Smart Pool
The smart pool device is a device that can be used for measuring various values of you pool. The different values are temperature (in°C), the quality of the water (in ppm) and the pH-value of your water. Depending on how high the value is, the LED-strip will either turn green or red to let you know the your measurement isn't to high or to low. A buzzer will let you know when a new value has been measured.
With this device, you can better control the water of your pool which can be a difficult thing to do.
I decided to make this device because at home I have a swimming pool myself and I know that it can be very hard to know when exactly you have to add the right product to your water to maintain the best quality.
Supplies
Electronics:
- Raspberry pi 4 model B
- ds18s20 waterproof temperature sensor
- CQRSENTDS01 water quality sensor
- ZHITING PH0-14 pH-sensor
- 5V 4A power supply
- mcp3008
- pcf8574
- potentiometer
- breadboard power supply module
- 9V 1A power supply
- active buzzer
- RGB-led
- LCD1602
Other things you need:
- heat shrink
- breadboard
- male to female wires
- female to female wires
- male to male wires
- some screws
- wood glue
- MDF wood
- ball lock
Main Components and Sensors
I will now give you some more information about the different components and sensors that I used in this project.
- First is the Raspberry Pi 4 model B that is used for running the webserver as well as controlling all the other components in this project.
- Second is the ds18s20 waterproof temperature sensor that measures the temperature of the water.
- The third component is the CQRSENTDS01 water quality sensor that measures the quality of the water. The sensor returns a value between 0 and 500 with 0 bein ideal drinking water and 500 being maximum contamination level.
- The fourth component and the final sensor is the ZHITING PH0-14 pH-sensor that is used for measuring the pH-value of the water. The first time you use this sensor you have to calibrate it. This sounds difficult but it is actually easy. What you habe to do is you have to get some water that has a pH-value that you are sure of (tip: use a pH-tester) and then you put your sensor in that water and turn that screw like part on top of the blue component of the sensor until you have the right value.
- The next component is the mcp3008. This component is used for converting the analog values of the water quality and the pH-sensor to a digital value for the Pi.
- The second chip that is used in this project is the pcf8574 that is used for the LCD-display to same some pins on the raspberry pi.
- The RGB-led let's the user know if the value of the sensor is good (green) or not (blue).
- The Potentiometer is used for the LCD display to set the correct brightness.
- The Active buzzer makes a sound when a sensor measures a new value.
- The final component is the LCD display that shows the address of the website that the user can surf to.
Assembling the Electronics
To make sure that your electronics are not malfunctioning, it's best to start on a breadboard. With a breadboard you don't have to worry about permanent connections and you can easily change something if you have to. After this you can solder them together so that the connection doesn't come apart. I did keep one breadboard so that it's easier to distribute the power. The two pictures show you how to assemble the electronics. The electric schema shows how to connect the electronics and the other shows how to do it with a breadboard.
The Program
The program is written in four different languages. I used HTML, CSS and Javascript for the frontend of the website and for the backend I used Python. With the help of Apexcharts I could generate the different charts you see on the website and I also used some socket io for the real time communication that can be seen on the homepage. The code for this program can be found here: https://github.com/howest-mct/2021-2022-projectone-CumptichSenne
Database
The database was made in MySQL Workbench And is made out of 4 different tables.
Device
The first table in the database is the Device table. Here are all the devices that are used for this project e.g. the Display, the three sensors ...
Actie (Action)
This table includes the different actions that a device can do.
Status
The status table will tell you if the value of your sensor is not to high or not to low.
Historiek (History)
The final table of the database is the History table, This table includes data of all the other tables and will tell you what you did and when you did it.
Making the Case
To make a case I used some regular MDF wood. The dimensions of the case are 30cm long, 15cm wide and 10cm high. To make sure that everything is sealed, use some screws and some wood glue so that nothing will come lose. To open the case I used two hinges. and I used a ball lock so that it can easily be opened and closed.
Assembling the Project
After the case has been made, can you insert your electronics en screw the LCD on. Don't forget to put the RGB-led and the buzzer in the hole you made so that you can see them from the outside. The last thing to do is to plug in the power supplies and you are ready to go.