I have a 16 channel relay that will basically manage 16 different contacts. However, each channel in the relay needs to be controlled by an individual Arduino. So in total I would have 16 different Arduino boards that will each control a single channel in the relay. Is this possible? If so, how do I make the conenctions? I tried it earlier using several arduinos and connecting their ground wires together but did not seem to work, the relays remained energized. I am using the SAINSMART 16-Channel 12V Relay Module

  • That board is intended to allow one micro-controller to control 16 relays. Why not get 16 single relay boards for your 16 arduino's? Also, having a common ground, plus connecting each arduous to a different relay should have worked.
    – esoterik
    Aug 6, 2018 at 21:21
  • @esoterik too expensive and the parts will take longer to arrive. What do I connect to the 5V input though? A separate power supply or can just one arduino power it?
    – lomas09
    Aug 6, 2018 at 21:23
  • you colud have one supply powering all the arudinos, and the board yes.
    – esoterik
    Aug 6, 2018 at 21:26
  • @esoterik so I have one arduino powering the relay module and hooked up to channel 1. Another arduino hooked up to channel 2. Only channel 1 seems to work. (both arduinos are grounded together)
    – lomas09
    Aug 6, 2018 at 21:39
  • Why do you need 16 Arduinos???
    – Juraj
    Aug 7, 2018 at 5:03

3 Answers 3


Looking at the schematic, here are some points to be kept in mind when using this relay board:

  • The relay board should be powered through the 12V connector
  • The relay board has its own 5V regulator
  • The optocouplers are attached in "reverse"

So, the external connections should be

  • Connect all the arduino grounds together, and connect them to the board ground
  • Do not connect any +5V wire together
  • Connect arduino 1 to IN1, arduino 2 to IN2 and so on
  • Writing a HIGH value on the INx pin will result in the relay to be de-energized (so contact goes in NC position), writing a LOW value on INx pin energizes the relay (so contact goes in NO position)

If making this connection the board does not work as expected, try to detach all the arduino boards and manually shorting IN1 and +5V, IN1 and GND, IN2 and +5V, ...


You could think of using 16 Arduino's sending messages (or a control signal) to a Master Arduino which controls the 16 relays.

You can use a protocol (like ModBus, I2C). Or you can connect each Arduino to a dedicated input pin of a 16:1 Multiplexer and let the Master check all 16 lines one by one to check which relay need to be enabled.

This way you can even add more intelligent logic in the Master if needed.


You wrote that joining Arduino ground together didn't work.

This leads me to believe that you didn't do the most important connection. You need to have each Arduino ground connected to the Relay Module ground. Usually this requirement is fulfilled, because people power all devices from the same power supply.

Without that Relay Module inputs are "floating", and their states are random.

  • the relay's ground is also connected to all of the arduino's ground
    – lomas09
    Aug 7, 2018 at 13:43
  • and is there one 5 V power source?
    – Juraj
    Aug 7, 2018 at 13:48
  • each arduino has its own power source, and the module has a dedicated 12V power supply
    – lomas09
    Aug 7, 2018 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.