I would like to programmatically toggle off/on (independently) eight 5 V small light bulbs. It seems that I could use eight transistors controlled by eight independent digital control pins.

(See the attached schema below.)

But I'm sure there is a simpler way using a single chip ... with only one or two digital control pins (my digital control out(s) are 5 V max with a 255 steps resolution, so it could be OK to store all the different combinations within only one byte!).

  1. I'm actually using an Arduino, so some of the digital outputs are PWM (at first, I simply tried to directly use the digital output to light the bulb on/off... But not enough current was available on the Arduino :(
  2. The lights will be triggered on with a 200 mA current, but for a small amount of time (less than 50 ms)
  3. I'm OK if I need to use three digital pins!
  4. I'm aware the magical chip should have at least eight pins (one per bulb)
  5. I'm super newbie, so not too much programming please :)

Enter image description here

  • 1
    \$\begingroup\$ "SPI IO expander" may be what you want, or a shift register. \$\endgroup\$ – pjc50 Feb 5 '15 at 13:58

Try this device, it looks suitable: -

enter image description here

  • \$\begingroup\$ aagh, you beat me to it! Just edited my earlier answer, thinking that there must be an open collector shift register, edited it, then noticed your answer! \$\endgroup\$ – Scott Seidman Feb 5 '15 at 15:11
  • \$\begingroup\$ @ScottSeidman muhuhahaha \$\endgroup\$ – Andy aka Feb 5 '15 at 15:15
  • 1
    \$\begingroup\$ I beat you both, but no-one seems to notice... \$\endgroup\$ – Wouter van Ooijen Feb 5 '15 at 15:34
  • \$\begingroup\$ @WoutervanOoijen it appears you did!! \$\endgroup\$ – Andy aka Feb 5 '15 at 15:35
  • \$\begingroup\$ No link, no glory ;) \$\endgroup\$ – Scott Seidman Feb 5 '15 at 15:40

Your question is confusing in more than one way.

It starts with your light bulbs being small. The relevant parameter is the current they draw, not their size.

Next you say that your digital outputs are 5V max with a 255 step resolution. Do you imply that they are analog outputs, or maybe digital but PWM?

You end with 'it should be OK to store all combinations in one byte' is correct if you are controlling 8 lamps, each fully on or fully off, but that implies that you need 8 output pins, and you seem to think that fewer are OK.

Anyway, if your lamps require let's say 100 mA each, you can use an ULN2803 chip as 8-fold buffer.

If you are into some more programming, you could use a TPIC6C595 to do the same, but using only 3 output pins of your microcontroller, or just 2 if you don't mind a little ghosting.

  • \$\begingroup\$ I would suggest PCF8574 or MCP23017 if OP wants 2-wire operation as it never ghosts if it is properly wired as I2C bus. \$\endgroup\$ – Maxthon Chan Feb 5 '15 at 14:03
  • \$\begingroup\$ I'd first like to get a figure for the lamp currents before I'd advise such feeble chips (compared to the ones I propose). \$\endgroup\$ – Wouter van Ooijen Feb 5 '15 at 14:08
  • \$\begingroup\$ I meant using one of those and 2803 to form a two-chip solution that works with less MCU pin usage. \$\endgroup\$ – Maxthon Chan Feb 5 '15 at 14:15
  • 1
    \$\begingroup\$ Max, it depends on ops current needs. The pcf Is intended for lower current leds, not 100mA incandescent bulbs \$\endgroup\$ – Passerby Feb 5 '15 at 14:29

D44C7 is capable of 4 amperes but the chip set I am suggesting will not be able to handle that much current. If your design works within 500mA you can try this: ULN2003 NPN Darlinton array.

And if you need to free up some pins you can add a PCF8574 8-bit I2C GPIO expander so you only need to use 2 pins from your MCU, and I2C is a bus so the signal lines can be shared.

The PCF8574/ULN2003 chipset works like this:


simulate this circuit – Schematic created using CircuitLab

The ULN2003 is pin compatible with '2803 (in the sense that it can fit in '2803 footprint, leaving bit D0 unconnected) so choose the one that suits your needs.

  • \$\begingroup\$ 500 mA is more like the total current for an ULN, and as the OP wants 8 outputs I'd suggest an ULN2803 rather than an ULN2003. \$\endgroup\$ – Wouter van Ooijen Feb 5 '15 at 14:09
  • \$\begingroup\$ Your picture shows a 8-fold chip, but calls it 2003, which is a 7-fold chip. Also note that the input current for an ULN is ~ 1mA, but the output source capability of an 8574 is ~ 100 uA, hence this is not a reliable combination. An MCP, which has a real totempole output stage, would be OK. \$\endgroup\$ – Wouter van Ooijen Feb 5 '15 at 14:58

Any open-collector or open-drain octal buffer in the 7400 series, like http://www.ti.com/lit/ds/symlink/sn74bct760.pdf, with an eight-bit serial in parallel out shift register, https://www.fairchildsemi.com/datasheets/74/74VHC164.pdf, should do the job.

If you want to go with one chip, you need to look for an open collector output shift register. Looks like TPIC6A595 would work


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.