The goal of this project was to make a project that can be helpful using Arduinos. I made an app to track water consumption that connects to the Arduino to accomplish this.
- Arduino R4
- hx711 weight cell amplifier
- 4 weight cells*
- coaster
- cardboard
*while you can use less weight cells than 4, in testing having 4 was a more accurate count as I average out the readings from all 4. Furthermore, the coster used in the prototype was larger than average and placing a cup off centre would cause inaccurate readings and potentally tilt the cups over.
- electron
- typescript/javascript
- Arduino programming language
- Node
- WSL
- Joy UI
This button is to be used to zero out/tare the scale to remove the weight of the empty cup. Simply place the empty cup on the scale and hit recalibrate and wait a few seconds. Then you are able to take your cup off and fill it with water to begin the process
The default goal is 770mL, based off my own daily use cup, however not all cups hold that much. So there is an option to change the goal to fit your own needs! Keep in mind this will not save so if you close the app it will be reset + right now it does not carry over if you recalibrate the scale again
This is where your mLs drank (top) and goal mLs (bottom) are located. This is where it will tell you how much has been drank and can take a second to update. If you know how to code and want to speed this process up you can edit line 64 in the App.tsx to speed it up but keep in mind you may need to change the SamplesPerAvg to match your speed
This area tells you the time since last drank and the current weight of the cup in mLs. The time since last drank is the last time the mLs drank is updated and current weight is the current weight of liquid in the cup.
This is simply where the username and profile pic are stored. Currently no way to change it as I ran out of time but if you know what you're doing feel free to edit. You may have to edit electron privacy settings though
Some quotes from a Quote API, you will need to use your own key the one provided is revoked :)
The arduino R4 has a matrix LED on the board itself and it will change the faces depending on the % completed for the water goal. This uses the Arduino_LED_Matrix and matrix library to function. If you do not have an LED matrix you may need to comment out the code for it in the .ino file.
Set up the arduino like this. When attaching the weight cells to the coaster be careful as the small inner square of the cell needs to have some space to flex! Personally I put the weight cells flat side down on some cardboard and put the coster on top since the cardboard had enough give to let it flex enough for this usecase.
Currently the arduino default pins set up are the dout pin = 3 and sck pin = 2. The baud rate is 9600 with a calibration factor of -7050 (feel free to change this but its the best i got in testing). A majority of this code is just for sending the arduino data to Node and then to the actual application to use for logic and calculations.