8-channel relay help/question

I have a question about why my 8-channel relay board isnt behaving as I expect.

First time messing with a relay before.. but I thought it was pretty straight forward (since I asked about before purchasing) in set-up.

Summary:

Arduino (UNO for testing)

8-channel relay board (SRD-12 kind, control 12v device from 5v Arduino signal)
https://www.ebay.com/itm/DC-12V-8-Channel-Relay-Module-with-Optocoupler-Relay-Controller-for-Arduino/223104693598

Ehcotech electric Solenoid

Currently just testing with a simple button press and toggle relay state.

I followed the top diagram and in scenario "A"...

nothing happens when I press the button (serial output is correct however..so the button itself is working..etc)

when I do scenario "B".. (ie; connect Arduino GND to the GND pin).. I -do- get a light and a 'click' by relay #1 (which is the only 1 I am testing with)..

HOWEVER... in scenario "B".. my solenoid is doing nothing? (I dont have any hose/lines or liquid connected to it).. but I would expect it to make some sort of noise is toggle/powered to allow the fluid to travel through???

Also.. should I be able to detect +12v on the screw terminals where my relay is connected?

How can I go about troubleshooting this?

Thanks!

Of course you won't see any voltage on the relay contact connections. They are uncommitted switch outputs. You are supposed to connect them to an external power source.

You need Setup “A”.

Current flow:

Sorry... I guess I -completely- misunderstood how/where the solenoid/valve is supposed to be connected in all of this I guess.

@larryd

If I am supposed to be using scenario 'A'.. (which I initially tried)..

why does the relay only 'trigger' (click) and the LED come on in scenario 'B'?

update:

  • So I connected +12v to the center terminal screw
  • Connected other terminal screw for NO (I believe) to one lead/wire on solenoid valve
  • Connected other lead/wire from solenoid to GND (from +12v source)

and now.. I -am- getting the solenoid to toggle..

BUT..

thats ONLY if I have the Arduino GND connected... which not how any of the diagrams say it should be?

What am I doing wrong?

I mean.. from the 'outside' (not the solenoid is wired correctly).. its works exactly as I expect it to.

Thanks.

"thats ONLY if I have the Arduino GND connected... which not how any of the diagrams say it should be?"

If there is no ground return path for the arduino control signal in the diagram, then I'd say the diagram is faulty. There has to be a return current flow path for the arduino signal.

zoomkat:
If there is no ground return path for the arduino control signal in the diagram, then I'd say the diagram is faulty. There has to be a return current flow path for the arduino signal.

Not necessarily, depending on how the optocouplers are wired. Generally those relay boards have the common connection for all the optocouplers connected to Vcc of the arduino, and the input pin is pulled LOW to active the relay.

Here is a typical schematic I found in another post:
OptoRelayChannelData-800.jpg

Now there is not really any reason the optocouplers could not be wired with a common ground, and a HIGH input activate the relay, but that seems to be uncommon, and there would be no need for the Vcc-JDVcc jumper, since the optocoupler input needs no power source.

xl97:
Sorry... I guess I -completely- misunderstood how/where the solenoid/valve is supposed to be connected in all of this I guess.

@larryd

If I am supposed to be using scenario 'A'.. (which I initially tried)..

why does the relay only 'trigger' (click) and the LED come on in scenario 'B'?

update:

  • So I connected +12v to the center terminal screw
  • Connected other terminal screw for NO (I believe) to one lead/wire on solenoid valve
  • Connected other lead/wire from solenoid to GND (from +12v source)

and now.. I -am- getting the solenoid to toggle..

BUT..

thats ONLY if I have the Arduino GND connected... which not how any of the diagrams say it should be?

What am I doing wrong?

I mean.. from the 'outside' (not the solenoid is wired correctly).. its works exactly as I expect it to.

Thanks.

We really need to see good images of your ‘actual’ wiring.

Yes you can connect the external GND to the Arduino GND but you then defeat the Opto-isolator.

Circuit “A” is what is needed, the current flow ‘Green’ is for the external cct., the ‘Yellow’ is the Arduino current flow.

"Not necessarily, depending on how the optocouplers are wired. Generally those relay boards have the common connection for all the optocouplers connected to Vcc of the arduino, and the input pin is pulled LOW to active the relay."

If the output of the optocoupler led goes to an arduino pin that is set low to ground, then that is a ground flow path. There is going to be a ground somewhere.

