Build a large 6 digit clock using 1.8″ + 0.8″ LED displays and TPIC6B595 shift registers

The project

I recently bought a few LED displays as a job lot which were parts for fruit machines; the type you see in the local pub and after testing them I found that they had a nice bright red / orange colour to them and decided to use them for a large clock project. As I have not made anything for a while and had some spare time on my hands I thought I’d need to brush up on my PCB design skills and C++ coding skills. Hence this project – a large LED clock which uses 1.8″ high digits for the hours and minutes and the seconds is displayed on 0.8″ 7 segment displays. It is controlled by an ATMEGA168P microcontroller and uses TPIC6B595 shift registers to drive the common anode displays. A DS3231 high precision RTC completes the electronics. It is a large PCB measuring 270x120mm and can easily be seen from 30 feet away making it suitable for large workplaces or people with limited vision. The clock is powered from a 12V regulated power supply which can supply 800mA or more. A fuse and reverse polarity protection diode helps to prevent incorrect power supply connection from damaging the components. Finally three buttons are used for setting the time. There is provision on the PCB for a 4th button which could be used for something else if I wanted to add extra features later or with the code being open source you could make use of it yourself should you make one.

This project was sponsored by PCBway who kindly offered to make the PCB’s for them. As I have already made the prototypes using boards from JLCPCB I decided to take up their offer and made a slight design change to the PCB layout. I plan to sell these PCB’s along with the remaining version 1 PCB’s on eBay / Tindie so you can make your own if you wish. Please see the links to the right for my eBay store where you can purchase one along with a completed, assembled PCB which I will list in the coming weeks once the button boards and new TPIC6B595 chips come into stock. The version 1 PCB’s are made in green solder mask whereas version 2 has black solder mask. The source code and schematic I will show below and also there is a YouTube video explaining how the circuit and code works.

Schematic, code, BOM and YouTube video

Schematic for the ATMega clock








Source code (C++) Arduino IDE

Button library

Bill of materials

Addendum to schematic & BOM – the 330 ohm resistors should, ideally be 390 ohm instead as with some LED displays the seconds display may be dimmer. There’s about 3mA difference in segment current between the main digits and the seconds which is not noticeable on the displays I used as shown on the schematic. But to keep segment current within 1mA use 390 ohm resistors instead. Do not reduce the value of the current limiting resistors on the seconds displays to make them brighter as this would result in too much power dissipation through the resistors. Segment current will be approximately 16.5mA. 


Basic use instructions

To set the time on this clock you press the “set mode button” and the clock will show “SEt” for 2 seconds and blank the seconds display. The decimal point will light on the last digit to indicate the clock is in time set mode. Then use the hour button and minute button till the correct time is shown then finally press set mode again to return to normal operation. Note that as soon as you press set time to exit setting mode it will zero the seconds. This way the clock can be synchronised to another time source. For example if the current time is 13:56 set the clock to 13:57, wait till the other time source changes to 13:57 then press set mode button.

Closing comments

And don’t forget if you would like to make one of these clocks yourself check my eBay page on the right were I will be listing some of the bare PCB’s and a completed, working PCB when the button board comes in a few weeks. Keep checking my eBay listings for updates. The project is also shared as an open source project on the PCBWay community site where you can order a set of PCB’s directly from Finally should you wish to use equivalents of the Kingbright LED displays be aware that the cheap Chinese LED 7 segment displays from AliExpress / eBay / Amazon often do not have datasheets and / or they have non standard pinouts; especially the 0.8″ displays where the pins are on the top & bottom rather than the sides. Also going by what I have found the 1.8″ high Chinese no-name brands have two LED chips per segment rather than three. Whilst this will work just fine you will have to adjust the current limiting resistor values accordingly. Better hope they have that datasheet!

Completed clock in example case.

6 Replies to “Build a large 6 digit clock using 1.8″ + 0.8″ LED displays and TPIC6B595 shift registers”

  1. Hi,
    I am experiencing problems in compiling the file for the 6 digit clock to use with a PCB that I ordered from your e-bay add.
    “Compilation error: ‘BUTTON_PULLUP_INTERNAL’ was not declared in this scope” appears during the compilation even though I have used the Button library by Alexander Brevig. I have deleted other Arduino libraries that use the Button file to ensure that the smaller Brevig library is called.
    Can you help with this query?

    • I can upload the compiled binary of you need it which can be flashed to the chip with xloader. I’ve replied to your email too. I was having issues with my email spam filter so sorry for the late reply.

  2. Hi, Adrian, Many thanks for your reply. I am using Arduino IDE version 2.2.1. I will try the Xloader route to programming the chip and hopefully this will resolve my problem. Cheers and again many thanks for an interesting project. Regards, David.

  3. Hi Adrian, Your replacement Button library has resolved my problem even though I had used the previous library by the author detailed in your code. Code now compiles error free and has been used to programme a chip with the result that I have a working clock. THANKS again, David E.

    • Thanks for letting me know. I will put the library I used in with the download on this site as it must be a version issue.

      I’ll update the website tomorrow with the firmware code and the library.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.