I'm pretty familiar with microcontrollers, but I just got new 12 V 8 channel relay module and I'm not sure how to connect it. Maybe some of you know this model and could help me with corrrect wiring.
Take a look at the attachments.
I guess VCC and GND are just 12 V and ground, but I wonder what to do with COM in this case?
Then, to operate it I'd use arduino digital pin to trigger one of IN pins.
Hardware:
12 V power supply for:
Arduino Mega 2560 R3
8 Channel Relay Module (SRD-12VDC-SL-C)
I'd like to trigger one of relays using digial pin 11 between HIGH and LOW.
OK, that photo is sufficiently detailed to allow me to see to what the "COM" connects, and it connects to the anode of an indicator LED.
So you connect COM to the 5 V on your Arduino and you pull an "IN" LOW to activate a relay.
While the relay module (that is, the relays themselves) operates on 12 V, You will also need a 5 V power supply for your Mega 2560 if you propose to connect other devices to it that require 5 V.
Similar circuit, ignore the "Jumper".
Well, you may get away with it, but the on-board regulator of the Mega 2560/ UNO/ Nano/ Leonardo etc. has negligible heatsinking and is really little more than a decoration.
A switchmode "buck" converter powering the "5V" pin (except when the USB port is connected to a PC) would be more reliable.
Looks like you have the 12V version of this board where you would connect a "Relay 12V Power Supply". It would be good to take advantage of the opto-isolation feature, but they show a connection scheme that shorts out this feature. Specifically, its the GND connection to Arduino that cripples opto-isolation.
I wonder if the relay board would work fine and provide full opto-isolation if the Arduino GND connection were removed.
The opto isolators are there on the board (the 4-pin ICs) - its a shame not to utilize them.
The only connections to Arduino should be:
A wire to COM and a wire from each "In#" to an output pin, if wired for "LOW true" COM to be connected to Arduino Vcc, else to Arduino GND. DO NOT connect BOTH Arduino Vcc AND GND to the relay board!