WakeUp Buddy – Smart Robot Alarm Clock That Forces You Out of Bed

by Thomas van der Reijken in Circuits > Clocks

282 Views, 4 Favorites, 0 Comments

WakeUp Buddy – Smart Robot Alarm Clock That Forces You Out of Bed

IMG_1337.JPEG

Do you hit the snooze button way too often?

Meet WakeUp Buddy, a smart robotic alarm clock designed to physically make you get out of bed.


This project was created as part of the Project One module at MCT, Howest (Kortrijk, Belgium). The idea came from personal frustration with ineffective alarms and the desire to build something more engaging, interactive, and impossible to ignore.


WakeUp Buddy combines a mobile robot, motion sensors, pressure sensors, and an interactive LED ring to make sure you actually leave your bed in the morning. The system runs on a Raspberry Pi and ESP32, and communicates wirelessly while storing your data in a local database with live visualization in a web dashboard.


In this Instructable, I'll guide you through every step: from wiring and coding to building the housing and setting up the live dashboard. You’ll also find links to all components, code, and 3D models so you can recreate it yourself!

Supplies

What You Will Need?

Electronics & Hardware

Total estimated cost: ~€242

  1. Raspberry Pi 5 – 8GB
  2. Main controller: processes data, hosts backend and handles communication.
  3. Kiwi Electronics – €90,74 (x1)


  1. ESP32 NodeMCU
  2. Bluetooth microcontroller that controls the robot.
  3. AliExpress – €4,23 (x1)


  1. Short Film Pressure Sensor
  2. Detects whether the user is still in bed.
  3. AliExpress – €2,89 (x1)


  1. Long Film Pressure Sensor
  2. Larger version of pressure sensor for wider surface coverage.
  3. AliExpress – €8,92 (x1)


  1. PIR Motion Sensor (AM312)
  2. Detects motion to confirm the user got out of bed.
  3. AliExpress – €1,26 (x1)


  1. Ultrasonic Distance Sensor (HC-SR04)
  2. Detects obstacles to avoid collisions.
  3. AliExpress – €1,43 (x1)


  1. ESP32 Dev Board
  2. Used for prototyping with more pins and easier breadboarding.
  3. AliExpress – €2,09 (x1)


  1. Motor Driver TB6612FNG
  2. Controls two DC motors using PWM and direction pins.
  3. AliExpress – €2,40 (x1)


  1. 2x DC Motors GA12-N20 (6V)
  2. Drives the robot's wheels.
  3. AliExpress – €8,48 (x2)


  1. MT3608 Boost Converter
  2. Boosts 5V to 6V for the motors.
  3. AliExpress – €0,80 (x1)


  1. Metal Emergency Stop Button
  2. Big physical button to immediately stop the alarm/robot.
  3. AliExpress – €5,99 (x1)


  1. Emergency Button Socket
  2. Mount for the stop button with good electrical contact.
  3. AliExpress – €2,09 (x1)


  1. WS2812B RGB LED Ring (16 LEDs)
  2. Provides visual feedback: alarm status, animations.
  3. AliExpress – €3,48 (x1)


  1. 7" LCD Display
  2. User interface, dashboard and data visualization.
  3. AliExpress – €36,49 (x1)


  1. 1.3" OLED Display (I²C)
  2. Displays Pi IP address and status.
  3. AliExpress – €2,50 (x1)


  1. 120x Jumper Wires (m-m, m-f, f-f)
  2. Wiring between components.
  3. AliExpress – €4,05 (x1)


  1. 2x 18650 Battery Holder
  2. For mobile power – with onboard protection + boost.
  3. AliExpress – €4,59 (x1)


  1. 2-pin Connectors (10x)
  2. Quick-connect for pressure sensors.
  3. AliExpress – €7,33 (x1)


  1. 22AWG Copper Wire (20m)
  2. General purpose wiring (motors, sensors).
  3. AliExpress – €5,79 (x1)


  1. MCP3008 ADC Chip
  2. Converts analog sensor values to digital (for Pi).
  3. AliExpress – €3,48 (x1)


  1. IC Sockets (10x, 16pin)
  2. Safe and removable mounting for ICs.
  3. AliExpress – €1,02 (x1)


  1. 5.1V 5A Raspberry Pi Power Supply
  2. Strong enough to power Pi + peripherals.
  3. AliExpress – €11,49 (x1)


  1. Argon THRML 30mm Fan for Pi 5
  2. Keeps Raspberry Pi cool under load.
  3. AliExpress – €9,29 (x1)


  1. 2x 18650 Recycled Batteries
  2. Eco-friendly Li-ion batteries (from e-steps).
  3. 123accu – €- (x2)


  1. 32GB microSD Card
  2. Stores Raspberry Pi OS and data.
  3. Action (Philips) – €6,42 (x1)


  1. Passive Buzzer
  2. Generates alarm sound using PWM.
  3. AliExpress – €0,16 (x1)


  1. Small Push Button
  2. Manual reset/start switch for Pi or logic.
  3. AliExpress – €0,02 (x1)


  1. Basic Resistors
  2. 2x 10kΩ, 1x 300Ω, 2x 470Ω – for pull-up/down and LEDs.
  3. AliExpress – €0,09 (x1 set)


  1. PLA Filament (Dark Grey)
  2. Used to 3D print the housing and robot parts.
  3. 123-3D – €14,73 (x1)


