Main Content

Control multiple output devices using single GPIO pins from the microcontroller

I was needed to control almost 200+ relays using one microcontroller and during research I found out that best way to do it is by using a GPIO Expander module but I wanted to have some simpler solution which should be both small and compact. Now if you worked with addressable RGB LEDs or neopixels you already know that we can control lots of such LEDs by just using one output pin.

There is a chip inside each of the LEDs which can control 3 outputs, Red, Green and Blue LED in this case. It reads the data coming from the microcontroller, set it’s outputs according to the given instructions and pass the rest of the code to the next IC.

This way we can daisy chained as many of them as we want. I just wanted to impliment the same principle for any output devices in general, such as relays, to control even bigger loads. The IC used inside the neopixel LED is WS2811 which is a signal line 256 Gray level 3 channal Constant current LED drive IC. Eaxh IC can control 3 outputs but the maximum current per channel is limited to 18.5mA. Which is enough for driving an LED but not enough to drive a relay.”

Link to article