Pages

Sunday, September 27, 2015

Making An Alarm Clock From Scratch

About a week and a half ago, a news story about a 14 year old in Texas getting arrested for bringing a homemade clock to school made national headlines. High school student Ahmed Mohamed made a simple electronic clock as a school project, and brought it to school to show off to his friends and teachers. Instead of praise, he was arrested for bringing a "bomb" to school, as the adults at the school didn't recognize it and just assumed it was one (the charges were later dropped).

Fortunately nothing like that has ever happened to me, but it did remind me of a similar project I have done in the past. About a year ago, I found a video on YouTube by a user called "skiwithpete" who was in the process of creating his own speaking alarm clock. He was doing this by connecting a Raspberry Pi to his iHome speaker, which would then read him the weather forecast and the current value of bitcoin, along with other features he planned to add later. A Raspberry Pi is a tiny, credit card sized board that has an entire computer built onto it. It is marketed toward programming hobbyists who use them to create projects like this.



A Raspberry Pi Model A

At the time of watching the video I wasn't using my Raspberry Pi for any projects, so I decided I would try to do something similar. I figured I could have it read the current temperature and weather forecast for the day, and also let me know if it's a holiday that day. Sometimes when I wake up I read online news stories, so I also wanted it to do that for me. With those things in mind, I started writing my code. Some of it was a little bit complicated for me, and I ended up having to borrow a little bit of Skiwithpete's code because of this, but in the end I finally got it to work. I had it programmed to go off at a set time every morning, where it would play a short tune to wake me up, tell me the date and time, the current temperature, the weather later that day, the weather at my family's cottage (if it was a weekend), and it would then read the top 5 headlines from the BBC news website and a one sentence summary of each article.

Up until a few months ago, that was how I woke up every day. During my last month of high school I re-purposed the same Raspberry Pi to create a radio station for a school project, and somewhere in the process I lost the data and the code for the alarm clock. Overall, the convenience of having that information provided to me when I woke up and the pride I was able to take in my own work made it a very fun and rewarding project, and I just might recreate my alarm clock one day in the future.

-Erik B.

Sources:

Raspberry Pi Model A. Digital image. SparkFun. SparkFun Electronics, 5 Oct. 2013. Web. 27 Sept. 2015. <https://cdn.sparkfun.com//assets/parts/8/2/1/1/11837-03.jpg>. 

skiwithpete. “(old) Raspberry Pi: Make a Speaking Alarm clock (now with Google text-to-speech Voice)” Online video clip. YouTube. YouTube, 26 Jul. 2014. Web. 27 Sept. 2015.

Worland, Justin. "School Defends Calling Police on Student Who Built Clock." Time. Time, 16 Sept. 2015. Web. 27 Sept. 2015.  

1 comment:

  1. The news story you shared was alarming and sad that in today's society, student's individual work and ideas are viewed as attacks. I liked the way you connected the student's discovery to your own! I think it's super cool the way you got something as complicated as that to work. You definitely have a passion for things related to engineering. -Stacie Kussro

    ReplyDelete