Back to Parent

Outcome


Intention

The goal of this project is to provide my roommate with assistance in waking up every morning.  Currently, he has a tendency to repeatedly hit "snooze" on his alarm.  This results in him not getting out of bed until he is nearly late for work and woken me up with his repeated alarms.  To solve this problem, I created an alarm that will force him to get out of bed and turn the lights on before the alarm turns off.

Context

Knowing that my roommate would be more awake if he was forced to get out of bed and turn the lights on, I figured it would be helpful to design an alarm system that does just that.  The alarm is made up of a photon board, an alarm set button, a piezoelectric speaker, a photoresistor and an LED to enhance the alarm experience.

While this system will be used primarily in the morning, I find that it relates a strongly to devices that could be used at night.  For example, by using a series of photoresistors and motion sensors, a smart hallway could be created that illuminates only the area immediately around you so that it does not hurt you night vision.

This devices was inspired by a coffee maker alarm, a toy car alarm clock and a bit of programmer humor hidden in code:

https://particle.hackster.io/30039/the-ultimate-alarm-clock-86b95d?ref=search&ref_id=alarm&offset=3

https://particle.hackster.io/ddk220/photon-alarm-with-mozilla-os-2ff407?ref=search&ref_id=alarm&offset=0

https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-for-photon-experiment-guide/experiment-5-music-time

Process

To create this product, I approached the problem in small segments.  I first established how the alarm was to be tripped.  I wanted the alarm to be very simple to use and not require reprogramming between uses.  With that in mind, I established a simple delay timer.  After the alarm button is pushed, the device waits a programmed amount of time before it starts the alarm.  It is currently eight seconds, but it could easily be coded to a desired amount of sleep time.  It took some trial and error to get this right, so during this process I also added a "stop" button.  This button would not be used in the final product, but it was instrumental in testing the code.  

Next, I established my alarm tone.  Using code from SparkFun, I was able to establish a tune that would be played when the alarm went off in the morning.  For simplicity's sake, I also incorporated the flashing of the light directly into the tone loop.  This provided the added benefit of the LED blinking with the music.  

After the alert sounds and lights were completed, I began work on how the device would be turned off.  Using the code from class as an example, I programmed a function that would turn off the alarm once a photo resistor experienced prolonged, blight light.

Product

As stated before, the device is made up of a piezoelectric speaker, an LED array (made up of one LED in this iteration), a photoresistor, two buttons and a photon board.  Here is an image of the device configuration:

Displaying FullSizeRender.jpg 

The device features two buttons in this image.  As the second button serves as a manual shutoff, it will likely not be included in the final version.  The only shutoff that will exist on the system will be the photoresistor.

 Below is a sample video of the device working in action:

Show Advanced Options
Show Advanced Options

Reflection

My primary takeaway from this project was an appreciation for programming devices that do not always have an outward display of success.  In other words, code that I have written in previous classes on my PC will immediately tell me if my code is working correctly or not.  If the code is not working, I can run the program line by line to determine the error.  With the Photon, I have no way of easily isolating the problem.  Instead, I had to work in ways to segment my code while is going through its continuous loop.  I achieved this primarily by using buttons and cloud variables.  In future projects I will know to build in similar breaks to make debugging easier.

Drop files here or click to select

You can upload files of up to 20MB using this form.