Jose Pino's projects & tidbits
"Great stuff from someone with an inquisitive mind"

Led Clock

12Hr Led clock using 16F84 or 16F628. Also, schematic to build a Jumbo clock is included. (6/05/2004)
16F84 version have a problem, pending to be fixed. Updated! (9/6/2006)


Source: http://www.josepino.com/?led_clock   Tags: microcontroller circuits diy

CODE: JP6282/JP841 - PIC: 16F628 or 16F84A

Using only 2 capacitors, 3 resistors, 4 seven-segment Display, 1 xtal, 2 switches n.o. and 1 Microcontroller PIC, you can build this Digital Led Clock. you can use common anode or common cathode display, just select the display type. Here is the pinout information:
Taken from http://www.josepino.com

Led Clock Schematic

Pin 3 defines the display type. If you will use common cathode display, connect to negative. For common anode, connect to positive. Here is a example circuit:

Led Clock Schematic

Please note: the pin 4 requieres a 10k resistor ONLY for 16F84. On 16F628 is not connected. The minutes displays are upside down.

For the capacitors, I used 30pf. You have to read the xtal manufacturer specifications to know the capacitor value recommended. Short connections on xtal is a must to keep accuracy.

Download the Digital Led Clock HEX code 16F628 version HERE
Download the Digital Led Clock HEX code 16F84 version HERE

I built some clocks using this circuit. 2 Wall clocks and a Desktop clock. Every digit is 3 inches high, every segments are 3 led in series. The voltaje used is 5.5 volts (1.8volts x 3 = 5.4 Volts) Leds aren't really bright but works great. Here is the pictures of my wall clocks:

Wall clock using 16F628
Wall clock using 16F628

Here is a desktop clock:

Desktop clock using 16F628

Feb 16, 2005. - UPDATE: If you want to build a clock with a big display, you have to add a non-inverting CMOS buffer. Here is the schematic to build a "jumbo" clock:

Jumbo clock schematic

Dec 4, 2005. - ERRATA: DO NOT USE 74HC541 FOR 12 VOLTS! is better to use 4050 CMOS. Some big 7-segment display works with 12 Volts. - Thanks Mark Efkowitz!

9/6/06 - Updated: Here is the schematic using CMOS 4050 instead of 74HC541. Sent by Flash Gordon.

This schematic is only a sample. You can connect the 4050 to 12V and drive jumbo displays. Do not connect regular (small) LED displays to 12 volts because the circuit may overheat. Please read the manufacturer specification of your displays. - Thanks Flash!

< Led Chaser II   Home   Lego Chichen Itza>

Share your comments and experience:
Keep it short, Comments with bad words, spam and non-related will be deleted.

07/28/09 - 01:30:17 Prashan from Australia wrote: Can somebody please send me PIC 16F628 source code for the LED clock.
08/22/09 - 04:02:59 misa from mexico wrote: do you have with the 16f84 ?
08/22/09 - 04:06:40 José Pino wrote: Yes, the hex file is available for the 16F84(a).  The schematic is the same.
08/22/09 - 04:22:52 misa from mexico wrote: excusme , im instructor of  a course of pic and i use your design, i made a pcb, but i have the problem that the code is wrong, the pic doesn´t work with these code can you send me the fix code
pd excuse my english   thanks
blindside89@hotmail.com
08/25/09 - 07:04:23 José Pino wrote: The device configuration should be: OSC Xtal, WDT Off, CP Off, PWRTMR On.
Try this settings.

09/20/09 - 01:01:45 ticky from thailand wrote: Can I use the same schematic for common cathode?/Thanks
09/20/09 - 01:04:38 José Pino wrote: Yes.  The Pin 3 defines what type of 7-segment display you are using.
09/30/09 - 20:07:13 Pedro from Spain wrote: Hola Jose Pino. En primer lugar enhorabuena por la  web y todos los proyectos en ella.
Me gustaria saber si el HEX que has puesto para el 16F628 sirve para el 16F628A, o si hay que modificar el codigo fuente.
Tambien saber si seria muy complicado hacer un reloj con alarma, partiendo de la base del tuyo o similar.
Gracias
09/30/09 - 20:54:12 José Pino wrote: El HEX funciona para el 16F628A pero la configuracion de los "fusibles"  tiene que ser asignada manualmente.  ( OSC Xtal, WDT Off, CP Off, PWRTMR On. )
Referente a reloj con alarma, habrá que hacer un software nuevo.

