Help with AC - Page 1
Forum section: electronics / beginners

author: matts-uk
author_rank: Contributor
timestamp: April 30, 2015, 01:41:28 pm
content: HiBasically I'm a digital networks and software kinda guy, happy to use Ohm's law within my low voltage DC comfort zone. My wife has set me the challenge of building a control system, which requires dimming a mains powered halogen spotlight with a micro controller. I have come across two potentially suitable circuits (see attached).One circuit uses a zero cross detector and phase control, to drive a thyristor. I managed to copy/build the zero cross circuit, generating a 50Hz interrupt pulse from the mains, without blowing myself up. I have yet to try connecting up to a thyristor.The alternative circuit, which drives an IGBT looks more suited, to my logic level mind set. I've got the circuit working at low voltage levels on a bread board and now I am trying to scale up to 220V. However, I find myself potentially short of what looks like a 350V 10 micro-farad capacitor, which will end up being expensive by the time I have paid postage.I have a nice selection of electrolytic capacitors up to ~50V. So, I was wondering, if I fit a 22K resistor across the bridge rectifier of my IGBT drive circuit, similar to the zero crosser, would it make it safe to use a lower voltage capacitor? Would I also need to fit the 330K (or similar) current limiting resistors?In any case, i would really appreciate seeing the working to arrive at the component values and ratings.

author: DmitryL
author_rank: Regular Contributor
timestamp: April 30, 2015, 02:02:05 pm
content: Quote from: matts-uk on April 30, 2015, 01:41:28 pmI would suggest you go and buy something already made for the purpose before you kill youself of burn your house down.Playing with mains is dangerous. If you want to develop your own MCU mains dimmer, you will need to understand in detail what are you doing and how it should work and you will make it wrong in any case (hardware/firmware issues). To debug this thing you will need to use oscilloscope at least. Playing with mains and scope is 2 times more dangerous.You can google a plenty of MCU - base dimmers with schematics and firmware. Most of them will be directly connected to mains, because MCU will be powered directly from mains via a capacitor. It is OK if you understand where and how it is going to be used. Otherwise there is a good chance that you will electrocute yourself

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 30, 2015, 02:42:55 pm
content: Please remember that mains AC voltages are RMS averages. A nominal "240V" mains is 400V peak-to-peak and would turn your 350V electrolytic capacitor into an explosive device. Recommend NOT playing around with circuits directly connected to the power mains until you have more experience with (and respect for) the hazards. There are safe methods of doing what you propose. But you aren't there yet.

author: albert22
author_rank: Regular Contributor
timestamp: April 30, 2015, 04:28:20 pm
content: You can use a triac and an "optoisolated triac driver". In this way the mains can be completely separated from the microcontroller.https://www.fairchildsemi.com/application-notes/AN/AN-3003.pdfThere are plenty of similar circuits on the web.Use small transformer to get the zero crossing signal. This isolates again your micro from mains. If you use a linear power supply for the micro you already have the transformer.similar to thishttp://forum.arduino.cc/index.php?topic=164432.0Other way to get the zero crossing is to use a optocouplerhttp://electronics.stackexchange.com/questions/19273/when-should-i-fire-the-triacs-gate-when-controlling-an-inductive-load-ac-motorBe very careful . Keep whatever circuits are connected to mains well separated from the microcontroller. Debug without connecting mains.

author: AG6QR
author_rank: Frequent Contributor
timestamp: April 30, 2015, 04:47:18 pm
content: Quote from: Richard Crowley on April 30, 2015, 02:42:55 pmAgreed with the main point. Quibble with the math. I think nominal "240V" mains would be 240V RMS, which would be about 340V peak, which would be around 680V peak-to-peak. Yes, there is danger of making a capacitor go "boom"!

author: Zero999
author_rank: Super Contributor
timestamp: April 30, 2015, 10:37:14 pm
content: Quote from: AG6QR on April 30, 2015, 04:47:18 pmThat's correct and even though the capacitor is rated to 350V it's still too close to be safe: use a 400V capacitor minimum.

