Question regarding the control of 24 individual switches

Hi Everyone,

I have a question that deals with sequentially controlling 24 SPST analog switch(ADG1412) for sourcing 24 different LEDs. I’m mostly concerned with the advantages/disadvantages of using a GPIO expander or simply running 24 different wires from my ATMEGA2560.

My goal is to maintain low power within my whole design (<4W) but I need to compare this to the ease of using 2 MCP23017 or simply turning the pins on and off from the ATMEGA. The 2 MCPs add about 10mW, this takes up a lot. I do have the option of increasing to about 6W but would rather not lower the bar.

Just looking for some advice or direction. Thanks in advance.

Using a multiplexed analogue switch to drive a LED is just plane stupid. Use a port expander every time.

Grumpy_Mike: Using a multiplexed analogue switch to drive a LED is just plane stupid.

It seems he was having a flight of fancy. :grinning:

Grumpy_Mike: Using a multiplexed analogue switch to drive a LED is just plane stupid. Use a port expander every time.

My description is a bit off. My LEDs are driven by high current output op-amp and my switches simply direct to each one.

Can you explain why I should always use an expander?

I appreciate it.

ThreeDMD: My LEDs are driven by high current output op-amp and my switches simply direct to each one.

Why drive leds with op-amps? And what are the switches directing? Some signal to the op-amp inputs, or the op-amp outputs to the leds? What are the input signals to the op-amps?

ThreeDMD: Can you explain why I should always use an expander?

Its simpler. Right now we don't understand the reasons for all your op-amps and switches, so that approach sounds over-complicated.

Have you considered shift registers? There are high-current ones available like tpic6c595.

PaulRB: Have you considered shift registers? There are high-current ones available like tpic6c595.

TPIC6*B595s or the highest current are TPIC6A*595s. But yes, for simple LEDs, the lower-rated TPIC6C595 would generally suffice.

These combine the function of "port expander" and current driver and are obviously the proper way to perform this function - only three port pins used to control 24 (or in fact, 128) LEDs. Of course, the LEDs require current limiting resistors.

ThreeDMD: My LEDs are driven by high current output op-amp and my switches simply direct to each one.

Clearly absurd, but out of curiosity, just what "op-amps" were you proposing to use?

ThreeDMD: The 2 MCPs add about 10mW, this takes up a lot.

Mmm, no you got that wrong, it would be 10 µW. Pages 1 and 26 of the datasheet, parameter D005; Standby current.