2 x 7 segment display counter

Hi I'm pretty much a complete beginner when it comes to Arduino...was just wondering if anyone knows a link where I can see how to wire up two 7 segment displays to the arduino Duemilanove and a switch. The idea being to create a counter...every time the switch is hit, the counter goes up.

Unless anyone can help with a diagram...

Thanks

Well, the switch is easy. The counter is a software feature. What are the 7 segments displays for?

Here's a data sheet for a 7 segment display:

Pins 5 and 10 got to a resistor that then goes to ground. The other pins go to digital pins on the Arduino. Set a pin HIGH to get a segment to light. Figure out which segments need to light to display a number, and write a function to set those pins HIGH. Write a function to turn all the pins off.

Two 7 segment displays are going to need 16 pins. The switch will need another. That's 19. Fortunately, the Arduino has 19. Two you shouldn't use (o and 1, they are for serial communications), leaving 17 you can use. Hey, just enough.

Thanks, I did some web browsing and multiplexed the displays and managed to code a 99-0 coundown. Just need to add in a switch to control the number count now. It's for a university project. So glad i've got something working now!

K

So did you end up using all those pins or is there some kind of driver that allows you to control / light up two 7-segment displays using half the pins if not less??

Anyone know please help and thank you in advance.

You might want to take a look at this tutorial http://www.arduino.cc/en/Tutorial/ShiftOut and use two 74HC595 shift registers to achieve this. (the tutorial uses LEDs, but you can easily adapt it to using 7 seg displays). Hope this helps.

I like the shift register solution, but if you want a fancier solution, you could use a 'proper' LED driver.

There are 'simple' ones like TLC5940, or proper 8-digit 7-segment display drivers e.g. http://uk.farnell.com/intersil/icm7228bipiz/ic-led-driver-8-digit/dp/1562066 which are more expensive than the microcontroller on the Arduino.

HTH
GB-)

@PaulS:

"Pins 5 and 10 got to a resistor that then goes to ground"

The datasheet linked is (I think) a common anode device (please correct me if I'm wrong) - shouldn't it go to +5V?

(I'm a noob at electronics and I'm trying to learn, and this anode/cathode stuff is confusing me)

The datasheet linked is (I think) a common anode device (please correct me if I'm wrong)

Quite correct.

Yes these pins should go to 5V, that other pins should go through a resistor to ground, or to a switched ground like a transistor or LED driver.

So, one "God" member says one thing and another says something else. :-/
How do I know who to believe?
How do you get to be a "God" member?
Is it possible to vote down "God" members?

How do you get to be a "God" member?

You make over 500 posts.

Is it possible to vote down "God" members?

No this is not a democracy. :wink:

We all make mistakes and despite being called gods we are only human.

How do I know who to believe?

Count the posts. :wink:

"Count the posts"

So, I just ignore posts by members with fewer than, what, 5000 posts?

So, I just ignore posts by members with fewer than, what, 5000 posts?

Not ignore but use it as a weighting factor. :wink:

This is not a Europe vs USA thing :), and I'm not a big believer in 'god' by purely counting posts :wink:

but

The datasheet linked is (I think) a common anode device

is true. This can be confirmed by looking at the sheet and checking the symbol for an LED and how it is connected (the arrow head pints to ground).

so

Yes these pins should go to 5V, that other pins should go through a resistor to ground, or to a switched ground like a transistor or LED driver.

is true.

Further, if you put a resistor on the LED matrix/displays common pin, and not on each LED, then the brightness of the 'On' LEDs will depend on how many LEDs are on. Each LED will look brighter when there are fewer 'On' LEDs (which might not be what is wanted).

Worse, if the common resitor is calculated to make the display very bright when all 7 (or 8) LEDs are on (but still within Arduino spec.), it might actually pull the Arduino pin beyond specification when only one LED is on.

HTH
GB-)

"This is not a Europe vs USA thing"
I don't understand why you said this thing.

"I'm not a big believer in 'god' by purely counting posts "
Does that make you "agnostic" or "atheist"?
I don't now know who to believe.
Maybe Grumpy Mike is a Messiah?

To make it clear, I never intended putting a single resistor on the common anode/cathode - I'm a noob, but not that stupid!

"This is not a Europe vs USA thing"
I don't understand why you said this thing.

Because the choice seemed to be between a USA 'god' and a UK 'god', and I'm from the UK too, worse I used evidence from another Euopean (you) to illustrate my case :slight_smile:
(sorry, I get a bit playful most days, and it might not come across)

"I'm not a big believer in 'god' by purely counting posts "
Does that make you "agnostic" or "atheist"?

I don't know, maybe "innumerate"? :wink:

Maybe Grumpy Mike is a Messiah?

He lives in Manchester, so he knows about rain that lasts for 40 days and 40 nights :), but ... :wink:

To make it clear, I never intended putting a single resistor on the common anode/cathode - I'm a noob, but not that stupid!

Okay. Good.

Putting a single resistor on the common was part of the initial advice:

Pins 5 and 10 got to a resistor that then ...

so I thought it might be helpful to catch that in this same thread.

HTH
GB-)

I think the question is simple.
PaulS said:-

Pins 5 and 10 got to a resistor that then goes to ground.

In the data sheet Pins 5 and 10 are anodes. Anodes go to +ve if you want to make the LED light up.

So if you want to settle it you can get the display and just wire it with pins 5 & 10 to ground through a 330R (or so ) resistor and one of the cathodes to +5.
If PaulS is right, and the data sheet of the device you have is the one posted this should light up. It will do no damage if this is wrong.

If it doesn't light then reverse the ground and +5.
Simple as that and your faith is not tested.

Simple as that and your faith is not tested.

Oh, you are "The One" :wink:

GB-)