author: AG6QR
author_rank: Frequent Contributor
timestamp: April 30, 2015, 11:17:54 pm
content: Quote from: Hero999 on April 30, 2015, 10:37:14 pmBut that first circuit uses a full-wave bridge rectifier. At no load, a full-wave bridge rectifier's output will have up to the full p-p voltage. In other words, it'll have up to 680V on the output. The capacitor should be rated for a bit more than this, to account for safety factor.Furthermore, that first circuit uses a resistive voltage divider and labels the point between the 100K and 5K resistors as "15V". A voltage divider is no substitute for a voltage regulator. And neither is a substitute for a step-down transformer. At no load, that point labeled "15V" will have somewhere around 30V, with lots of ripple. But the impedance of that 15V rail will be very high, so I guess it'll be possible to pull it down to 15V if you use the right current draw. And if you don't care about ripple.

author: macboy
author_rank: Super Contributor
timestamp: May 01, 2015, 02:05:09 pm
content: Quote from: AG6QR on April 30, 2015, 11:17:54 pmDefinitely not. A full wave recitifer gives you 1.414 * RMS voltage, ~= 340 V in this case.

author: dom0
author_rank: Super Contributor
timestamp: May 01, 2015, 02:10:23 pm
content: Don't forget +-10 % voltage tolerance. Calculate voltage ratings with 255 V for 230 V mains.

author: Zero999
author_rank: Super Contributor
timestamp: May 01, 2015, 03:28:51 pm
content: Quote from: AG6QR on April 30, 2015, 11:17:54 pmWhere on earth did you get that idea from? Bridge rectifiers only give the peak voltage, minus 1.2V to 2.2V losses, depending on the current, which is just under 340VDC for 240VAC in.

author: SeanB
author_rank: Super Contributor
timestamp: May 01, 2015, 03:36:07 pm
content: Capacitor voltage ranges are also approximate. How many 250VDC capacitors are used in lights directly connected to mains, and only fail after around a year of operation. Your 350VDC capacitor is likely formed for 400V, and the 400v will be formed for 450V. There are not many with a 385V rating.

author: matts-uk
author_rank: Contributor
timestamp: May 05, 2015, 07:49:03 am
content: DimitryL, thank you for the depth of your concern towards my well being but may I suggest, you take the time to ask a few questions, before presuming someone might be completely clueless. That way, you can save yourself some typing and the risk of looking foolish, when it turns out they are not.I started my working life sweeping the floor in a cal lab, worked up through assembly, wireman, prototype and test before moving to digital tele-comms and eventually data networks. I can reassure you, I have used enough scopes to know what a ground loop looks like, have fixed my share of washing machines and amplifiers, even managed to rewire my last two houses without burning them down or electrocuting anyone.If I posted in the wrong forum section, then I apologise. If you can provide a link to a suitable off the shelf module, that would be great.Quote from: AG6QR on April 30, 2015, 11:17:54 pmIt's not like I was never taught the theory but it is 25 years since I last used it, as my career focussed on digital.As I recall. The UK mains is 230V nominal, +10% -6% tolerance, which conveniently encompasses the old 240V +-5% I was taught prior to EU harmonisation. Without quibbling over decimal places, 710Vpp seems a nice round figure to use for calculation. The effect of the bridge is to flip the inverse phase 180 degrees, halving the voltage and doubling the frequency, so 710Vpp @ 50Hz becomes 355Vp at 100Hz. Capacitors are rated for continuous DC operation. In a pure AC circuit, the charge current will lag 90 degrees behind the Voltage, hence never reaches the same extreme as the equivalent DC Voltage. I recall (just about), that RMS represents the equivalent of DC energy carried in the form of a sine wave.However, my exposure to AC stuff was brief, quite some time ago and I never got as far as having to make my own design choices outside of a classroom.QuoteLooking at the IGBT drive circuit. At the point labelled 15V, I (just) need a 'dirty' DC 15V @ < 1mA. A pulse will be generated by an MCU pulling the line low via a 4N35 but that part of the circuit is not relevant at this stage.Looking at the Zero Cross detector circuit. As far as I can see, the arrangement of 22K and 1K resistors with the capacitor, form an RC divider which limits the Voltage over the capacitor. I was hoping to use the same principle in the IGBT drive circuit and was hoping for some help with the maths. I suspect, I = deltaC * V / deltaTime might have something to do with it but I was never great at differential equations.Maybe I need to come at this from a different direction. Looking at the Zero Crossing detector circuit. Am I right in thinking the 220K resistors in series with the bridge input, will limit the current in the circuit to a less than lethal, 1mA ( @ 230Vrms) 3mA ( @ 710Vpp).