# Controlling a 7 segment display from a rotary switch

Discussion in 'The Projects Forum' started by SouthernAtHeart, Jan 2, 2011.

1. ### SouthernAtHeart Thread Starter Active Member

Jan 2, 2011
110
2
I have a 2p5t rotary switch. I am only using 1 pole to change the resistance/time on a 555 delay timer circuit.
That leaves me with the extra pole, 5Throw switch, so here's my question:
Can I control a 7 segment LED to read 0,2,4,6, or 8 with this 5 throw switch???
I understand how the 4511 controls a 7 segment LED, but is there a way to have it work off of 1 rotary switch? I don't want to use anything that I have to program.
Thanks,
ck

2. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Something like that. Would 0, 1, 2, 4, 8 be acceptable?
If so, use 10k pull-down resistors, one per input, to keep the 4511 four inputs near ground.
Connect the switch 2nd pole common to Vdd, leave output 1 disconnected, and outputs 2 through 5 to the A thru D inputs, respectively.

If you really want the 0, 2, 4, 6, 8 sequence, you'll need to do some gating using diodes.

SouthernAtHeart likes this.

Jan 2, 2011
110
2
4. ### SouthernAtHeart Thread Starter Active Member

Jan 2, 2011
110
2
I think I've found something better!
What I REALLY need, but didn't think I could do very easily is this:
2,4,6,8,& 10
I see that to get a 0 in the display takes no input. So I could have a 2 digit display, and the first digit would just show 0, giving me 02, 04, 06, & 08. Then could I use the 5th throw from my switch to connect to the A input for the other digit, making it a 1, and if nothing is going to the first digit, it'll be a zero, so I'd have 10!
I'll have to see if I can find a 2 digit 7 segment display...
cheers,

5. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
It's not quite that difficult.

The only "tricky" part is the 6; you need to raise both B and C high to get it.

Like this:

I've just shown the pull-down resistors and the switch connections for simplicity.
[eta]
There is a missing junction to the left of IC1 pin 6 where the wire from C5 joins.

Note that you'll need to use proper current-limiting resistors on the outputs a through g, or your segment brightness will be inconsistent.

File size:
14.1 KB
Views:
169
6. ### SouthernAtHeart Thread Starter Active Member

Jan 2, 2011
110
2
Great! I see by your diagram that it isn't all that bad, I only need 2 diodes.
I've looked for a 2 digit display, but it looks like I'll have to use 2 single digit displays in my situation, as the 2 digit display has both digits controled by the same inputs, use the latching gate thing to differentiate them.
Thanks again.
Before today, I didn't even know what a 7 segment display was called, but now I think I'm actually ready to use one!
cheers.

7. ### SouthernAtHeart Thread Starter Active Member

Jan 2, 2011
110
2
When I turn on the 2nd digit, I'll want it to show a one, so I'll just tie the V++ to the segments B & C.
If I'm use a 860 ohm resistor on each of the 7 inputs for the segments, should I use one half that size since I'll be feeding 2 segments? ...or do I need to tie the power to 2 860 ohm resistors, each one feeding one of the two segments?
thanks,

8. ### KMoffett AAC Fanatic!

Dec 19, 2007
2,584
234
A "brute force" method of switch to 7-Segment decoding is with a diode matrix. A second digit can be added by just adding more diodes and resistors. The one shown is for displaying "0" through "4". Diodes can be cheap 1N4148's.

Ken

File size:
12.2 KB
Views:
101