Rolly Robot Alarm Clock

Site: GoLabs
Course: Rolly Robot Alarm Clock
Book: Rolly Robot Alarm Clock
Printed by: Guest user
Date: Friday, 26 April 2024, 9:03 AM

Description

Build a robot alarm clock that makes you get out of bed to turn it off.

1. Introduction

Ever find yourself turning off your alarm clock without realizing it only to wake up an hour later and have to race out the door? We can help with that by building a robot alarm clock that makes you get out of bed to turn it off! Not only that, but the robot will be able to sync to your Google Calender allowing for the alarm time to be adjusted using almost any device.

Today almost everyone uses their phone as an alarm clock which has a range of benefits. Phones are easy to set, easy to adjust, play custom songs, and can even sense when is the best time to wake you up. The problem is, unless your phone is across the room, we use our phones so much we can literally use them in our sleep.

Why not build a robot that is able to do all these things, but will not stop till you get up and start moving! Our robot will be able to easily move randomly around the room over any surface with ease while playing a custom alarm tone. In order to set the alarm, simply link the program on the BrickPi to your Google account and it will search events with the title “wake1” and automatically start the alarm at the events time. This means the alarm time can very easily be adjusted using any device that can access your Google Calender.

 

 


2. Parts Required

Parts Required


3. The Build

In order to begin we will need to collect the components from the bill of materials below. These will be needed in order to build our robot. It is possible to use either LEGO® Mindstorm® NXT or EV3 motors and sensors for this project.

After collecting all of the necessary parts, it will simply be a matter of assembling the robot. This can be done by following the step-by-step instructions found here in PDF format.

Once the robot has been assembled it is important to remember which sensors and motors are plugged into each port.

  • Right Motor - PORT_A
  • Left Motor - PORT_D
  • Touch Sensor One - PORT_1
  • Touch Sensor Two - PORT_2
  • Ultrasonic Sensor - Port_4
  • Speaker - Audio Jack and USB port

Your Rolly Robot is know assembled and ready to be programmed!



4. The Software

For our software to work, we need to install a few additional components to our Raspberry Pi. You will need to download the .ZIP file below. While there are two versions, the Ultrasonic Sensor is what determines which version you are able to use.

This should be unzipped into a folder on the desktop, thealarm.pyfile opened, and lines 26 and 27 edited. You will need to replace emailwith your Google Calender email and ‘password’ with your password and save the file.

  • calendar_service.email = ’email’ #your email
  • calendar_service.password = ‘password’ #your password
With thealarm.py file customized, it is time to setup the software. This can be done very easily by setting up the alarm_setup.sh as an executable file and running it. First you will need to open a terminal window and using thecdcommand change to the directory where you unzipped the needed files.

Once the terminal is looking at the correct folder, it will be necessary to run “sudo chmod +x alarm_setup.sh” without the quotes.

Once this script has finished it will be possible to run the command “sudo ./alarm_setup.sh” which will run the installer.

Upon completion, your Rolling Robot is ready to run. If you are still in the directory where the files were unzipped, all that is necessary to run the program is type “python alarm.py”. This will start your robot scanning Google Calender for the phrase “wake1.”







5. Putting it all Together

With our robot built, the Raspberry Pi configured, and the BrickPi programmed, we only have one step left to complete. In order for our robot to play its alarm and move, we will need to give it a start time. This can be done by simply logging into Google Calender and adding a new event. This event must be titled “wake1” and be given the time when you would like the robot alarm to go off. Simply save this event and your robot will wake you up and make you get out of bed to turn it off the next morning. It is also possible to add a small speaker which will play the ‘alarm_sound.mp3’ file while the robot moves around the room. This .mp3 file can be any track as long as the name remains the same.

 

 

6. Questions

Have a question or a problem? Post it on the forums and we’ll help you out.