david_2018:
Now there is not really any reason the optocouplers could not be wired with a common ground, and a HIGH input activate the relay, but that seems to be uncommon, and there would be no need for the Vcc-JDVcc jumper, since the optocoupler input needs no power source.

This is consistent with the advice that switches used as input be connected to ground so that the supply voltage need not be taken out to wherever the switch is, with some potential risk of being shorted to ground. At worst if the input line shorts to ground it spuriously appears as if the switch is closed. :grinning:

It is also consistent with the use of "open-collector" logic.

zoomkat:
"Not necessarily, depending on how the optocouplers are wired. Generally those relay boards have the common connection for all the optocouplers connected to Vcc of the arduino, and the input pin is pulled LOW to active the relay."

If the output of the optocoupler led goes to an arduino pin that is set low to ground, then that is a ground flow path. There is going to be a ground somewhere.

You just have to be careful to not confuse people. When you stated

If there is no ground return path for the arduino control signal in the diagram, then I'd say the diagram is faulty. There has to be a return current flow path for the arduino signal.

a lot of people are going to take that to mean that the GND pin of the arduino needs to be connected to the relay board. There is NO "ground return path for the arduino control signal", the arduino control signal is the return path for VCC.

these relay modules are comprised of 3 separate parts.
#1) the contacts. these are totally isolated from the low voltage logic. The contacts can often handle line voltage AC power.
The reason for the relay is to get this isolation from the mains power. They act like a switch only. no power is sourced from them.

#2) the coil. The coil needs power, often around 100mA for each coil. Also the coil will dump a back voltage spike on the power and spike that power supply. The coil voltage is ALWAYS recommended to be a separate power source than your Arduino, especially for these multi-relay boards. and yes, these boards do have a back-diode to address the spike.

#3) logic. there is a semi-isolated circuit that often shares ground or power or both with the coils and your micro and yes, it needs a separate logic signal to your micro-controller.

Since the digital pin of your micro is only completing a circuit to light an LED inside of the opto-coupler, the current needed is calculated exactly like an LED and a dropping resistor may be needed.

so, the question is if you are to source the power for the opto, then a ground is required. and yes, that ground is connected to the power for the coils. There is not a true isolation between boards.
so, to source power, your digital pin output is HIGH and ground completes the circuit.

if your want to sink power for the LED, then you need to supply power to the relay module board.
This is often selectable with a jumper on the relay module. Provide power from the micro OR you can use the relay module board Vcc from it's separate power supply.
Using the module Vcc you are bringing the opto to ground to complete the circuit and you will need to have the grounds connected between your Arduino and the relay board to complete the circuit.

As you can see, if your relay module is 12v and you need to control an LED in the opto, and you are using the 12v module for Vcc, you will need to add a resistor.

It all boils down to creating and completing circuit to light an LED.

Whoosh! LOL..

I'm following some of it.. but then I read an argument against what I just read?.. (not trying to cause trouble, just trying to understand, and see what I am doing wrong............if anything now?)

As requested: (left as big image on purpose).. sorry the crappy image though (tried to brighten it up on photoshop)

Now remove the GND wire going to the Arduino.

Also place a reversed biased kickback diode across the solenoid coil connections.

What diode should I use?

Also.. thats what I have been saying.

if I remove the GND wire going to the Arduino.. it does NOTHING. Same results as reported above. No light, no click, no solenoid toggle (opening)

A 1N4001 to 1N4007 diode.

Okay, if it only works with the GND, we need to see a schematic of the relay PCB.

Or, you can trace out the traces and draw your own schematic.

With the power off, measure the resistance from the GND pin on long header to the GND pin on the short header.

I got it off ebay,.... so good luck with me finding a schematic for it! :slight_smile:

I can take a look and see if I can draw it out..

I will take my MM and take an R measurement between the 2 GND pins..

What am I looking for? Expecting? Anything?

If the cct/schematic is similar or the same as other like relay boards you will see 0 Ω.

If it is zero, that is why you should not connect it to the Arduino GND.

You only need to draw one of the eight relay circuits, with the two header connections.

"I got it off ebay,.... so good luck with me finding a schematic for it!"

Maybe post a link to what you got on ebay.

Should be this one:

[https://www.ebay.com/itm/DC-12V-8-Channel-Relay-Module-with-Optocoupler-Relay-Controller-for-Arduino/223104693598](http://" https://www.ebay.com/itm/DC-12V-8-Channel-Relay-Module-with-Optocoupler-Relay-Controller-for-Arduino/223104693598")