Arduino #10 - Ultrasonic HC-SR04 Range Sensor - Robotics Arduino Tutorial

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

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

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

    I don't care how old this video is - excellent! Thank you!!

  • @katelastoskie264
    @katelastoskie264 8 лет назад +2

    Thanks for the video!
    Is there a posted schematic diagram anywhere?

  • @johnathan5807
    @johnathan5807 10 лет назад +3

    do you have a downloadable version of your code? I copied it down and it seems to have errors for some reason?

  • @AlokKumar-km6pi
    @AlokKumar-km6pi 9 лет назад

    where i can get ur all videos??please it really good

  • @ruitfsilva
    @ruitfsilva 9 лет назад

    Great video

  • @maramaterai9980
    @maramaterai9980 8 лет назад

    Nice video dude. helped me a lot peace

  • @vladstrulev
    @vladstrulev 10 лет назад

    Thank you Vlad

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

    Great tutorial! But can u plz tell me what's the value for the resistor u used ?

  •  10 лет назад +6

    Thank you the tutorial was really helpful!
    But please repair the microphone I lost three minutes of my life while I checked my headset LOL

  • @JohnSmith-wv4mo
    @JohnSmith-wv4mo 9 лет назад

    Are PWM pins required for the connection?

  • @mohammedalaidaroos2137
    @mohammedalaidaroos2137 9 лет назад

    Thanks for this helpful video. Can it work as a water level sensor?

  • @bournsted4512
    @bournsted4512 9 лет назад

    hae!!!! thanks a lot!
    for ur help
    u helped me a lot

  • @akshayn3926
    @akshayn3926 8 лет назад

    nice tutorial..

  • @amrabdlkadersabry5649
    @amrabdlkadersabry5649 3 месяца назад

    How can i use ultra sonic sensor without delay in the code

  • @missbittersweetcutie
    @missbittersweetcutie 8 лет назад

    I can see that you're using a blue resistor. The image is too blurry to see which one it is. Can you please tell me? Thanks

  • @wilson6717
    @wilson6717 9 лет назад

    I have heard they use these in bowling alleys to detect strikes . What about half scale bowling with about a 20 inch triangle ? Would these be good for that ? I can't seem to find any information about it .

  • @king_SAM_
    @king_SAM_ 8 лет назад

    PulsIn(echo, HIGH), but what if no waves come back? Will the PulseIn keep waiting then?

  • @tejara01
    @tejara01 7 лет назад

    You're right about the ultrasonic not moving in a straight line. It follows an inverse square law. 1/distance squared

  • @ben3223
    @ben3223 9 лет назад

    how do you make the light turn on when an object is in front of it

  • @RogerCanda
    @RogerCanda 9 лет назад

    where can i download the schematic diagram

  • @DaGeneyweeny
    @DaGeneyweeny 7 лет назад

    Is there a way to code the sensor to make it sense things closer to a straight line?

    • @VladRomanov89
      @VladRomanov89  7 лет назад

      Unfortunately that's not possible with ultrasonic sensors. I'd recommend using a laser sensor if you absolutely need that "feature".

    • @DaGeneyweeny
      @DaGeneyweeny 7 лет назад

      thanks

  • @neeldesai8940
    @neeldesai8940 8 лет назад

    what is change in code if i want led on digital pin ,like at 150 cm ultrasonic read arduino led glow and at 5 cm led off.

  • @m1994m1
    @m1994m1 9 лет назад

    Thank you!

  • @harshkant07
    @harshkant07 9 лет назад +1

    how can i increase the area covered by ultrasonic sensor?

    • @VladRomanov89
      @VladRomanov89  9 лет назад

      +Harshkant Sharma I'm afraid the only way of doing that would be to purchase a more powerful sensor.

    • @claraj.winston7156
      @claraj.winston7156 9 лет назад

      +Harshkant Sharma I was lucky to get this awesome=== FREE DOWNLOAD Arduino Tutorial and Programming plus.google.com/105456673395930650430/posts/PWgqWWct4AF? XOXO~iLV

    • @chathurasilva3150
      @chathurasilva3150 7 лет назад

      does sensor able to go through a object ?

  • @MohdHasan-mh7cl
    @MohdHasan-mh7cl 8 лет назад

    Can it detect water as well? I wish to install it in a tank to measure water level.

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

      there is actually a specific component for water-level-measuring!

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

    i have a question about pulseIn() function. Why does it measure the time when the pin is recieving a HIGH signal?Shouldn't it measure the time is recieving a LOW signal because from what i heard i understood that the sensor triggers an ultrasound and waits for the ultrasound to come back.So the time from the nearest object for the ultrasound to travel is the time the ultrasound travels until it returns to the sensor divided by 2.

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

      Adi, you are correct about the pulse. That being said, if you look at the documentation of the pulseIn() function, you will notice that a HIGH parameter translates to the following: Trigger as the signal is sent on HIGH and wait for a LOW. Therefore it's doing exactly what you have described. The distance is divided by two; it's incorporated in the division shown in the tutorial.

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

      Yes,but when the signal is set on HIGH in this project with the ultrasonic sensor? I know that we need the duration between the moment the pulses were sent and the moment the pulses are recieved and for this we are using the pulseIn function which times the duration the signal is HIGH on that pin. What i am asking is from what does that HIGH signal come ?

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

      First let's see if i got the pulseIn function straight
      For example if i hook up a button to a digital pin and write some code in which i want to find out the duration i press the button. If i push the button for 1 sec the function pulseIn(pin,HIGH) should return in the serial 1000

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

      That's correct provided that your button sets the signal to low as it unlatches.

  • @parthsabyasachi1570
    @parthsabyasachi1570 8 лет назад

    when i implemented this project then distance =0 shown on communication channel.
    what type of error ??

    • @VladRomanov89
      @VladRomanov89  8 лет назад

      +parth sabya Sachi I would need more information about what you are seeing. I can't help you with the above statement unfortunately.

  • @Burntoeye
    @Burntoeye 9 лет назад

    Can I connect more sensors on Arduino Uno? Or I need other kind of Arduino?
    I need eleven sensors to be connected

    • @VladRomanov89
      @VladRomanov89  9 лет назад

      +Carlos Mauricio Rangel Mancilla You have multiple options here. You can use the I2C bus and have up to 128 sensors connected, or use multiplexing chips, or shift registers, etc. The short answer is yes you can connect 11 or even more sensors.

  • @AvinashRavi
    @AvinashRavi 9 лет назад

    really nice tutorial! Can u tell me how to calculate distance using Radio frequency(433Mhz) using Arduino?

    • @VladRomanov89
      @VladRomanov89  9 лет назад

      I'm not sure that's possible. As far as I know, there is no way to detect the strength of the radio signal which would give you the distance. There might be such components, but I'm not aware of any.

  • @MrTalhakamran2006
    @MrTalhakamran2006 9 лет назад

    is ultrasonic supposed to be cold?
    I can sense some cold wind when I put my hand 20 cm away.

    • @VladRomanov89
      @VladRomanov89  9 лет назад

      Talha Kamran I haven't observed any air currents, but I would say it is possible.

    • @MrTalhakamran2006
      @MrTalhakamran2006 9 лет назад

      EEEnthusiast it is extremely mild but you can sense it.

  • @appie21
    @appie21 10 лет назад

    Thank you

  • @adithyaajith8203
    @adithyaajith8203 8 лет назад

    where to get code

  • @ranickpatra6013
    @ranickpatra6013 8 лет назад

    my sr04 sensor stop transmitting ultrasonic sound when a quick distance change occure or out of range. Then i plug it back then it start working and same thing happpen. give me some solution....

  • @pawan9ist
    @pawan9ist 7 лет назад +1

    PLZ COMMENT GUYS -> can i power all these just a mobile 5v charger or pc usb or i need more ? i have ardiuno uno r3 @EEEnthusiast

  • @anassjouhri6153
    @anassjouhri6153 9 лет назад

    Man, thanks for the explanations :D , abt the range of detection, i've read in a website that it can detect objects even in 3meters ,is it true ? and is there' r anyways to limit it's detection angle, for example to limit it in 30 degree ? thanks a lot

    • @VladRomanov89
      @VladRomanov89  9 лет назад +1

      +anass jouhri thank you for your comment! The datasheet for the sensor specifies a 4m range, so it is possible. I don't know of a way to limit the angle, but I would look into IR or laser sensors if you are looking for narrow detection angle sensors. You need to find a specific sensor for your application.

  • @king_SAM_
    @king_SAM_ 8 лет назад

    Good video! But sometimes, the sound was bit weird...

  • @ikbeniwan007
    @ikbeniwan007 9 лет назад

    i get this error: avrdude: ser_open(): can't set com-state for "\\.\COM3"
    What to do?

  • @175griffin
    @175griffin 8 лет назад

    You say you're using PWM for the LED brightness, but you used analogWrite. Im pretty sure PWM is digitalWrite, and analogWrite varies voltage and only works on analog pins.

    • @felipeestevez9724
      @felipeestevez9724 8 лет назад

      +175griffin look up analogWrite in the Arduino web, it is used with PMW

    • @VladRomanov89
      @VladRomanov89  8 лет назад

      +175griffin That is incorrect. Arduino can only write 0 OR 1. The AnalogWrite "simulates" an analog value through PWM. Here's the reference from Arduino: www.arduino.cc/en/Reference/AnalogWrite

    • @175griffin
      @175griffin 8 лет назад

      Ok, so what's the difference between analog pins and digital pwm pins then?

    • @175griffin
      @175griffin 8 лет назад

      I just reread that, it sounded aggressive. I mean that as curiosity, not trying to prove anything.

    • @VladRomanov89
      @VladRomanov89  8 лет назад +2

      +175griffin not agressive at all; I just pointed out the correct reference. To answer your second question, Analog pins are the ones you can use for Analog to Digital (ADC) conversion; in other words, only those pins can read voltages that aren't just HIGH/LOW. The PWM pins, are the ones you can use to output a PWM signal or a "fake" analog. Analog pins on the Arduino are A0 - A5. PWM pins are 5, 11, 12, 15, 16, 17 for the UNO.

  • @alialghamdi6816
    @alialghamdi6816 9 лет назад +1

    can you talk about how long does the sensor has 4 or 5 meter ?
    also please talk about the range how can the sensor cover the the area in front of it ?is it 180 degree or not more 45 degree wide

  • @utpaldas7903
    @utpaldas7903 8 лет назад

    provlem
    AVRDUDE: ser-open ():can't open device "...

  • @aymansuhiemat7830
    @aymansuhiemat7830 7 лет назад

    عل ايش بتشتغل

  • @fastsofaracing
    @fastsofaracing 8 лет назад +2

    Good video. Stop chewing your fingernails

    • @VladRomanov89
      @VladRomanov89  8 лет назад

      Thanks. It has been a bad habit of mine for as long as I can remember... :(

    • @fastsofaracing
      @fastsofaracing 8 лет назад +2

      Lol. Just fucking with ya.

  • @DaPedozYT
    @DaPedozYT 8 лет назад

    Cancer