Report
Report
Components required:
• Arduino uno R3
• HC-SR501 PIR motion detection sensor module
• Led 5mm (green)
• Jump wire
• Resistor
• Buzzer
Connection of circuit :
Working principle:
• When motion is detected, the input pin is taken by digital
pin D2 and stores it in variable defined in the code.
• If the stored value is 1 then it would give positive output to
the LED and buzzer means it will set to HIGH and it will get
turn ON.
• And if not then it will remain LOW as value is 0
Code:
Here is the code written in arduino IDE and the pin D2 is set as input and D4 as output
The input is stored in variable r as defined in the code and by getting the value of r the pin of led and
buzzer is set HIGH or LOW according to value.
Ouput:
Before (No motion):
As we can see the when any motion is provided in the range of PIR sensor the led is glown
and buzzer makes beeping sound.