LED display clock

By Eric M.

Overview

This is a digital LED clock with an alarm that is designed to be powered from a wall power supply. The clock setup itself is a bit cryptic, as there are only three buttons, and no alarm on/off switch. There is also nothing on the display for the sole purpose of showing whether the clock is displaying real time or alarm time. To get around this, one of the dots in the colon is disabled when the clock is showing alarm time. There is also no alarm button to toggle whether the alarm is on or off, so to deactivate it the alarm time must be set to 24:00. The boards are designed to fit into 4"x2"x1" plastic enclosure from Radioshack.

Hardware

The microcontroller used for this clock is an ATTINY 45. There are two 3”x4.5” boards used for this clock. The DS1339C-3.3 real-time clock stores the time in case it is unplugged. The RTC is powered by a 3V backup battery which will keep the time until the clock is plugged back in, and then is powered again by the wall supply. The RTC shares the I2C bus with the SAA1064 display driver. The LED display is actually two identical panels, with one turned upside down to create the colon between the hours and minutes.

Schematic Front board Rear board

Software

The clock is programmed in assembly language. The first part of the code is devoted to button debouncing. All three buttons need to be set up so that the clock knows whether it is in alarm time or real time. If the alarm time is being displayed, the minutes and hours buttons need to be programmed to update the alarm time, and the same goes for real time. The buzzer must also be programmed so that it does not sound when it is set to 24:00. The other part of the code deals with the I2C interface which is what the RTC and diplay driver use for communication. The clock runs at 0.5 MHz, and since the right display panel is upside down, the bits must be reversed in order to show the correct time.

Downloads


Last modified:Mon, Jan 23, 2023.

00954