Hiking, playing sports, and generally enjoying the outdoors is a great way to spend time...until you realize you haven't had any water all day and you feel tired and dehydrated. Not a very healthy way to conclude what could have been a very rejuvenating outdoor experience. Some phone apps offer a solution: simply record each time you drink another glass of water and the app will track your progress and let you know when you need to drink more. This seems like a perfect solution...until you forget to track your water because you're too busy having fun outside! We designed Hydr8Mate so you don't have to remember to log your water.

What it does

Hydr8Mate is an comprehensive hydration monitoring system. The star of the show is the fully integrated HC-SR04 Ultrasonic distance sensor module which is placed conveniently underneath the lid of the bottle and continuously measures the exact amount of water remaining in your bottle to the milliliter. The system intelligently analyzes the height, area, and volume of your specific bottle using algorithms developed using physics principles revolving around the speed of sound so you can be confident that you will receive accurate data every time. The small sensor circuit under the lid uses wireless Bluetooth technology to transmit data about the contents of the bottle to your phone which is then displayed in the Hydr8Mate app. The system transmits data at critical times - such as immediately after it detects the user has taken a drink - to constantly provide up-to-date data about your consumption whenever you need it.

How we built it

There are two main systems involved in Hydr8Mate: the small, water-bottle-integrated ultrasonic distance sensor circuit that transmits data using Bluetooth via the EPS-32 MCU and the corresponding app built in Processing IDE. The calibration mode first takes a distance reading using the ultrasonic sensor (with an empty bottle) to determine the baseline height of the bottle. Then, the user fills the bottle to a predetermined volume and the sensor takes another reading - allowing the system to determine the area of the bottom of the bottle. After this point, the system runs by itself, taking height readings every few seconds. We process all this data in the MCU, wherein we wrote code to send the data via Bluetooth if the data is noteworthy. Then, we created an app in Processing to receive this data and display it to the user as our sort of front end. All of the math and analysis is accomplished in the MCU and only the final numbers are sent to the app.

Challenges we ran into

Throughout the development of our hydration monitoring system, we ran into multiple problems ranging from simple to complex and confusing. The simple problems included failing to get a simple LED to blink using the EPS-32 MCU and then failing to take readings from the ultrasonic sensor using the MCU. The LED issue was solved by reanalyzing the datasheet and discovering that we had used the wrong pin numbers in our code. The ultrasonic sensor error was caused by a lack of voltage supplied to the sensor: at first we used the digitalWrite() voltage of the MCU but later realized that it wasn't enough to power the sensor. So, we ended up plugging in an external 9V battery, which worked instantly. We also accidentally connected a power supply to Vin and the micro-USB ports on the MCU simultaneously, burning the internals of the MCU. We also had issues connecting the MCU to other devices via Bluetooth and ended up switching to Processing IDE to eventually allow the communication to be achieved. Additionally, we originally took multiple measurements with the ultrasonic sensor and took the average to obtain a more accurate reading. However, we discovered that using multiple ultrasonic pings in an enclosed environment disrupted the sensor readings as the sound "bounced" around the bottle. So, we decided to take a single sensor reading, which, given the remarkable accuracy of the sensor itself, worked significantly better than taking multiple readings.

Accomplishments that we're proud of

Creatively determining methods to take measurements about the water bottle was a significant achievement. We decided to implement a calibration feature wherein the user takes a sensor reading with an empty bottle and then one with a set amount of water, allowing the system to accurately calculate the area of the bottom of the bottle and therefore the exact volume of water remaining given the height of the water in the bottle. Additionally, creating an adequately small circuit to fit inside the bottle without disrupting the user was a proud achievement. Troubleshooting and finally achieving a working Bluetooth system was also an exciting moment.

What we learned

We learned about wireless Bluetooth communication and the EPS-32 MCU. We also learned the value of thoroughly reading the datasheet to quickly understand exactly which pins correspond to which functions. We also had to do a lot of troubleshooting, where we learned to systematically check each error until coming up with a solution.

What's next for Hydrate Mate

Ideally, we would like to use a smaller ultrasonic sensor to reduce the inconvenience of a sensor inside the water bottle. Additionally, we would like to improve the app's UI and add interesting animations to create a more enjoyable experience. If everything came to fruition, we want Hydr8 Mate to include a small, cheap, and powerful sensing circuit that seamlessly integrates into any water bottle lid accompanied by a clean, professional app that users enjoy. We hope that this system truly takes the hassle out of hydration reminding the user to drink and monitoring their progress - even if the user doesn't do anything (including entering their water consumption).

Built With

Share this project: