Since the range sensor is positioned atop the tank, control over water flow is completed taking into consideration the amount of water from the top of the tank. For instance, if the measured range is found to be between 0 to at least 1 cm, the tank is overflowing additionally the microcontroller in the water level controller sends a control signal to rotate the motor in reverse direction, in order to eliminate the surplus water.
In case the range is between 2 to 5 cm, the tank is supposedly full therefore the microcontroller sends a control signal to turn off the motor. In the event that range is above 5cm, the tank is practically empty therefore the microcontroller sends a signal to rotate the motor in the forward direction.
The circuit of the water level controller would comprise of the following elements:
- Ultrasonic Range Finder SRF04
- PIC Microcontroller PIC16F84A
- Motor Driver L293
- DC Motor
- Two 1K Resistors