Amusing 5 pin 7 segment LED display - Page 1
Forum section: electronics / projects

author: Renate
author_rank: Super Contributor
timestamp: August 28, 2019, 09:17:22 pm
content: My apologies if this is old hat, but I've never run into it before...Everybody knows those 4 digit 7 segment displays.They have 4 common pins and 7 (+1 for the decimal point) segment pins.Everything is arranged electrically in a little rectangle, 4 x 8 = 32 lightable thingies.I found a trashed USB power bank on the highway.It had a cute little 2.5 digit (188) LED display on it.I thought that I'd salvage it.I was amazed to see that it connected on only 5 pins.I scratched my head.If it were 2 rows and 3 columns, that would be 6 lightable thingies.What they are doing is connecting between every pin and every other pin an LED.Ok, but that would be 5 * 4, (then divided by 2 since polarity does matter) = 10 lightable thingies.But! They have LEDs going in both directions between all the pins, 5 * 4 = 20 lightable thingies.Since this is a 2.5 digit (without decimal points) we only need 16 lightable thingies.So what we have is actually a square matrix (with the row drivers and the column drivers being the same).It has a dimension of 5 * 5 (minus of course the 5 where the row and column is the same, i.e. the diagonal) = 20 active crosspoints.Since we are only using 16 crosspoints, we could use the remaining 4 as pushbutton inputs (with an isolating diode).Since we're driving LEDs and they need a resistor and there's no division between rows and columns, each of the 5 leads gets a resistor, 1/2 of the value we'd want.The advantage to all this is that you only need 5 pins out of your uP.The disadvantage is you have to do wacky bit bopping to determine the right segment.Since builtin pullups on uPs are easy, I have the multiplexing work by grounding 1 of the 5 pins and either Hi-Z or VSS on the other pins.Without reading any extra pushbuttons, a 4 phase refresh will do.With pushbuttons you need 5 phases.Of course, you could make this 16 (or 17) phase to make sure that the drop across the resistors is absolutely uniform.

author: Nusa
author_rank: Super Contributor
timestamp: August 28, 2019, 09:43:17 pm
content: https://en.wikipedia.org/wiki/Charlieplexing

author: mikerj
author_rank: Super Contributor
timestamp: August 28, 2019, 09:45:16 pm
content: This is a technique calledCharlieplexingwhich has been around for quite a long time. I've not seen a multi digit seven segment display package specifically manufactured to use this method though, so it's an interesting find.

author: Renate
author_rank: Super Contributor
timestamp: August 29, 2019, 07:28:35 pm
content: Ok, well, Charlieplexing.I'm not really impressed.To do this properly with LEDs you need either to use a phase per LED or use a special driver that can do all 3 for each pin.1) A hard drive (unlimited current)2) Hi-Z3) Current limited drive.So, for 64 LEDs we need 9 lines with Charlieplexing.For a standard matrix we'd need 16! OMG!But the 8 columns drives aren't real data, it's actually 3 bits of actual information.So, we'd need 11 lines out of the processor (and a 3-8 driver).So for saving 2 lines out of the processor we're going to jump through all these hoops?Ever try debugging a Charlieplex?Ever see the two LED paths dimly glowing because of leakage?It's cute, but engineering isn't always about cute.

author: Nusa
author_rank: Super Contributor
timestamp: August 29, 2019, 08:02:46 pm
content: You asked how it was done. Didn't say it was recommended in the general case. When you have a large number of segments, you're better off with a dedicated LED driver in most cases, rather than trying to find enough controller pins.

author: james_s
author_rank: Super Contributor
timestamp: August 29, 2019, 09:19:06 pm
content: IIRC many of the Dallas/Maxim dedicated LED driver ICs use Charlieplexing.

author: mikerj
author_rank: Super Contributor
timestamp: August 30, 2019, 01:55:38 pm
content: Quote from: Renate on August 29, 2019, 07:28:35 pmExcept you have a 2.5 digit display using just 5 pins, meaning it cold be driven from an 8 pin micro. A conventional multiplex would need seven segment pins and 3 digit pins, double the number of pins.

author: Renate
author_rank: Super Contributor
timestamp: August 30, 2019, 04:52:08 pm
content: Quote from: mikerj on August 30, 2019, 01:55:38 pmWell, yeah, that was why I demonstrated it with an ATtiny85, which only has 5 data pins (if you don't muck with PB5, the reset pin).

author: BravoV
author_rank: Super Contributor
timestamp: August 30, 2019, 05:27:24 pm
content: Just google for MAX7219 , driving 8 digits 7 segments leds with only 4 wires.