Ultrasonic Water Level Indicator using HC-SR04 & Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 มิ.ย. 2024
  • In an earlier video I had put together a tank water level Indicator using an Arduino. The video has been well received, but one recurring question I get is how to use an ultrasonic sensor instead of the water level sensor. Well, let's do just that in this video.
    #arduino #hc-sr04 #ultrasonicsensor #DIY
    Code:
    talkingstuff.net/water-level-...
    Ultrasonic sensor only:
    amzn.to/3idN3Qp
    Flipkart:
    fkrt.it/Mt7mGPNNNN
    Aruduino only:
    amzn.to/2AlceQ6
    Flipkart:
    fkrt.it/MtBJGPNNNN
    Arduino Kit, has ultrasonic sensor, Arduino, wires LED’s and more:
    amzn.to/2Vzi6wi
    =============================
    Table of Contents:
    =============================
    00:00 - Introduction
    01:18 - Components List
    01:33 - HC-SR04 Connections
    02:18 - Arduino Connections
    03:03 - LED Connections
    03:39 - Code
    08:37 - Demonstration
    09:38 - Final Thoughts
    [DISCLOSURES]
    This video contains affiliate links, which afford talkingStuff Network a commission should you make a purchase.
    Want to grow on TH-cam try TubeBuddy here:
    www.Tubebuddy.com/talkingstuf...
    Website: www.talkingstuff.net
    Twitter: / talkingstuffnet
    Facebook: / talkingstuffnet
    Instagram: / talkingstuffnet
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Ultrasonic sensor only:
    amzn.to/3idN3Qp
    Flipkart:
    fkrt.it/Mt7mGPNNNN
    Aruduino only:
    amzn.to/2AlceQ6
    Flipkart:
    fkrt.it/MtBJGPNNNN
    Arduino Kit, has ultrasonic sensor, Arduino, wires LED’s and more:
    amzn.to/2Vzi6wi

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

    Thank you for this video and for explaining code very well. Can you please make a video of same using LCD display. It will really helpful.

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

    Nicely done!! Now to figure out how to get it installed on top my water tank and keep humidity out.

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

      3d printed a case for the ultrasonic sensor and except for the sensor transceiver the entire PCB can be encased in silicone. Using a long wire you can have the circuit within the house to view the level, only the sensor stays within the tank.

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

      You can use clear nail polish for waterproofing.

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

    Nice and informative video thank you I will do this to my project

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

    Great tutorial, thank you!
    I would like to use this in water, yet....I'm confused by what you said at the end about 9:30.
    "If you would like to use it with your water tank, you will need to place it in a protective housing". |
    Given this is sonar, would not the echos bounce off the protective housing (instead of the water level), giving reading of protective housing?
    If you can elaborate, that would be appreciated!

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

      You will need to place the sensor in a protective housing but the sensor area should be open to be able to transmit and receive the signals. The sensor by itself is not waterproof and will be damaged if submerged in water which includes splashing water too. So to protect the components I suggested 3d printing a housing to protect the sensor to a limit. For example www.yeggi.com/q/ultrasonic+sensor+case/

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

      @@TalkingstuffNet that's fantastic. thank you very much. I find myself currently trying to start designing 3D stuff with FreeCad, and I'm having a little difficulty. Is there any resource or application you would suggest for Windows and a complete novice to 3D printing? Cheers

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

    Can you specify how accurate the water level readings are? in millimeters

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

    Thank you . Great project. Don't we need current limiting resistors in series with the LED's?

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

      We do, as i was setting this up temporarily i didnt use them. But I did mention it in the video. I didn't have low value resistors to add to the circuit.

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

    this video is very educational and its very nice i lov eyour vids number 1

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

      Glad you liked the video, thank you for watching. 🙂

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

      @@TalkingstuffNet thx alot my my favourite youtuber

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

      how can i make the water level work my code is perfect and everything i was wondering what i have not checked

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

      Check the serial monitor to see what values you're getting. As per those values change the code.

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

    Hi, I like your video so much. Can you do a tutorial on ultrasonic water level indicators with a 5v water pump? When the water is low the water pump will start.

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

      Hi, thank you for watching my videos 😁, I will try making one.

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

    Hi Vinayak. I liked the video. Can I use waterproof Ultrasonic Sensor JNR-SR04M instead of HC-SR04. Will there be any change in the code if I use JNR-SR04M.
    Thank you

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

      You will have to anyway calibrate the values in the code as per what's being returned by the sensor. I feel the rest of the code should be relatively the same.

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

    Good one

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

    Hi vinayak thanks for this video. One thing i would like to ask is how long can the cable be? Because i am planning to do this with 2 Ultrasonic sensor; one for the top tank and one for the bottom tank (for dry run protection). So the total distance comes to around 80 metres ( top tank and motor are at diagonal corners of the house) 🙄.

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

      I haven't tried installing it in my tank, I'm using a pre-built soltution now and they provide a 100 metre cable with their plug. It works well, only concern I have is the power to the sensor at that distance when we make a custom solution. In an earlier water level sensor video I had used a 50 yard ethernet cable to power the water sensor and it worked.

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

      @@TalkingstuffNet any link to the pre built controller set that you are using?

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

      I'm using tankbolt by Oakter
      th-cam.com/video/cbIdgWi1uBE/w-d-xo.html

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

      @@TalkingstuffNet its great. Just one thing. It doesnt have sensor to check lower tank level. If the motor is connected to a well then this is fine, but i have a tank which stores municipality water which sometimes used out when municipality stops water for 3, 4 days due to some maintenance.
      The product has dry run protection but maybe that is just checking if level is changing after motor turns on; if no change means no water. But in this case pump will get damaged over time plus we will need to prime the pump manually the next time. 🙄
      Product is currently available only in tata cliq now @3990.

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

      It has dry run protection, if the tank level doesn't increase for a certain time period it stops automatically. But it can't monitor the lower tank. I liked this because of the app and Alexa control. There are other options available with both upper and lower tank sensors but no automation or app is present.

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

    hi sir, what if the results of the data are calibrated from ml to cm so that they can be implemented on IOT

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

      You can rewrite the functions to provide the appropriate units and use the output to trigger other devices. We already have inches and centimeters.

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

    Wow..nice

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

    Hello Sir. Can we use float sensors instead of ultra sonic sensor- because ultra sonic sensor is not recommended for long term usage. How to rewrite the code for float sensors.

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

      You have generally an on and off state only , you will not get granular levels but you will know when its on so you can play an alarm sound when the tank is full.

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

    Can we apply this ultrasonic sensor to a bigger water tank, like 1 ton tank? If we can, is it enough to use only one sensor?

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

      I've not tried the circuit with a bigger tank, but I did purchase a readymade solution and I'm using it with a 1500 litre tank. Looks like they're using a similar sensor.

    • @adam.d
      @adam.d 2 ปีที่แล้ว

      @@TalkingstuffNet Which readymade solution did you use?

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

      I'm using the oakter tankbolt at present
      th-cam.com/video/cbIdgWi1uBE/w-d-xo.html

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

    Will the output be fluctuating when connected to pump cause in the experiment the leds are blinking on increasing the water level, could it be solved by increasing the pulse intrervell time

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

      It keeps fluctuating between the LEDs as the water has to stabilize and because it's still moving while being poured it triggers multiple LEDs.

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

      @@TalkingstuffNet thanks for replay, one more question will it make the pump to fluctuate when connected

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

      It will not as it's connected separately.

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

    When I installed it the sensor output is unstable ,it keeps fluctuating. This happens only in the tank ,it works fine rest of the time

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

      Tanks have a resonance frequency it might caused a problem.

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

    Hey is there a way i can make the hcsr04(ultrasonic sensor) waterproof?

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

      Maybe make a case for it and submerge the main circuit in glue. But the front sensor is still not waterproof and it needs to be open to send and receive signals so it's not going to be totally waterproof.

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

    Can we use lcd screen instead of led to indicate the level of water

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

      Yes you can, but you will need to rewrite the code as required for the LCD screen .

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

      An also i need to add a buzzer to arduino so in which pin do we need to connect it an lcd display connection pin also

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

      I have the code in python for raspberry pi but its very costly how can i implement the same code of pi in ardunio

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

      I have provided the code on my website for the Arduino. But without a LCD screen. There should be tutorials available where you would show the percentage value on the LCD as per the level of water.

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

    Not getting the proper output after connecting,automatically led light gets on and only one led is getting on...can i get the instructions of what to do?

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

      You will need to calculate the height and set the variables accordingly. Also try changing the code to see if you change to a different led does it light up instead.

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

    Does this also on/off the motor automatically?

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

      This would only display the water level in the tank, but you can write code to control a motor when it reaches 100%.

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

    sir this project circuit diagram and result pls tell

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

      You can find the link in the description, the code is available on my website.

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

    Sir can you send program to me pls iam doing project on it can you help me

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

      It is available on talkingstuff.net, the link to the program is in the description of the video I shared with instructions.

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

    Sir..can i get your coding please..

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

      Hi, link is available in the description which opens on my website talkingstuff.net