Controling 110VAC with the digital I/O board?
cers350
Posts: 2
I plan to use the digital I/O board PN 27113 with sharp S202S02 relays to control lights, fans and pumps for a hydroponic green house. I am new to using a micro controller to switch high voltage AC and don't want to let the smoke out of anything.
The example for setting the input voltage uses VDC, is the math the same for VAC? If so doing the math tells me that I would need a 10.8k resistor, does this sound right?
If so then I will have around 10.8 amps across the octocoupler LED using a 10K resistor.
Thanks in advance for any help!
The example for setting the input voltage uses VDC, is the math the same for VAC? If so doing the math tells me that I would need a 10.8k resistor, does this sound right?
If so then I will have around 10.8 amps across the octocoupler LED using a 10K resistor.
Thanks in advance for any help!
Comments
Here is a picture of a contactor in an approved box...
http://www.deanbennett.com/bw-with-contactor.jpg
Notice how these are designed to be mounted in a box and also have large electrical connections so you can safely connect large wires.
These types of electrical installations (when not done to "code") in the past have caused people, small children, and pets to be electrocuted. Or caused fires.
And that is the whole idea behind getting an electrical permit. They check to be sure everything is installed in a safe manner for the protection of you, your family, pets, and persons who might purchase your home in the future.
You can also go ask your local electrical inspector if what you plan to do will be safe. Many are happy to help you (some are jerks). But most want to keep you safe and like people who ask in advance.
The S202S02 relay output is rated at 8A max, and that current is determined by the load (light, fan, motor) connected to it. If your equipment needs higher currents then a different relay is needed.
You will need solid state relays/switches of the appropriate voltage and current ratings to turn on the lights, fans, and pumps. The resistor values used with the 27113 will depend on the voltage you plan to use for the Digital I/O Board. It will operate from 5V to 30V so the current limiting resistors will need to be selected accordingly.
For a typical led forward voltage drop of 1.2V and 20mA current the formula to calculate the resistor value would be "(Vin - 1.2) / .020" This would give a resistor value of 190 ohms with 5V in.
In any event, relays are your solution for control.
In some cases, solid-state relays are fine and don't require an intermitent stage of transistors and higher voltage to drive coils.
But in many cases, traditional mechanical relays driven by something like a 2N2222 transistor that is switch a 12VDC relay coil is fine. If you really need more power to the relay coil TIP120 darlingtons can drive just about any 12volt relay coil directly from microcontroller logic and run cool.
A good industrial relay that is rated at 12VDC coil and 240VAC 12amp control is much smaller than a solid-state relay. These also come with plugs that can be set to a stadard aluminum rail. When a relay fails, it can be replaced in 2 seconds. When one begins to consider costs and ease of repair, traditonal relays are a much better option that solid=state relays.
Also, mechanical relays tend to fail into an OFF state, while solid-state relays may fail into an ON state.
Loopy, sorry I meant 10.8 milliamps.
If I were to drive mechanical relays with the TIP120 darlington could I run into circuit protection concerns if something were to fail? Would it be possible to damage the microcontroller? This is why I was looking into the optocoupler.
Thanks
Powerswitch Tail
The resistors for the outputs are just there to limit the current for the indicator LED's for each relay (or solid state switch). You may want to consider using the relays since they can control either AC or DC loads. The contacts are completely isolated from the micro so you should be safe there.
Definitely think about what Bill190 says about being safe and check on local codes if you are going to directly tap into the SC lines or bring that directly back to your board.
Robert
Firstly, the mechanical relay offers physical isolation between the 12volt coil and the 120/240 VAC. Inexpensive relays are available up to 12amps at 120/240VAC.
Secondly, there is often some degree of fear or doubt about using 12 volts as an intermediate stage. Many novices don't understand that the Base of the transistor is safely isolated from the 12 volts. It helps to thing of the transistor as two diodes that share a common ground when thinking about protection from backflow.
You can use the TIP120 or even a 2N2222 with the base controling the 12 volt load and not worry about further isolation. You certainly don't need to 'junk up' you design with opto-isolation or other complexities.
The only real question is if your relay coil draws more power than a 2N2222 can provide (roughly 600ma) and I suspec that by testing the relay for coil resistance you will likely find out 'no'. But if you do need more power, the TIP120 is likely all you will ever need for a relay coil (well over 1 amp).
The 2N2222 is a better and cheaper choice if you don't need the TIP120.
BTW, while the micro-controller requires 5 volt regulated supply, the 12VDC doesn't have to be from a regulated source. You can use a 12 volt wall wart or battery to drive the relay coils through the transistor and you may send the same unregulated 12 volts to the 5 volt regulator for the micro-controller. Add some filter caps and be sure to include fly-back diodes on the relay coils to stop noise that might (but I doubt will) possible reach the micro-controller.