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

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ย. 2024

ความคิดเห็น • 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 9 ปีที่แล้ว +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

  • @mohammedalaidaroos2137
    @mohammedalaidaroos2137 9 ปีที่แล้ว

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

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

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

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

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

  • @JohnSmith-wv4mo
    @JohnSmith-wv4mo 9 ปีที่แล้ว

    Are PWM pins required for the connection?

  • @wilson6717
    @wilson6717 8 ปีที่แล้ว

    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 .

  •  9 ปีที่แล้ว +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

  • @ruitfsilva
    @ruitfsilva 8 ปีที่แล้ว

    Great video

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

  • @king_SAM_
    @king_SAM_ 8 ปีที่แล้ว

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

  • @vladstrulev
    @vladstrulev 10 ปีที่แล้ว

    Thank you Vlad

  • @king_SAM_
    @king_SAM_ 8 ปีที่แล้ว

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

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

  • @maramaterai9980
    @maramaterai9980 8 ปีที่แล้ว

    Nice video dude. helped me a lot peace

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

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

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

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

  • @RogerCanda
    @RogerCanda 9 ปีที่แล้ว

    where can i download the schematic diagram

  • @ben3223
    @ben3223 8 ปีที่แล้ว

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

  • @bournsted4512
    @bournsted4512 9 ปีที่แล้ว

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

  • @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  8 ปีที่แล้ว +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.

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

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

    nice tutorial..

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

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

  • @m1994m1
    @m1994m1 9 ปีที่แล้ว

    Thank you!

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

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

  • @ikbeniwan007
    @ikbeniwan007 9 ปีที่แล้ว

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

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

  • @adithyaajith8203
    @adithyaajith8203 8 ปีที่แล้ว

    where to get code

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

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

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

  • @utpaldas7903
    @utpaldas7903 8 ปีที่แล้ว

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

  • @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 8 ปีที่แล้ว

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

  • @appie21
    @appie21 10 ปีที่แล้ว

    Thank you

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

  • @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 7 ปีที่แล้ว

    Cancer