#rgukt
#saitech
#telugu #arduinoproject #ece #rguktongole
#arduino #scienceproject #iotprojects
#tinkercad
Thinkercad link : www.tinkercad.com
Using a PIR (Passive Infrared) sensor with a buzzer and Arduino can be a fun project, especially for creating motion-activated alarms or interactive installations. Here's a basic guide on how to do it:
Components Needed:
Arduino board (e.g., Arduino Uno)
PIR sensor module
Buzzer
Jumper wires
Circuit Diagram:
Connect the components as follows:
PIR Sensor:
VCC pin to Arduino's 5V pin
GND pin to Arduino's GND pin
OUT pin to any digital pin on Arduino (e.g., pin 2)
Buzzer:
Positive (+) pin to a digital pin on Arduino (e.g., pin 3)
Negative (-) pin to Arduino's GND pin
CODE :
int sensorState =0;
void setup()
{
pinMode(2, INPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop()
{
// read the state of the sensor/digital input
sensorState = digitalRead(2);
// check if sensor pin is HIGH. if it is, set the
// LED on.
if (sensorState == HIGH) {
digitalWrite(9, HIGH);
Serial.println("Sensor activated!");
} else {
digitalWrite(9, LOW);
}
delay(10); // Delay a little bit to improve simulation performance
}
How it Works:
The PIR sensor detects motion and sends a HIGH signal to the Arduino when motion is detected, and LOW when there's no motion.
The Arduino continuously checks the state of the PIR sensor using digitalRead(pirPin).
When motion is detected (pirState is HIGH), the Arduino turns on the buzzer for one second and then turns it off.
Additional Notes:
Adjust the sensitivity and time duration of the PIR sensor using its onboard potentiometers if needed.
You can modify the code to add more functionality, like sending a notification, turning on lights, etc., when motion is detected.
Once you have everything connected and the code uploaded to your Arduino, test it out by moving in front of the PIR sensor. You should hear the buzzer sound when motion is detected.
Негізгі бет Using Thinkercad PIR Sensor With Buzzer Through Arduino uno | PIR With led |
Пікірлер