Driving common anode 7-seg with a 74hc164 shift register

537 views
Skip to first unread message

Michael Erskine

unread,
May 18, 2011, 4:42:59 AM5/18/11
to nottinghack
OK, I'm "challenged" with some basic electronics here: I have a cute
little 7-Segment LED digit (HDSP-A101) and a handy 74hc164 shift
register so I can drive it with only two of my precious Arduino pins.
Unfortunately, I have no idea what to do because the 7-Segment display
is common-anode! Everything is upside down and this doesn't fit my
"software" brain. Any pointers?

Michael E.

Matt Lloyd

unread,
May 18, 2011, 4:45:35 AM5/18/11
to notti...@googlegroups.com
Add a Darlington array in between re gift and the LEDs??

'RepRap' Matt
Sent from my iPhone 4

James Hayward

unread,
May 18, 2011, 5:27:19 AM5/18/11
to notti...@googlegroups.com

I have some darlington arrays in my box you can have.

J

sent from my HTC Desire

Michael Erskine

unread,
May 18, 2011, 5:32:45 AM5/18/11
to notti...@googlegroups.com
Hmm, I'm thick enough not to get this! So how does a Darlington Driver
invert the "logic" coming out of the shift register?

Here's how my brain sees it: I have 8 digital signals which are logic
high when I want a segment lit.

I have 8 LEDS and I can wire them individually to a digital output
(and series resistor).

But the LEDS have a common anode and I can't just wire all the digital
outputs together!

My brain hurts!

James Hayward

unread,
May 18, 2011, 5:37:29 AM5/18/11
to notti...@googlegroups.com

You wire the common anode to Vcc, then the cathodes go into the darlington array (just a load of transistors) and to ground.  The high signals from the output turn on the individual transistors in the array and allow current from the cathode to flow to ground.

A picture would be easier to understand, I can show tonight if you like?

J

sent from my HTC Desire

Michael Erskine

unread,
May 18, 2011, 5:45:12 AM5/18/11
to notti...@googlegroups.com
On 18 May 2011 10:37, James Hayward <jhaywa...@gmail.com> wrote:
> You wire the common anode to Vcc, then the cathodes go into the darlington
> array (just a load of transistors) and to ground.  The high signals from the
> output turn on the individual transistors in the array and allow current
> from the cathode to flow to ground.

Ah, I see it now. I guess this shift register is not well suited to my
task - I just had both to hand and thought "that should work!"

Hardware is hardwork :)

James Hayward

unread,
May 18, 2011, 5:52:48 AM5/18/11
to notti...@googlegroups.com

You'll still need the shift register, or you'll need 8 lines to drive the array!

sent from my HTC Desire

Iain Sharp

unread,
May 18, 2011, 6:31:40 AM5/18/11
to notti...@googlegroups.com
Depends on the current drain. If the shift register has enough current capacity to drive the display you really don't need the darlington transistors.

Wire the common nnode to positive. Wire the segments to the shift-register outputs though a suitable resistor. Write the shift-register bits to "low" to turn the segment on and "high" to turn the segment off.

Remember that almost all digital outputs can sink current as well as source it.

Iain

jfowkes

unread,
May 18, 2011, 6:37:40 AM5/18/11
to Nottingham Hackspace - Nottinghack
What Ian said.

In the arduino, I presume you'll have a byte variable that you shift
out to the 74HC164 pins? Just before you shift it, do a x = ~x; Job
done (hopefully)!

On May 18, 11:31 am, Iain Sharp <sharp...@pinedragon.com> wrote:
> Depends on the current drain. If the shift register has enough current
> capacity to drive the display you really don't need the darlington
> transistors.
>
> Wire the common nnode to positive. Wire the segments to the shift-register
> outputs though a suitable resistor. Write the shift-register bits to "low"
> to turn the segment on and "high" to turn the segment off.
>
> Remember that almost all digital outputs can sink current as well as source
> it.
>
> Iain
>
> On 18 May 2011 19:52, James Hayward <jhayward1...@gmail.com> wrote:
>
> > You'll still need the shift register, or you'll need 8 lines to drive the
> > array!
>
> > sent from my HTC Desire
> > On 18 May 2011 10:45, "Michael Erskine" <mse...@googlemail.com> wrote:

Michael Erskine

unread,
May 18, 2011, 7:06:49 AM5/18/11
to notti...@googlegroups.com
On 18 May 2011 10:52, James Hayward <jhaywa...@gmail.com> wrote:
> You'll still need the shift register, or you'll need 8 lines to drive the
> array!

I'm thinking of a _different_ shift register (rather than the first
one I have to hand) that can drive the common anode display without
the need for another IC on my board.

Matt Lloyd

unread,
May 18, 2011, 7:47:05 AM5/18/11
to notti...@googlegroups.com
Nice one Iain and JamesF

Will need to just check how much current the shift register can sink and how much the led's pull when all on. We can check the LEDs with the bench suppy and lookup datasheet for the shift register

'RepRap' Matt
Sent from my iPhone 4

Reply all
Reply to author
Forward
0 new messages