Water Sensor With Arduino

Introduction: Water Sensor With Arduino

This is an example of ultrasonic sensor with LED in the use of detecting water level.

Most of the people put water beside their working table, and this machine can remind and warn the user about the water level.

This machine will detect the water level in the bottle. Whenever the water level is higher than 2/3 of the bottle, green LED will shine. When the water level is about 2/3 of the bottle, green and yellow LED will shine. When the water level is less than 1/3 of the bottle, all three LEDs will shine, include the red one.


1. 1 Ultrasonic sensor

2. 1 Arduino

3. 1 cable (connecting line for Arduino and computer)

4. 1 breadboard

5. a box (20x14x10cm) - for covering Arduino

6. a bottle of water (bottle and water)

7. 3 yellow resister

8. 3 LEDs (1 red, 1 yellow, 1 green)

9. wires

10. removable mounting putty

11. acrylic foam tape

Step 1: Prepare Materials

Prepare all the materials mentioned in "supplies."

The material picture above is what you need for building a circuit. (you need wires too)

Step 2: Build the Circuit

1. Connect positive charge with 5V and negative charge with GND.

2. Add three LEDs.

Connect wires on all legs of LEDs. Connect one leg of the yellow resister with the shorter leg of the LED (on the same line) and another leg of the yellow resister on a negative charge. As for the longer leg of the LED, connect it with a wire and on digital 13 for red light, digital 12 for yellow light, digital 11 for green light (optional for which digital, but the code provided in the next step would use these three).

3. Add the sensor.

Connect wires on all four legs of the sensor. Connect Vcc with positive charge, Trig with digital 7, Echo with digital 6, and Gnd with negative charge.

Step 3: Upload the Code

Link: https://create.arduino.cc/editor/shirshir0619/b49f...

This link is the code of this project. You can change the code with the help of the remarks beside the code which start with // in gray color.

Step 4: Test

After building the circuit correctly and adding the code, test the project by uploading the code onto Arduino. If it doesn't work, check your circuit and code if there is something connect wrong (things to check such as if the code's digital work with the circuit or any negative and positive connect wrong).

Step 5: Build and Decorate

1. Put Arduino inside the box

2. Use utility knife to cut three little holes, just about the size of LED, on the cover of the box, and stick the LED from inside to outside.

3. Stick the LED onto the cover of the box, use removable mounting putty to stick it from inside.

4. Cut off of the wings at the cover of the box.

5. Cut a little hole at the side of the box, about the size of the cable, so the cable can connect Arduino with the computer.

6. Stick the bottle on the top of the box using the acrylic foam tape.

7. Cut a little hole just beside the bottle for the use of letting the wires of the sensor out. You don't need to make the hole too big, just big enough to let the sensor out.

8. Stick the sensor using removable mounting putty at the edge of the bottle. You will want to stick at the opposite side of where you will pour the water so the sensor won't get wet.

Step 6: Congratulation! You're Finished.

View the video and see if your project looks the same.

The video have some explanation about the machine (in Chinese).

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • For the Home Contest

      For the Home Contest
    • Big and Small Contest

      Big and Small Contest