Go Down

Topic: Flyback diode required for relay board and 12v solenoid? (Read 9937 times) previous topic - next topic

Xerosene

I'm making a simple watering system that operates a solenoid valve via a 5v relay connected to a 12v battery.

1. Do I need a flyback diode on the solenoid?
I'm guessing that the relay will protect the Arduino from flyback and noise, but it wouldn't hurt to add a diode to protect the relay. Solenoid will be open for 2 minutes every 2 hours. According to specs, the solenoid uses 250mA when activated.

2. Is the earthing correct?
Or should I earth the relay direct to the battery instead of the Arduino?

3. (Bonus question) What does the jumper on the relay do?
See image at bottom of this post. The jumper is not shown clearly in the image, but it's sitting across pins 2 and 3. This is the 5v relay board I'm using.


Link to larger images.




MarkT

Always use a free-wheel diode with an inductive load in a DC circuit.  The relay contacts
will arc loads if you don't and may be rapidly destroyed or weld shut.\

Run separate wires from the battery to the relay and to the Arduino supply, ie use a star-
ground arrangement for minimal interaction / interference.

Often the jumper is removed so the circuit is opto isolated, but that requires a separate
5V supply for the relay board.  With the jumper present there is no isolation (but
the relay provides that), so the Arduino supply powers the relay board transistor and
relay winding.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

larryd

Here is a 4 relay PCB illustrating the jumper.


However, as Mark said the relay supplies isolation.
Unless you have a second 5v PS, leave the jumper.


.
No technical PMs.
The last thing you did is where you should start looking.

Xerosene

Thanks for the quick replies.

I'll definitely put in a diode. Just to clarify, in this situtaion the diode is there to protect the relay, not the Arduino right?
What is the correct value diode to use?

Run separate wires from the battery to the relay and to the Arduino supply, ie use a star-
ground arrangement for minimal interaction / interference.
Is this necessary, or just the optimal way to do it? The relay is 5v, so can't go direct to the battery.

If I'm not going to run the relay directly off the battery, should I run the relay ground to the battery, or to the Arduino?

larryd

The diode protects the contacts and keeps noise spikes from causing problems with the Arduino.

Use separate (star) power leads to keep devices from interfering with each other.

Necessary if you want things to work.
.
No technical PMs.
The last thing you did is where you should start looking.

larryd




.
No technical PMs.
The last thing you did is where you should start looking.

Xerosene

Use separate (star) power leads to keep devices from interfering with each other.

Necessary if you want things to work.
I'm getting more confused.
So instead of getting the 5v for the relay from Arduino (as in the pic), I have to get 5v for the relay from the battery?
Or are you just talking about keeping the 12v that runs through the relay separate?


---
I've got a fuse sitting on the bench  ;)  I just forgot to put it in my pic.

larryd

I'm getting more confused.
So instead of getting the 5v for the relay from Arduino (as in the pic), I have to get 5v for the relay from the battery?
Or are you just talking about keeping the 12v that runs through the relay separate?


---
I've got a fuse sitting on the bench  ;)  I just forgot to put it in my pic.
12v from the battery goes to the DC to DC buck converter which creates 5 volts.

The Arduino and the relay module get 5 volts from the output of the converter as shown.

The green terminals on the relay module are basically a switch connection.



Do you have a link to the relay module?
.
No technical PMs.
The last thing you did is where you should start looking.

Xerosene

I didn't notice that you'd moved the 5v lines to the buck converter ... makes more sense now!
I think all my build questions are answered now. Thanks.
I'll hook it up tonight and see what happens.

Link to relay is in first post. Not a heap of info there...
http://www.chinalctech.com/index.php?_m=mod_product&_a=view&p_id=1005

The relay came in an Arduino starter kit.
I have a few other similar relays, but they all have LEDs - which I don't want for this project.

Xerosene

One last thing...

Do I put the fuse on the 12v into the relay, or (most likely) right back at the battery before the buck converter as well?



OR



MarkT

Put the fuse on the battery lead - its there to prevent wiring catching fire, not really to protect your electronics(!)

The opto-isolation thing is available on most relay drivers, you don't have to use it, so don't worry about
it.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

soeren

this might be a stupid question, but how come such a simple thing as a flyback/freewheel diode isn't already installed in a relay driver package like the one OP is using here? I see there's already a diode on the relay, but that must be something else then?

larryd

They do make relays with diodes incorporated inside.


.
No technical PMs.
The last thing you did is where you should start looking.

JohnLincoln

They do make relays with diodes incorporated inside.
Which means that you have to be careful which way round you connect it

soeren

how do you know if your relay has that already on it?

 i bought this one https://www.elextra.dk/details/H37526/5v-relaemodul-m-optokobler-til-arduino-8-kanals but it doesnt seem to have it already

Go Up