Simon Says... "Wake Up!"

This alarm clock was made for a project in ECE362 at Purdue University, taught by Professor Meyer. The assignment was called a mini-project and our team of three had a little over a week to complete it. The guidelines of the project were very lenient and were to basically to create anything we wanted using the Freescale HS9S12C32 microcontroller, while utilizing at least 4 the following modules: analog to digital (ATD), pulse width modulation (PWM), timing (TIM), serial peripheral interface (SPI), and SCI (UART).

  1. Project Description
  2. Clock Portion Overview
  3. Puzzle Portion Overview
  4. Video
  5. What We Learned
  6. What We Would Do Differently
  7. Conclusion
  8. Pictures

Project Description

Our group decided that we would be creating an alarm clock, however this wouldn't be any old alarm clock. It would require the user to solve a "Simon Says" type puzzle to turn off the speaker, where a sequence of lights blink and the user must then push the corresponding pushbuttons in the correct order to turn it off. Failure or taking too long will result in the speaker activating back up. From personal experience, we knew that after using a regular alarm clock for a long time it becomes easier to turn off without even realizing it. With our alarm clock this will be less likely to happen because the user is required to solve a random puzzle, so they can never get used to it. More importantly, this also ensures that the user will have a certain level of cognition once the alarm is turned off. Hopefully enough to not go back to sleep!

Team members holding clock: Adam Siembida, Matt Veldman, and Dmitry Khalabuda

From left to right: Adam Siembida, Matt Veldman, and Dmitry Khalabuda

Return to Top

Clock Portion Overview

All of the coding was done in assembly using Codewarrior. Creating the clock was relatively straightforward. A counter was incremented in the TIM isr, and the BCD time was updated after accumulating a minutes worth of interrupts. The time was displayed on 7-segment LED displays through the SPI, which output through four serially connected shift registers implemented with GAL16V8 PLD. When the user pushed either the "set alarm" or "set time" buttons, a "setting" flag was set, and another "alarm" flag was either set or cleared. This flag would differentiate between setting the time and alarm and came into play when the user was done with whatever they were setting by deciding if the value on the display would be saved into the alarm time or actual time.

Return to Top

Puzzle Portion Overview

As stated earlier, the puzzle we decided to implement was a "Simon Says" type puzzle. An alternative puzzle we considered was asking the user to complete a simple one-digit math problem. That idea was discarded because we figured that if someone is quick with their arithmetic, they might be able to solve the puzzle without being fully aware, and might go back to sleep. The sequence of lights was made random by incrementing an 8-bit variable quickly in the timing interrupt service routine, and when the user started the puzzle the value would be saved and converted into a sequence of lights. Every two bits corresponded to an LED, and the lowest bits correspond to the first in the sequence. I.e. if the first two bits are 2t, then the first LED to turn on would the LED2. If the second two bits were 0, then the second LED to turn on would be LED0, and so on.

Return to Top

Video

Return to Top

What We Learned

The first challenge we faced was that we never took an idea from start to finish before. We've created a lot of prototypes on breadboards or created components that could be used in a larger project, but we never created something with soldering, packaging, and labeling; basically something that you could take it home and actually use for yourself as a finished product. We learned that even although we are electrical engineers, we still have to consider the other practical implications, like creating a design that will fit nicely into a small box for example.

Another thing we learned is datasheets. Without a teacher to ask for help, we had to learn how to read through datasheets and solve problems on our own. I noticed that a surprising amount of components either came without a datasheet, a datasheet that was not made for the actual component you were sold (i.e. it was made for a similar but different one), or just didn't have a datasheet at all. We were always able to figure out how the component was supposed to work by playing around with and testing it, but without a good data sheet we didn't get the peace of mind of being sure that there wasn't going to be some kind of unexpected behavior, or some kind of reliability issues later down the road.

Return to Top

What We Would Do Differently

Working on this project we had many areas we would have loved to improve on, however we had time constraints and some things were just not possible to implement or improve. Most of the components were chosen because they simply worked; if we had more time we would have searched through the many different components available on the market and chosen the ones with the best performance to cost ratio. We would have chosen larger 7-segment displays, larger pushbuttons with a better feel to them, nicer labels for the buttons, and a nicer feeling volume knob. We would have also planned out the internal wiring in a way that would make the box much smaller.

Return to Top

Conclusion

In conclusion this was a fun project that was satisfying to complete. It took much more time and effort than we expected, but that was mostly due to it being the first time taking something from start to finish. It we were to do it again we would have chosen components more selectively and spent a longer time planning everything out before starting work on coding or construction. Now I can't wait until I can take the Senior Design class and spend a whole semester building a project instead of just one week. I think the coolest thing about completing this project is that now when I walk through a store and look at the electronics, I can think to myself, "I have the power and knowledge to design and build something like that from scratch!" Pretty exciting if you ask me!

Return to Top

Pictures

Puzzle prototype

^ Clock prototype

Clock prototype

^ Puzzle prototype

Inside the clock, picture 1

Inside the clock, picture 2

Outside the clock, picture 1

Outside the clock, picture 1

Return to Top