10/01/09 - 07:55:16 Pedro from Spain wrote: Entonces puedo meter el HEX que tienes en esta pagina para el 628 en el 628A, sin modificar el codigo fuente, claro, solo modificando los fusibles a la hora de quemar el pic.
Lo que has puesto de "OSC Xtal" y eso, ¿Son los fusibles que hay que modificar? no son lo mismo que has puesto mas arriba?
10/06/09 - 06:51:54 José Pino wrote: Correcto es la respuesta a todas tus preguntas.
10/06/09 - 22:28:24 Pedro from Spain wrote: Pedro, una ultima pregunta. No me queda claro como estan unidos los displays.
es:
A1 con A2 con D3 con D4
ó es
A1 con A2 con A3 con A4
Gracias. Es que los dos ultimos digitos estan invertidos, y tengo un display de 4 digitos que estan unidos A1 A2 A3 A4 y no se si sirvirá
10/07/09 - 06:26:34 José Pino wrote: Los display estan conectados así:
Pin 6 - A1 - A2 - A3 - A4
Pin 7 - B1 - B2 - B3 - B4
Pin 8 - C1 - C2... etc.
Display de 4 digitos no te servirá ya que aparecerán invertidos los minutos.
PS. No me llamo Pedro.

10/07/09 - 07:28:51 Pedro from Spain wrote: Perdon, es verdad, te llamas Jose Pino. Un fallo provocado por el sueño que tenia.
Vale, si el de 4 digitos no funcionará eso quiere decir que le das la vuelta a los digitos por software no?.
10/13/09 - 21:00:08 Jairo Piran from Brazil wrote: Thanks!!! This is the best home page for estudent of microchip. Thank you very much.
10/19/09 - 12:49:55 Ash from England wrote: excuse me but i posted something about that i was a school kid in electronics and JOSE PINO if u are reading this...... i cannot find the link in which i posted it and im not exactly sure what iposted so please could u find it

11/09/09 - 21:36:01 luisencizo from colombia wrote: muy buenos circuitos el problema es que la simularlos en proteus siempre se da el error EEPROM  data has invalid address 2000 for this device. le agradeceria cualquier informacion para corregir este error
11/18/09 - 10:07:20 kris from uk wrote: i was wondering did u have to write a programs for the chips??
11/18/09 - 18:14:35 José Pino wrote: Yes. Software are needed to make the micro controller to work. Software is provided as HEX file.

Name:   Location:
Captcha:   <-- This is the Captcha
Your Comments:

Bookmark or Bookmark and Share Suscribe to RSS Feeds

10 most viewed pages:

- How To Make a Speaker
- Hi-fidelity Homemade Loudspeaker.
- Tachometer/RPM II.
- Homemade WiFi Lid Antenna.
- Super Simple Sun Tracker.
- Led Clock
- USB LED Light.
- How To Repair Sony PSP
- Knowing Everything.
- Matrix Led Display.

Articles related:

- Getting Started with PICs.
- 'Almost No Parts' 12/24hrs LED Clock
- Anthony Sotillet's POV Display
- Computer to TV adapter.
- Fluorescent Light.
- Homemade COLDHEAT.
- LCD Clock/Calendar
- LED chaser using PIC 16F84A
- Led Chaser II
- Led Clock
- Lie Detector
- Matrix Led Display.
- One Second Timebase.
- PIC 16F505
- Led Chaser.
- My PIC Programmer
- PIC Programmer sent by Fco. Arroyo.
- Traffic Light.
- Security Keypad.
- Security Keypad II
- Soundmeter
- Strobe from Flash.
- Tachometer/RPM.
- Tachometer/RPM II.
- Tachometer for Bikes (circuit).
- Timebase generator.
- Transistor LED Flasher
- Water Level Control/Monitor.

All categories:

- about
- advertisement
- audio
- automobile
- bad_ones
- best
- circuits
- computer
- discover
- diy
- electronics
- fail
- food
- from_readers
- funny
- furniture
- hacks
- homemade
- how_it_works
- howto
- humor
- interesting
- lego
- light
- microcontroller
- mysql
- opinion
- php
- projects
- readings
- realmeal
- religion
- robots
- science
- scripts
- trips
- videos
- websites
- woodworking


Mr. Counter says: 7885 views.

Search Article

Additional Links:

- Mary's Creations.
- Publicidad Gráfica.
- Todito Yucatán
- Lucina Castillo's Art
- Conoce Amigos en Dalnet
- Narciso González' Alebrijes

Need to contact me?
e-mail address
Please get a good reason before sending me an e-mail.

IE, Firefox, SeaMonkey & Opera tested OK, Some features may not work with Google Chrome. © 2006 - 2009 José Pino - JPC-PHP V5.0
If any information, data, picture or design infringes a copyright material, please send me an e-mail asking to remove it along with the supporting data.