- Abstract
This report details the design, implementation, and evaluation of an advanced water level indicator system. Unlike traditional methods, this project employs an ultrasonic sensor (HC-SR04) to precisely measure the depth of water within a small container. The system is controlled by an Arduino Nano microcontroller, which processes the ultrasonic readings to calculate the current water level as a percentage of the total tank height. This information is then visually presented on a 0.96-inch OLED display, featuring both a numerical percentage and a dynamically filling tank image that provides an intuitive graphical representation. The data updates every second, ensuring real-time monitoring. Powered by a 9V battery, this non-contact water level indicator offers a versatile, portable, and accurate solution for various fluid monitoring applications.
- Introduction
2.1 The Criticality of Water Level Monitoring
Effective management of water resources is paramount in a multitude of contexts, ranging from household consumption to large-scale industrial operations. Accurate and continuous monitoring of water levels in tanks, reservoirs, and process containers is crucial for optimizing usage, preventing wasteful overflows, ensuring a consistent supply, and facilitating the efficient operation of pumps and other associated machinery. In residential settings, an automated water level indicator serves to conserve water by preventing tanks from overflowing, especially in areas where water conservation is critical. Industrially, precise level control is vital for maintaining product quality, avoiding costly spills, and ensuring operational safety in chemical, food processing, and manufacturing environments. Relying on manual checks is often inefficient, labor-intensive, and can pose safety risks. The development of automated and reliable water level indicators has thus become an essential aspect of modern resource management and process automation.
2.2 Project Overview
This project focuses on developing a robust and accurate water level indicator system leveraging non-contact sensing technology. The primary objective is to provide a clear, real-time, and user-friendly visual display of the water level in a given container without requiring direct physical contact with the water itself. The system’s core component for measurement is the ultrasonic sensor, chosen for its ability to provide precise distance measurements regardless of water conductivity, which addresses a key limitation of older, conductive probe-based systems. The Arduino Nano microcontroller serves as the central processing unit, responsible for interacting with the ultrasonic sensor, performing the necessary calculations (converting depth to percentage), and driving the display. A 0.96-inch OLED display provides an intuitive visual interface, featuring the water level in percentage form and a corresponding animated tank icon that visually represents the filled status. The system is designed for portability, operating on a 9V battery, and updates its readings every second, ensuring immediate feedback and enhanced usability. This project highlights the practical application of ultrasonic sensing and microcontroller programming in a relevant real-world scenario.
- Literature Review/Background
3.1 Water Level Sensing Technologies: Focus on Ultrasonic
The field of liquid level sensing employs a diverse array of technologies, each with distinct operational principles and suitability for specific applications.
- Float Switches: Simple mechanical devices providing discrete ON/OFF indications, primarily used for alarm triggering.
- Pressure Sensors: Measure hydrostatic pressure to infer depth, offering continuous measurement but requiring direct contact and susceptibility to clogging.
- Capacitive Sensors: Detect changes in capacitance due to liquid presence, suitable for both contact and non-contact detection, but can be sensitive to liquid properties.
- Conductive (Resistive) Probes: Rely on water’s electrical conductivity to complete circuits, simple and inexpensive for conductive liquids but prone to corrosion and unsuitable for non-conductive fluids.
For this project, the Ultrasonic Sensor was chosen for its significant advantages in modern water level monitoring:
- Principle of Operation (Time-of-Flight): Ultrasonic sensors, such as the widely used HC-SR04, operate on the principle of echolocation, similar to how bats navigate. They emit a high-frequency sound pulse (ultrasonic wave) that is inaudible to humans. This pulse travels through the air, reflects off the surface of the water, and returns to the sensor. The sensor precisely measures the time taken for the sound pulse to travel from emission to reception (Time-of-Flight, ToF).
- Distance Calculation: Knowing the speed of sound in air (approximately 343 meters per second or 0.0343 cm/µs at 20°C), the sensor’s microcontroller can calculate the distance to the water surface using the formula: Distance=2Time-of-FlightĂ—Speed of Sound​ The division by 2 is because the sound travels to the surface and back.
- Non-Contact Measurement: This is a crucial advantage. The sensor is mounted above the water surface, eliminating direct contact with the liquid. This prevents issues like corrosion of probes, contamination of the liquid, and makes it suitable for non-conductive liquids.
- Accuracy: Ultrasonic sensors can provide relatively accurate distance measurements, typically within a few millimeters, suitable for most general-purpose level indication applications.
- Limitations: While advantageous, ultrasonic sensors can be affected by factors such as:
- Temperature: The speed of sound varies with air temperature, which can impact accuracy if not compensated for.
- Obstructions/Beam Angle: Objects in the sensor’s path or the sensor’s beam width reflecting off tank walls can cause erroneous readings.
- Surface Conditions: Highly turbulent surfaces, foam, or extreme condensation can scatter sound waves, leading to inconsistent readings.
- Minimum Distance: There’s usually a “dead zone” or minimum distance below which the sensor cannot accurately measure.
3.2 Arduino Nano Microcontroller
The Arduino Nano is a compact, breadboard-friendly microcontroller board based on the ATmega328P. It shares much of the functionality of the larger Arduino Uno but in a smaller footprint, making it ideal for portable and space-constrained projects.
- Microcontroller: ATmega328P
- Operating Voltage: 5V
- Input Voltage (recommended): 7-12V (via VIN pin)
- Digital I/O Pins: 14 (6 with PWM capability)
- Analog Input Pins: 8 (A0-A7)
- Memory: 32 KB Flash, 2 KB SRAM, 1 KB EEPROM
- Clock Speed: 16 MHz
- Connectivity: Mini-USB for programming and serial communication.
In this project, the Arduino Nano’s digital I/O pins are used to interface with the ultrasonic sensor (Trigger and Echo pins), and its I2C pins (A4 and A5) are dedicated to communicating with the OLED display. Its processing power is more than sufficient for the required distance calculations and display updates.
3.3 OLED 0.96″ Display (I2C)
The 0.96-inch OLED (Organic Light-Emitting Diode) display is a small, high-contrast visual output device, commonly featuring a 128×64 pixel resolution and an I2C communication interface.
- Characteristics: Self-illuminating pixels (no backlight needed), resulting in deep blacks and high contrast. Offers wide viewing angles and low power consumption (especially when displaying sparse content).
- I2C Interface: This serial communication protocol significantly simplifies wiring, requiring only four connections: VCC (power), GND (ground), SDA (Serial Data Line), and SCL (Serial Clock Line).
- Role: The OLED serves as the primary user interface for this project, displaying the calculated water level percentage and a dynamically filling tank image, providing clear and intuitive feedback to the user. Its compact size is well-suited for a portable, battery-powered device.
3.4 Ultrasonic Sensor (HC-SR04)
The HC-SR04 is a popular and inexpensive ultrasonic ranging module.
- Operating Voltage: 5V DC
- Static Current: Less than 2mA
- Output Signal: 0-5V electric level, high-level signal.
- Sensor Angle: Not more than 15 degrees.
- Detection Distance: 2cm to 400cm (actual reliable range is often less, e.g., 2cm to 200cm in practical applications).
- Pins:
- VCC: +5V DC power supply.
- Trig (Trigger): Input pin for sending a 10µs (minimum) high pulse to initiate a measurement.
- Echo: Output pin that goes HIGH when the ultrasonic pulse is emitted and stays HIGH until the reflected pulse is received. The duration of this HIGH pulse is the Time-of-Flight.
- GND: Ground.
- System Architecture and Design
4.1 Overall System Diagram
The water level indicator system is an integrated embedded system. A 9V battery powers the Arduino Nano, which acts as the central controller. The ultrasonic sensor is mounted above the water container, constantly emitting and receiving ultrasonic waves. The Arduino measures the Time-of-Flight from the sensor’s Echo pin, calculates the distance to the water surface, and then determines the water level based on the known total height of the bucket. This water level is converted into a percentage and transmitted to the 0.96-inch OLED display via I2C. The OLED visually presents the percentage and an animated tank graphic that reflects the current fill status. The entire measurement and display cycle refreshes every second, providing real-time data to the user.
      +—————–+
      |  9V Battery   |
      | (Power Supply) |
      +——–+——–+
               | VCC, GND
               V
      +—————–+
      |  Arduino Nano |
      | (Microcontroller)|
      +——-+———+
              | Digital I/O (Trig, Echo)
              |
              V
      +—————–+
      | Ultrasonic Sensor|
      |   (HC-SR04)   |
      +——-+———+
              |
              | (Measures distance to water surface)
              V
      +—————–+
      | Small Bucket  |
      |  (Water Tank) |
      +—————–+
      +——————-+
      | Arduino Nano     |
      +——-+———–+
              | SDA (A4)
              | SCL (A5)
              V
      +——————-+
      |  0.96″ OLED     |
      |  (I2C Display)  |
      | (Water Level %  |
      | + Tank Image)   |
      +——————-+
