I really hoped I'd be able to solve this myself, but I'm trying to drive a DPDT 2coil latching relay with the arduino. The relay I'm working with is this one.
The idea of the project is to use (say) pin 3 to switch one set of contacts on, then (say) pin 4 to switch to the second set of coils... The program will eventually toggle between contacts continuously.
I'm new to arduinos and electronics in general, so I did some research and found this link which is what I've based my circuit off - essentially I've built two circuits almost identical to this, except that I've joined them together with a common 12V+. (See the image below). I also have an LED on each circuit before R1 to let me know which circuit has power.
Now, I'm posting here so obviously it didn't work. I'm not too concerned about diagnosing my existing circuit, I assume I've done something fundamentally wrong but if someone could offer guidance on a circuit to drive a similar relay I'd greatly appreciate it - so far my searching has been fruitless.
The advice would be to do what you did, as far as we can tell. It should work, so the reason it isn't working must be something you haven't shown us (or you have a faulty component).
So draw a schematic. Hand drawn on paper is fine. But you must show every connection, label every pin and give every component model/value. Also post your sketch in case that is the source of the problem, using code tags. Don't forget to show those leds and how you connected them.
OK, well I got it working... I just don't know why it's working
I flipped the transistors around (collector to ground), and fiddled with the resistor values (I didn't keep track of values so it might be back where I started)...
Anyway... Here's the finished circuit with two LEDs driven off the relay.
Next step is to make another identical circuit which will allow me to control 4 solenoid valves...
The program will eventually toggle between contacts continuously.
I see what you mean by that now! How long do you expect the relay to last? At that rate, not very long I think.
The common use case for that kind of relay is in low power circuits where there will be long periods between the relay switching. What are you using the relay for in your project?
GerrardHickson:
I flipped the transistors around (collector to ground), and fiddled with the resistor values (I didn't keep track of values so it might be back where I started)...
Most probably you confused the transistor pins, and now have the emitter on ground.
I don't understand the use of the LEDs, before R1, because a short pulse should be sufficient to toggle the relay, so that the LEDs should be almost off all the time.
PaulRB - component life isn't my biggest concern, i fully expect to replace the relays at some point. They'll be used to switch solenoid valves on and off at the same rate so, but the whole project is for a backyard spec steam driven motor using an old compressor. So it's a blend of tech and red neck... call it red teck maybe?
DrDiettrich - perhaps... but i checked my circuit against plenty of diagrams.... the pin going to ground is the one on the left if the flat of the transistor is facing upwards.
The point of the LED before R1 was as a witness so I could see whether the circuit is receiving a pulse. My sketch sends a high signal constant until it's time to send low... so I'm not just sending a short pulse.
Hi,
As PaulRB has voiced, if you are just switching the latching relay back and forth faster than say once every 5minutes, you are misusing them.
Why latching, if it isn't to save power, then use a normal DPDT relay and use the arduino to hold the relay ON and release it OFF.
You will find that if you are switching solenoids with this relay, then the contact size needs to be considered.
Please I just saw your video, can you post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hi,
Please note the Contact Data, Frequency of operation.
Under load 900/hr = 900/60 = 15/min = 15/60 = 0.25/second
Which converts to 1 every 4 seconds, for reliable contact stability and timing.
Do not forget to put back EMF diodes on the solenoids.
Also only buy a couple of those valves to test, as I don't think they will like the speed you want to operate them at.
The valve stems have inertia and the valve return is with a return spring, not a return solenoid.
Just thought I'd mention that its a requirement to operate the coil with a short pulse (use 30ms). Otherwise the coil very quickly overheats and you might notice an electrical burning odor emanating from the relay. I suspect using a flip/flop style energization scheme has already done damage.
Solid state relays may not work with DC, they may be AC only. They usually contain triacs. Your link does not seem to work, by the way. Solid state relays would be overkill, even of they did work, and are also not designed to work at those frequencies. What's wrong with my MOSFET suggestion? Are you sure your solenoid valves will even go that fast?
Fair enough... thanks for the advice.
Nothing wrong with the mosfet idea... i didn't see it at first... for the layperson, what makes the mosfet suitable?
The MOSFET I mentioned, and there are many similar models, is a high current, high voltage transistor. It can switch up to 16A @ 60V, so more than enough for your solenoid valves. It has a "logic level gate" so can be wired directly to an Arduino output (a low value resistor is a good idea but not critical) and will draw almost zero current from the Arduino, so you don't need an extra transistor like you do with a relay. A MOSFET can switch thousands of times per second if required and will never wear out (if correctly used). It makes no noise, uses far less battery power, is smaller, cheaper and simpler.
You will still need that flyback diode across the solenoid terminals.
I really hoped I'd be able to solve this myself, but I'm trying to drive a DPDT 2coil latching relay with the arduino. The relay I'm working with is this one.
The idea of the project is to use (say) pin 3 to switch one set of contacts on, then (say) pin 4 to switch to the second set of coils... The program will eventually toggle between contacts continuously.
I'm new to arduinos and electronics in general, so I did some research and found this link which is what I've based my circuit off - essentially I've built two circuits almost identical to this, except that I've joined them together with a common 12V+. (See the image below). I also have an LED on each circuit before R1 to let me know which circuit has power.
Now, I'm posting here so obviously it didn't work. I'm not too concerned about diagnosing my existing circuit, I assume I've done something fundamentally wrong but if someone could offer guidance on a circuit to drive a similar relay I'd greatly appreciate it - so far my searching has been fruitless.
Thanks in advance.
Why do you want to use dual coil magnetically latching relays? They are very expensive and their only use is to MAINTAIN one state or the other without the need for constant coil current.
Unless you plan a low current, battery powered Arduino that sleeps a lot and occasionally toggles the state of a relay, then goes back to sleep, I can't see why a latching relay is needed.
Krupski:
Why do you want to use dual coil magnetically latching relays? They are very expensive and their only use is to MAINTAIN one state or the other without the need for constant coil current.
Just read the post... I'm just using parts I had available.
PaulRB - thanks... I've ordered some MOSFETs, I'll give that a go... but it leaves me wondering why anyone would bother with the relay option...?