Introduction
My name is Shafin, and I am a member of Aiversity. I will demonstrate how to build a water level sensor using a Raspberry Pi. This project is meant to help you to understand the workings of the Raspberry Pi in detail. See below for the video project.
For the full project, visit http://aiversity.com/water-level-monitor-using-raspberry-pi/
Or, the written project is below
Extra Materials:
- A Jug Of Water
- A Small Bucket
Let's talk about how the raspberry pi, ultrasonic sensor, and buzzer are connected.
Here is a circuit diagram for your reference:
Written Connections:
- Ultrasonic sensor VCC to 5v of Raspberry Pi
- Ultrasonic sensor GND to GND of Raspberry Pi
- Trigger to GPIO 2
- Echo to GPIO 3
- Buzzer + to GPIO 4
- Buzzer – to GND
- Attach a scale to the bucket.
- Next, attach the buzzer and ultrasonic sensor to the scale
- Measure and note the distance between the ultrasonic sensor and the bottom of the bucket (you will need this information in the code)
Now you know the connections and the structure, let’s build the code.
1. Open the Thonny Python IDE
2. Download the Github code from below:
3. Run the code.
TestingPrepare the bucket by filling it with water. A buzzer will beep when the ultrasonic sensor is 4 centimeters from the water, indicating the bucket is almost full.
If you have any queries, please ask at shafinkothia@gmail.com or hello.aiversity@gmail.com
Or type in the comments
To know more, visit http://www.aiversity.com
Comments