Go Down

Topic: Driving 7 Segment led's (Read 2043 times) previous topic - next topic

EEhack2B


                           Hi all, i have a project i'd like to get going, i have over googled and am dizzy ! so a little help would be great. i'm looking for the best way to drive 4 7 segment led's. i have seen a few units that are pre-made, great! but i'd like to make my own and plus they didn't provide a schematic or chip info. I'd like to use it as a voltage display for my psu and later as a text display for other arduino project's. would be nice if i could use it like a "backpack" display

Osgeld

in a nut shell its 7 led's that share the same cathode (- side) then you multiply it by how many digits

so if you have a 4 digit display you will have 7 or 8(decimal point) pins going to led's and 4 cathodes

the magic trick is to display them 1 number at a time, quick enough that you cant see them blink on and off

doing this can be direct to arduino, or you can use some shift registers
http://arduino.cc/en/Tutorial/ShiftOut

or any other million and one ways to tackle the problem, each with their advantages and disadvantages ... for instance shift registers cant provide much current so your limited to a rather dim display, especially if each number is only on for 1/4 the time

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

JimboZA

I'm looking into this too, and am leaning towards using SPI and the MAX72XX chip as explained in the playground.
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

EEhack2B

i think the max is the most popular way i've seen (youtube) everything else has a ton of wiring i'd like to avoid !! spi,i2c anything would be great to save pins for other task.

mjkzz

I did one project using Max7219 with 5 7-segment displays, with a PIC16F628A. It is easy to grasp, just follow the document.
Search for "mjkzz" on eBay :-)

Hippynerd

Like most LED projects, there are many ways to accomplish the same task.
If you include any possible limitations, that makes it easier to choose one method over another.

Your more common options are:
Multiplexing
Charlieplexing
Constant Current Drivers
Shift registers
Transistors.

If adding parts or complexity is a problem, then multiplexing or charlieplexing might be a good option.
If brightness is a primary concern, then mutiplexing or charliplexing are less optimal, and constant current or shift registers might be a better option.

If your LEDs are under 9ma each, and you must use shift registers, then the 74hc595 shift registers will probably be ok, if you need 20ma, you will want TPIC???? shift registers as the hc595s are limited to 70ma.

There are probably ways that I havnt even mentioned... You may want to try them all... its possible to try each way, and see what you like best.
https://sites.google.com/site/rgbledcubes

CrossRoads

#6
Mar 08, 2013, 10:21 pm Last Edit: Mar 08, 2013, 10:23 pm by CrossRoads Reason: 1
Here's one way to drive 4 displays as a standalone project.
The TPIC6B595 is a nice driver because it can also control segments that are 3-4-5 LEDs in series and powered by 12V, and can sink more than 20mA per pin continuously.
74HC595 is only good for 5V and not much current as pointed out.

Easy to send data to:
Code: [Select]

// define these in pre-setup code
byte dataArray[] = {digit0,digit1,digit2,digit3};  // data that will be displayed

byte fontArray[] = {  // fonts that make up the numbers, 1 is an On segment
B00111111, // 0        a
B00000110, // 1    f        b
B01011011, // 2        g
B01001111, // 3    e        c
B01100110, // 4        d       DP
B01101101, // 5
B01111101, // 6
B00000111, // 7
B01111111, // 8
B01101111, // 9
B00000000, // Off 0x0A
};

// data is stored in an dataArray[], update when needed then call this code:

digitalWrite(ssPin, LOW);
for (x=0; x<4; x=x+1){
SPI.transfer(dataArray[fontArray[x]]);  
}
digitalWrite(ssPin, HIGH; // data changes on this rising edge


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up