PIR Sensor with Arduino Uno

The PIR (Passive Infrared) Sensor is an electronic device used to detect the presence of an object or human being in its vicinity. It is commonly used in security systems to detect intruders, in robotics for navigation and obstacle avoidance, and in automation systems to detect the presence of an object. The PIR Sensor is connected to an Arduino Uno board, which is used to control the buzzer alarm and servo motor.

Buzzer Alarm

The buzzer alarm is triggered when the PIR Sensor detects the presence of an object or human being in its vicinity. The Arduino Uno board is programmed to detect the signal from the PIR Sensor and activate the buzzer alarm. The buzzer alarm can be set to sound for a certain duration or can be set to sound continuously until the object or human being is no longer detected.

Servo Motor Control

The servo motor is connected to the Arduino Uno board and is programmed to move in response to the signal from the PIR Sensor. The servo motor can be programmed to move in a certain direction or to rotate in a certain direction when the PIR Sensor detects the presence of an object or human being. The servo motor can also be programmed to move in a certain direction and then return to its original position when the object or human being is no longer detected.

Tutorial

The tutorial for connecting the PIR Sensor to the Arduino Uno board and programming the buzzer alarm and servo motor is relatively simple. The PIR Sensor is connected to the Arduino Uno board using the three pins: ground, power, and signal. The buzzer alarm and servo motor are then programmed using the Arduino IDE. Once the programming is complete, the PIR Sensor can be tested by moving an object or human being in front of it. If the PIR Sensor is working correctly, the buzzer alarm and servo motor should activate as expected.

PIR Sensor with Arduino Uno

The PIR (Passive Infrared) Sensor is a motion detector used to detect movement of people, animals, or other objects. It is commonly used in security systems and automated lighting systems. This tutorial will show how to use the PIR Sensor with Arduino Uno to control a buzzer and a servo motor.

Components Required

To complete this tutorial, you will need the following components:

Arduino Uno

PIR Sensor

Buzzer

Servo Motor

LEDs

Jumper Wires

Connections

The connections for the PIR Sensor with Arduino Uno are as follows:

Connect the VCC pin of the PIR Sensor to the 5V pin of the Arduino Uno.

Connect the GND pin of the PIR Sensor to the GND pin of the Arduino Uno.

Connect the OUT pin of the PIR Sensor to the digital pin 4 of the Arduino Uno.

Connect the positive pin of the buzzer to the digital pin 2 of the Arduino Uno.

Connect the negative pin of the buzzer to the GND pin of the Arduino Uno.

Connect the signal pin of the servo motor to the digital pin 9 of the Arduino Uno.

Connect the power pin of the servo motor to the 5V pin of the Arduino Uno.

Connect the ground pin of the servo motor to the GND pin of the Arduino Uno.

Connect the positive pin of the LEDs to the digital pin 3 of the Arduino Uno.

Connect the negative pin of the LEDs to the GND pin of the Arduino Uno.

Programming the Arduino Uno

The following code is used to program the Arduino Uno to control the buzzer and servo motor using the PIR Sensor:

#include <Servo.h>

Servo myservo;

Int pirPin = 4;

Int ledPin = 3;

Int buzzerPin = 2;

Int pirState = LOW;

Int val = 0;

Void setup() {

Myservo.attach(9);

PinMode(pirPin, INPUT);

PinMode(ledPin, OUTPUT);

PinMode(buzzerPin, OUTPUT);

Serial.begin(9600);

}

Void loop() {

Val = digitalRead(pirPin);

If (val == HIGH) {

DigitalWrite(ledPin, HIGH);

DigitalWrite(buzzerPin, HIGH);

The PIR Sensor with Arduino Uno can be used to create a simple security system or automation system. The PIR Sensor is connected to the Arduino Uno board and programmed to activate the buzzer alarm and servo motor when an object or human being is detected. The tutorial for connecting the PIR Sensor and programming the buzzer alarm and servo motor is relatively simple and can be completed in a few minutes.

Share.
Exit mobile version