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

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

Комментарии • 60

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

  • @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 ruclips.net/video/piuUfGVafC0/видео.html which is part of my Arduino Step By Step Course that Starts here ruclips.net/video/-6qSrDUA5a8/видео.html

  • @jjeducool6640
    @jjeducool6640 Год назад

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

  • @anythingunderthesun9930
    @anythingunderthesun9930 4 года назад +2

    Thanks for this. Please keep uploading Arduino projects.

    • @robojax
      @robojax  4 года назад

      You are welcome.

  • @loucostello3111
    @loucostello3111 4 года назад +1

    Thanks for explaining the jumpers. Big help.

    • @robojax
      @robojax  4 года назад

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

  • @dallarosajp
    @dallarosajp 3 года назад +1

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

  • @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 ruclips.net/user/robojaxTVvideos you will be surprised. Cheers from Canada. Stay safe.

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

  • @pianotunesbymichael3168
    @pianotunesbymichael3168 2 года назад +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.

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

  • @burakk.48
    @burakk.48 Год назад

    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  Год назад

      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.

  • @mixme8655
    @mixme8655 4 года назад

    Thank you easy to understand your video

    • @robojax
      @robojax  4 года назад

      Glad it was helpful!

  • @MischievousMischief
    @MischievousMischief 5 лет назад

    It worked! Thank you very much for this example.

    • @robojax
      @robojax  5 лет назад

      you are welcome. Ahmad from Canada

  • @adrianTNT
    @adrianTNT 3 года назад

    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  3 года назад

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

  • @anantwankhade1611
    @anantwankhade1611 6 лет назад

    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  6 лет назад

      Thank you very much. I have another video on stepper motor hopefully you find it useful ruclips.net/video/Sl2mzXfTwCs/видео.html

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

  • @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 ruclips.net/video/QQ7iDagQnQM/видео.html

  • @josverstraten4133
    @josverstraten4133 6 лет назад

    HC-SR501 motion sensor tested
    ➡ Read this article
    chinese-electronics-products-tested.blogspot.com/p/hc-sr501-motion-sensor-tested.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.

  • @BertHeideveld
    @BertHeideveld 5 лет назад

    Thank you , it works good.

    • @robojax
      @robojax  5 лет назад

      You are welcome.

  • @biomedica9494
    @biomedica9494 3 года назад

    Thanks!

  • @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 ruclips.net/video/omyIFd1FqCI/видео.html

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

  • @Jjtofe
    @Jjtofe Год назад

    the code did not work with me

    • @robojax
      @robojax  Год назад

      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  Год назад

      May be watch this video ruclips.net/video/QQ7iDagQnQM/видео.html

    • @Jjtofe
      @Jjtofe Год назад

      Ok, thank you

  • @junker5461
    @junker5461 2 года назад

    subbed; ;)

  • @_mazahist_5567
    @_mazahist_5567 3 года назад

    Don not stoped

    • @robojax
      @robojax  3 года назад

      Watch carefully, that’s exactly what I have explained

  • @_mazahist_5567
    @_mazahist_5567 3 года назад

    What on stoped

    • @robojax
      @robojax  3 года назад

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