Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How do I use 5VDC to switch 120VAC?

Status
Not open for further replies.

Ingeniir

New Member
Hey all,

I want to use an Arduino (can output a maximum of 5VDC) to switch 120VAC lightbulbs. However, most 120VAC relays have turn-on voltages of around 30VDC. So what kind of circuitry can I use link the Arduino to the lightbulbs? Should I just use another relay in between the Arduino and the larger relay?

Thanks
 
You can accomplish what your after by having the output from your Arduino turn on an optocoupler that in turn activates a triac to switch the AC load. I'll post a schematic of what I'm talking about in a few minutes.
 
Here you go. I think that triac is good up to 8 amps but check the data sheet to make sure.
 

Attachments

  • Triac.PNG
    Triac.PNG
    24.4 KB · Views: 637
You can also use a solid-state AC relay module which includes the opo-isolator and TRIAC in one package.
 
Hey, I took a look at the product you linked me to, and its exactly what I need! I must not have shopped around enough. Previously I had only looked on Digikey. I should have looked on Mouser! In any case, I restarted my own product search and after tweaking the filters a bit I found this product: http://www.omron247.com/marcom/pdfcatal.nsf/PDFLookupByUniqueID/64AC57FB68FACE4586256D35004F60AC/$File/D20G5LE0503.pdf?OpenElement. This looks like exactly what I need, thanks for telling me about Mouser!
 
Hi Ingeniir. The relay you are refering to looks good but as the datasheet says, the 5V coil version requires 80mA of current. Definetely more than the MCU can supply. So as previously said, you'll need a transistor to supply that current (like 2N7000).

I would personally go with an SSR (solid state relay), like the S108T01F. Much smaller and a bit more MCU friendly. Requires only 1.2V @ 20mA. If your MCU cannot suppply the 20mA, you'll still need the transistor. If your MCU can supply the 20mA, be carefull because the output voltage in this case is probably less than 5V.

You'll also need a resistor to lower the voltage down to 1.2V. To determine the resistor value, use the following :

With a transistor line 2N7000 : R = V/I = (Supply - SSR input voltage - voltage drop across the transistor at given current) / SSR input current = (5V - 1.2V - ≈0V) / 20mA

Directly from the MCU : R = V/I = (MCU VOH at given current - SSR input voltage) / SRR input current = (something probably less than 5V - 1.2V) / 20mA
 
Hi Ingeniir. The relay you are refering to looks good but as the datasheet says, the 5V coil version requires 80mA of current. Definetely more than the MCU can supply. So as previously said, you'll need a transistor to supply that current (like 2N7000).

Couldn't I also use a smaller electromechanical relay instead of a transistor?
 
The solid state relay is a more elegant solution. How many or how large a light bulb are you trying to switch?
 
So in this case, you need four individual devices, each switching one bulb. The choice of the device is yours but in the end, it must satisfy the following two conditions :

1) On one side, it has to be rated for the AC requirements you have : 120VAC and at least I = P/V = 208.33mA AC. To be safe, I would look for : 120 VAC, 1A

2) On the other side, you have to check the DC voltage and current required to turn on the device and see if your MCU port can provide that :
a) Check the device current rating (Idevice) :
- If the MCU port cannot source that much current, you will need to use a transistor and go to step c)
- If the MCU port can source that much current, you are not sure yet if a transistor is required or not so go to step b)
b) Check the MCU output voltage for logic high (VOH) at the given current* and compare against the device voltage rating (Vdevice).
- If the MCU port voltage at the given current is too low, you will need to use a transsitor and go to step c)
- If the MCU port voltage at the given current is too high, you will need to use a limiting resistor R = (VOH - Vdevice) / Idevice. You're done.
c) If a transistor is required, compare the device voltage rating (Vdevice) against 5VDC and the transistor voltage drop (Vgs or Vce) at given current (Idevice) :
- If 5VDC - Vtransistor is too high, you will need to use a limiting resistor R = (5VDC - Vtransistor - Vdevice) / Idevice. You're done.


So when you've chosen your device, let us know if you want us to validate the choice or if you need a circuit example.


* A 5V MCU will output a logic "1" to a port with a high voltage close to 5V. But the more current you ask of the port, the lower the voltage will actually become. For example, at 20mA, the voltage could go as low as 2.5V or so.
 
OK I have decided to use SSRs. Here's the website that has links for the data sheets (S202T01). The relay can handle up to 240VAC and 2A. The input voltage is listed at 1.2VDC, and the recommended operating current for the ON state is 16-24mA. I'm using an Arduino that can output 5VDC and 40mA.

I don't fully understand how my MCU, or these solid state relays work, however. Do you need to hit a certain voltage across the input terminals for the relay to activate, or do you need to hit a certain current? Is this correct: if you direct the MCU to output a high voltage of near 5V, the current drawn depends on the resistance of the circuit?
 
This is the data sheet for your chosen SSR.

Now look at page 4 Electro-optical Characteristics and note:

Forward voltage VF = 1.2 V with a max of 1.4 but 1.2 volts is typical for 20 mA of current. Your uC has a 5 volt output so we do this:

V applied - Vf/ If (the forward current) = 5 - 1.2 / .020 = 190 Ohms.

If you now look at page 9 Standard Circuit the above tells you that R1 is a 190 Ohm resistor. However since 190 is not a common value for off the shelf resistors you would use either a 180 or 200 ohm off the shelf 1/4 watt resistor. That resistor goes between your uC output and pin 3 of your SSR with pin 4 going to ground. This is how we get the "certain current" you mentioned.

Hope that helps
Ron
 
I think I see. Then is it correct to say, in the control circuit, the solid state relay has a resistance of Vf / If = 1.2V / 0.02A = 60 Ohms?
 
Pretty much, but remember the actual forward voltage and current of the opticals are based on nominal values of voltage and current or typical values. So with a forward voltage of 1.2 volta and a forward current of .020 amp there is an apparent DC resistance of 60 ohms. Just remember that inside the SSR is actually a tiny LED, the LED turns on a photo transistor that in turn turns on a triac. The merit to the SSR is everything is in a neat single package. Also remember we are only looking at the optical side and not the AC side. Make sure you wire the AC side exactly per the data sheet example(s).

Ron
 
I think I see. Then is it correct to say, in the control circuit, the solid state relay has a resistance of Vf / If = 1.2V / 0.02A = 60 Ohms?
That's true only for that snapshot value of the nominal voltage and current. But an LED's forward current versus voltage is quite nonlinear (exponential) so a small change in voltage can cause a large change in current, which will then give a significantly different value for the calculated resistance. That is why you need to add a resistor in series to stabilize the current against small changes in voltage or the LED unit-to-unit voltage versus current characteristics.
 
Your uC has a 5 volt output so we do this:

V applied - Vf/ If (the forward current) = 5 - 1.2 / .020 = 190 Ohms.

That is indeed true only if the MCU output remains at 5V while sourcing 20mA. To verify that, one has to check the MCU's VOH vs IOH diagram. I took a quick look at the ATmega328 datasheet (that's the MCU found on the Arduino Uno board... not sure if it's the one the op has). In this case the difference is not that big : VOH is typically 4.5V at 20mA.

So the equation becomes : 4.5 - 1.2 / .020 = 165 Ohms
 
Status
Not open for further replies.

Latest threads

Back
Top