
Overview
The Smart Coaster with Friends is an IoT-enabled device designed to track water consumption and provide timely hydration reminders. It integrates with Discord, allowing friends to motivate each other. This project was developed in an IoT class and was driven by the personal goal of encouraging better hydration habits.
System Functionality
The Smart Coaster with Friends system offers a set of features designed to encourage consistent hydration and facilitate social interaction. Each smart coaster functions as follows:
Core Coaster Actions
- Placing a water bottle on the coaster registers a new drink. Upon lifting the cup and placing it back down lighter, a sip is registered. A heavier weight detected upon placement registers a new drink.
- Each time a sip is taken, a drinking timer activates.
- An RGB light fades from green to red to indicate the status of the timer.
- A tune plays to alert the user when the timer is up.
- The brightness of the RGB light can be controlled by a dial (potentiometer).
- A push button on the system allows for individual actions:
- Single Press: If it's the first press after the device is ready, it starts a new tracking session, resetting the total consumed and reminder light to green. If a cup is already on the scale, it registers a new cup, corrects a mistaken sip, and sets the current weight as the new starting weight for a full cup.
- Double Press: Resets total consumption, starts a new session, and resets the reminder cycle.
- Long Press: Instructs the scale to re-tare itself.
Discord Integration

- Each coaster is registered as a separate unit and connected to a shared Discord server.
- Devices send notifications to the Discord channel regarding status or action updates — such as when a user starts the device or a session, starts a new drink, takes a sip (including sip amount and total amount), or when the buzzer is active.
- The Discord server can also be used to control the individual timer and buzzer of each coaster. Proposed commands include setting the drinking timer length and muting or unmuting the buzzer.
- This setup enables friends to update their device settings, monitor each other's drinking habits, engage in conversations about water consumption, or even unmute someone's buzzer as a friendly nudge — all from a centralized location.
Flask Web Server
A Flask web server provides a local graphical interface for debugging and monitoring each device. It allows for updating settings and hosts two pages:


ThingsBoard Integration

All devices are connected to a ThingsBoard cloud platform for monitoring hardware telemetry data. This allowed for real-time monitoring of system properties for debugging purposes and as an assignment requirement, without flooding the Discord channel with unnecessary notifications.
System Architecture & Design
The system was designed so that each unit integrates both front-end and back-end components with a robust data-fetching mechanism through various communication protocols.
Architecture Diagram

Multi-layered IoT Architecture
The system's architecture came together through an iterative process, integrating its physical and software components to enable data reporting to ThingsBoard and communication through various protocols.
- Physical Layer: The fundamental hardware components for all four smart coasters — Arduino, a 5Kg load cell for accurate weight measurement, a user input button, a potentiometer for brightness control, an RGB LED, and a passive buzzer.
- Edge Computing Layer: Each coaster has a Raspberry Pi running on a Debian virtual machine. The Pi is responsible for immediate data collection, core logic, and managing the state of the local device.
- Network/Communication Layer: Responsible for Serial communication between Arduino and Raspberry Pi, MQTT protocol between the Pi and the cloud, and HTTPS from the Pi to the Discord API.
- Cloud/Application Layer: ThingsBoard.io serves as the cloud layer for monitoring and visualising device telemetry. The Discord API facilitates bidirectional communication for notification services and bot interaction.
Key Hardware Components
- Load Cell & HX711 Amplifier: A 5KG load cell with HX711 amplifier converting the analog signal to digital. Assembly involved soldering the amplifier, extending wires with heat shrink, and calibrating via the HX711 library.
- Potentiometer: A 10K potentiometer providing analog voltage from 0–5V for RGB LED brightness control.
- Push Button: A digital sensor for triggering operations such as taring the weight sensor, resetting, or initiating a new session.
- RGB LED: Displays the current timer state, fading from green to red.
- Passive Buzzer: Plays a tune when the timer is up — chosen over an active buzzer to allow for custom tunes.