Actuating a 12V Valve with a relay and Arduino

Thread Starter

AdhesiveLamb

Joined Feb 16, 2019
19
Having some trouble getting a valve to properly actuate using a 12V relay. The LED indicator on the relay lights up when I send it a signal but the valve doesn't do anything. The valve will actuate when I hook up the leads but is unresponsive to the relay. I've tried switching the positive/ negative leadss.. Tried using normally open and normally closed on the relay and every other configuration I could think of. Any help is appreciated!
 

Attachments

djsfantasi

Joined Apr 11, 2010
9,163
Show us a complete schematic if possible. Particularly the connection to the Arduino.

When you say 12V relay, do you mean that the coil is activated at 12Vs? Or that the contacts are rated at 12V?

The Arduino outputs are at most 5V. This will/may be insufficient to activate the relay. You’d need a transistor or MOSFET to switch 12V to the coil.

If your unfamiliar with the Arduino, you may be confused by the fact that it’s power supply can be 12V. However, it has an onboard voltage regulator to bring that down to 5V. That’s the maximum it’s GPIO pins can supply. Further, they can only supply a max current of 20mA. Relays often draw more than that. Another reason why you need a transistor or MOSFET driver.
 

bertus

Joined Apr 5, 2008
22,277
Hello,

It looks like that the relaysboard has optocouplers as inputs.
There must be an external powersupply connected for the relays.
As said, please post the datails of the ralays board.

Bertus
 

Thread Starter

AdhesiveLamb

Joined Feb 16, 2019
19
I'm powering the relay with the 5V output on the Arduino. I'm also powering a bluetooth module with the same 5V pin. I'm not sure if this would cause any problems. The valve is being powered with a 12V battery pack. And it actuates when I hook it up to the batter as shown in the images.
 

Thread Starter

AdhesiveLamb

Joined Feb 16, 2019
19
Ahhh, I think I see what the problem is - or at least one. That is a 12V relay board. You need to have the connection to 12v DC+ and DC- and then the Arduino can operate them. They use optoisolators, but this board is not with 5v relays.


At least that it was it looks like to me.

I tried hooking up the relay to a 12V supply but now the LED input indicator won't turn on when I send it a signal
https://imgur.com/a/Th45kXo
 
Thanks for the all the replies.

Here's some more pictures of my full setup: https://imgur.com/a/N2iqSoG

The LED indicator comes on which leads me to believe the Arduino is interfacing with it properly
That is deceiving you. Look at the relays, they are clearly marked 12V. That is what they require to operate. You are not giving them 12V and they are not operating.

The link that you posted comes up with a similar board, but one with 5V relays. It has an option on the page to switch to your board, which has 12V relays.

I am sure that all three of us @bertus and @djsfantasi can see this and I have to admit that they both picked up on it while I was still looking.
 
I tried hooking up the relay to a 12V supply but now the LED input indicator won't turn on when I send it a signal
https://imgur.com/a/Th45kXo
Hang on and please go a little slower. There has to be documentation on the board. Off hand, I would say that the Arduino GND has to be connected to the battery gnd, but these are very common boards with lots of people using them and I don't have it in front of me.
 

bertus

Joined Apr 5, 2008
22,277
Hello,

The ground connection of the Arduino also must be connected to the DC- input of the relays board.
Without that connection, you will have a floating input.

Bertus
 
OK, as far as I can tell, this is how you have to hook it up. Be forewarned, I can't see a schematic.

In addition to how you have the battery hooked up in your first picture. Add a connection from +battery to DC+ on relay board. Add a connection from -battery to DC- on relay board. Add a connection from Arduino GND to DC- on relay board.

As @be80be noted, set the jumper switchs for how you want to Trigger the relays (Hi/Lo) from the Arduino code.
 
I would love to see a schematic. I can see the board has optoisolators but I wonder if they are being used - I have seen stranger...

edit to elaborate. If they had used optoisolators the way I would think they would be used, you would not have to tie Arduino GND to the external supply GND. Instead, there would be a terminal for Arduino GND and you would have the "proper" isolation - @bertus or anyone - am I seeing that correctly?
 

Thread Starter

AdhesiveLamb

Joined Feb 16, 2019
19
Are you saying that just connecting Arduino GND to DC- on the board made it so the relays now operate from the Arduino - that is, that the Arduino is operating those relays with 5V? That would be good information to know.
The relay is operating from the 12V battery. But yes I just added a wire between the Arduino GND and the DC- on the relay.
 
Top