Aquamate (MCT Howest)
by Arne Vandeputte in Circuits > Raspberry Pi
65 Views, 0 Favorites, 0 Comments
Aquamate (MCT Howest)



Hello, I am Arne Vandeputte and I am a student at Howest Kortrijk. I study MCT (Multimedia and Creative Technologies) and this project is my first project. I have made Aquamate, which is a smart water dispenser. It helps you track your daily water intake. I created this because many people do not drink enough water each day. For me personally, my health is very important.
Supplies
- Raspberry Pi 5
- Raspberry Pi power adapter
- Sd card (min 16gb)
- Raspberry Pi GPIO Breakout Board
- 2 breadboards
- LCD display (shows the IP address)
- PCF8574 (controls the LCD)
- Potentiometer (for LCD contrast control)
- 100 µF capacitor
- 0.022 µF capacitor
- RFID RC522 (login system)
- 1 kg load cell (sensor for measuring water intake) + HX711 module (for load cell)
- DS18B20 one-wire temperature sensor (measures reservoir temperature)
- YwRobot breadboard power supply
- Water pump (moves water from bucket to tank)
- Diode
- Resistors: 3 × 100 Ω, 1 × 220 Ω, 1 × 4.7 kΩ
- Grove water level sensor (measures water level in the reservoir)
- Wires
- Bucket
- 2N2222A transistor
- MDF wood
- Wood screws
- 2 buttons (one for controlling the water pump, one for powering off the Pi)
Price:
+- €260
Database

1. Components
- ComponentId: Unique ID for each hardware component (e.g., sensor, pump).
- ComponentName: Name of the component.
- Description: Short description of the component.
- MeasurementUnit: Unit in which the component measures (e.g., liters, degrees).
- IsSensor: Indicates whether the component is a sensor (1 = yes, 0 = no).
2. History
- HistoryId: Unique ID for each historical event.
- ComponentId: Refers to the involved component (relation to Components).
- ActionId: Refers to the performed action (relation to Actions).
- Timestamp: Date and time of the event.
- Value: Stored value (e.g., measured quantity).
- PersonId: Refers to the person involved (relation to Persons).
3. Actions
- ActionId: Unique ID for each possible action (e.g., "water dispensed", "sensor read").
- ActionDescription: Description of the action.
4. Persons
- PersonId: Unique ID for each user.
- LastName: Last name of the person.
- FirstName: First name of the person.
- BirthDate: Date of birth.
- RFIDTag: RFID tag for identification.
- Password: Password for login.
- DailyVolume: Daily water goal (in ml or liters).
5. Water Consumption
- ConsumptionId: Unique ID for each water consumption record.
- PersonId: Refers to the person who drank the water (relation to Persons).
- WaterAmount: Amount of water consumed (FLOAT).
- Timestamp: Date and time of consumption.
Relations between tables
- History is a central table that logs events and links to components, actions, and persons.
- Water Consumption directly links a person to a consumption moment and the amount of water.
- Components and Actions are connected to events via History.
- Persons are linked to their actions and water intake via both History and Water Consumption.
Code Summary
App.py:
Key features include:
- Hardware Control: Interfaces with sensors and actuators to read values (temperature, water level, weight) and control the water pump and LCD.
- Background Threads: Continuously monitor sensor values, handle button presses, read RFID tags, and update the LCD.
- REST API Endpoints: Allow clients to retrieve and add data about temperature, water level, weight, RFID, users, water dispenses, history, and user water goals.
- Real-Time Updates: Uses Socket.IO to send immediate feedback to the frontend when events occur (e.g., bottle placed, water dispensed, water level changes).
- Safe Shutdown: Provides an option to safely power off the Raspberry Pi via a button or API call.
- Logging: Implements logging for monitoring and debugging.
App.js:
Key features:
- Live Data Visualization:
- Shows current temperature, water level, bottle weight, RFID tag, and user’s water goal.
- Visualizes progress towards daily water goals and displays consumption history and statistics with dynamic charts (using ApexCharts).
- Real-Time Updates:
- Listens to Socket.IO events from the backend for immediate updates when water is dispensed, RFID is scanned, or sensor values change.
- Updates the UI instantly when the state of the hardware changes (e.g., bottle detected, water goal changed).
- User Interaction:
- Allows users to adjust their daily water goal and submit it.
- Handles user login, registration, and logout.
- Provides feedback and disables/enables controls based on system status (e.g., when the bottle is missing or the device is dispensing).
- System Controls:
- Enables safe power-off of the Raspberry Pi via a protected button.
- Manages button states and feedback colors for clear user guidance.
- Data Fetching:
- Fetches sensor data, user information, and consumption records from the backend API.
- Updates charts and statistics based on the latest data.
The Circuit


In these PDF files, you can see my Fritzing diagrams for building the circuit.
Design of Aquamate


The first photo shows a cutting plan for the MDF panels of your project, with all dimensions in centimeters.
- The piece measuring 16 x 27 cm should be made from 8 mm MDF.
- All other pieces are cut from 18 mm MDF.
- The drawing includes two L-shaped side panels (40 x 48 cm with a 16 x 32 cm cutout), three rectangular panels (27 x 32 cm, 40 x 27 cm, 28.6 x 48 cm), and smaller support pieces ( 27 x 13 cm, 2 x(13 x 4 cm), 4 x 13 cm).
Building Aquamate





My father is very good with wood so he helped me.For connecting I used wood screws.
Making Holes for the Electronics





Now you have to make holes for the electronics. I used a normal drill and a clock drill. For the place for the lcd and rfid I used a drill and a wood saw.
Circle for Load Cell


You can use a 60 mm hole saw to drill a circular opening in the MDF for the load cell (weight sensor). After drilling the hole, attach the load cell securely using screws. This ensures the sensor is properly positioned and stable for accurate measurements.
Putting the Electronics in Aquamate





Now you can put the electronics in Aquamate, I used normal screwws for fasten the electronics.It is very tricky to do because the wires are small. To secure the breadboard also use screws.
Finishing Touches




You can add feet underneath the enclosure and attach them with small screws for stability. Drill a hole in the back panel to route the wires neatly out of the box. For the door, use cabinet hinges so it can open and close smoothly.You can use a cable duct (cable channel) to neatly organize and protect the wires inside your enclosure. Simply cut the cable duct to size, attach it to the inside of the box, and place the wires inside for a tidy and safe finish.
Get the Github Repository

You can find my code here.