[SOLVED] Using 4 Digit 7 Segment Display with Arduino (newbie question)

Hi
I just received my 4 Digit 7 Segment Display from SparkFun (7-Segment Display - 20mm (White) - COM-11409 - SparkFun Electronics) and now I'm trying to get it working but I don't understand how the pins are supposed to be wired to the Arduino... I found some tutorials (and notably this one : http://www.instructables.com/id/Arduino-4-digit-7-segment-display/) about how to program and I understood well it but I did not find how it was wired... If someone could help me it would be... helpful ! :smiley:
Thank you in advance

See page 3 of the datasheet

You will need 8 220 ohm resistors. and a ULN2003, ULN2803, or 4 NPN transistors with 4 1K resistors.
Connect 8 Arduino outputs to 8 resistors to pins
11,7,4,2,1,10,5,3
Connect 4 arduino outputs to the ULN2003/ULN2803 inputs, GND to GND, COM is not connected, and 4 outputs connect to 12,9,8,6;
or connect arduino outputs to 1K resistors to NPN bases, emitters to GND, and collectors to 12,9,8,6.
Setup the anodes for digit 1, turn on cathode 1, after 2 mS turn off cathode 1,
Repeat for digits 2,3,4.
During the 2mS do other stuff.

It seems a lot complicated seen like this :~
It seemed simpler on Instructables... no ?
Is there any way to do it simplier or not ? Because it was not precised on Sparkfun that I would need all this stuff and actually I find it a bit strange... but I will see everything tomorrow. Thanks for the answer :slight_smile:

Depends on how you want to multiplex - whole digit on at a time, or just 1 of 28 segments on at a time. Whole digit will be brighter as a digit is on for 1/4 of the time, vs each segment being on 1/28 of the time.
I'm a hardware guy - 1/4 of the time on is the way I'd do it.

Also, I don't see any current limit resistors on that setup, so that's begging for arduino outputs to be burned out in pretty short order.

And look at this:

digitalWrite( GND4, LOW);    //digit 4
  pickNumber(dig4);
  delay(DTime);
  digitalWrite( GND4, HIGH);

1 output pin is being tasked to sink the current from 7 other output pins.
Kiss that '328P chip goodbye.

Hi again !
Yeah actually it is more difficult than I thought, and here I can see a scheme with all explaniations and stuff :
http://learn.parallax.com/4-digit-7-segment-led-display-arduino-demo
So thank you for your answer I'll try to find all the components tomorrow !

The display is multiplexed, 4 cathode connections (one per digit), 8 anode
connections (for the segments and decimal point).

Typically you would use high current drivers to drive the digit pins, and
drive the anode pins via a resistor as each segment only needs 20mA, within
the safe range for an Arduino pin. Each digit pin will take upto 160mA,
hence high current drivers are used.

There are interface chips that can do the work for you, MAX7219/21 for instance
(I haven't used one though). The large pin count is always an issue driving such
displays, which is why serial-interfaced modules are available for a bit more
money:

OK I understand now (happy to learn things :p) and... yeah I will try making it work... and if I can't, I have bought a LCD screen too but I found the 7 segment had more... style ^^ but if I can't then, the price I paid it won't make me regret it !
Thanks again for your answers, I'll keep you up to date if I have difficulties or whatever

It's not difficult at all, it's just new to you. The concept itself is very simple:

Setup the anodes for digit 1, turn on cathode 1, after 2 mS turn off cathode 1,
Repeat for digits 2,3,4.
During the 2mS do other stuff.

It's getting simpler and simpler at measure you explain it ^^
But the four cathodes are for the digits, no ? The other ones are for each segment... But it means 4 digits + 7 segments + 1 dot. I guess everyithing is clear now...
Thanks !

EDIT : just a little question now... The thing is I turn n cathode 1, write the value for each segment and then what ? I turn on the second cathode but how do I have different values for the segments ?

Set up the anodes for digit 1. Turn on cathode 1. After 2 mS turn off cathode 1.
Set up the anodes for digit 2. Turn on cathode 2. After 2 mS turn off cathode 2.
Set up the anodes for digit 3. Turn on cathode 3. After 2 mS turn off cathode 3.
Set up the anodes for digit 4. Turn on cathode 4. After 2 mS turn off cathode 4.
Repeat.
Persistence Of Vision (POV) tricks the eye/brain into seeing all 4 on at once when they clearly are not.
During the 2mS, check if the number to be displayed needs to be updated.

Perfectly clear now... So confirm me I'm understanding well, it will be something like the thing the guy made here, no ? But just before you said he was wrong, so was he wrong only "hardwarely" (with the lack of resistors and transistors) or "softwarely" too (in which case I'm wrong) ?
Thank you again

The hardware design was poor.
The software iworkable and could be better. Look up "blink without delay" so that something can be done beside sitting static for 16mS of every pass thru loop.

OK... so IT WORKS !
So thank you and now I'm gonna find a thing do do with this display :stuck_out_tongue:
thanks again

Cool.