Large 7-Segment Clock,

Since it was one of the first things I ever built, I decided to put it in an enclosure of its own and consider it too as a finished product.

The problem was that the prototype never ran properly. It worked, just not as well as it should. Needless to say, I tried to fix it in the way of an Arduino upgrade. On paper everything should run perfectly, but in the real world, it just doesnā€™t. The clock bounces all over the place. Itā€™s more of a random number generator than a clock. I really thought that moving away from the 60Hz line signal as a timebase to a solid 1Hz signal from a DS3231 RTC would solve all my problems. At the end of the day, it boils down to the fact that itā€™s all soldered together on a DIY homebrew PCB. The holes that I drilled are too big for the pins; resulting in some pretty shoddy-looking soldering. Itā€™s a noisy circuit, and Iā€™m sure thereā€™s some grounding issues in there too.
Large 7-Segment Clock,I put in a bunch of caps to help filter out the noise, but I think the board is just fundamentally flawed. You can polish a turd, but itā€™s still a turd.

Itā€™s just a shame to throw it in a closet and forget about it. The case came out so nice and it looks great in the living room. Iā€™m going to gut it, and replace my old 7490 prototype board with something brand new. Iā€™m going to keep it a 7-segment clock, so Iā€™ll have to design a new PCB for the display.

I was thinking that I could just run the whole thing off the Bare Bones Arduino/DS3231 shield thatā€™s running it now.

All Iā€™d have to do is modify it so that I could connect the display to it. Iā€™d have to string all 6 digits together and multiplex them. Thatā€™s 48 wires Iā€™d have to solder onto the back of the display board.

That sounds like a real ratā€™s nest in the making. Not to mention, trying to unsolder the 48 wires that are on the back now and rewiring the whole thing not only seems like a daunting task, but a good way to damage some of the LED segments. When 7-segment LEDs only cost a buck or two, itā€™s better to just start off clean. Besides, Iā€™d rather have a display PCB that I could just connect to a mainboard with a ribbon cable. Neat and tidy.

I thought about recycling my Mini 7-Segment LED Clock design and just breaking the digits out to a header that I could then connect to a display board with a ribbon cable, but again, itā€™ll probably be better (and cleaner) to just start from scratch.

The multiplexing on that clock is OK, but itā€™s not ideal. In order to make that clock as small as possible, I made it in a way that I wouldnā€™t need to use any transistors or LED driver chips. As a result, thereā€™s sometimes a little ghosting on the digits and the first digit on the right is always a little brighter than the rest. If Iā€™m going to do this, Iā€™m going to do it right.

I got to work on prototyping something new. I decided to make use of the Multiplex7Seg library and drive the LEDs with transistors. Since Iā€™m using common-anode LEDs, I can drive them with some 3904 NPN transistors. The following schematic shows these displays as having G1 and G2 connections. However, Iā€™m using common-anode. Iā€™ll pretend that those are anodes and not cathodes. If you were using common-cathode, youā€™d need to use 3906 PNP transistors and connect the emitter to Vcc.

#include <Multiplex7Seg.h>
byte digitPins[] = {
Ā Ā 9, 10};
byte segmentPins[] = {
Ā Ā 2, 3, 4, 5, 6, 7, 8};
int num;
void setup() {
Ā Ā Multiplex7Seg::set(1, 4, digitPins, segmentPins);
Ā Ā num = 0;
}
void loop() {
Ā Ā num = num++;
Ā Ā if (num == 99) {
Ā Ā Ā Ā num = 0;
Ā Ā }
Ā Ā delay (200);
Ā Ā Multiplex7Seg::loadValue(num);
}

The sketch has the digits count from 0-99, then start over. It runs great, and the LEDs look fantastic.

I added another 4 digits to my breadboard and attempted to modify my code to support the additional digits. It was then that I discovered that the Multiplex7Seg library is limited to 4 characters. That seemed to make sense considering the library is intended to be used with the commonly available 4Ɨ7 digit display variety; something I failed to realize when I downloaded it.

I was about to try and modify the library, but the notes within one of the files said not to bother; that ā€œMore than 4 digits is not practical since the brightness decreases with a faster refresh rate and the MsTimer2 library only goes to 1msā€. So that was basically the end of that.

I took a look at a few other examples online and figured out a better way to do it. Itā€™s similar to the way that I multiplexed the digits on the Mini 7-Segment Clock, but a little more efficient. Not to mention, it looks even better. Thereā€™s no ghosting, and all the digits are of an equal brightness.

Iā€™m just counting milliseconds here just to test the functionality, but soon Iā€™ll add a DS3231 as a timebase.

 

For more detail: Large 7-Segment Clock,

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter