Page 1 of 1

Novelty Mini-clock set.

PostPosted: Wed Jun 13, 2012 9:28 pm
by Brian Griffin
Project Name: Novelty mini-clock set, loosely based on Adafruit's Monochron clock.

Project Description: Mini GLCD (ST7920) clock set using large fonts as display. 5x7 fonts are included as it is much more space-saving than the built-in 8x8 fonts. With the DS1307, you do not need to worry about losing time when you pull out the power supply! Time and date is shown on the screen.

The buttons are handled by the external interrupts on the PIC32.

The clock is simple, press button0 to enter menu, and same button0 to exit menu without saving.

Button1 is to select menu item. Which one to set, eg. "Hour" and "Minute" to "Date".

Button2 is to set the value in the menu item. Increments by 1.

When menu left alone, all the settings are saved and it is exited to the main "clock face".

Since it is not that computationally intensive, I used the 8MHz for the PIC32 instead.

This project can be ported into a smaller microcontroller, and can fit in a case or something else. Create! :)

Compiler: MPLAB X IDE v1.10, MPLAB XC32 v1.0

Hardware: SKPIC32 (running at 8MHz), ds1307, CR2032 battery holder, three buttons, 2x 10K resistors, 3x 1K resistors, breadboard, jumper wires, one or two potentiometer.

Schematic:
schematic.gif
Schematic.


(Power lines and contrast are not shown here - for the GLCD and the ds1307 is the +5V, while the rest of others are +3.3V)

Pictures:
skpic32mod1.jpg
Prototype of the clock:

skpic32mod2.jpg
Clock display:

skpic32mod3.jpg
Clock menu display:

(Pardon the last "ghosting" image - the camera caught that picture when it is transitioning to the main clock face from menu!)

Much of the code inside can be freely improvized. Why not try adding an alarm clock function inside? Or a reminder? World clock? Sky's the limit! :)

References:
1.) http://www.hobbytronics.co.uk/hi-tech-c-i2c-master (the webpage has closed down - use the Google Cache to view it) - Example I2C driver.

2.) http://picnote.blogspot.com/2009/01/sim ... f877a.html - Example for microcontrollers interfacing with DS1307.

Re: Novelty Mini-clock set.

PostPosted: Thu Jun 14, 2012 7:33 am
by robosang
Nicely presented! Yup, sky is the limit 8-)

Re: Novelty Mini-clock set.

PostPosted: Thu Jun 14, 2012 2:25 pm
by Brian Griffin
robosang WROTE:Nicely presented! Yup, sky is the limit 8-)


Thanks! I forgot to draw the battery holder in the schematic - just refer to the datasheet of the DS1307. Uses CR2032 or 2025 coin battery. :)