️ Tools

  1. Soldering iron and solder
  2. Wire cutters and strippers
  3. Screwdrivers
  4. Breadboard (for prototyping)
  5. 3D printer (for housing)
  6. Hot glue gun
  7. Multimeter (recommended for debugging)

Creating the Circuit in Fritzing

ESP32_WakeUpBuddy_schema.png
Pi_WakeUpBuddy_schema.png

Before building the physical hardware, I created a detailed wiring diagram using Fritzing. This helped me organize and plan the connections between the Raspberry Pi, ESP32, sensors, and actuators clearly and logically.

Included in the schematic:

  1. Raspberry Pi 5 as the main controller (power, GPIO, I²C, SPI)
  2. ESP32 NodeMCU, connected to the Pi via Bluetooth
  3. MCP3008: analog-to-digital converter for the pressure sensors
  4. Pressure sensors (short and long): connected to CH0 and CH1 of the MCP3008
  5. PIR motion sensor: digital input to a Pi GPIO pin
  6. Ultrasonic sensor (HC-SR04): TRIG and ECHO connected to GPIO pins
  7. WS2812B RGB LED ring: connected to GPIO18 with a 470 ohm series resistor
  8. OLED display (I²C): connected to SDA and SCL on the Pi
  9. Buzzer and button: directly connected to GPIO
  10. Motor driver (TB6612FNG): controlled by the ESP32
  11. 2x DC motors: connected to the motor driver output channels
  12. Power modules: 18650 battery holder and boost converter for powering motors and Pi

All GND connections were grouped together to reduce clutter. Power lines were clearly marked in red and orange

Breadboard Setup and Functional Testing

afbeelding_2025-06-20_125448794.png

Once all components were connected according to the Fritzing schematic, I built the complete circuit on a breadboard to test the entire setup before final soldering and assembly.

This step allowed me to confirm that:

  1. All components functioned as intended
  2. Pin mappings in the code matched the physical wiring
  3. No faulty sensors or wiring issues were present


Testing approach:

  1. I powered the Raspberry Pi and used Python scripts to read sensor data and activate outputs
  2. Each sensor was verified in isolation, then as part of the full system
  3. Data from pressure sensors was read via the MCP3008 and printed to the terminal
  4. The OLED displayed system information (e.g. IP address)
  5. The LED ring ran basic animations
  6. The buzzer was triggered based on button presses or simulated alarm conditions


ESP32 Bluetooth testing:

The ESP32 was programmed using PlatformIO, which allowed better project structure and easier dependency management.

  1. The ESP32 advertised itself as a Bluetooth serial device
  2. I connected it to the Raspberry Pi via Bluetooth
  3. Python on the Pi established a serial connection to send and receive test messages


All testing scripts used during this phase are available in my GitHub repository:

View test code on GitHub


Creating the Database

afbeelding_2025-06-20_130332525.png

To log all sensor data, actuator states, and sleep-related events, I designed a normalized SQL database using MYSQL, MariaDB, running locally on the Raspberry Pi. The database is accessed by the backend API to store and retrieve all relevant system information.


Database Overview

The database contains 8 main tables, designed with a clear separation between structure and data logs:

1. Sensors and SensorLog

  1. Sensors: static info like name, type, location, and unit
  2. SensorLog: all real-time readings linked by foreign key to a SensorID

