This project uses a Raspberry Pi to monitor the water level in a tank and control a pump based on the water level. It utilizes an ultrasonic distance sensor, the Philips Hue bridge for controlling a smart light socket, and the Pushover service for sending notifications.
- Raspberry Pi with Raspbian OS
- Python 3
- RPi.GPIO library
- phue library
- pushover library
-
Connect the ultrasonic distance sensor to the Raspberry Pi GPIO pins.
-
Install the required libraries by running the following commands:
pip install RPi.GPIO pip install phue pip install pushover
-
Update the
bridge_ip,pushover_user_key, andpushover_api_tokenvariables in the code with your own values.
-
Run the script using the following command:
python3 water_level_monitor.py
-
The script will continuously monitor the water level and control the pump accordingly.
-
If the water level exceeds the critical threshold, the pump will be turned on and a notification will be sent.
-
If the water level drops below the safe threshold and the pump is running, it will be turned off.
Contributions are welcome! If you have any suggestions or improvements, please create a pull request.
This project is licensed under the MIT License.