Go Down

Topic: Hooking up a solenoid to a relay (Read 3218 times) previous topic - next topic

konidias

Alrighty so before I go screw this up, I have the following:

Arduino Uno R3
SainSmart 8-Channel Relay Module
12v 2a DC power adapter
This 12v 1a solenoid: https://www.amazon.com/gp/product/B00HR8H38A/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

now I've wired up the relay module like this:



My question is... how do I now hook up the solenoid to the first relay?

konidias

Any help would be greatly appreciated!

756E6C

#2
May 12, 2017, 01:43 am Last Edit: May 12, 2017, 02:45 am by 756E6C
First, disconnect the wire from Arduino GND to relay board, not needed, connect 12V + to relay NO terminal, connect one solenoid wire to COM terminal, connect other solenoid wire to 12V -, relay is energized when you make the Arduino output pin LOW. You DO need a kickback diode across (in parallel with) the solenoid coil, cathode end (stripe) toward relay.

EDIT: I'm assuming you have a 12V relay board, not a 5V, if it's a 5V, take the 12V off of JDVCC and GND NOW!

konidias

I have this one:

https://www.amazon.com/gp/product/B0057OC5WK/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1

Which I thought was the same one from the diagram I posted... no?

It says 5v but then says "Equipped with high-current relay, AC250V 10A ; DC30V 11A".

So... what should I do here? Should I just hook it up to the 5v on the Arduino? Should I just have the jumper on the VCC/JD-VCC instead?

So just running through the solenoid hook up again:

1. Run a wire from COM to the diode+one solenoid wire.
2. Connect other end of diode to the other solenoid wire... then connect that solenoid wire to ground on the power supply.
3. Connect the live wire of the power supply to the NO terminal.

So then when the relay triggers, it closes the circuit and powers the solenoid? Right? The diode is there to prevent voltage damaging the board, if I'm not mistaken?

Thanks for the help though! I'm learning. :)

Just wanna make sure I don't need to put the 12v to the relay. Not sure why the diagram I found shows it going to those connections then...

Wawa

Is this for one solenoid, or for eight.
For one solenoid, a single logic mosfet with kickback diode would be enough.
A relay module complicates things. You need a dedicated 5volt/1Amp supply to power the coils.
Leo..

konidias

Is this for one solenoid, or for eight.
For one solenoid, a single logic mosfet with kickback diode would be enough.
A relay module complicates things. You need a dedicated 5volt/1Amp supply to power the coils.
Leo..
It will be for at least 4. I assume 4 would be wired the same way as 1... Each connecting to a relay and each having a diode run across them. None of them are going to be firing at the same time. They would alternate.

So if I'm not mistaken, I should power the arduino board separately... then provide 5v power directly to the relay module via the Ground/JD-VCC... meaning I don't need to run power/ground from the module to the arduino.

Then I'd use the 12v to power the connected solenoids. Oh, and of course run pins 1-4 to arduino pins.

Wawa

Yes, remove the jumper and connect a 5volt/1Amp (cellphone/tablet) supply to JD-VCC(+) and GND(-).
Connect Arduino 5volt to VCC (on the long row), and DON't connect Arduino ground to the relay module.
Joining grounds disables opto isolation.

The relay contacts and 12volt solenoid supply is a different circuit.
Use diodes across the solenoids.
Leo..

konidias

Yes, remove the jumper and connect a 5volt/1Amp (cellphone/tablet) supply to JD-VCC(+) and GND(-).
Connect Arduino 5volt to VCC (on the long row), and DON't connect Arduino ground to the relay module.
Joining grounds disables opto isolation.

The relay contacts and 12volt solenoid supply is a different circuit.
Use diodes across the solenoids.
Leo..
Thank you! Gonna give this a go soon. Your help is greatly appreciated! :)

konidias

Worked great on the first try, thanks everyone for the assistance! :)

Wawa

In void setup(), digitalWrite a HIGH to the relay pin before you set the pin to OUTPUT with pinMode.
That stops the relays from chattering during bootup.
Don't use pin 0, 1, and 13 for the relays.
Leo..

Go Up