2 digit seven segment display

Hi guys,

I want to drive 2 digit seven segment display

I have just 3 pins left in my arduino uno.

So i was planning to use a shift register. But I cant do it with three pins on my arduino

So is there any way to drive 2 digit seven segment display (combined or seperate ) using these 3 pins

You can drive a shift register with 3 pins look at the stuff in the playground. It also shows how to daisy chain shift registers.

Mark

For 2 digits then 3 pins and two shift-registers is fine. However, you could also use your three pins to control a driver chip such as a Maxin 7219, which will drive up to 8 digits (and can be daisy-chained).

The advantage of the driver chip is that you only need one resistor to set the current rather than 14 resistors for 2 digits using shift registers.

can i use a MAX 7221 chip?

I havent used it before

so pls help me with it?

Definitely. 7221 is just a fancy version of the 7219 I think.

Datasheet is here: http://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf

You need to set up a few parameters first then, when you come to write data, you send it two bytes at a time using shiftOut:

Pull the latch pin LOW
shiftOut the digit number
shiftOut a byte of data
Pull the latch pin HIGH again.

There is code for using a 7219 to control 4-digits of a sunrise-clock that I built here: http://www.instructables.com/files/orig/F3L/08WZ/HAQ2ZGH7/F3L08WZHAQ2ZGH7.txt

The initial setup may need changing for the different chip and you only want 2 digits rather than four, but the data-transfer functions should be the same. I defined my own characters but the chips have a "decode" mode where you just send them the number and they display it using a built-in font.

Ugi

hi
I googled the price for 7221 and it is around 20$
i dont have that much money with me so i think i will go with two 74HC595 shift register IC

what all are needed to connect 2 seven segment displays with an arduino with two shift registers in between?

That's why I used a 7219 - less than £2 for 2 delivered: http://www.ebay.co.uk/itm/320777447581

I'm sure I've seen them cheaper too.

For the shift registers you connect each pin of your 7-segment to a shift-register output using a suitable resistor. You connect the data-in of the first shift register to the Ardu' and the data-in of the second to the data-out of the first. Both shift registers are connected to latch and clock pins on the Arduino. You send data with shiftOut just like the shiftOut tutorial.

Edit - 10 for $5 - http://www.ebay.com/itm/130733916831

$1.25 for MAX7219 from taydaelectronics.com
MAX7219 7 Segment + Dot Point, Common Cathode serially interfaced display driver PDIP-24
Arrives in the US from a Colorado address with inexpensive shipping.
Two 74HC595 will work, have to pay attention to the HC595 70mA Absolute Max current limitation.
A better shift register is TPIC6B595, will support more current for a brighter display.
78 cents at avnet.com
https://avnetexpress.avnet.com/store/em/EMController?langId=-1&storeId=500201&catalogId=500201&action=products&term=tpic6b595&Nn=25&N=100153+4294956112

If i am using a shift register should i use a resistor for each segment (7*2=14 resistors) ?

I saw a circuit diagram with just a single resistor . Is this correct?

If using a shift register, you are usually turning on all the segments together.
So you would use a resistor per segment betweent he 74HC595 and the display pins.
MR needs to be tied to VCC, not Gnd.
Size the resistors for 10mA, the HC595 only supports 70mA max.
TPIC6B595 is much better as a current sink, can handle 20mA/segment for all 7 segments.
You may find 10mA is bright enough, depends on the display.

what resistor value should i use for the segments?

74HC595 can go down to ~0.33V,
So:
(5V-Vf-led - 0.33)/.01 = Resistor value
What's the voltage drop for your display?

dont know the voltage drop
it is a normal 1/2 inch seven segment display

Use a 270, 330 ohm, something in that range, in series with 5V on anode and resistor to Gnd. Measure the voltage across a segment.

thanks cross roads

Glad to help.