Simple 1 digit display?

I want to drive a single number display but most of the projects I've seen use lots of IO pins. What's the best way to do this with (ideally) only 3 pins?

Shift Register?

ShiftOut() using an 8 bit Serial to Parallel Register to light 8 LEDs.

With 3 bits you can only count up from 0 to 7. You need at least 4 pins to transmit one decimal digit. On the receiving side you can use a decoder. Google "7 segment decoder"

0-7 would be fine for my purposes...

olf2012:
With 3 bits you can only count up from 0 to 7.

You need at least 4 pins to transmit one decimal digit.

  1. True.

  2. Not true if the pin outputs serial data.

Three pins can drive as many 7-segment displays as you like.
Leo..

Three pins can drive as many 7-segment displays as you like.

http://www.geeetech.com/wiki/index.php/Arduino_7_segment_LED_timer_with_74HC595_module

BillHo:
Three pins can drive as many 7-segment displays as you like.

http://www.geeetech.com/wiki/index.php/Arduino_7_segment_LED_timer_with_74HC595_module

I'm not sure though about putting the current limiting resistor on the anodes. I could imagine that the brightness of the display would be dependent on the number of segments lit.

6v6gt:
I'm not sure though about putting the current limiting resistor on the anodes. I could imagine that the brightness of the display would be dependent on the number of segments lit.

Agreed. Common anode segment displays will want cathode resistors.

BillHo:
Three pins can drive as many 7-segment displays as you like.

http://www.geeetech.com/wiki/index.php/Arduino_7_segment_LED_timer_with_74HC595_module

Seeming as you can have it so the human eye can not really distinguish anything occuring sub 50Hz...then you "could" drive 2 displays with one register using the last bit to flip a transistor to control which display is active.

Turning displays on with their own number for say 5ms and then the next display for 5ms and loop it.

Johnny010:
Seeming as you can have it so the human eye can not really distinguish anything occuring sub 50Hz...then you "could" drive 2 displays with one register using the last bit to flip a transistor to control which display is active.

Turning displays on with their own number for say 5ms and then the next display for 5ms and loop it.

I'd also definitely think about multiplexing it all so that with two shift registers, one for the anodes, one for the cathodes, 8 transistors for the anode side and 8 resistors for the cathode side, you could drive up to eight seven segment displays. There would be a loss of brightness though because the duty cycle would be 1:8.

This is all interesting, but way above my pay grade. I want a simple solution, as I said up to 7 digits would be OK

Ah yes. It did all drift off in an academic direction which rather lost sight of your original requirements.

This is cheap, can display many digits, and requires only 2 arduino pins: I2C LCD
The characters are small.

This is cheap, simple, displays 1 digit (large) but consumes 9 arduino pins (8 if you don’t want a decimal point. 7 segment LED

If you want a single, but large LED display, that uses only 3 arduino pins, you can buy one shift register and a few additional components as illustrated by BillHo earlier in this thread.

Which (if any) of the suggestions could work for you ? There are also other possibilities.

As above and my initial reply.

A single 8 bit shift register such as the SN74HC595 is a 3 pin packaged option. There are sparkfun and arduino tutorials galore about its use.

This will work with cathode common displays. The IC will give HIGH outputs to drive each LED segment through a resistor (usually 100-330ohms).

Being an IC, it is also a nice simple package.

Option 2 is the use of a darlington pair IC such as the ULN2008A in conjuncton with a bit shift register with common anode displays.

So basically...for less hardware...go option 1.

Cathode common display with an SN74HC595

thanks for this. the blue LCDs are physically too big and the number is to small :wink:

I don't have 8 pins spare and adding shift registers seems complicated to a beginner like me...

It might be simpler to use 3 LEDs to show the binary code of the display - a bit obscure, but it would work for me.

Have you actually read a tutorial?

It is pretty straight forward as the Arduino library has ShiftOut() as a built in standard function.

I have some small OLED displays that work on i2c (2 wires)...may be more what you want?

Youd also need 4 LEDs...0 to 9 is 10.

2^3 = 8...you'd only manage a binary representation of 0,1,2,3,4,5,6,7

4 leds = 2^4 = 16 which would allow 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

Johnny010:
Have you actually read a tutorial?

Yes I have. Here are some projects I have built.

http://www.looping.me.uk/category/arduino/

The LED solution I can manage by myself, it was the general principle for minimal-wire LED displays I was looking for advice about.