Driving a 120VAC load using a microcontroller

Thread Starter

ltkenbo

Joined Sep 11, 2008
30
So my friends and I have this project for our microcomputer class, our group is making this conveyor belt thing that sorts packages. We are using a treadmill as the conveyor (which is basically a 90VDC motor driven by a PWM motor controller than plugs into the wall).

Long story short, we need to be able to control this 120VAC load using the TTL signal microcontroller (it's a HCS12 but that's kind of irrelevant). My idea to use a NPN transistor to power a relay which will switch the large current/voltage. I know I can switch a relay using this the MCU and transistor but I've got a question about the relay.

What kind of relay do I need? Will the 12V 10A automotive one that I have work or will there be problems with the electricity breaking down the connection when the relay is off?

 

retched

Joined Dec 5, 2009
5,207
You need to know the load of the 120vAC side. That is it.

You can also skip the transistor by getting a Logic level relay. It will have a 5v coil.

Therefore it can be energized directly from the uC and you can eliminate the 12v BUSS if the relay was the only thing that needed the 12v.

You MUST determine the AC load size.

The treadmill should have a data plate on it somewhere that specifies the amp draw.

Just be sure that the load spec on the relay is higher than that number.

If it happens to be 10A, then get a relay with AT LEAST a 10A rating.

The higher over your actual number the better. It will cost more, but the reliability and the ability to handle surges will increase.

Its that easy.
 

Thread Starter

ltkenbo

Joined Sep 11, 2008
30
We tested the motor itself, it typically draw around .6 amps and goes up until 3 when you change the PWM. MY question is about the relay though, will it work even though it's a 12 volt relay can I push an AC waveform that has an open loop voltage of 120 Volts as long as I keep it under the current rating of the relay (In this case 10A)?
 

retched

Joined Dec 5, 2009
5,207
Do you have the data sheet for the relay? If it is an automotive relay you don't want to apply 120vAC through it.

I understand it has a 12v coil but are you sure the load side is only rated for 12vDC?

Typically there are DC and AC specs for a relay.

A part number will clear this up easily.
 

retched

Joined Dec 5, 2009
5,207
The voltage rating is determined by how close the contacts are together. If you applý too much voltage it will arc over and you will have no control.

The current spec is determined by the size of the contacts and how much heat they can handle.
 

Thread Starter

ltkenbo

Joined Sep 11, 2008
30
Yeah that's what I figured the voltage rating was for, by whether it would arch based on how close the contacts sit when open... Thanks.
 

thatoneguy

Joined Feb 19, 2009
6,359
This is semantics, but "Driving 120VAC Load" implies some inverter topology.

"Controlling 120VAC Load" would be a more precise question, just for future reference.
 

t06afre

Joined May 11, 2009
5,934
I do not hope you plan to do PWM control with a relay. A relay is not a very dynamic type of component. Using a relay this way is like asking for trouble. However using a relay as some sort main power switch. Is a good use of a relay
 

SgtWookie

Joined Jul 17, 2007
22,230
The relay that Jaguarjoe linked to will work for your application.

You MUST insulate the 120VAC connections to the relay using heat-shrink tubing. Use two layers.

Make certain that you are switching the hot (line) side of the 120v input. The connector will be labeled L for line/hot, N for neutral, and G for ground (the center terminal).

The relay coil measures 100 Ohms. With a 12v supply, there will be 120mA current flowing through it, which you will need to sink via your transistor. I suggest using a 2N2222.

You will need 12mA base current in order to saturate the transistor.
Rbase = (Vcc-Vbe) / (Ic/10)
Rbase = (5v-0.7v) / (120mA/10)
Rbase = 4.3 / 0.012
Rbase = 358.333... Ohms. 360 Ohms is a standard value and will work well for you.
Now calculate the power requirement for Rbase:
P = EI
P = 4.3 *0.012 = .0516, we double this for reliability, so P=103.2mW. You can use a 1/10 Watt or higher rated resistor. 1/8W, 1/4W would work just fine.

You will need to use a diode across the relay coil to protect against reverse EMF spikes. A pair of 12v Zener diodes back-to-back or a single 1N4004 with the cathode towards positive will work just fine.
 

Thread Starter

ltkenbo

Joined Sep 11, 2008
30
No not using PWM through the relay lol, I'm using the relay to switch on a 120VAC powered PWM DC motor controller. Just wanted to know if I could use my automotive one but since I can't Sparkfunelectronics sells a high voltage relay that should work great. Thanks for the help!
 
Top