2. Actuators and ActuatorLog

  1. Actuators: stores metadata about motors, buzzers, LEDs, etc.
  2. ActuatorLog: logs actions (e.g., "on", "off", "speed=100") with timestamp

3. Alarms and SleepSession

  1. Alarms: time, repeat days, and enabled state
  2. SleepSession: tracks when the alarm was enabled/disabled, and when sleep was detected to start/end

4. Settings

  1. Simple key-value store for system configuration (e.g., "led_brightness" → 75)


Features of the design

  1. Fully normalized, no duplicate data
  2. Each log table is lightweight and scalable (indexed on timestamp)
  3. Clear foreign key relationships between entities
  4. Easy to query for graphs, summaries, or dashboard views


Designing and Printing the Housing

IMG_1265.JPEG
IMG_1279.JPEG
IMG_1080.JPEG
IMG_1278.JPEG

After the electronics and database were working, I started designing a custom 3D-printed enclosure for the WakeUp Buddy. The design was fully customized and built around the actual dimensions of all hardware components.

Individual test prints

Before creating the full enclosure, I printed small test blocks for each critical component:

  1. Raspberry Pi 5
  2. 7" LCD touchscreen
  3. Emergency stop button
  4. DC motors (GA12-N20)
  5. Sensor mounts (PIR, ultrasonic, pressure sensors)
  6. Battery holders and boost converters

This allowed me to verify fit and tolerance, avoiding failed large prints later.

Final housing design

Once everything fit correctly, I created a combined housing using Tinkercad. The project consists of two separate parts:

  1. Base Station
  2. Contains the Raspberry Pi, LCD screen, OLED display, and emergency button
  3. Front-facing design for UI visibility
  4. Cutouts for USB, HDMI, and GPIO access
  5. Mobile Robot Unit
  6. Holds the ESP32, motors, LED ring, and sensors
  7. Compact structure with slots for wiring and ventilation
  8. Designed for stable driving and easy assembly

Printing details

  1. Designed in Tinkercad
  2. Sliced in Ultimaker Cura
  3. Printed with an Ender 3 V3 SE
  4. Print time: approximately 14 hours in total
  5. Material: 1.75 mm PLA, dark grey

All parts were printed with:

  1. 0.2 mm layer height for faster output
  2. 40% infill
  3. Supports off (but on with the Base Station back)
I designed everything to be modular and serviceable. Parts are screwed together or use press-fit mechanisms where possible.


Creating the Web Dashboard (HTML, CSS, and Live Data)

Step 6: Creating the Web Dashboard (HTML, CSS, and Live Data)

To make the WakeUp Buddy user-friendly, I designed a custom web dashboard that runs locally on the Raspberry Pi. This interface allows users to view live sensor data, check alarm status, and configure basic settings.

Tools used:

  1. HTML & CSS: for layout and styling
  2. JavaScript: for real-time updates and user interaction
  3. Socket.IO (JS client): for receiving live data via WebSocket
  4. FastAPI (Python backend): serves the webpage and handles API logic

All scripts used during this phase are available in my GitHub repository:

View test code on GitHub

Reading Sensors, Writing to the Backend, and Final Integration

After assembling the hardware and designing the database, I finalized the software side by integrating all sensor readings into the Python backend.

Sensor readout

All sensors were read using Python on the Raspberry Pi:

  1. Pressure sensors:
  2. Connected to MCP3008 (channels CH0 & CH1)
  3. Read using SPI and converted to a pressure value
  4. Mapped to sleep state (in bed or not)
  5. PIR motion sensor:
  6. Read as a digital GPIO input
  7. Used to detect if the user has left the bed
  8. Ultrasonic sensor:
  9. Triggered via GPIO pin
  10. Used to detect obstacles around the robot
  11. Button:
  12. Detected via GPIO input
  13. Used to manually stop the robot or alarm
  14. ESP32 Bluetooth status:
  15. Data sent/received using Python serial communication

Writing to the backend (FastAPI)

The Python scripts continuously looped through all sensor checks and wrote data to the backend using POST requests:

  1. The backend was built with FastAPI and exposed endpoints like:
  2. POST /readings → log sensor values
  3. POST /events → log robot actions, button presses, movement
  4. POST /sleep_session/start and /end → manage sleep sessions
  5. Communication between the main sensor loop (app.py) and the backend was asynchronous, using asyncio, httpx and socket.io for live updates

Code integration

Each of the separate test scripts (from earlier steps) was refactored into a unified loop in app.py:

  1. Created modular functions: read_pressure(), read_motion(), detect_obstacle(), etc.
  2. Each reading was written directly to the database via the backend
  3. The system detected alarm start/stop conditions based on sensor values and time
  4. Status updates were sent live to the web dashboard via socket.io

All scripts used during this phase are available in my GitHub repository:

View test code on GitHub

Final Assembly, Soldering and Mounting Components Into the Housing

IMG_1102.JPEG
IMG_1104.JPEG
IMG_1107.JPEG
IMG_1115.JPEG
IMG_1116.JPEG
IMG_1120.JPEG
IMG_1122.JPEG
IMG_1126.JPEG
IMG_1134.JPEG
IMG_1137.JPEG
IMG_1141.JPEG
IMG_1179.JPEG
IMG_1222.JPEG
IMG_1229.JPEG
IMG_1240.JPEG
IMG_1238.JPEG
IMG_1234.JPEG
IMG_1280.JPEG
IMG_1284.JPEG
IMG_1288.JPEG
IMG_1289.JPEG
IMG_1290.JPEG
IMG_1294.JPEG
IMG_1296.JPEG
IMG_1302.JPEG
IMG_1303.JPEG
IMG_1319.JPEG
ChatGPT zei:

Dank je, hier is een herschreven en duidelijkere versie van Step 7: Final Assembly, zoals jij het bedoeld hebt:

Step 7: Final Assembly, Placing, Gluing, Connecting, and Testing

After all components were printed, soldered, and tested individually, I completed the final assembly by installing everything into the custom 3D-printed housing.

Placing the components

  1. All components were physically placed into their designated locations inside the printed parts.
  2. I followed the layout planned during the design phase in Tinkercad.
  3. The robot chassis and base station were each assembled separately.

Gluing and securing

  1. Once fitted correctly, I glued components in place using hot glue or super glue (depending on the part).
  2. For parts like the OLED display, ultrasonic sensor, and motors, glue ensured a firm and vibration-resistant fit.
  3. The Raspberry Pi, LCD screen, and MCP3008 perfboard were fixed using screws and printed brackets.

Wiring and connections

  1. All previously soldered wires were connected one by one, carefully following the schematic.
  2. Special care was taken to correctly route:
  3. Power lines (5V, 3.3V, GND)
  4. Data lines (I²C, SPI, GPIO)
  5. Motor and LED wiring

Final system check

After full assembly:

  1. The device was powered on and booted
  2. I verified that:
  3. All sensors worked
  4. The LED ring displayed correctly
  5. The button stopped the alarm
  6. The ESP32 received commands
  7. Everything was confirmed to behave as expected using the live dashboard
The device was now fully assembled, tested, and ready for daily use.


Final Hardware Assembly, Mounting the Base Foot and Robot Wheels

afbeelding_2025-06-20_133743057.png
afbeelding_2025-06-20_133806207.png
IMG_1309.JPEG
IMG_1311.JPEG
IMG_1314.JPEG
IMG_1328.JPEG
IMG_1334.JPEG

With all electronics installed and tested, I completed the final physical touches to make the WakeUp Buddy system fully operational.

Mounting the base foot

  1. I attached a supporting foot to the bottom of the base station using M3 bolts and nuts.
  2. This added extra stability, ensuring the housing remains upright even when the touchscreen is touched or when the emergency button is pressed.
  3. The foot was pre-designed with mounting holes matching the base structure.

Installing the wheels

  1. I then mounted the two GA12-N20 motors firmly into the robot chassis using friction-fit slots and hot glue.
  2. 3D-printed wheels were pressed onto the motor shafts.
  3. The wheel rotation was tested manually to ensure smooth movement and balance.

At this point, the entire hardware system was complete and fully assembled.

Transition to Software Refinement (UI/UX and Backend)

With all physical components finished, I moved on to refining the user interface, improving the backend, and optimizing system communication:

  1. The frontend dashboard was updated for clarity, responsiveness, and real-time feedback
  2. The backend API was optimized with cleaner endpoints and structured error handling
  3. All sensor data, events, and alarms were now visualized and stored live, completing the loop between physical interaction and software control
From this point forward, development focused on polishing the user experience and ensuring the system was stable, responsive, and user-friendly.