Back to Projects

BrickPi Project

Rolly Robot – Rolling Alarm Clock

An alarm clock that drives away from you when it goes off — forcing you to get up and chase it to make it stop. Syncs to Google Calendar so you can set the alarm from any device.

Python LEGO EV3 / NXT Motors Touch Sensors Google Calendar Wi-Fi
Rolly Robot – the rolling alarm clock top view

See It in Action

Introduction

Almost everyone uses their phone as an alarm clock — easy to set, plays custom music, and smart enough to guess when to wake you. The problem is we've become so accustomed to our phones that we can dismiss an alarm in our sleep.

The Rolly Robot solves this. When the alarm fires it plays your chosen MP3 and starts driving randomly around the room over any surface. The only way to stop it is to get up, catch the robot, and press the touch sensors. It also syncs with Google Calendar, so you set your alarm time by creating an event with the title wake1 on any device — phone, tablet, or computer.

Component overview diagram for Rolly Robot

Parts Required

  • BrickPi (any version)
  • Raspberry Pi
  • 2 × LEGO Mindstorms Motors (EV3 or NXT)
  • 2 × LEGO Mindstorms Touch Sensors (stop-button triggers)
  • 1 × LEGO Mindstorms Ultrasonic Sensor (obstacle avoidance)
  • 2 × LEGO Wheels
  • LEGO beams and pins for the robot chassis
  • Small speaker (3.5 mm jack, e.g. X-Mini 2 Capsule Speaker)
  • Wi-Fi dongle or built-in Wi-Fi (Raspberry Pi 3+)
  • microSD card with Raspberry Pi OS Trixie for BrickPi3
  • 12 V battery pack for BrickPi

Build the Robot

Mechanical Assembly

Collect the parts and assemble the robot following the step-by-step PDF instruction manual:

Both EV3 and NXT motors / sensors can be used interchangeably — choose whichever you have available.

Port Connections

  • Right motor → Motor Port A
  • Left motor → Motor Port D
  • Touch sensor 1 → Sensor Port 1
  • Touch sensor 2 → Sensor Port 2
  • Ultrasonic sensor → Sensor Port 4
  • Speaker → 3.5 mm audio jack + USB power

Software Setup

Download the Code

Two versions are available — choose the one matching your ultrasonic sensor:

Unzip the downloaded archive onto your desktop.

Configure Google Calendar Access

Open alarm.py and edit lines 26–27 with your Google account credentials:

calendar_service.email    = 'your@gmail.com'
calendar_service.password = 'your_password'

Install Dependencies

In a terminal, navigate to the folder where you extracted the files and run:

sudo chmod +x alarm_setup.sh
sudo ./alarm_setup.sh

The installer will pull in all required Python packages for Google Calendar integration and audio playback.

Run the Alarm Clock

python alarm.py

The robot will start polling Google Calendar for an event called wake1. When the event time arrives it plays alarm_sound.mp3 (replace this file with any MP3 you like — keep the filename the same) and begins driving around the room. Press both touch sensors simultaneously to silence the alarm.

Setting the Alarm

Log into Google Calendar on any device and create a new event titled wake1 with your desired wake-up time. Save the event — the robot will detect it automatically the next time the alarm runs.

Updating the alarm time is as simple as editing the event in Google Calendar — no SSH session or terminal required.

Never Hit Snooze Again

Fork the source on GitHub and make your own alarm-dodging robot.