Using a 4 digit 7 segment display

Hi everyone!

I'm trying to use this 4 digit 7 segment display to show a countdown timer. 7-Segment Display - 4-Digit (Red) - COM-09483 - SparkFun Electronics

I've searched high and low of tutorials, but it seems that everyone has their own way of accomplishing it. Sadly, none of them worked for me.

Does anyone have any experience with this display? I just want to start with a basic program to test all of the individual LEDs first, then go to the timer :slight_smile:

Thanks!

Did you look through the hookup guide? It looks like it can hook up through serial uart and several other ways. Take a look here Using the Serial 7-Segment Display - SparkFun Learn there is also an example code

That's a great find! However, that uses a different type of 7 segment display. I might have to switch to something like that if nothing else but for the single pin control (rather than 12!)

That is actually found under the one you linked to. You should be able to set it up the same way.

Oh woops! I linked to the wrong one! My bad!

This is the right one: 7-Segment Display - 4-Digit (Red) - COM-09483 - SparkFun Electronics

Did you look at the Datasheet for it on that page?

You'll need a PNP transistor for each digit, and seven NPN transistors. Then you use something called multiplexing.

And you could get away with just the four PNP transistors, and use the Arduino pins directly for the seven segments. That is because each cathode pin will be driving only one LED each, so <=20mA, but the common anode has to carry a maximum of 7x that, so possibly 140mA maximum. And an Arduino pins absolute max current in or out is 40mA, better to stay around 20mA max.

This is for a PIC, but it illustrates the idea.

Then it is just a matter of lighting up each digit in turn, while illuminating the proper LEDs. I would use Blink Without Delay to accomplish the timing, using the micros() timer rather than millis(). Do NOT use delay().

Hmm... someone has written a library for seven segment LED displays:

https://docs.google.com/file/d/0Bwrp4uluZCpNdE9oWTY0M3BncTA/edit

I always use the MAX7219 (can drive 8 digits however these are common cathode displays).
Very easy to use with Bubble Display - 7-Segment (4-digit) - COM-12710 - SparkFun Electronics