Aquamate (MCT Howest)

by Arne Vandeputte in Circuits > Raspberry Pi

65 Views, 0 Favorites, 0 Comments

Aquamate (MCT Howest)

IMG_3615.jpg
home.jpg
historiek.jpg

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

Database

Erd_AquaMate.png

1. Components

  1. ComponentId: Unique ID for each hardware component (e.g., sensor, pump).
  2. ComponentName: Name of the component.
  3. Description: Short description of the component.
  4. MeasurementUnit: Unit in which the component measures (e.g., liters, degrees).
  5. IsSensor: Indicates whether the component is a sensor (1 = yes, 0 = no).

2. History

  1. HistoryId: Unique ID for each historical event.
  2. ComponentId: Refers to the involved component (relation to Components).
  3. ActionId: Refers to the performed action (relation to Actions).
  4. Timestamp: Date and time of the event.
  5. Value: Stored value (e.g., measured quantity).
  6. PersonId: Refers to the person involved (relation to Persons).

3. Actions

  1. ActionId: Unique ID for each possible action (e.g., "water dispensed", "sensor read").
  2. ActionDescription: Description of the action.

4. Persons

  1. PersonId: Unique ID for each user.
  2. LastName: Last name of the person.
  3. FirstName: First name of the person.
  4. BirthDate: Date of birth.
  5. RFIDTag: RFID tag for identification.
  6. Password: Password for login.
  7. DailyVolume: Daily water goal (in ml or liters).

5. Water Consumption

  1. ConsumptionId: Unique ID for each water consumption record.
  2. PersonId: Refers to the person who drank the water (relation to Persons).
  3. WaterAmount: Amount of water consumed (FLOAT).
  4. Timestamp: Date and time of consumption.

Relations between tables

  1. History is a central table that logs events and links to components, actions, and persons.
  2. Water Consumption directly links a person to a consumption moment and the amount of water.
  3. Components and Actions are connected to events via History.
  4. Persons are linked to their actions and water intake via both History and Water Consumption.


Code Summary

App.py:

Key features include:

  1. Hardware Control: Interfaces with sensors and actuators to read values (temperature, water level, weight) and control the water pump and LCD.
  2. Background Threads: Continuously monitor sensor values, handle button presses, read RFID tags, and update the LCD.
  3. REST API Endpoints: Allow clients to retrieve and add data about temperature, water level, weight, RFID, users, water dispenses, history, and user water goals.
  4. 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).
  5. Safe Shutdown: Provides an option to safely power off the Raspberry Pi via a button or API call.
  6. Logging: Implements logging for monitoring and debugging.

App.js:

Key features:

  1. Live Data Visualization:
  2. Shows current temperature, water level, bottle weight, RFID tag, and user’s water goal.
  3. Visualizes progress towards daily water goals and displays consumption history and statistics with dynamic charts (using ApexCharts).
  4. Real-Time Updates:
  5. Listens to Socket.IO events from the backend for immediate updates when water is dispensed, RFID is scanned, or sensor values change.
  6. Updates the UI instantly when the state of the hardware changes (e.g., bottle detected, water goal changed).
  7. User Interaction:
  8. Allows users to adjust their daily water goal and submit it.
  9. Handles user login, registration, and logout.
  10. Provides feedback and disables/enables controls based on system status (e.g., when the bottle is missing or the device is dispensing).
  11. System Controls:
  12. Enables safe power-off of the Raspberry Pi via a protected button.
  13. Manages button states and feedback colors for clear user guidance.
  14. Data Fetching:
  15. Fetches sensor data, user information, and consumption records from the backend API.
  16. Updates charts and statistics based on the latest data.



The Circuit

schakeling.png
Bovenzicht.jpg

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

Design of Aquamate

IMG_3632.jpg
IMG_3633.jpg

The first photo shows a cutting plan for the MDF panels of your project, with all dimensions in centimeters.

  1. The piece measuring 16 x 27 cm should be made from 8 mm MDF.
  2. All other pieces are cut from 18 mm MDF.
  3. 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

image.jpg
image1.jpg
image2.jpg
image4.jpg
fotoek.jpg

My father is very good with wood so he helped me.For connecting I used wood screws.

Making Holes for the Electronics

image5.jpg
image6.jpg
image7.jpg
image8.jpg
image9.jpg

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

blabla.jpg
arag.jpg

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

image10.jpg
image11.jpg
image12.jpg
image13.jpg
image14.jpg

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

agafafaag.jpg
agafaagag.jpg
afagaega&.jpg
faagagag.jpg

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

code.png

You can find my code here.