How to use HC-SR501 Motion sensor for Arduino with code

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ม.ค. 2025

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

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

    Great breakdown of all salient info! I wish other maker/reviewer videos were as thorough. Thanks!

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

      I am pleased you liked it. Here the better version of this with wiring Diagram th-cam.com/video/piuUfGVafC0/w-d-xo.html which is part of my Arduino Step By Step Course that Starts here th-cam.com/video/-6qSrDUA5a8/w-d-xo.html

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

    well explained, thank you. Most Arduino users would be at lost how to make these modules work in the real world without arduino lol. I like that you took the extra minute or two to explain how this module could be hooked up without arduino. I like using arduino for experimentation and design, then go to a actual protocol for a device that will actually be used. The explosion of modules that have become available is incredible! Sure hope people move past arduino to designing their own devices from scratch!

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

      Thank you. James I am glad you found it useful. Stay safe. Greeting from Ahmad from Canada.

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

    Great video, awesomely explained and the position of adjustable screws is shown too! Well done! Thanks! Liked and subbed :)

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

    Thanks for this. Please keep uploading Arduino projects.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome.

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

    Thanks to your detailed explanation it worked perfectly! really appreciate it!

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

    Thanks for explaining the jumpers. Big help.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome. The best thank you for me is to subscribe to my channel and thumb up the video. It is greatly appreciated. 🔔 😊

  • @burakk.48
    @burakk.48 2 ปีที่แล้ว

    In my code, low, high, input, output texts appear colorless and my circuit did not work. I think my library is missing where can I find it?

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

      have you watched the video? I just watched it to remind myself. you don't need any library. you need to adjust the sensitivity. watch carefully to so you learn.

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

    Big shouts from £ngland ur a good teacher 💯👊🏾🌟⭐⭐⭐🔥

    • @robojax
      @robojax  3 ปีที่แล้ว

      Wow so nice. thanks. I am glad you like it . just browse my channel th-cam.com/users/robojaxTVvideos you will be surprised. Cheers from Canada. Stay safe.

  • @texchip977
    @texchip977 5 ปีที่แล้ว

    does it still detect motion if the sensor itself is in motion? i.e. if you put it on a robotic hand and move the robotic hand

    • @robojax
      @robojax  5 ปีที่แล้ว

      No. As soon as object or the sensor moves, it will turn ON.

  • @adrianTNT
    @adrianTNT 4 ปีที่แล้ว

    If you stop moving and then move again, it can only detect motion again after around 4-5 seconds, is this normal ? With both jumper position.
    Continuous motion works OK (with the right jumper), but once you stop, it only detects motion again after 4-5 seconds.

    • @robojax
      @robojax  4 ปีที่แล้ว

      it should. I have shown how to adjust it. Watch it carefully. There is adjusting and position of object or something.

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

    Thank you so mucchh, It really works!!!
    Just Liked the video and Subscribe to you!!!

  • @ibrahimyalcinsoy9421
    @ibrahimyalcinsoy9421 4 ปีที่แล้ว

    Very good! Greetings from Munich!

    • @robojax
      @robojax  4 ปีที่แล้ว

      Thank you very much!. Greetings from Canada.

  • @MischievousMischief
    @MischievousMischief 5 ปีที่แล้ว

    It worked! Thank you very much for this example.

    • @robojax
      @robojax  5 ปีที่แล้ว

      you are welcome. Ahmad from Canada

  • @orzzatx6816
    @orzzatx6816 4 ปีที่แล้ว

    Sir, can we change the code so that to make the sensor keep sending signal eventhough the hand keep in the same position?

    • @robojax
      @robojax  4 ปีที่แล้ว

      I did not understand the role of "hand" here. Perhaps I forgot what is in the video. But if you want to keep something ON or OFF when it detect the motion, here is my video th-cam.com/video/QQ7iDagQnQM/w-d-xo.html

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

    Do we need to calibrate the sensor or just used this code directly?

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

      Do whatever bus shown in video. It will not work by default.

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

    no calibration of the pir sensor in your code

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

      the calibration is done by rerating the potentiometer. watch the video and learn. code has nothing to do with it.

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

      @@robojax thx for the reaction, thats they adjustment by the two potentiometers for time and distance, maybe calibration is not the right word what i mean is the startup time (calibration) of the whole sensor thats about 1 minute , this is essential part before starting to use it, read the technical data sheet of the sensor

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

      @@robojax Power On Delay
      Like most PIR sensors, the HC-SR501 takes approximately 30 to 60 seconds after being turned on to go through the initialization sequence. At that time it learns the ambient infrared signature of the environment. Basically it’s calibrating itself to the environment to determine what constitutes motion.
      False triggers are likely to occur during this calibration time, so any triggers during this time should be ignored. Also make sure that there is not too much movement in front of the sensor when it is undergoing self-calibration as this may interfere with the calibration process.

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

      this module has variable resistor. if you set it in the wrong value/position, there is not code to help you. Just rotate it and set it.

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

      Power On Delay
      Like most PIR sensors, the HC-SR501 takes approximately 30 to 60 seconds after being turned on to go through the initialization sequence. At that time it learns the ambient infrared signature of the environment. Basically it’s calibrating itself to the environment to determine what constitutes motion.
      False triggers are likely to occur during this calibration time, so any triggers during this time should be ignored. Also make sure that there is not too much movement in front of the sensor when it is undergoing self-calibration as this may interfere with the calibration process.

  • @richardhough3640
    @richardhough3640 4 ปีที่แล้ว

    You are really a wizard !!!!
    I love all your videos...
    Are you from India or East Europe?

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

      Hi. Thank for liking my videos. I am from Canada. I’ve shown my face in my latest videos.

  • @anantwankhade1611
    @anantwankhade1611 7 ปีที่แล้ว

    sir if we remove usb connection from aeduino after upload the program / code and supply 9 V then what. 2nd point is I except a vedio from u on how bipolar stepper, arduino and controler driver with a code to drive the motors forward revers and with specific angle. Hope you will helps me. all vedios are so good, thanku

    • @robojax
      @robojax  7 ปีที่แล้ว

      Thank you very much. I have another video on stepper motor hopefully you find it useful th-cam.com/video/Sl2mzXfTwCs/w-d-xo.html

  • @jeffbowyer4576
    @jeffbowyer4576 3 ปีที่แล้ว

    My motion sensor has "L" and "H" printed on the board adjacent to three pads. However, it does not have jumper pins. Why doesn't my motion sensor have jumper pins? How can I select "repeat" or "no repeat" without the pins?
    My motion sensor is actually an HW-416-B
    Based upon your answers, I will decide whether to complain to the seller. Thanks.

    • @robojax
      @robojax  3 ปีที่แล้ว

      Hello, I just checked the image. for the module you use. When we we use jumper we connect the middle pint to L or H. so it is exactly the same as I've shown so connect the middle pint to L or the middle pint to H to get one of the result. there is not different. that is what I understood from the image.

    • @jeffbowyer4576
      @jeffbowyer4576 3 ปีที่แล้ว

      @@robojax Thank you for your kind response. My problem: there are no pins...just pads. To connect the middle pad to H, for example, I would need to put a little solder between the middle pad and the H pad.
      I don't understand why a manufacturer would make a motion sensor board with the L, middle, and H pads, but no jumper pins.
      Here's an image of a board like mine: arduino.en.alibaba.com/product/62255409775-813499796/HW_416B_Infrared_smart_device_Human_body_induction_ir_infrared_sensor_module_Imported_probe.html
      See--no jumper pins. Just L, middle, and H pads

    • @robojax
      @robojax  3 ปีที่แล้ว

      Yea I saw that , I did not say pin I said points so solder it to those points.

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

      Yes solder the points however you can either wire or just solder . I would solder wire through the hole , first clear the hole, pass wires though them and solder so they are secure. If you don’t use wire you might damage it with multiple soldering.

  • @mixme8655
    @mixme8655 4 ปีที่แล้ว

    Thank you easy to understand your video

    • @robojax
      @robojax  4 ปีที่แล้ว

      Glad it was helpful!

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

    for this arduino board, it have 2 5V pin. but im only have 1 5V pin.

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

      make extra 5V pin th-cam.com/video/omyIFd1FqCI/w-d-xo.html

  • @BertHeideveld
    @BertHeideveld 5 ปีที่แล้ว

    Thank you , it works good.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome.

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

    the code did not work with me

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

      The code works, you did not adjust the settings. Also when you want to say "code did not work" please provide any error you are getting.

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

      May be watch this video th-cam.com/video/QQ7iDagQnQM/w-d-xo.html

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

      Ok, thank you

  • @biomedica9494
    @biomedica9494 3 ปีที่แล้ว

    Thanks!

  • @josverstraten
    @josverstraten 6 ปีที่แล้ว

    HC-SR501 motion sensor tested
    ➡ Read this article
    chinese-electronics-products-tested.blogspot.com/p/hc-sr501-motion-sensor-tested.html

  • @_mazahist_5567
    @_mazahist_5567 4 ปีที่แล้ว

    What on stoped

    • @robojax
      @robojax  4 ปีที่แล้ว

      Я только что добавил субтитры на вашем языке, чтобы вы могли лучше их понять.

  • @_mazahist_5567
    @_mazahist_5567 4 ปีที่แล้ว

    Don not stoped

    • @robojax
      @robojax  4 ปีที่แล้ว

      Watch carefully, that’s exactly what I have explained

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

    subbed; ;)

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

      Thanks