Alarm Clock


This was an Embedded Design project from our Micro controllers class at Oregon State. This project was a culmination of smaller incremental projects throughout the term. The product requirements were objective, but the implementation and design were more or less up to the individual. There were some limitation with the supplies at hand, given that we didn’t have access to the normal lab for this was during COVID, alas our cohort pressed on.

One requirement of this project was the creation of circuit diagrams along with one on one live product demonstration and review with the instructor. In these demo we would showcase the new things we had designed and implemented in the last 2 weeks, things like SPI for reading encoder values, I2C for driving the LCD display, using the DSP to output a tone to the Audio IC that was driving the speaker.

Along with learning and implementing hardware communication protocols we also implemented various different hardware and devices. One limitation we were faced with was the limited amount of GPIO on the board, therefore most of us tackled this problem by time sharing the GPIO ports. At micro-second interval the GPIO pins would be toggled between Input and output with the help of a Octal Buffer. A port of 8 pins was shared between driving LED’s and reading button inputs. The Octal Buffer was used to create a floating connection between the GRN plain and cathode of the LED’s, when the micro-controller wanted current to pass through the LED’s it would allow it, but when it didn’t it would make the Octal Buffer go into a state of High Impedance, essentially create a floating connection.

Another hardware component we got familiar with was rotary encoders, we had 2. 1 was for dimming the lights and setting the time, the other was for setting the alarm and tuning the FM Radio. To get the data from the encoders we used an 8 bit parallel in shift out register that we would read in the data through SPI. The top nibble of data would correspond to an output of one encoder, while the bottom nibble to the other. This data was eventually processed to indicate the position of the encoder to then determine which direction the encoders were being turned. If they were being turned that indicated the user was setting the time, setting the alarm, changing the volume, or tuning the radio.

The whole project was done using an Atmega128p a 25 year old at the time chip. One of the first to use Flash instead of EEPROM for program storage. The whole thing was written in C and is still one of my favorite projects. We were not tasked with powering the device or creating a PCB design for it, this I learned through other projects like my BLE HID split Keyboard.