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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 113

  • @ujwalskill9592
    @ujwalskill9592 3 หลายเดือนก่อน +1

    thank you so much .this project is working

  • @Dinaltium
    @Dinaltium 4 หลายเดือนก่อน +3

    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

  • @crispinopesalbon6663
    @crispinopesalbon6663 2 ปีที่แล้ว +1

    thanks bro it works

  • @ayoraz_0144
    @ayoraz_0144 ปีที่แล้ว +2

    uhhh so i have a question: how can i use the 2 normal rgb leds with 4 pins on this project?

  • @rajannachandnkera6892
    @rajannachandnkera6892 ปีที่แล้ว +2

    I want know who to use hw-416-b model pir sensor

  • @Raja-dl5uc
    @Raja-dl5uc 4 หลายเดือนก่อน +2

    thanks
    i am a 13 year old boy
    i was searching for guidance for my science expo
    ur project made my way clear

    • @hashincludeelectronics
      @hashincludeelectronics  4 หลายเดือนก่อน

      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 👏🏻👏🏻👍🏻

  • @mrkromen3743
    @mrkromen3743 ปีที่แล้ว +2

    You're a legend

  • @pinkbrush5543
    @pinkbrush5543 7 หลายเดือนก่อน +1

    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

    • @hashincludeelectronics
      @hashincludeelectronics  7 หลายเดือนก่อน +1

      This looks like big project . I would suggest to go through my tutorial videos on servo , sensors etc and see if it helps 👍🏻👏🏻

  • @memphistomem3576
    @memphistomem3576 7 หลายเดือนก่อน +1

    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?

    • @hashincludeelectronics
      @hashincludeelectronics  7 หลายเดือนก่อน

      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 .

  • @Raja-dl5uc
    @Raja-dl5uc 4 หลายเดือนก่อน +1

    thanks for the code

  • @shabnambhadauria3009
    @shabnambhadauria3009 8 หลายเดือนก่อน +1

    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

    • @hashincludeelectronics
      @hashincludeelectronics  8 หลายเดือนก่อน

      This is very basic project and we can not add voice assistant as it is . 👏🏻👍🏻

  • @taefm9712
    @taefm9712 ปีที่แล้ว +2

    can you connect the arduino with thingspeak platform to analysis the data from the sensor and who it does?

    • @hashincludeelectronics
      @hashincludeelectronics  ปีที่แล้ว +1

      I believe thingspeak needs internet and Arduino can not handle that . You need to use modules like esp32

  • @prabhatverma7538
    @prabhatverma7538 2 ปีที่แล้ว +1

    Awesome 👍...

  • @chandandas647
    @chandandas647 5 หลายเดือนก่อน +1

    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

    • @hashincludeelectronics
      @hashincludeelectronics  5 หลายเดือนก่อน +1

      Use the exact setup and connection 👍🏻👏🏻

  • @4ri8
    @4ri8 ปีที่แล้ว +1

    but i can also connect the output pin of PIR to relay input pin directly without using arduino right?

  • @The.Real.Reddit.Chronicles
    @The.Real.Reddit.Chronicles ปีที่แล้ว +3

    did you cut the plug wire yourself? and where can i find a AC Bulb socket like yours?

    • @hashincludeelectronics
      @hashincludeelectronics  ปีที่แล้ว +1

      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 .

    • @ritika7665
      @ritika7665 15 วันที่ผ่านมา

      ​@@hashincludeelectronicscould u give the link on where I can buy ac plug socket like that

  • @propanda5584
    @propanda5584 8 หลายเดือนก่อน +2

    Bro can you tell what is the advantage of using aurduino UNO instead of doing it directly?

    • @hashincludeelectronics
      @hashincludeelectronics  7 หลายเดือนก่อน +2

      You can add any additional handling using Arduino code . You can add delays etc . 👍🏻👏🏻

  • @kundan.rajput
    @kundan.rajput หลายเดือนก่อน +1

    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

    • @hashincludeelectronics
      @hashincludeelectronics  หลายเดือนก่อน

      Please check the video slowly and carefully for missing steps 👍🏻👏🏻

  • @cylexarts3598
    @cylexarts3598 ปีที่แล้ว +1

    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?

    • @hashincludeelectronics
      @hashincludeelectronics  ปีที่แล้ว +1

      You will have to use only 1 Arduino . Yes it will work for 16mhz Arduino . 👍🏻

    • @rajaramrr
      @rajaramrr ปีที่แล้ว +1

      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 👏

  • @HappyHermitt
    @HappyHermitt ปีที่แล้ว +2

    I would like to use a servo with a pir. Could this code be edited for it?

  • @user-cx1tm8ii2x
    @user-cx1tm8ii2x 6 หลายเดือนก่อน +1

    Can you give the link for 7-12 V DC battery as well?

    • @hashincludeelectronics
      @hashincludeelectronics  6 หลายเดือนก่อน

      Yes. You can check my other car videos where I have provided the battery link 👍🏻👏🏻

  • @cylexarts3598
    @cylexarts3598 ปีที่แล้ว +1

    Slight problem, after 10 secs of activation it just turns off even thougj im moving in front of the sensor...how to fix this?

  • @RenzAndreiSuarez
    @RenzAndreiSuarez หลายเดือนก่อน +1

    can i ask about the jumper cable what pin is that is that 10 pin?

    • @hashincludeelectronics
      @hashincludeelectronics  หลายเดือนก่อน

      Please check the video for these details 👍🏻👏🏻

  • @artoflivingrajkot
    @artoflivingrajkot 7 หลายเดือนก่อน +2

    will it work on my project which is street lights made from LEDs?

    • @hashincludeelectronics
      @hashincludeelectronics  7 หลายเดือนก่อน +1

      It should work 👍🏻👏🏻 However take good care while making this project as we are dealing with AC at the output 👍🏻

    • @artoflivingrajkot
      @artoflivingrajkot 7 หลายเดือนก่อน +2

      @@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?

    • @hashincludeelectronics
      @hashincludeelectronics  7 หลายเดือนก่อน +1

      @@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 . 👍🏻

    • @artoflivingrajkot
      @artoflivingrajkot 7 หลายเดือนก่อน +2

      @@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.

    • @artoflivingrajkot
      @artoflivingrajkot 7 หลายเดือนก่อน +2

      @@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.

  • @brianmasangkay9153
    @brianmasangkay9153 ปีที่แล้ว +1

    where we can buy the battery? what is other replacement for it

    • @hashincludeelectronics
      @hashincludeelectronics  ปีที่แล้ว

      You can buy it online on Amazon . You can use lion batteries as well . But make sure you use rechargeable battery only .

  • @_Literallyus
    @_Literallyus 3 หลายเดือนก่อน +1

    How can i use this project for industrial automation

    • @hashincludeelectronics
      @hashincludeelectronics  3 หลายเดือนก่อน +1

      You can use this wherever you need to take some action based on human movements . Do some research where this can be used 👍🏻👏🏻

    • @_Literallyus
      @_Literallyus 3 หลายเดือนก่อน

      @@hashincludeelectronics Thankyou indeed !!

  • @ronixbhaskar8263
    @ronixbhaskar8263 ปีที่แล้ว +2

    How to connect the arduino code on the proteus software

    • @hashincludeelectronics
      @hashincludeelectronics  ปีที่แล้ว +1

      Unfortunately I don’t have any idea on that . Please share your findings 👏🏻

  • @aathik7229
    @aathik7229 8 หลายเดือนก่อน +1

    One doubt, It is consider as AI Project?

    • @hashincludeelectronics
      @hashincludeelectronics  8 หลายเดือนก่อน

      Not really. It’s very basic DIY project 👍🏻👏🏻

  • @jpena6678
    @jpena6678 6 หลายเดือนก่อน +1

    Well I have another question. The light is turning on while motion is detected but turning off immediately. How do I keep it lighting?

    • @hashincludeelectronics
      @hashincludeelectronics  6 หลายเดือนก่อน

      How long do you want the light to be turned on ? You can add that in code as well 👍🏻👏🏻

    • @jpena6678
      @jpena6678 6 หลายเดือนก่อน

      @@hashincludeelectronics My idea is to just turning the light on then I would manually turn it off.

  • @user-zw6ns6yx4x
    @user-zw6ns6yx4x 3 หลายเดือนก่อน +1

    Will it still work if I replace the bulb with a mini fan?

    • @user-zw6ns6yx4x
      @user-zw6ns6yx4x 3 หลายเดือนก่อน +2

      Also will the code still work if I already replaced the bulb with a fan?

    • @hashincludeelectronics
      @hashincludeelectronics  3 หลายเดือนก่อน +1

      It will work 👍🏻👏🏻

  • @lancedias9333
    @lancedias9333 2 ปีที่แล้ว +2

    In the circuit diagram why isnt the breadboard included?

    • @hashincludeelectronics
      @hashincludeelectronics  2 ปีที่แล้ว +1

      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 .

  • @mayuritekar6793
    @mayuritekar6793 4 หลายเดือนก่อน +1

    Can we supply 12v DC power in place of 220v Ac

    • @hashincludeelectronics
      @hashincludeelectronics  4 หลายเดือนก่อน +1

      Yes you can but you will have to use 12c dc appliance then 👍🏻👏🏻

    • @mayuritekar6793
      @mayuritekar6793 4 หลายเดือนก่อน +1

      @@hashincludeelectronics what are those appliances

    • @hashincludeelectronics
      @hashincludeelectronics  4 หลายเดือนก่อน

      @@mayuritekar6793 I am not sure . As you want to use 12v dc instead of 220v ac 😂

    • @mayuritekar6793
      @mayuritekar6793 4 หลายเดือนก่อน +1

      @@hashincludeelectronics no bro.. I have 12v DC solar system, so I want to run entire motion sensor on 12v. Please suggest me bro😥⁦🙏🏻⁩

    • @hashincludeelectronics
      @hashincludeelectronics  4 หลายเดือนก่อน +1

      @@mayuritekar6793 you can connect it to Arduino vin pin directly then 👍🏻👏🏻

  • @riddhi2509
    @riddhi2509 หลายเดือนก่อน +1

    Breadboard of how much dots?? 80 or 100

  • @mohamadaldawood4949
    @mohamadaldawood4949 2 ปีที่แล้ว +1

    Is there a problem using 220 volt electricity?

    • @hashincludeelectronics
      @hashincludeelectronics  2 ปีที่แล้ว

      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 .

    • @mohamadaldawood4949
      @mohamadaldawood4949 2 ปีที่แล้ว +1

      @@hashincludeelectronicsCan I have a video link?

  • @furqonoof
    @furqonoof 5 หลายเดือนก่อน +1

    how do i make the project doesnt require battery?

  • @jpena6678
    @jpena6678 6 หลายเดือนก่อน +1

    I didnt understand where you used the Battery? is it not necessary?

    • @hashincludeelectronics
      @hashincludeelectronics  6 หลายเดือนก่อน +1

      Yes we have used battery . Please check the video and also circuit diagram for reference 👍🏻👏🏻

    • @jpena6678
      @jpena6678 6 หลายเดือนก่อน

      @@hashincludeelectronics thanks for replying. yeah I found that

  • @shahnewajbd4623
    @shahnewajbd4623 6 หลายเดือนก่อน +1

    How can we use your link for diagram and code

    • @hashincludeelectronics
      @hashincludeelectronics  6 หลายเดือนก่อน

      You can download the code and diagram from that link and use it 👏🏻👍🏻

    • @shahnewajbd4623
      @shahnewajbd4623 6 หลายเดือนก่อน +1

      @@hashincludeelectronics i can't see any download options in there

    • @hashincludeelectronics
      @hashincludeelectronics  6 หลายเดือนก่อน

      @@shahnewajbd4623 click on the link . Then it will open something where the code and diagram will be there . Please explore 👏🏻👍🏻

    • @shahnewajbd4623
      @shahnewajbd4623 6 หลายเดือนก่อน +1

      @@hashincludeelectronics thanks you very much

  • @ZenHulk
    @ZenHulk 4 หลายเดือนก่อน +2

    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.

  • @TalhaMalik-ij2tl
    @TalhaMalik-ij2tl 2 หลายเดือนก่อน +1

    Please give programming

    • @hashincludeelectronics
      @hashincludeelectronics  2 หลายเดือนก่อน

      Code and diagram link is provided in the description of the video 👏🏻👍🏻

  • @mohaiminrahman6592
    @mohaiminrahman6592 ปีที่แล้ว +2

    Everytime of light on and off,I hear the sound of switch😁

  • @biviyu3828
    @biviyu3828 ปีที่แล้ว

    Yo, i have a problem with this, can you help me please?

    • @hashincludeelectronics
      @hashincludeelectronics  ปีที่แล้ว

      What problem are you facing. ?

    • @biviyu3828
      @biviyu3828 ปีที่แล้ว

      @@hashincludeelectronics my sensor is keep detecting things even though everything around it are standing still

  • @ShubhamKumar-pj6es
    @ShubhamKumar-pj6es 4 หลายเดือนก่อน +1

    Code wala link open nahi ho Raha hai

  • @SumanSuman-lq1vg
    @SumanSuman-lq1vg 8 หลายเดือนก่อน +1

    Aap sahi se code btao

    • @hashincludeelectronics
      @hashincludeelectronics  8 หลายเดือนก่อน

      The code and diagram link is provided in the description of the video 👍🏻👏🏻

    • @SumanSuman-lq1vg
      @SumanSuman-lq1vg 8 หลายเดือนก่อน

      @@hashincludeelectronics hamne try kiya but kuch ni ho rha ... plz help kijye

  • @AyeshanidaNuheen-rj3lb
    @AyeshanidaNuheen-rj3lb 10 หลายเดือนก่อน

    Switch off on

  • @clobel55
    @clobel55 9 หลายเดือนก่อน +1

    speak english!!!!!!!!!!