For most people, waking up promptly at the first instance of the alarm in the morning is one of the hardest things to do each day. We are always tempted to snooze because we feel groggy and don't feel ready to tackle the day yet and the not-yet-conscious-brain constantly coaxes us into believing that just 5 more minutes of sleep will make all the difference. However, the act of dipping in and out of sleep by snoozing messes up the internal clock within our body and can make our day more draining and exhausting, according to many physicians.
Since this problem is so common in today's civilized society, we wanted to create a mobile alarm clock that can run away to force the sleeper to get out of bed, stand on his or her two feet, and actively chase it to turn off the annoying alarm. With this short accidental exercise, thanks to a new mobile alarm clock, the person is ready to start the day feeling more alert than bygone days.
We've all been there. That moment when the alarm clock rings in the morning and it feels like you're getting hit on the head with a jack-hammer and you feel the irresistible urge to hit that snooze button to get the sweetest 10 minutes of extra sleep, which often turns into 1 or 2 hours... Because this problem is so common and relevant to today's college students, especially at Cornell (where the weather isn't usually great), we wanted to create a gadget that can solve this problem. We present to you our Anti-Snooze Alarm Clock: our solution to one of many problems of modern day college students.
Our Anti-Snooze Alarm Clock is essentially a mobile autonomous robot with basic functionalities of an alarm clock. The system consists of the Raspberry Pi 3 (the central microcontroller), piTFT screen (for user interface), the motor control (for robot's movement), the Speaker (to annoy the sleeper), RTC (Real-Time Clock) module (to keep track of time offline), PIR Motion sensor (for robot to recognize that the sleeper is trying to grab it so that it can decide to run away), and IR sensor (for robot to detect object in its path to avoid collision). The diagram representing our system composition and the picture of our finished product is shown below.
Figure 1: Finished Product
Figure 2: Diagram Representing our System Composition
For the final demo we showcased an alarm clock robot with a GUI interface implemented on the piTFT capable of detecting human motion and deterministically moving to avoid capture. Additionally the robot was able to avoid collisions with obstacles in its path using the IR sensor and deterministically reroute its path to continue to avoid capture.
When we first proposed the project, we suggested a robot that with a functional alarm clock that moves away from you stopping when an object is hit as a baseline goal. We met that goal successfully. Additionally we had proposed a concept of an expanded demo which was a “smart robot that sounds the alarm and moves erratically while avoid objects in the room aimed at annoying the user and forcing him to get out of bed.” We were not ultimately able to complete all the functionalities described in our expanded demo. Despite that we were able to complete some of the work we aimed to accomplish for the expanded demo. For example, we able to implement basic navigation capabilities for our robot past simply stopping when it encounters an object. Using IR sensors, the robot was able to detect objects in its path and perform a simple reroute to a different direction.
In the process of creating and testing our robot we discovered that there were some performance optimizations that could have been made. The optimizations will be covered in Future Work sections of the report.
Overall we were to achieve a functional prototype of our alarm clock concept. The project integrated several of Linux’s features that we learned throughout the semester such as the use of environmental variables, configuration of GPIO for flexible purposes, and the use of pygame for animation. Additionally we were able to explore some new features of Linux such as using the os library to call Linux functions within scripts, using real-time clocks to augment the capabilities of the Linux system, and using the ALSA sound system.
The only features that definitely were not fully compatible in our design were the pygame library and the ALSA sound utility. Although we remedied this by not initializing all features in the pygame library, a more effective method would be to utilize the music and sound libraries within pygame. Additionally we discovered that running a looping mpg123 process and only modifying volume was only effective to a point. With the sleep time parameter we implemented, there are occasionally cases in which motor actions were delayed slightly which we compensated by running the DC motors are slower speeds. However to improve performance past this point, conditional music thread spawning would likely be necessary.
On the physical side of our project, there were cases in which our PIR sensor detected incorrect values which we believe is attributed to high frequency noise generated by the use of our DC motors. Although we implemented a software fix, in practice creating a noise isolation circuit would resolve the issues more completely.
Given more time there are several areas we would have liked to explored to improve our Anti-Snooze Alarm Clock’s quality and capabilities. To make the alarm clock more difficult to catch, it would have been interesting to explore the use of pseudo-random functions to generate variable motor speeds in order to have random movement. Additionally, as mentioned in the previous section, creating a noise isolating circuit for the PIR sensor would have improved the reliability of our navigation algorithm. The pacing of the schedule also made us reluctant to attempt to learn how to integrate sound using the modules the pygame library provided us. Utilizes the pygame library’s modules may present possibility to improve overall performance by implementing sound within the script rather than as an OS function call that would spawn an additional process. On the topic of music, implementing an interface for users to upload alarm tones they wish to be used to wake up to would have been an interesting feature as well. Finally an improvement to how we stored alarm parameters would be to create an alternative file rather than using ~/.profile. That way the file can be rewritten to and overwritten to conserve memory without deleting user configurations.
Improving the structural design of the alarm clock would be necessary in a hypothetical commercial setting as some of the methods we used to integrate all the hardware is not reliable over long periods of time (such as electrical tape).
Material | Price |
---|---|
2 DC Motor | $4.00 X 2 = $8.00 |
IR Sensor | $5.95 |
PIR Motion Sensor | $9.95 |
Diodes/Capacitors (aggregate) | $1.00 |
L293D H-Bridge | $3.55 |
SN74AHCT125 Voltage Converter | $0.39 |
Adafruit PCF8523 Real Time Clock Assembled Breakout Board | $4.95 |
Mini External USB Stereo Speakers | $12.50 |
CR1220 12mm Diameter - 3V Lithium Coin Cell Battery | $1.00 |
Total | $47.29 |
David Li: Assisted in creating and implementing navigation algorithm, implemented sound, time, and GUI subsystems. Created method for software filtering of PIR sensor readings.
Ju Seong Kim: Implemented and integrated the motor control subsystem and the PIR/IR sensors. In charge of the final assembly and structural aspect of the robot.
The H-bridge Datasheet
Voltage Converter Datasheet
PIR Motion Sensor Datasheet
IR Sensor Datasheet
Configuring Pi (Jessie) to recognize USB speakers as primary output audio device.
Initial idea on how to work around interference between ALSA and PYGAME.
PYGAME documentation used to reference modules and research issue.
David Li (dhl72@cornell.edu) & Ju Seong Kim (jk2528@cornell.edu)
We would like to take the time to thank Dr. Joseph Skovira and the course TAs: Brendon Jackson, Steven Yue, and Jacob George for all their help and guidance throughout the course and during the development of this final project.