Control a 220V relay - Page 1
Forum section: electronics / projects

author: npelov
author_rank: Frequent Contributor
timestamp: October 07, 2013, 12:06:07 am
content: Hi,I need to switch on and off a relay from MCU for simple timer project. The mcu will be powered by transformerless power supply and the whole circuit (without the relay) will draw about 1-2 mA max. I wandered what was the best way to do it and fit it in small space. I'm now thinking about controlling 220V relay (I'll write my other ideas at the end of the post). I looked up and I foundthis(coil: 0.4W, contacts 8A/250V) andthis(coil: 0.75W, contacts 16A/250V). The more powerful one will consume about 3.2mA. Because most triacs I found have holding current (max) 10mA (even when typical is about 1-2mA), I can't rely on a triac to keep the relay on with just a small pulse - I have to supply 5mA at the gate all the time. This means that the low voltage will drain 7mA +- some extra for the regulator circuit. That is about 2W, which means it'll get a little bit hot.I thought about using transistors and that's the circuit I came up with:http://www.circuits.io/circuits/5947The Dz diode is a zenner (coundn't find the zenner symbol) and it only represents the regulator circuit which could be more complex. But let's not talk about the low voltage regulation now. The transistors will have Vcemax = 400V + a MOV will protect the whole circuit from overvoltage. the relay will only be about 3mA, so if I pick a transistor with hfe >=100 then I need about 0.05mA to drive it. The values on the schematic are just an example. They probably could be tuned better. Also running mcu on lower voltage will reduce low voltage consumption.The reason I want low consumption on the control circuit is because it'll be on all the time. If it draws ~3W and you have 10 in your home it'll be 30W 24/7. it's not much, but I like to save power. The coil consumption is not a problem because it's meant to control powerful consumer so it doesn't matter if your oven or heater will draw 2000W or 2001.My question is:isthis circuit with the transistorsgonna work and did I miss something that will cause this thing to blow... I'm usually trying the circuit and if it doesn't work ask questions, but when 220V comes to play I try to be more careful.-------------------------------------P.S.I had a lot of other ideas do do this, but they have problems:1. I can use any switching 5V power supply + 5V relay - it's hard to find high contact current relays, power supply is big and doesn't fit the small boxes2. The same with 12V power supply + 78L05 but with 12V relay. This is better because the relay drains less current and it's easier to find it. But again it's too big.3. A 5V power supply + a power triac.. Because you also have to use cooler for the triac you can't save space so with this option I don't care about space. However I only use triac when I need to reduce power consumption - for a heater or a party grill.4. I get the smallest PCB mountable 12V transformer I can find and I use simple rectifier +78L05 and power the relay from the unregulated 12V. This seams a bit smaller in length, but not in height. It's still hard to fit it in some boxes.5. the 220V relay I described above allows to mount almost all the parts on the other side of the pcb with size a little bit larger than the relay. so if I can fit a relay - I can fit it all (like in the power socket box).And if someone wanders why I'm so obsessed with this timer here are few reasons:1. Me and my girlfried are often in front of the computers. This makes the food that's cooking start smoking and smells really bad.2. The daughter of my girlfriend often sleeps at 30 degrees C in the room because she forgets to turn the heater off.3. When we leave to somewhere for more than one day I can't stop thinking if I turned everything off to make sure the place won't burn down.4. Well I'm all about saving power. Some times I get up at night and I see all the lights in the appartment turned on. For this one I'm planning to use some ofthese

author: Jon86
author_rank: Frequent Contributor
timestamp: October 07, 2013, 05:50:13 am
content: Wait, you're connecting the relay's coil straight up to the mains?

author: MinK
author_rank: Contributor
timestamp: October 07, 2013, 06:32:41 am
content: Try to control relay with NPN transistor if relay control signal is DC or if control signal is mains AC you can try Triac Optoinsulator. And i guess relay could be replaced by Triac in final design.

author: filip_cro
author_rank: Regular Contributor
timestamp: October 07, 2013, 10:45:25 am
content: You can use opto-isolator for switching relay. If you use small 12V transformer you can just put 12V on coil. But use protective diode

author: npelov
author_rank: Frequent Contributor
timestamp: October 08, 2013, 12:20:17 am
content: I knew that if I write too much no one will read itat least tell me something about the circuit:http://www.circuits.io/circuits/5947I use 2 transistors - one for each side of the sine wave. npn + pnp + diodes = can control AC. will it workSo:@Jon86: of course. It's 220V AC relay coil. Why wouldn't I do that.@MinK: control signal is DC. Can't power relay from DC (read post). However triac optoinsulator could be a good idea. However I want to minimise the power drained from low voltage signal. Maybe I should somehow power the optoinsulator LED from mains - shouldn't be that hard. It'll drain 1W, but only when it's on. Triac gets a little bit hot at 10-16A, so relay is better idea.@filip_cro as I said I can't find transformer small enough. Transformer or SMPS - they are quite big. But opto-isolator is something I can think on. I'll draw a schematic and post it here for comments

author: Andy Watson
author_rank: Super Contributor
timestamp: October 08, 2013, 12:38:55 am
content: Quote from: npelov on October 08, 2013, 12:20:17 amNo, T2 will not function - it will need a negative control voltage to turn it on and its collector should face the load - due to the higher breakdown voltage of the C-B junction.QuoteBecause you need to take care of the back-emf generated when the relay turns off. I.e. you need some form of snubber across the relay coil if you want to avoid zapping T1 (and T2).

author: npelov
author_rank: Frequent Contributor
timestamp: October 08, 2013, 01:14:17 am
content: Damn you are right. Control signal must be more negative than GND. And I mirrored the transistor by mistake (fixed). Well I don' think this transistor can be placed in a way that it works. Shame.The circuit is simplified. I'll actually have a regulator after the zenner and snubber will be added. Not sure if I use 220V relay what kind of snubber will be better - probably RC. If I use an optron with a triac do I still need snubber? Well I guess I do, but it must be RC - it's an AC relay. I know inductive loads are pain in the ass, but that's all I know about it. The current is very little - 3-4 mA, so it's easier than driving a motor for example.

author: geraldjhg
author_rank: Regular Contributor
timestamp: October 18, 2013, 02:20:16 am
content: use a small latching relay and turn it on with a pulse transformermoitor it with a opto