How to drive an AC relay off the Netduino?
#1
Posted 19 December 2011 - 04:55 AM
#2
Posted 19 December 2011 - 05:13 AM
The circuit shown is right to drive a relay, no matter whether your load is DC or AC. However, the relay must be targeted for a reliable and safe usage on high voltages (110VAC), as long as relatively high current (some Ampere).
The problem is just on the pump side, that is the relay contacts. Since a pump is a "coil" (i.e. a magnetic machine), it works as an inductor.
What's the problem?...The problem is when the contacts open.
Practical rule: an inductor "tries" to preserve the current flowing through it, by raising the voltage across its leads.
Thus, as soon the contacts open, the pump current will cease. However, since it's an inductor, it will raise the voltage (even kiloVolts), so that a spark easily happens between the contacts. This spark discharges all the magnetic energy, and the process is gone.
To solve this, you should place a capacitor across the contacts. Upon the pump specs, the capacitor can vary from 0.1uF to some uF.
In any case, it must be targeted for *at least* 250V, and it *cannot* be electrolytic or tantalum (i.e. polarized).
I'd suggest to ask your reseller.
Cheers
- dougY and Paul Newton like this
#3
Posted 19 December 2011 - 08:28 AM
- Paul Newton likes this
#4
Posted 19 December 2011 - 09:42 AM
Hello Reactive.
The circuit shown is right to drive a relay, no matter whether your load is DC or AC. However, the relay must be targeted for a reliable and safe usage on high voltages (110VAC), as long as relatively high current (some Ampere).
The problem is just on the pump side, that is the relay contacts. Since a pump is a "coil" (i.e. a magnetic machine), it works as an inductor.
What's the problem?...The problem is when the contacts open.
Practical rule: an inductor "tries" to preserve the current flowing through it, by raising the voltage across its leads.
Thus, as soon the contacts open, the pump current will cease. However, since it's an inductor, it will raise the voltage (even kiloVolts), so that a spark easily happens between the contacts. This spark discharges all the magnetic energy, and the process is gone.
To solve this, you should place a capacitor across the contacts. Upon the pump specs, the capacitor can vary from 0.1uF to some uF.
In any case, it must be targeted for *at least* 250V, and it *cannot* be electrolytic or tantalum (i.e. polarized).
I'd suggest to ask your reseller.
Cheers
Thanks Mario. The engineers already use the pump manually, so I'm sure that they've already implemented something to cater for the induction problem... or were you referring to the reason why I need a diode and transistor?
Hi Reactive, Mario
I think Reactive's query is more about AC and DC, as he is not sure he can drive an AC circuit with a DC control voltage.
The answer is that you can drive an AC pump with a DC control voltage, because a relay is actually two electrically isolated circuits. One circuits switches a switch in the other circuit but no current flows between them.
One circuit you could call the coil circuit, Reactive needs to use a Relay with a dc coil as he is going to turn the relay on and off with DC coming from the Netduino. Use the famous diagram, it works. Anything Driven off the Netduino will always use a DC relay.
The other circuit is the load circuit, the relay's part of which is just the equivalent of an on/off switch. for Reactive he should make sure that the relay can switch 110v AC at the pumps rated current.
Reactive you don't need an AC relay you need a DC relay(5 or 12 volt). The difference is on the coil side.
Both sorts of relays can switch both AC and DC loads but be aware that the voltage and current ratings for the load will be different and so each relay should come with ratings for both AC and DC loads.
Very helpful, thanks Magpie. So, all I need to do is get a 5VDC SSR which switches to 110VAC, and then just drive the digital pin high whenever I want the relay to switch?
#5
Posted 19 December 2011 - 10:02 AM
#6
Posted 19 December 2011 - 12:45 PM
#7
Posted 19 December 2011 - 01:59 PM
Hi Reactive
Firstly I must own up, I have never yet used an SSR so my experience is zero, but I have recently bought 2 so that will change.
SSR's (Solid State Relays) tend not to be as good for switching inductive loads, such as pumps and motors. I think a normal electromagnetic relay would be your best bet. 5volt relays wont be as common for relays with high current switching capability, so If you power your netduino off a 12 volt supply you can grab the 12 volts from the netduino itself and use a 12 volt relay. The 6th pin next to the two ground pins Vraw? . This will wire into the relays.pdf circuit as Relay Power V+.
Use the diode in the circuit.
Magpie, what do I do when the 12V relay is DC but I need to switch to AC? And do I need the transistor from the diagram? I'm also not very sure how I wire up the circuit with the digital output pin... or do I get to control the 12v vraw pin?
#8
Posted 19 December 2011 - 02:26 PM
Also, I've read that I need to use transistors and diodes... why?
Hi Reactive,
Why the transistor?
You need to use a transistor because the Netduino/Arduino digital outputs cannot provide enough current to directly drive the coil in the relay. The transistor is capable of handling more current; in this circuit, it acts as an on/off switch controlled by the Netduino. The resistor is there to allow enough current to flow from the Netduino to turn on the transistor. (In the relay diagram, for a Netduino and using the 1K ohm resistor, this will be around 2.6mA - which is a lot less than the 100mA or more that might be needed to drive a typical relay coil.)
The 5V or 12V coil in the relay is a type of inductor. When current passes through it, it stores up energy in a magnetic field.
As Mario was explaining, when you try to stop the current flowing through an inductor, that energy in the magnetic field has to go somewhere. Its a bit like trying to instantly stop a flywheel. In the case of in inductor, the stored energy causes the electrical current to want to keep flowing. If there is nowhere for the current to go, the voltage across the terminals of the inductor can shoot up. With a mechanical switch this can cause sparks, which in turn can burn away the switch contacts or can even weld the contacts together.
"Switch mode" power supplies use this principal to either boost or reduce a voltage without using a bulky transformer.
So why the diode?
Well when the transistor (our switch) is turned off, the current in the inductor will keep going - it has to. If it has nowhere to go, the voltage will build up and may destroy other components in the circuit - e.g. the transistor (and possibly the Netduino that is driving it!).
The diode stops this from happening by providing a short circuit across the coil to dump the current.
Referring to the relay diagram when the transistor is on, current flows from the top to the bottom through the transistor. At the moment the transistor turns off, the current instead flows clockwise through the diode averting disaster.
Finally as Mario described, a similar problem exists on the pump side of your relay - you can get a spark across the relay contacts. This poses little danger (if any) to the Netduino but may reduce the reliability or life of the relay. If the load was low voltage DC, you could just use another diode across the load. Since you are working with an AC load, you need a suitably rated capacitor across the relay terminals.
Hope this helps - Paul
#9
Posted 19 December 2011 - 02:55 PM
Hi Reactive,
Why the transistor?
You need to use a transistor because the Netduino/Arduino digital outputs cannot provide enough current to directly drive the coil in the relay. The transistor is capable of handling more current; in this circuit, it acts as an on/off switch controlled by the Netduino. The resistor is there to allow enough current to flow from the Netduino to turn on the transistor. (In the relay diagram, for a Netduino and using the 1K ohm resistor, this will be around 2.6mA - which is a lot less than the 100mA or more that might be needed to drive a typical relay coil.)
The 5V or 12V coil in the relay is a type of inductor. When current passes through it, it stores up energy in a magnetic field.
As Mario was explaining, when you try to stop the current flowing through an inductor, that energy in the magnetic field has to go somewhere. Its a bit like trying to instantly stop a flywheel. In the case of in inductor, the stored energy causes the electrical current to want to keep flowing. If there is nowhere for the current to go, the voltage across the terminals of the inductor can shoot up. With a mechanical switch this can cause sparks, which in turn can burn away the switch contacts or can even weld the contacts together.
"Switch mode" power supplies use this principal to either boost or reduce a voltage without using a bulky transformer.
So why the diode?
Well when the transistor (our switch) is turned off, the current in the inductor will keep going - it has to. If it has nowhere to go, the voltage will build up and may destroy other components in the circuit - e.g. the transistor (and possibly the Netduino that is driving it!).
The diode stops this from happening by providing a short circuit across the coil to dump the current.
Referring to the relay diagram when the transistor is on, current flows from the top to the bottom through the transistor. At the moment the transistor turns off, the current instead flows clockwise through the diode averting disaster.
Finally as Mario described, a similar problem exists on the pump side of your relay - you can get a spark across the relay contacts. This poses little danger (if any) to the Netduino but may reduce the reliability or life of the relay. If the load was low voltage DC, you could just use another diode across the load. Since you are working with an AC load, you need a suitably rated capacitor across the relay terminals.
Hope this helps - Paul
That's an excellent guide, thanks Paul. Just out of interest - surely the resistor will restrict the amount of current flowing to the transistor, unless I use a parallel configuration?
If I use the digital output pin with it's 5V threshold, I suppose I wouldn't be able to drive a 12V relay as Magpie suggested using the raw V+ pin. If I can't find a 5V relay, what other options do I have?
#10
Posted 19 December 2011 - 03:58 PM
That's an excellent guide, thanks Paul. Just out of interest - surely the resistor will restrict the amount of current flowing to the transistor, unless I use a parallel configuration?
If I use the digital output pin with it's 5V threshold, I suppose I wouldn't be able to drive a 12V relay as Magpie suggested using the raw V+ pin. If I can't find a 5V relay, what other options do I have?
Thank you - I just added to the very sound replies from Mario & Magpie.
(Mario has started a Wiki page that is worth a visit.)
The whole point of the resistor is to restrict the current from the Netduino. The current flowing through the resistor goes to the base of the transistor and flows down to ground via the emitter. This current from the Netduino does not actually pass through the relay coil. Instead, when this very small current flows, it allows a much bigger current to flow from the collector to the emitter of the transistor. A transistor is an amplifier with a gain. The type of transistor shown amplifies the current flowing from base to emitter. (Other types of transistor use a voltage rather than a flowing current to control the output). In this case the amount of current through the resistor is large enough that the result is like an ON/OFF switch.
(The Netduino actually has 3.3V digital outputs.)
I believe that Magpie was suggesting that:
- using a 5V relay, you could supply the relay coil voltage "Relay power V+" from the 5V pin on the Netduino.
- using a 12V relay you might be able to power the relay from the Netduino Vin pin. This will depend on how you are powering the Netduino. You might for example be powering the Netduino using the maximum 12V on the barrel connector - in this case, the 12V would also be available on the Vin pin.
Note that the current you can draw from the 5V pin should not exceed 800mA. See the How much current can I draw... Wiki FAQ page.
The Vin output is not regulated like the 5V output, hence I am not sure how much current you may draw on the Vin pin. Without any other information, I would not exceed the 800mA.
Paul
#11
Posted 19 December 2011 - 09:35 PM
#12
Posted 09 February 2012 - 05:49 PM
....
To solve this, you should place a capacitor across the contacts. Upon the pump specs, the capacitor can vary from 0.1uF to some uF.
In any case, it must be targeted for *at least* 250V, and it *cannot* be electrolytic or tantalum (i.e. polarized).
I'd suggest to ask your reseller.
Cheers
hey mario. thanks for all the advice i see you giving.
its especially great for those of us coming from purely software backgrounds.
anyway, to follow up on what's quoted above, do you think this cap is enough for a relay that is switching on a compressor for a refrigerator that's rated at 1.4A 120VAC
http://search.digike...6014-ND/2208913
its rated 0.1uF and 500V
also, lets say the fridge had a larger motor of say 3A 120VAC (the 1.4A motor is for a small one)
how much would you need to step up capacity?
http://search.digike...-3510-ND/789642
this one is rated .22uF and 500V
#13
Posted 09 February 2012 - 06:46 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users