How to use PIR Motion Sensor with Arduino | Motion sensor light
ฝัง
- เผยแพร่เมื่อ 15 พ.ค. 2024
- In this video we are going to learn how to use PIR motion Sensor (HC-SR501) with Arduino so that we can detect if there is any human movement and take some action.
We will make a motion switch to turn on and off light automatically if human motion is detected.
I have explained in details each step along with code and connections.
👉Please subscribe: th-cam.com/users/hashinclude...
👉Components list :
✅ Arduino Uno amzn.to/3tjKRMR
✅ PIR Sensor module amzn.to/3qgxAUj
✅ 5V Relay amzn.to/3pWsr2u
✅ AC bulb socket and plug
✅ Blub
✅ 7-12 V DC battery
✅ Breadboard
✅ Jumper wires
👉 Shorts Channel :
/ ujwalnandanwar
👉Code and diagram:
github.com/un0038998/lessons/...
👉What is Relay and how to use it
• What is Relay? | How t...
👉Watch more videos:
/ hashincludeelectronics
👉Follow us on Instagram:
/ hashincludeelectronics
#pirsensor #hashincludeelectronics #arduino - วิทยาศาสตร์และเทคโนโลยี
thank you so much .this project is working
Nice 👏🏻👍🏻
Hey bro, I am a beginner into coding ( I know a bit of Python coding but not C) So can you give me code to adjust the timing for the light to stay on, Mines stay on for a minute or 2 and then switches of after that. Since I need this for my upcoming project exhibition, I want it to switch off faster so I can show again quickly how my project works instead of having to wait for long
thanks bro it works
Welcome 👍
uhhh so i have a question: how can i use the 2 normal rgb leds with 4 pins on this project?
I want know who to use hw-416-b model pir sensor
thanks
i am a 13 year old boy
i was searching for guidance for my science expo
ur project made my way clear
I am glad that you liked the video and it was helpful to you. Keep learning and I wish you all the best for your future 👏🏻👏🏻👍🏻
You're a legend
IK BRO
Hello. Im actually beginner and I have a project to do. I need to control alot of servo motor (12) with motion sensor and at the same time I have to control another thing (kind of robot with arduino). I want to use IR control and motion sensor for the first robot, also with the data flow and the other robot to move simultaneously
This looks like big project . I would suggest to go through my tutorial videos on servo , sensors etc and see if it helps 👍🏻👏🏻
Hi, I just did this one here, works perfect :) But I just wonder how to make light stay on until I leave the room? Is it just to set pir sensor to HIGH mode?
Thank you very much for checking out the video and nice comment 👍🏻👏🏻. It will stay high as long as you are there in the room and keeps moving .
thanks for the code
You are welcome 🙏
Can i add a voice assistant to this project, and if yes and then how, do you have a video on it , kindly share ,it would helpful
This is very basic project and we can not add voice assistant as it is . 👏🏻👍🏻
can you connect the arduino with thingspeak platform to analysis the data from the sensor and who it does?
I believe thingspeak needs internet and Arduino can not handle that . You need to use modules like esp32
Awesome 👍...
Thank you! Cheers!
You have single channel relay
Was used. If I am using a 2 channel relay then where should I put the input of the second relay.
I have to connect 2 bulbs
Use the exact setup and connection 👍🏻👏🏻
but i can also connect the output pin of PIR to relay input pin directly without using arduino right?
Yes you can 👍🏻
did you cut the plug wire yourself? and where can i find a AC Bulb socket like yours?
Yes you can cut the wires as needed . Also you can buy the sockets which are available at your location . No issues in that . 👍🏻 but make sure to make proper connection as it deals with AC voltages .
@@hashincludeelectronicscould u give the link on where I can buy ac plug socket like that
Bro can you tell what is the advantage of using aurduino UNO instead of doing it directly?
You can add any additional handling using Arduino code . You can add delays etc . 👍🏻👏🏻
Hello , I want to ask one thing
I have a 5v relay module and 1 pir sensor
I have done connection
Vcc of sensor and relay are from same charger of 5v 1A
Gnd pin is also same
Out of sensor is connected to in of relay
And relay's No is connected to bulb and common is connected to vcc
I am facing the issue
Bulb is always onn after power on supply
Even after it for not detect human
Please check the video slowly and carefully for missing steps 👍🏻👏🏻
What if you are using 2 motion sensors, does that mean you need to use 2 arduino's....and also can this design be use in a 16mhz arduino?
You will have to use only 1 Arduino . Yes it will work for 16mhz Arduino . 👍🏻
Actually you don't even need an Arduino, you can directly connect the output of the PIR sensor to trigger the relay. But it's a very nice tutorial though 👏
I would like to use a servo with a pir. Could this code be edited for it?
Yes you can easily edit this code to use servo motor .
Can you give the link for 7-12 V DC battery as well?
Yes. You can check my other car videos where I have provided the battery link 👍🏻👏🏻
Slight problem, after 10 secs of activation it just turns off even thougj im moving in front of the sensor...how to fix this?
can i ask about the jumper cable what pin is that is that 10 pin?
Please check the video for these details 👍🏻👏🏻
will it work on my project which is street lights made from LEDs?
It should work 👍🏻👏🏻 However take good care while making this project as we are dealing with AC at the output 👍🏻
@@hashincludeelectronics can you tell me what to use instead of AC bulb socket? Or can I directly connect the wires of LED to arduino UNO?
@@artoflivingrajkot how many LEDs are there ? Is it like a series of LEDs?if these LED bulbs are AC controlled then instead of bulb socket you can use normal plug socket and use it . 👍🏻
@@hashincludeelectronics there are 12 LEDs.and it is not LED bulbs they are 5mm LED diodes.that's why I asked you that it will work or not.
@@hashincludeelectronics sir i will want 9v battery in it so how to insert the positive and negative wires and from where in the relay or arduino i will get the output? please tell me sir tomorrow is my science fair.
where we can buy the battery? what is other replacement for it
You can buy it online on Amazon . You can use lion batteries as well . But make sure you use rechargeable battery only .
How can i use this project for industrial automation
You can use this wherever you need to take some action based on human movements . Do some research where this can be used 👍🏻👏🏻
@@hashincludeelectronics Thankyou indeed !!
How to connect the arduino code on the proteus software
Unfortunately I don’t have any idea on that . Please share your findings 👏🏻
One doubt, It is consider as AI Project?
Not really. It’s very basic DIY project 👍🏻👏🏻
Well I have another question. The light is turning on while motion is detected but turning off immediately. How do I keep it lighting?
How long do you want the light to be turned on ? You can add that in code as well 👍🏻👏🏻
@@hashincludeelectronics My idea is to just turning the light on then I would manually turn it off.
Will it still work if I replace the bulb with a mini fan?
Also will the code still work if I already replaced the bulb with a fan?
It will work 👍🏻👏🏻
In the circuit diagram why isnt the breadboard included?
Thanks for checking out the video and for query . Breadboard is just for extending the connections. So i did not include in circuit diagram to keep the connections clear with modules. I hope you are familiar with how to use breadboard . Let me know if you need any help .
Can we supply 12v DC power in place of 220v Ac
Yes you can but you will have to use 12c dc appliance then 👍🏻👏🏻
@@hashincludeelectronics what are those appliances
@@mayuritekar6793 I am not sure . As you want to use 12v dc instead of 220v ac 😂
@@hashincludeelectronics no bro.. I have 12v DC solar system, so I want to run entire motion sensor on 12v. Please suggest me bro😥🙏🏻
@@mayuritekar6793 you can connect it to Arduino vin pin directly then 👍🏻👏🏻
Breadboard of how much dots?? 80 or 100
You can buy any 👏🏻👍🏻
Is there a problem using 220 volt electricity?
Thanks for checking out video 👍 There is no problem in using 220 V in this project . However good care should be taken while making connections as we are dealing with AC High Voltage. So make sure you connect wires properly. You can check my other video for reference where I have explained how to use relay. Let me know if you face any issue .
@@hashincludeelectronicsCan I have a video link?
how do i make the project doesnt require battery?
You will have to use solar cells 👍🏻👏🏻
I didnt understand where you used the Battery? is it not necessary?
Yes we have used battery . Please check the video and also circuit diagram for reference 👍🏻👏🏻
@@hashincludeelectronics thanks for replying. yeah I found that
How can we use your link for diagram and code
You can download the code and diagram from that link and use it 👏🏻👍🏻
@@hashincludeelectronics i can't see any download options in there
@@shahnewajbd4623 click on the link . Then it will open something where the code and diagram will be there . Please explore 👏🏻👍🏻
@@hashincludeelectronics thanks you very much
This set yp is like playing with legos in the 70sm blah, never works, those sensors sell 5 at a time because 3 dont work or work sometimes in the best condition on your bench.
Please give programming
Code and diagram link is provided in the description of the video 👏🏻👍🏻
Everytime of light on and off,I hear the sound of switch😁
Yes thats relay sound 👍🏻. Enjoy it 😂
@@hashincludeelectronics 😂😂😂
Yo, i have a problem with this, can you help me please?
What problem are you facing. ?
@@hashincludeelectronics my sensor is keep detecting things even though everything around it are standing still
Code wala link open nahi ho Raha hai
It is opening fine . Please check 👍🏻👏🏻
Aap sahi se code btao
The code and diagram link is provided in the description of the video 👍🏻👏🏻
@@hashincludeelectronics hamne try kiya but kuch ni ho rha ... plz help kijye
Switch off on
speak english!!!!!!!!!!