Software apps and online services
This project was developed as part of a course called "Internet of Things Ecosystems" at the University of Applied Science Esslingen. Through this project, students have the opportunity to build their own IoT application from the ground up and gain an understanding of the associated business aspects.Motivation
High bills due to prolonged shower times can be frustrating, especially when finances are tight. Long warm showers worsen the situation, especially during the energy crisis. But that doesn't mean that the problem is caused by you. Maybe you have family members or roommates and one of them spends way too much time in the bathroom to shower. But don't blame them. People spend a lot of time in shower and at some point just lose the sense of time. However, with our product, you now have a solution for that problem.Solution
Our Dusch-o-Meter IoT device and accompanying app aim to reduce water consumption and minimize shower time with features such as:
- Tracking of the water consumption during shower and upload of the data to the cloud
- Also tracking of the water temperature to consider the water consumption with warm water (not implemented yet)
- Sending of an alert to the IFTT-App if a specific water limit is reached during shower
- Statistics about the water consumption over different time ranges (days, weeks, months and years) in the Web-Dashboard and the Dusch-o-Meter app
- Integrated cost calculator for calculating the exact costs of the wasted water (not implemented yet)
Before the first use, install the Dusch-o-meter water flow sensor between the shower tap's water outlet and the hose connected to the shower head. Then, connect the water flow sensor to the Particle Photon following the wiring scheme included in this article. After these steps, the Dusch-o-meter device is ready to use.
Before showering, ensure to press the play button in our app, as our backend needs to know who is showering in order to assign the water consumption to the appropriate person. If this step is not taken, the water consumption will still be monitored, however, it will not be linked to a specific person.
Upon completing your shower, simply press the pause button in the app and the water consumption value will be uploaded to the Dusch-o-meter cloud and credited to your account. Forgot to hit the pause-button? Not an issue, there is a timeout implemented which performs an automatic reset and upload of your water consumption after you stopped showering.Backend/Implementation
The main code of the program is located in the loop() function of the program.
When water is flowing, the sensor measures the water consumption by returning pulses. The higher the frequency of the pulses, the greater the water flow. The formula below demonstrates how to calculate the water consumption per hour using the Pulse_count value provided by the water flow sensor:
Liter_per_hour = (Pulse_Count * 60 / 6.6);
This calculation is triggered once a second. The variable Pulse_Count contains the number of pulses from the sensor within this second. This value will be multiplied with 60 to convert its value from Liter/min to Liter/hour. Then, it will be divided by 6.6 which is a sensor specific constant. The formula is provided in the datasheet of the sensor.
After the calculation, the amount of used water within one second is calculated and added to the variable used_water, which holds the total water consumption of the current showering session.
used_water += calc_used_water_1s(Liter_per_hour);
When the water usage exceeds a predetermined limit of e.g. 150 liters, the Dusch-o-meter program will trigger an event ("limit reached") and send it to the particle cloud. This event will then be redirected to IFTTT, which will send a notification to the IFTTT app on your phone via webhooks. The setup of the webhook to IFTT is described here.
After you finished showering, there is a timeout after which the used_water value is uploaded to your ThingsPeak cloud using the ThingsPeak Community library, which can be added from the Particle web IDE. More info on the library here.Frontend (Prototype)
The app offers a comprehensive view of who exceeded the water limit and when, and enables you to start the shower by simply pressing the play button. It also showcases water consumption statistics and calculates the associated costs. Additionally, it includes various customization options such as changing the theme, modifying personal details such as name and avatar. Feel free to test our demo here.
The following steps give a brief explanation how to set up the Dusch-o-Meter (not implemented yet)
- Enter your account details like name, profile picture etc.
- Create your own group and invite your friends to share your statistics about water consumption or join an existing group.
- Set up the Dusch-o-Meter by registering your specific device with the provided identification number and password.
- Chose a fancy theme