4.2 Hardware Components
4.2.1 Arduino Nano: As the project’s brain, it controls the ultrasonic sensor’s trigger pulse, measures the echo pulse duration, performs distance and percentage calculations, and sends display commands to the OLED.
4.2.2 OLED 0.96″ Display (I2C): The primary output device. Its high contrast and graphic capabilities are crucial for an intuitive user interface, displaying both numerical data and a dynamic visual representation of the tank’s fill level.
4.2.3 Ultrasonic Sensor (HC-SR04): This is the core sensing component. It provides the non-contact distance measurement to the water surface. Its Trig pin is connected to an Arduino digital output pin, and its Echo pin is connected to an Arduino digital input pin.
4.2.4 Breadboard: A solderless breadboard is used to connect the Arduino Nano, ultrasonic sensor, OLED display, and 9V battery connector, providing a flexible platform for prototyping.
4.2.5 Small Bucket: Serves as the container for water. Its internal depth needs to be accurately measured and used as a calibration constant in the software for accurate percentage calculation. The ultrasonic sensor will be mounted above this bucket.
4.2.6 9V Battery: Provides portable power to the Arduino Nano via its VIN pin (7-12V input range) and subsequently to the OLED display and ultrasonic sensor (which are powered via the Arduino’s 5V output). A battery clip is used for connection.
4.2.7 Jumper Wires: Numerous male-to-male and male-to-female jumper wires are essential for making all the necessary electrical connections between the components on the breadboard.
4.3 Software Design
The software, developed within the Arduino IDE, is responsible for initiating ultrasonic measurements, processing the received echoes, calculating the water level and percentage, and dynamically updating the OLED display.
4.3.1 Logic for Reading Depth using Ultrasonic Sensor:
- Pin Definitions: Define specific digital pins for the Trig and Echo pins of the HC-SR04 sensor.
- Trigger Pulse: To initiate a measurement, the Trig pin is set LOW for 2µs, then HIGH for a minimum of 10µs, and then LOW again. This sends an ultrasonic burst.
- Echo Duration Measurement: The Echo pin will go HIGH upon emission of the pulse and remain HIGH until the echo is received. The Arduino uses the pulseIn() function to measure the duration (in microseconds) for which the Echo pin stays HIGH. This duration is the Time-of-Flight.
- Distance Calculation: Convert the measured duration into distance using the speed of sound. The formula distance = (duration * 0.0343) / 2 (where 0.0343 is cm/µs) yields the distance in centimeters. This distance represents the empty space from the sensor to the water surface.
4.3.2 Converting Depth to Water Level and Percentage:
- Total Tank Height (Calibration): A crucial constant in the code is TANK_HEIGHT_CM, representing the total measured internal height of the bucket from the sensor’s mounting point to the very bottom.
- Empty Tank Distance (Calibration): Measure the distance from the sensor to the bottom of the empty tank. This EMPTY_TANK_DIST_CM value is also a key calibration constant.
- Water Level Calculation: The water level is calculated by subtracting the measured distance (to the water surface) from the EMPTY_TANK_DIST_CM. $$\text{Water Level} = \text{EMPTY_TANK_DIST_CM} – \text{Measured Distance}$$
- It’s important to handle cases where the measured distance might be less than EMPTY_TANK_DIST_CM (e.g., sensor not exactly at the top edge) or greater than EMPTY_TANK_DIST_CM (e.g., no water). The formula must be carefully chosen to ensure Water Level is positive and accurately reflects the water column. A simpler approach if the sensor is mounted at the very top is Water Level = TANK_HEIGHT_CM – Measured Distance. However, for robust design, it’s better to use EMPTY_TANK_DIST_CM as the reference for full depth.
- Percentage Calculation: Convert the calculated water level into a percentage of the TANK_HEIGHT_CM. $$\text{Percentage} = \left( \frac{\text{Water Level}}{\text{TANK_HEIGHT_CM}} \right) \times 100$$
- Boundary conditions: Ensure the percentage is clamped between 0% and 100% to prevent negative or over-100% readings due to measurement noise or calibration inaccuracies.
4.3.3 OLED Display Management:
- Libraries: Wire.h (for I2C), Adafruit_GFX.h (graphics primitives), and Adafruit_SSD1306.h (OLED driver) are indispensable.
- Initialization: The OLED display is initialized with its resolution (128×64) and I2C address (e.g., 0x3C).
- Text Display: Utilize display.setTextSize(), display.setTextColor(), display.setCursor(), and display.print() to present the calculated water level percentage.
- Image Display (Tank Image): A pre-defined monochrome bitmap array representing the tank outline is drawn using display.drawBitmap(). To simulate the water level, a filled rectangle (display.fillRect()) is drawn within the tank outline. The height of this rectangle is dynamically calculated based on the water level percentage, ensuring it visually corresponds to the fill status.
- Update: After all drawing commands, display.display() is called to push the content from the Arduino’s buffer to the OLED.
4.3.4 Update Frequency:
- A delay(1000) at the end of the loop() function ensures that the ultrasonic measurement, calculation, and OLED update cycle occurs approximately once every second, providing a consistent real-time display.
- Implementation Details
5.1 Hardware Connections
Accurate and secure wiring is critical for the reliable operation of the ultrasonic water level indicator.
- Arduino Nano Power:
- Connect the positive (+) terminal of the 9V battery to the VIN pin of the Arduino Nano.
- Connect the negative (-) terminal of the 9V battery to a GND pin on the Arduino Nano.
- Ultrasonic Sensor (HC-SR04) to Arduino Nano:
- HC-SR04 VCC to Arduino 5V.
- HC-SR04 GND to Arduino GND.
- HC-SR04 Trig to Arduino Digital Pin D8 (or any other suitable digital output pin).
- HC-SR04 Echo to Arduino Digital Pin D9 (or any other suitable digital input pin).
- (Note: For some ultrasonic sensors, a voltage divider might be needed on the Echo pin if it outputs 5V and your Arduino is 3.3V, but Arduino Nano operates at 5V, so direct connection is usually fine).
- OLED 0.96″ (I2C) to Arduino Nano:
- OLED VCC to Arduino 5V (or 3.3V if your specific OLED module requires it).
- OLED GND to Arduino GND.
- OLED SDA to Arduino A4 (SDA pin).
- OLED SCL to Arduino A5 (SCL pin).
5.2 Software Configuration
The Arduino IDE is the primary tool for developing, compiling, and uploading the firmware to the Arduino Nano.
- Arduino IDE Setup:
- Ensure the Arduino IDE is installed.
- Go to Tools > Board > Arduino AVR Boards and select Arduino Nano.
- Go to Tools > Port and select the correct COM port for your connected Arduino Nano.
- Install Libraries:
- Open Sketch > Include Library > Manage Libraries…
- Search for “Adafruit GFX Library” and install it.
- Search for “Adafruit SSD1306” and install it.
- The Wire library for I2C communication is usually pre-installed.
- Write the Arduino Sketch:
-
- Calibration Constants: Crucially, accurately measure and adjust EMPTY_TANK_DIST_CM and TANK_HEIGHT_CM according to your specific bucket and sensor mounting. EMPTY_TANK_DIST_CM is the reading when the tank is empty, and TANK_HEIGHT_CM is the maximum depth of water when the tank is full.
- OLED Address: Verify your OLED’s I2C address (0x3C or 0x3D are common). Use an I2C scanner if uncertain.
- Tank Image: The code directly draws a simple rectangle for the tank outline and fills it. If you have a custom bitmap image, you’ll need to define it as a PROGMEM array and use display.drawBitmap().
- Upload Code:
- Connect your Arduino Nano to your computer via a Mini-USB cable.
- Ensure the correct board and port are selected in the Arduino IDE.
- Click the “Upload” button to compile and upload the code.
5.3 Powering the System
Once the hardware is connected and the software is uploaded:
- Mount the Ultrasonic Sensor: Securely mount the ultrasonic sensor above the bucket, ensuring it has a clear, unobstructed path to the water surface and that its beam angle is within the bucket’s diameter to avoid reflections from walls.
- Connect 9V Battery: Connect the 9V battery clip to the battery. Then, connect the red wire of the battery clip to the VIN pin on the Arduino Nano, and the black wire to a GND pin.
- System Activation: The Arduino Nano and OLED display should power on. The OLED will initialize and then start displaying the water level, which will initially be 0% if the tank is empty.
- Observation: Pour water into the bucket and observe the OLED display updating in real-time, showing the percentage and the dynamic tank fill.
- Testing and Results
Thorough testing is essential to confirm the accuracy, responsiveness, and reliability of the ultrasonic water level indicator system.
6.1 Functional Testing
- Initial Power-Up: Upon connecting the 9V battery, verify that the Arduino Nano’s power LED illuminates and the OLED display initializes (showing Adafruit splash screen briefly, then clearing). The initial reading should reflect the empty tank state (e.g., 0%).
- Gradual Filling: Slowly pour water into the bucket.
- Observe the OLED display. As water fills the tank, the distanceCm reading should decrease, and consequently, the calculated waterLevelCm should increase.
- Verify that the displayed percentage smoothly increases (e.g., from 0% to 25%, 50%, 75%, 100%).
- Confirm that the animated tank image on the OLED visually “fills up” proportionally to the displayed percentage.
- Gradual Emptying: Slowly remove water from the bucket.
- The distanceCm reading should increase, and waterLevelCm should decrease.
- The displayed percentage should decrease, and the tank image should “empty” accordingly.
- Edge Cases:
- Completely Empty Tank: Verify that the system consistently displays 0% when the tank is empty (or near-empty, considering the sensor’s minimum distance).
- Completely Full Tank: Confirm that the system displays 100% when the tank is full to its calibrated maximum water level.
- Obstructions: Briefly place your hand or an object in the sensor’s path to see how the reading reacts (it should show a very low or incorrect distance, indicating a potential issue).
6.2 Calibration Process
Accurate calibration is critical for precise percentage readings.
- Mount Sensor: Securely mount the ultrasonic sensor above your bucket. The sensor’s face should be parallel to the water surface.
- Measure EMPTY_TANK_DIST_CM: With the bucket completely empty, place the sensor in its final mounted position. Take several readings from the serial monitor (distanceCm) and average them. This average value is your EMPTY_TANK_DIST_CM.
- Measure TANK_HEIGHT_CM: Fill the bucket to its maximum desired water level (the “100%” mark). Then, carefully measure the actual height of the water column (from the bottom of the bucket to the water surface). This is your TANK_HEIGHT_CM.
- Update Code: Enter these precise EMPTY_TANK_DIST_CM and TANK_HEIGHT_CM values into your Arduino code. Upload the code again.
6.3 Performance Evaluation
- Update Rate: Confirm that the OLED display updates consistently every second.
- Accuracy: Subjectively and objectively assess the accuracy. After calibration, compare the displayed percentage to the actual water level (e.g., measured with a ruler) at several points (e.g., 25%, 50%, 75% full).
- Response Time: The system should react almost immediately (within milliseconds) to changes in water level. The 1-second delay is for display refresh, not sensing.
- Battery Life (Qualitative): Monitor how long the 9V battery lasts during continuous operation. While OLEDs and Arduinos are relatively power-efficient, constant ultrasonic pinging consumes some power. For prolonged use, a larger power source or power-saving modes would be necessary.
6.4 Observations and Troubleshooting
During testing, common issues and their solutions were noted:
- OLED Not Displaying / Showing Garbage:
- I2C Address: Verify SCREEN_ADDRESS (0x3C or 0x3D). An I2C scanner sketch can help.
- Wiring: Double-check SDA/SCL, VCC/GND connections.
- Power: Ensure the OLED is receiving stable 5V power from the Arduino.
- Ultrasonic Sensor Returning Erratic/Incorrect Readings:
- Mounting: Ensure the sensor is mounted perfectly perpendicular to the water surface. Tilting can cause reflections off tank walls.
- Obstructions: Clear any objects directly in the sensor’s path (e.g., wiring, tank lips).
- Beam Angle: If the tank opening is very narrow or the sensor is too close to walls, the ultrasonic waves might reflect off the sides instead of the water. Consider a wider tank or adjust mounting.
- Surface Conditions: Foam, ripples, or extreme turbulence on the water surface can cause inconsistent readings.
- Minimum Distance: HC-SR04 has a minimum sensing range (around 2cm). Ensure the sensor is not too close to the water surface even when the tank is full.
- Wiring: Check Trig/Echo/VCC/GND connections.
- Percentage Display Incorrect (despite correct distance reading):
- Calibration Values: Re-measure and adjust EMPTY_TANK_DIST_CM and TANK_HEIGHT_CM in your code. This is the most common cause of percentage inaccuracies.
- Calculation Logic: Review the waterLevelCm and percentage calculation formulas, especially the use of constrain().
- No Update on OLED / Frozen Display:
- Ensure display.display() is called at the end of the loop() after all drawing commands.
- Check if the delay(1000) or any other blocking code is causing the loop to stall.
- Monitor Serial output for continuous readings, which indicates the Arduino is still running.
Overall, the testing confirmed that the system accurately detected and displayed water levels in real-time using the ultrasonic sensor, providing a robust and convenient non-contact monitoring solution.
- Advantages and Limitations
7.1 Advantages
- Non-Contact Measurement: The primary advantage. The sensor does not touch the water, preventing issues like probe corrosion, contamination of the liquid, and making it suitable for a wide range of liquids, including those that are corrosive, dirty, or non-conductive (like oils).
- Improved Hygiene: Ideal for applications where maintaining water purity is essential (e.g., drinking water tanks, food processing).
- Versatility: Can be used with various container shapes (within the beam angle limits) and different types of liquids as long as they provide a clear reflection.
- Simple Setup (Wiring): Compared to multi-probe conductive systems, the ultrasonic sensor requires only four wires, simplifying the physical connections.
- Relatively Accurate: Provides sufficient accuracy for most general-purpose water level monitoring applications.
- Clear Visual Feedback: The OLED display’s ability to show both numerical percentage and a dynamic tank image provides an intuitive and user-friendly interface.
- Portability: Powered by a 9V battery, the system is compact and easily deployable in different locations.
7.2 Limitations
- Affected by Environmental Factors:
- Temperature: The speed of sound varies with temperature. Without temperature compensation in the code, accuracy can drift significantly with ambient temperature changes.
- Humidity/Dust/Vapor: High humidity, dust particles, or condensation can attenuate or scatter ultrasonic waves, leading to less accurate or unreliable readings.
- Foam/Turbulence: Foamy or highly turbulent water surfaces can absorb or scatter ultrasonic waves, making it difficult for the sensor to get a clear echo.
- Minimum Distance (Dead Zone): Ultrasonic sensors have a minimum detection range (typically 2-3 cm for HC-SR04). If the water level is too close to the sensor, it may return incorrect readings.
- Beam Angle Limitations: The sensor has a specific beam angle (e.g., 15 degrees for HC-SR04). If the tank is very narrow or has internal obstructions, the ultrasonic waves might reflect off the walls instead of the water surface, causing false readings.
- Cost: While inexpensive, an ultrasonic sensor is slightly more expensive than simple jumper wire probes.
- Power Consumption: Continuous “pinging” of the ultrasonic sensor, while relatively low, will drain a 9V battery faster than a passive conductive probe system.
- Future Enhancements
The current ultrasonic water level indicator provides a robust base, but several enhancements can significantly increase its functionality, accuracy, and versatility:
- Temperature Compensation: Integrate a temperature sensor (e.g., DHT11/DHT22 or DS18B20) to measure the ambient air temperature. Adjust the speed of sound calculation in the code based on the measured temperature to improve the accuracy of ultrasonic readings.
- Critical Level Alarms: Incorporate a buzzer, LED, or even an SMS module to trigger audible, visual, or remote alerts when the water level reaches predefined critical low or high thresholds, preventing overflows or dry runs.
- Remote Monitoring & Control:
- Integrate a Wi-Fi module (e.g., ESP8266) or Bluetooth module (e.g., HC-05) to transmit water level data to a smartphone app (like Blynk), a web dashboard, or a cloud platform (e.g., ThingSpeak) for remote monitoring.
- This could also enable remote control of a pump (if added) to maintain desired water levels.
- Automatic Pump Control: Add a relay module to the Arduino to automatically control a water pump. The system could turn the pump ON when the water level drops below a minimum threshold and OFF when the tank is full, achieving automated water replenishment.
- Power Optimization: Implement power-saving techniques, such as putting the Arduino into sleep mode between readings, to significantly extend battery life for portable applications. Using a larger capacity battery (e.g., Li-ion battery pack) with a charging circuit would also be beneficial.
- Data Logging: Store historical water level data to an SD card module for offline analysis, trend tracking, and debugging. Alternatively, send data to a cloud database for long-term storage and visualization.
- Enhanced UI/UX:
- Add a small keypad or buttons for manual calibration, setting alarm thresholds, or switching between different display modes.
- Implement graphical trends or history on the OLED if memory allows.
- Robust Enclosure Design: Design and 3D print or fabricate a waterproof and durable enclosure for the electronics, protecting them from splashes, dust, and environmental factors, especially if used in damp or outdoor environments.
- Advanced Filtering: Implement software filtering (e.g., moving average, median filter) for ultrasonic readings to smooth out noise and improve measurement stability, especially in environments with some surface turbulence.
- Conclusion
This project successfully developed a functional and accurate water level indicator leveraging the precision of an ultrasonic sensor. By integrating the HC-SR04 with an Arduino Nano and a 0.96-inch OLED display, a reliable non-contact measurement system was achieved. The project effectively calculates water level as a percentage and provides an intuitive graphical representation through a dynamically filling tank image, all updated in real-time. Powered by a 9V battery, the system offers portability and versatility, making it suitable for monitoring various conductive and non-conductive liquids without the corrosion concerns associated with conductive probes. While considerations such as temperature compensation and environmental factors exist, this project stands as a robust demonstration of modern sensor technology and embedded systems programming, providing a valuable foundation for future enhancements in fluid management solutions.





Reviews
There are no reviews yet.