Controlling 16-channel relay with ease

Deouss
Posts: 386
Joined: Tue Mar 20, 2018 11:36 am

Controlling 16-channel relay with ease

Postby Deouss » Sun Mar 03, 2019 12:54 am

I was playing with the 16-channel relay that is widely available for IoT projects and it turned out a great tool.
To reduce number of pins I used also very polpuar cheap 16C multiplexer (HP4067)

Here is a video from part of my project:

https://www.youtube.com/watch?v=0oiGmXb5Kuc

I plan to add code controlling it via WiFi and publish on github soon )

mikemoy
Posts: 391
Joined: Fri Jan 12, 2018 9:10 pm

Re: Controlling 16-channel relay with ease

Postby mikemoy » Mon Mar 04, 2019 1:41 pm

If you want to reduce the I/O even more try using the MCP23017 (I2C interface) or the MCP23S17 (SPI interface)
https://www.digikey.com/product-detail/ ... ND/5226680

Deouss
Posts: 386
Joined: Tue Mar 20, 2018 11:36 am

Re: Controlling 16-channel relay with ease

Postby Deouss » Mon Mar 04, 2019 3:16 pm

Good idea - use the IO expander. However I wonder how many pins are needed for expander.
With multiplexer there are 6 mux pins plus 3.3VCC because mux ground goes to the relay board.
SPI would be only 2 pins less I think and MCP23017 I2C total 2 pins - best choice.
But code complexity for multiplexer is ridiculously simple. Just few lines of code)

mikemoy
Posts: 391
Joined: Fri Jan 12, 2018 9:10 pm

Re: Controlling 16-channel relay with ease

Postby mikemoy » Tue Mar 05, 2019 1:06 pm

However I wonder how many pins are needed for expander.
4 pins. Power, Gnd, SCL, SDA. Those 4 pins gives you 16 I/O.

It is true that the code is simple for the other IC. However, once you have the code its just as simple to call it and change I/O. Not to mention that if you need more I/O, say another 16 you arent going to use any more pins for the next IC.

Deouss
Posts: 386
Joined: Tue Mar 20, 2018 11:36 am

Re: Controlling 16-channel relay with ease

Postby Deouss » Tue Mar 05, 2019 3:40 pm

So I had this idea that with one 16c multiplexer we could control 4 another 16c multiplexers using 4bits x 4 as inputs.
Going further because esp is 32bit we could control 128 channels with only 16bits of two input multiplexers serving 256 channels!
There is of course a way of accessing unlimited number of channels with those 4bits but speed is lost.
The rule is 5 multiplexers can control 16 x 4 channels and that sounds like some led panel project)

mikemoy
Posts: 391
Joined: Fri Jan 12, 2018 9:10 pm

Re: Controlling 16-channel relay with ease

Postby mikemoy » Fri Mar 08, 2019 2:03 pm

Ya, if your looking for a led project you should check out the IS31FL3731. you can control 144 leds with just I2C.
http://www.issi.com/WW/pdf/31FL3731.pdf

vigilantis
Posts: 1
Joined: Sat Jun 15, 2019 5:10 pm

Re: Controlling 16-channel relay with ease

Postby vigilantis » Fri Jun 21, 2019 11:14 am

Deouss wrote:
Sun Mar 03, 2019 12:54 am
I was playing with the 16-channel relay that is widely available for IoT projects and it turned out a great tool.
To reduce number of pins I used also very polpuar cheap 16C multiplexer (HP4067)

Here is a video from part of my project:

https://www.youtube.com/watch?v=0oiGmXb5Kuc

I plan to add code controlling it via WiFi and publish on github soon )
Hi Deouss,

I have viewed the youtube video and was wondering if you would be prepared to share the pinout configuration and code with me as I am an absolute newbie and looking for a basic starting point?

Who is online

Users browsing this forum: No registered users and 9 guests