Using 12V for the relay is a good idea.
The ULN darlington drivers are safe. But using optocouplers also helps to avoid common ground between the RPi 5V supply and the relay power supply.
As you probably will need port expander chips like MCP23017 or MCP23S17 for the 16 relay * dual coil = 32 control signals, you could place optocoupler between the RPi and the MCP. SPI is quite simple as you do not need to read from the MCP23S17, but I2C needs more sophisticated solution (1) A 12V down to 5V regulator on the relay side could provide the 5V VCC for the port expanders and isolation logic.
But looking to the effort needed for this setup: 16 relay, line drivers, port expander, isolators, connectors for the relay contacts, 12V power connectors and a PCB for all this, it is perhaps less expensive to buy a ready to use 16channel relay unit (2).
(1) https://www.nxp.com/docs/en/application ... N10364.pdf
(2) https://www.waveshare.com/catalogsearch ... 6-Ch+Relay
The ULN darlington drivers are safe. But using optocouplers also helps to avoid common ground between the RPi 5V supply and the relay power supply.
As you probably will need port expander chips like MCP23017 or MCP23S17 for the 16 relay * dual coil = 32 control signals, you could place optocoupler between the RPi and the MCP. SPI is quite simple as you do not need to read from the MCP23S17, but I2C needs more sophisticated solution (1) A 12V down to 5V regulator on the relay side could provide the 5V VCC for the port expanders and isolation logic.
But looking to the effort needed for this setup: 16 relay, line drivers, port expander, isolators, connectors for the relay contacts, 12V power connectors and a PCB for all this, it is perhaps less expensive to buy a ready to use 16channel relay unit (2).
(1) https://www.nxp.com/docs/en/application ... N10364.pdf
(2) https://www.waveshare.com/catalogsearch ... 6-Ch+Relay
Statistics: Posted by ghp — Fri Jul 11, 2025 4:14 am