10
\$\begingroup\$

I have a board with 8 relays on it that will take 5v from my arduino and the relays will flip on my 120VAC devices.

I'm not an electrical engineer by any means so I am wondering how to wire my 120V devices into the relays, and how to wire the 5v coming from the arduino to the board.

This is a picture of the whole board, and I wrote the pins names below the pins:

image of board with 8 relays

This is a picture of the output of the Relays: 120V terminal connections A close up of the control logic.

Close up of the control logic

\$\endgroup\$
15
  • 3
    \$\begingroup\$ Do you have a manual for this thing? \$\endgroup\$ – Majenko Sep 1 '11 at 18:39
  • 7
    \$\begingroup\$ If you are not sure about how to wire this device, and you are not familiar with using datasheets and schematics, I would be extremely careful doing any project that involved 120v mains. To be honest, I'd avoid it altogether until you have got the basics down by doing some safer electronics projects first. \$\endgroup\$ – Jim Sep 1 '11 at 19:21
  • \$\begingroup\$ also - to get a good answer, you'll need to post the exact name of the relay module and probably a link to the module's datasheet too, to make sure that we're talking about the same thing when we advise you how to wire it up. \$\endgroup\$ – Jim Sep 1 '11 at 19:24
  • 2
    \$\begingroup\$ Agreed, a manual/schematic is definitely needed to lessen the possibility of giving bad advice with high voltages involved. \$\endgroup\$ – Oli Glaser Sep 1 '11 at 19:43
  • \$\begingroup\$ No manual or schematic sheet for this product. I bought it off of amazon and I think it was soldered by hand. The company that makes the relays is chinese and has poor online support. I have worked with 120v before so I can somewhat safely work with it. I'm mainly just wondering why there is a VCC on this? Shouldn't I just have to put in 5v to the one end of the relay and it magnetizes the coil to flip the switch? \$\endgroup\$ – Luke D. Sep 1 '11 at 21:56
7
\$\begingroup\$

I found this picture whilst surfing (the top is chopped unfortunately):

Relay board picture

... along with this shopping link. It looks very similar to what you have in your hands.

In this case, the JD-VCC supply is a stiff source to provide the relay coil current, which needs a common return with the Arduino VCC supply. If you have a multimeter, you should be able to verify if the same connection exists on your board. (Your board appears to have VCC and JD-VCC jumpered.)


RMc added comment:

(1) If Vcc and JD-Vcc are connected the input and output are not isolated and the optical isolator diodes can be powered from the Arduino supply if desired (if 5V is available).

(2) If Vcc and JD-Vcc are not connected a separate 5V supply can be used on the output side and complete optiocal isolation of input and output cam]n be achieved if the Arduino and output grounds are not connected.

(3) In (2), if separate supplies are used but grounds are commoned there is not full isolation but many output disasters are still survivable as long as ground is "stiff".

(4) Note that inputs need to be driven LOW (to ground) to activate, not high (+5V) as I suggested in my answer.

(5) Input levels need to be 5V as they must drive opto diode (1.5V maybe) and a series LED (1.7V maybe) for over 3V drop before resistor drop in included.

(6) Input current needs to be high enough to drive opto well enough to activate output stage. How high this is depends on relay current and Q3 current gain and opto CTR (= Current Transfer Ratio = current gain in to out) but say 1 mA drive, 50% CTR (typical cheap opto), beta (current gain) of 100 = 1 x 1/2 x 100 = 50 mA relay current per mA of opto drive. R5 will set opto current at 5V drive to about (5-3)/R5 = 2/R5 amp or 2000/R5 mA. Most micricontroller pins are liable to easily be able to sink enough current to groud to drive this OK.

(6) Current drive to Q3 in (6) will also be limited by R6 but CTR etc are probably limiting factors.

(7) YMMV :-) ! (but probably not).

Summary:

JD-VCC = 5V (probably) for relay drive

Connect JD-VCC and VCC and power with +5VDC if isolation not wanted.

Use separate 5VDC supply for JD-VCC if true opto isoaltion wanted.

Input drives are active low and need to be 5V. 3V3 almost certainly won't work well or at all.

\$\endgroup\$
2
  • \$\begingroup\$ Ahhh, thanks for that, makes sense now. That's why there are 2 VCCs as the inputs are open drain. Also the 2 grounds visible make sense. I thought it was as all uC related power can be kept behind the optos. I'm probably missing something, but why do you think JD-VCC needs a common return with the Arduino supply? \$\endgroup\$ – Oli Glaser Sep 3 '11 at 2:54
  • \$\begingroup\$ @Oli Glaser - You are correct, JD-VCC does not need to be shared with the arduino. \$\endgroup\$ – Connor Wolf Sep 4 '11 at 6:28
1
\$\begingroup\$

