simplest way to detect 120VAC using a microcontroller

Hi,

I would like to detect if 3 different 120VAC signals are active using a microcontroller, is it safe to just use a 1kV ceramic capacitor from the

120VAC signals and feed them into the microcontroller's ADC?

cheers, Jamie

Reply to
Jamie
Loading thread data ...

Probably not! If all you need to know is if the signal is active or not, could you maybe use a Hall effect sensor?

Reply to
Bitrex

"Jamie"

** Think the ADC input is happy with 170 volt spikes do you ??

..... Phil

Reply to
Phil Allison

How about three opto-isolators, resistors, and zeners to set thresholds and provide noise immunity.

Reply to
tm

"tm"

** It's easy enough it drive a LED from the AC supply via a suitable cap and current limiting resistor.

Using 3 optos is the way to go, transistor out is all you need.

.... Phil

Reply to
Phil Allison

On a sunny day (Wed, 31 Aug 2011 22:31:19 -0700) it happened Jamie wrote in :

I have used optos in the past.

Reply to
Jan Panteltje

AC-input optos (back-to-back LEDs) or precede the opto with a couple of BAV99s in a bridge configuration.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

Jamie a écrit :

Yep, perfectly safe: the caps should survive...

--
Thanks,
Fred.
Reply to
Fred Bartoli

In addition to the other approaches already mentioned:

- A relay with a 120 VAC coil powered from each line.

- An undervoltage sensor (e.g., a relay with tighter spec'd pull-in and drop-out voltages).

- A loop of nichrome wire and a thermistor.

- A light bulb, a chicken, and a microphone.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

In their new scopes, Tek does this by heatshrinking a piece of normal hookup wire to the outside of the AC line wiring, making a small-value capacitor that has the insulation characteristics of the AC wire. It should be pretty safe to attach that to a uC ADC input, and it'll work whether the load is drawing any current or not.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
 Click to see the full signature
Reply to
Phil Hobbs

You're going to need a anti-parallel diode across the isolator's diode, at least. A line-rated capacitor in series with the diode/resistor can reduce the power dissipated quite a bit (10mA * 240V gets hot). I don't think the zener is necessary but may be useful.

Reply to
krw

He'd probably need a buffer amplifier. PIC ADC inputs, for example, like to see no more than 10K (2.5K for some newer units). If we put a

20K + 20K voltage divider across Vdd/Vss and capactively couple 120VAC to the midpoint, and want (say) ~100mV RMS (1 LSB being ~5mV) for reliable detection, we'd need more than 200pF.

A 'Y' safety type capacitor (typically something like 4kV rating) _might_ be okay, but I'd use an opto.

Reply to
Spehro Pefhany

That's an AC limitation due to charge injection, no?

Guessing that the capacitance is around 10 pF, that's about 450 nA RMS. For a low accuracy application like this, I'd try it with a 4.7M/4.7M voltage divider and 1 nF to ground to reduce the charge injection spikes.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
 Click to see the full signature
Reply to
Phil Hobbs

Should? Not with all the shorted disc and surface mount ceramic caps I've seen.

--
You can't have a sense of humor, if you have no sense.
Reply to
Michael A. Terrell

A field effect chicken?

mike

Reply to
m II

Nah. When power is lost the light goes out and the chicken roosts. The lack of "cluck cluck" noise is sensed and thereby used to decide that power was indeed lost. Not a particularly fast response, and the chicken has to sleep *sometime* but the eggs are a useful side-effect, as is the fried chicken when it's time to upgrade to a newer model. ;-)

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

Maynard doesn't need the competition. He already lays enough eggs.

--
You can't have a sense of humor, if you have no sense.
Reply to
Michael A. Terrell

That just asks for EMI and ESD problems, as well as problems with the moisture and contamination.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

why an adc input if you only want to detect?

I've seen a microchip appnote where they use a 20M resistor from 220V to a digital input for zero cross detection in a dimmer.

the esd diodes clamp the voltage, the resistor limits the current

or just get three tiny transformers, something like 6VAC 0.35VA

-Lasse

Reply to
langwadt

Why? If it's bypassed to ground with 1 nF, that's a 100:1 voltage divider or thereabouts. And even without that, you'd have to have a pretty amazing spike to get enough current through 10 pF to damage the PIC's input protection.

And so what if you get moisture under the heat shrink? It might change the capacitance by a few percent.

Anyway, tell it to Tektronix--see Dave Jones's teardown, posted yesterday.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
 Click to see the full signature
Reply to
Phil Hobbs

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.