In this project, we will use an Arduino Nano and an HC-SR04 ultrasonic sensor to accurately measure water levels. The results will be displayed using LEDs, which will allow you to visually control the amount of liquid in the container. Such a system is easy to implement and ideal for home or educational automation projects.
7 LEDs (you can take several different colors for more informativeness)
A breadboard and a set of wires
Computer/laptop
VCC → Arduino 5V pin
GND → Arduino GND pin
TRIG → Arduino pin A4
ECHO → Arduino pin A5
Cathodes → all to GND Arduino
Anodes → to pins D12, D11, D2, D3, D4, D5, D6. If desired, all anodes can be connected through 220 Ohm resistors. This will increase their service life.
**If you do not have the Arduino IDE installed, I advise you to watch the video tutorial, which shows how to install and configure it.
At this link you will find information on how to install the driver on the Arduino board.** Download the firmware from this link and upload it to the Arduino according to the instructions above. The scheme of the project can be found here.
The sensor measures the distance to the water surface. Depending on how far the water is, different LEDs light up. We hope that everything worked out for you!