Answer based on examination of the photo. I started writing this before but held off due to no schematic and not wanting to give bad advice.
This is still the case, I don't recommend this is used for mains voltage unless you are absolutely confident you know exactly what is going on, and that everything is as it should be, so I would use this for something else with and buy another with detailed documentation for high voltage purposes. It can be tested/used with safe voltages though, so here are some guesses to help with that, since there doesn't look to be a manual available.

The relay coils will require more current to drive them than your arduino pins can supply (or right on the limit so not ideal) and in any case are not connected directly to the inputs.
This is almost certainly what the transistors (Q1,Q2,etc) are for, and need a supply. These are likely controlled by what looks like opto-isolators, which will also need a supply on one side. These and the relay coils are what will need the VCC and/or VCC-JD, which can therefore be kept isolated from the Arduino VCC, which is not connected, only its ground and inputs (which drive one side of the optos and likely used to light the LEDs present)

What I am not sure about (i.e. even less sure than the rest) is what looks like a yellow jumper on the right hand side (the GND, VCC, JD-VCC) but this maybe something to do with the VCC options, so VCC can be the same as VCC-JD.

Anyway, if I'm right, you would connect your arduino board ground to the pad with the inputs on the left, and digital outs to the INx pads. Connect another supply to the VCC, probably 5V-12V (voltage will be written on relays, looks like 5V from what I can make out - type part number into google and check datasheet), and toggle the digital outs to switch the relays. You should be able to follow the traces to see where the power for the transistors is coming from, and what the jumper (if it is one) does.

You could run a test with e.g. 5V for all VCCs and wire as suggested, no need for anything connected to relays, you should hear them click if activated. Even if it doesn't work you are unlikely to damage anything.
Further close up photos of the board (back also) and part numbers would probably help to clarify some points.
Please don't do anything dangerous based on the above, as I reserve the right to be utterly wrong about all of this :-)

\$\endgroup\$
1
\$\begingroup\$
  • JD-VCC: 5V
  • VCC (on 3-pin header): None
  • GND (on 3-pin header): GND
  • VCC (on input header): 3v3
  • IN1, IN2, etc: Digital outputs
  • GND (on input header): GND

(According to http://wiki.netduino.com/SainSmart-5V-Relay-Module.ashx)

\$\endgroup\$
1
  • \$\begingroup\$ Please could you add a summary of the pointed page so that the content remains if the link goes dead? \$\endgroup\$ – clabacchio Apr 23 '13 at 7:29
1
\$\begingroup\$

I have a very similar board.

Use separate 5V power to run the relays:
1) Jumper on VCC/JD-VCC
2) +5V [external] power to VCC on main header (the larger one that also has the IN1-IN8 pins)
3) Connect external power and Arduino to common ground
4) Connect the [common] ground to the GND pin by the jumper

now you can use the Arduino to set the [IN1-IN8] pins to ground to activate relay / LEDs. (for mine, and I expect yours ... settings the INput to ground (LOW) activates the relay. Setting to HIGH (or disconnecting from ground of course) turns it off.

NOTE: this setup needs a common ground between the power and the Arduino.

\$\endgroup\$
0
\$\begingroup\$

As Kortuk advises, "playing" with AC mains is dangerous if you are not certain of what you are doing.

In this case the output functions APPEAR clear but the responsibility is yours.

Assume mains has "Live" and "Neutral" leads. Connect:

  • Live to left connector terminal in diagram

  • Right connector terminal to one side of load.

  • Other side of load to Neutral

enter image description here

Driving board:

  • I do not know what Vcc should be - probably 5 Volts but ???

  • I do not know what JD-Vcc means.

  • I do not know what level Vin is.

BUT

Proper voltage +ve to Vcc.
Ground to ground.
Vin to IN1 etc (possibly 5V OK).

YMMV.

\$\endgroup\$
1
  • \$\begingroup\$ I assume I have advised that in the past at some point, I was surprised to see my name. \$\endgroup\$ – Kortuk Sep 2 '11 at 6:10
0
\$\begingroup\$

think of the 3 pins of the relay module as a switch 1 being common and the other 2 being the state so if module 1 channel 1 state 1 is always on unless active lo or high depending on the setup and the second state will be the alternative state so it maybe always off unless active hi or lo depending on the setup so when your playing with ac power best thing is to only intend on using either the ac + or ac _ but not both as this will cause a short so use either + or - always work with power switched off and then test with multimeter set to ac (set range to correct ac) and test there’s no power before working on this but hope this helps!

\$\endgroup\$
0
\$\begingroup\$

Change r14, r12, r11, r9, r7,r5, r3, r1 from 10k sm resistors to 4.7K ohm

Run separate power, remove jumper ( if present) from power option connection 12 volt relays, so connect JD-VCC to 12V

problem solved for me anyway.....

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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