I thought I had a solution for a project I am working on to switch up to 60 LED's using a TPIC6B595 but then realised I needed red/green indication which meant double the I/O but also the red/green LED's I can get are two pin bicolour LED's.
I don't want to use 2 I/O for each LED and have done a few hours research online today but have only found one circuit I think is appropriate. The one kicking around the internet that is used in all answers to this question is constantly sinking current to GND via two resistors in a voltage divider arrangement. I don't want to do this. I have also seen a simple inverter IC being used with a single series resistor but this doesn't allow for adjustment of each colour brightness (allowing for different forward voltage drop in each colour).
The circuit below uses a few more components but has a tiny quiescent current and also allows for different currents through each LED to allow matching brightness given the different forward voltage drop in each colour LED.
Trouble is I don't fully understand the circuit and I can't find the components mentioned on Digikey or RS online (here in Australia) - the BSS101 I can't find on http://au.rs-online.com/
Would someone be able to please describe the circuit to me and may suggest some components ?
I want to drive these bicolor LED's from one I/O pin on a cheap shift register (74HC595 / TPIC6B595) and be able to set the resistors to allow matching brightness of the two colours.
Using discrete components, another circuit offers an inexpensive approach that avoids the other circuits' disadvantages (Figure 3). When the microcontroller's output port goes high, current flows through the green (upper) LED, R2, D2, and FET Q2, which the port's high level turns on. When the microcontroller's output port goes low, transistor Q1 turns on and delivers current to the port pin through R2 and the red (lower) LED. The circuit operates symmetrically because silicon diode D2's forward-voltage drop is present regardless of whether the microcontroller's port pin goes high or low. VCC may vary during operation but must remain higher than 3V.
You can individually adjust the LEDs' currents to equalize brightness or compensate for a difference between the microcontroller's power-supply voltage and the LED-driver circuit's VCC. Replace R2 with two resistors connected in series between Q1's emitter and D2's anode. Connect the midpoint of the two resistors to the LEDs.
With the microcontroller's port pin configured as an "input with pullup," the port delivers a small current to the green LED. However, pullup-resistor values of 22 kΩ or higher do not cause misleading light output from LEDs in the off-state. When the input signal from the port pin floats—that is, with VCC at 5V and the port configured as an input with no pullup resistor—the circuit draws no additional current, and the quiescent current, which R1 determines, averages less than 100 µA.
No offence implied, but that uses 2 x I/O pins per bicolor LED. That doubles my I/O requirements. If this is the way it would normally be done then I will go with it.
I thought that an NPN / PNP solution would be more elegant !
Does this need the 2 x TPIC6B595's or could one of them service up to 4 bicolor LED's ?
@CrossRoads - In your example above wouldn't the TPIC6B595 be sinking current via the resistors when the pins are driven low via the shift register ? I don't think I can drive them into a tri-state mode so they would always be sinking current on every pin even if the LED was off. Then instead of them dropping a couple of volts they would have the full 5v across them.
Did you consider addressable RGB LEDs.
They come in all shapes and sizes, even 5mm through-hole (Adafruit, Sparkfun).
No external hardware (TPIC).
Just one I/O pin for the whole string, and a 5volt supply.
Leo..
Wawa:
Did you consider addressable RGB LEDs.
They come in all shapes and sizes, even 5mm through-hole (Adafruit, Sparkfun).
No external hardware (TPIC).
Just one I/O pin for the whole string, and a 5volt supply.
Leo..
I don't want to take the easy way out ! I'm trying to learn analogue electronics and SMD PCB design on this project and I'm looking to use 3mm light pipes. Secondly, 60-100 addressable RGB LEDs will cost a lot more.
I don't think the TPIC6B595 is available in SMD. The TPIC6C595/6 is.
As CrossRoads has pointed out, you can make a "poor man's H-bridge" for four bi-coloured LEDs with TPIC chips.
You might run into fan-out problems with that many (15-25) TPIC chips.
Leo..
25 TPIC chips is a lot of board area and wire length between chips.
The Arduino I/O pins have to drive that.
Signal rise times become a problem at some point, and buffers might be needed.
No practical experience of the exact limitations.
Someone else might have.
Leo..
Wawa:
25 TPIC chips is a lot of board area and wire length between chips.
The Arduino I/O pins have to drive that.
Signal rise times become a problem at some point, and buffers might be needed.
No practical experience of the exact limitations.
Someone else might have.
Leo..
Maybe if I just made 16 or 32 channel boards and stacked them rather than putting it all on one board. Is there a better way of attacking this ?
It's funny because the simplest part of this project, lighting leds, has turned out to be the most complex ! For me anyway...
Wawa:
Addressable LEDs would be simple, and a lot cheaper.
Leo..
But I don't want addressable LED's ! Well I thought I didn't until I just went searching !!! I can get 5mm addressable LEDs with the WS2812 IC built in ! Problem is, I need 3mm LED's to fit the control panel.
A pair of TPIC6C595 can drive 8 bicolor LEDs. You can daisy chain as many as you want, I've done up to 45, with the Arduino driving 5 74HC125s, and the 125s then driving 9 each of the 595s. 8 x 45 = 360 LEDs, well I guess 180 in this application.
The TPICs are open drain outputs. When you shift in a 0, the outputs are off and no current is sunk - LEDs are off. When you shift in a 1, the output turns on and current is sunk to turn on an LED. If both TPICs are On, or both are off, the LEDs have the same voltage across them (~0V, or ~5V), and do not turn on.
The smallest SMD RGB LEDs I know of are in the '5050' package, 5mm x 5mm, 4 pin for addressable parts like WS2812B and 6 pin for 'dumb' parts needing current control per LED.
These 2-pin red/green guys are also charlieplexable. This requires only I/O pins and resistors.
60 R/G devices, being 120 LEDs, would require 12 I/O pins (30 R/G device, being 60 LEDs would require 9 I/O pins).
This solution wouldn't be so hot for an "all pixels on" situation, but the LEDs mentioned aren't, in my opinion, well-suited to some ultimate signboard ideal.
CrossRoads:
A pair of TPIC6C595 can drive 8 bicolor LEDs. You can daisy chain as many as you want, I've done up to 45, with the Arduino driving 5 74HC125s, and the 125s then driving 9 each of the 595s. 8 x 45 = 360 LEDs, well I guess 180 in this application.
The TPICs are open drain outputs. When you shift in a 0, the outputs are off and no current is sunk - LEDs are off. When you shift in a 1, the output turns on and current is sunk to turn on an LED. If both TPICs are On, or both are off, the LEDs have the same voltage across them (~0V, or ~5V), and do not turn on.
The smallest SMD RGB LEDs I know of are in the '5050' package, 5mm x 5mm, 4 pin for addressable parts like WS2812B and 6 pin for 'dumb' parts needing current control per LED.
Looking at the 74HC125s now. I haven't used these before.
The addressable LEDs would work but I have no way of mounting them under a panel and I can't find any light pipes that would work.
This is another idea (first time KiCad user so go easy on me!)
I've tested it on a breadboard and it works !
Not sure if I should be using a hex inverter to drive LED's directly though. Each inverter would only do 3 LED's and I am only running them at 5 - 10mA.
I am not quite sure what Crossroads circuit (previous posts) uses the quad buffer 74HC125 IC for ? From what I have read it is generally used for level shifting. Is it because I am running the Teensy and with 3.3v we would want 5v at the TPIC6C595's ?
R1, D1, R2, D2 can be replaced with ONE 220ohm resistor.
R3, U1A can be removed, and the HC595 output can be connected directly to the above 220ohm resistor and the input of U1B.
The 74HC14 has only six inverters, so you need even more chips.
Leo..