0
\$\begingroup\$

I want to sense mains voltage at a frequency faster than 5000Hz, with a microcontroller. The idea behind this is to visualize the actual shape of the AC voltage, and eventually to compare it with the current to determine its cosphi.

I have read that I need to use a optoisolator to isolate both circuits. How do I choose which one I need for an analog output of the scaled voltage?

\$\endgroup\$
2
  • \$\begingroup\$ Can you please provide a link to where you read that you should use an optoisolator in this case? Are there certain optoisolators that you are considering? \$\endgroup\$ – Joe Hass Feb 7 '14 at 17:37
  • \$\begingroup\$ Originally it said "sense mains voltage at a frequency faster than 5k" - I assumed this might have meant sample at 5k or above. I'm not sure that the modification/edit is correct based on that - it now implies samping at least 10kHz. \$\endgroup\$ – Andy aka Feb 7 '14 at 18:20
1
\$\begingroup\$

I would look into putting the microcontroller circuit on the hot side, have it do all the measurements by being directly coupled, then send the digital results over a opto. This gets around having to use analog optoisolaters. You will only be shipping digital information accross the isolation barrier.

Of course you have to be careful about touching anything on the hot side, whether that includes a microcontroller or not. Initial debugging should be done a isolation transformer, and preferably at lower voltages.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks ! Now something that is not clear in my mind: the microcontroller must be supplied with a 5V DC power supply. Does it share the same ground with mains voltage ? \$\endgroup\$ – tfjgeorge Feb 12 '14 at 16:34
  • \$\begingroup\$ @tfjg: You will need to arrange for 5V power for the micro on the hot side. If you buy something off the shelf for that, it will probably be isolated, so the ground reference can be whatever is most convenient for making the measurements. Otherwise, you can probably use something like a capacitive charge pump that uses the AC line frequency for the pumping. I'd probably use the AC ground as the microcontroller ground then. That works with the charge pump and should be useful for making the measurements. \$\endgroup\$ – Olin Lathrop Feb 12 '14 at 17:19
1
\$\begingroup\$

There are a number of analog optoisolators that will work for you. The Vishay (nee Infineon) IL300 is an old standard.

enter image description here

It is normally used in a circuit such as this:

enter image description here

Because a single LED illuminates two photodiodes, the LED drift can be largely compensated by the closed loop feedback circuit.

Note that you require a power supply on the high voltage side, so you may require an appropriate DC-DC converter.

More accuracy is possible from more recently developed similar parts such as the HCNR201.

As others have said, there are a number of other galvanic isolation technologies, digital and analog (your signal could be digitized on the hot side, so there is some percentage in considering digital methods). Magnetic (analog and digital) and differential capacitor coupling are a couple of common ones. Some are modules that have an isolated power supply incorporated. Of course, price escalates rapidly as such features are added.

\$\endgroup\$
0
\$\begingroup\$

Use a regular voltage transformer rather than an opto coupler - it will provide the isolation (safety) and give you a decent linear analogue signal to feed into your MCU.

When you come to look at current use a current transformer. Feed the single wire thru the CT's hole and you get a decent representation of current across its burden resistor.

If you are going to calculate power factor (I'm presuming that's what you meant by Cos Phi) be prepared for significant errors - you can't just use zero crossing algorithms unless the current is particularly clean and free of harmonics. See this answer - it may help you understand how tricky it may be to measure power factor.

\$\endgroup\$
12
  • \$\begingroup\$ I wonder if typical transformers designed for power applications have the bandwidth to pass the entire signal of interest? \$\endgroup\$ – Chris Stratton Feb 7 '14 at 18:13
  • \$\begingroup\$ @ChrisStratton if you are interested only in calculating power factor then you are only interested in fundamental frequencies (with the assumption that the voltage waveform is virtually sinusoidal). Apart from the fact that power transformers deliver the power to your home in the first place!! \$\endgroup\$ – Andy aka Feb 7 '14 at 18:16
  • 1
    \$\begingroup\$ The poster expressed an explicit interest in getting a wider bandwidth view. Many types of power supplies do in fact introduce distortions at other than the fundamental frequency - that may not strictly qualify as "power factor" but it can be of interest and actual concern. While transforms involved in power delivery may attenuate these to some degree, an instrument is hopefully designed to reflect as true a measurement as possible, without introducing additional rolloff in the bandwidth of interest. \$\endgroup\$ – Chris Stratton Feb 7 '14 at 18:19
  • \$\begingroup\$ @ChrisStratton I agree with what you say - wider bandwidth is better of course but I took the meaning of the question to be "sampled" at 5kHz which you've subsequently altered to bandwidth of 5kHz upping S to 10kHz. It's just my impression of what he said. \$\endgroup\$ – Andy aka Feb 7 '14 at 18:24
  • \$\begingroup\$ The \$ cos(\phi) \$ implies it's sinusoidal, but 5kHz implies a lot of harmonic content. Hard to tell without ESP. \$\endgroup\$ – Spehro Pefhany Feb 7 '14 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.