Trying to control 16 relays

I'm pretty new to the Arduino space and am trying to learn via a difficult project

One of the issues I am stuck on is that I need to be able to control a 16 -channel relay board with the Arduino but I don't have 16 pins to spare. I got a multiplexer with the understanding that this is how you accomplish the task, but when trying to program it I have discovered that you can only enable one at a time

Can someone confirm that this is correct?

I need to be able to turn on multiple at once. What can I use to accomplish this task?

What is the part number of the multiplexer?

I would use a MCP23017 16-Bit I2C I/O Expander. 16 digital IO pins using just 2 Arduino pins.

Here is one of many pages on how to use the MCP23017 with an Arduino.

I have one of these

That appears to be a '16 input to 1 output' analog multiplexor :frowning:

Try as mentioned or two 74HC595:

saars:
I have one of these

https://www.codrey.com/wp-content/uploads/2019/05/Analog-Mux-Demux-Primer-HP4067-Module-China.jpg

OK, that would work OK - if you only ever want one of the relays to remain actuated at any one time. Presuming the relay boards are "active low", you connect the "common" of the 4067 to ground and the 16 switch positions to the relay board.

Otherwise you get the correct part - the PCF8575 module or two PCF8574 modules or two 74HC595s. :grinning:

Or 2 x mcp23008 or 2 x mcp23s08 or 1 x mcp23017 or 1 x mcp23s17...