simplest way to detect 120VAC using a microcontroller

Yes, I saw that app note as well.

You forgot to mention that the micro-controller was also powered by the same 120VAC.

So the micro was HOT as respect to neutral.

Not a deign for the faint of heart.

hamilton

Reply to
hamilton
Loading thread data ...

It looks pretty cool to me, at least for simple a.c. detection. I just did this differently, using a transformer (I didn't want HV a.c. close to my device).

.

He, ah, could um, ah, cut about 5 minutes out of his ah, video, um, if ah, he'd um, STOP saying "um" and "ah!"

;-)

Great video though.

Thanks.

-- Cheers, James Arthur

Reply to
dagmargoodboat

I've used this method to check for the presence of line voltage in a remote location. The circuit has been in service for over 5 years with no problems (I used several 1/2 watt resistors in series so they would withstand a few kV of line spike).

John S

Reply to
John S

On a sunny day (Thu, 01 Sep 2011 09:45:29 -0500) it happened " snipped-for-privacy@att.bizzzzzzzzzzzz" wrote in :

Yes, diode, but you do not need 10 mA. Those optos are linear to much lower currents, so if you use 100 uA, and the opto does 1:10, then you have 10 uA in the photo transistor,

10 uA in 5V is about .5 MOmh pullup, OK on a CMOS input pin, add a small capacitor so it is a lowpass for 50 Hz or 60Hz, that also protects against spikes, RFI.
Reply to
Jan Panteltje

The one's I've used get really squirrely at under a mA, and that's when new. They degrade quite a bit, over time. The specs want 10mA. A series cap can reduce the power dissipation, though.

Reply to
krw

The reason I really like the heatshrink method is that you don't have to have the AC wiring on your board at all, which removes all sorts of worries.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

ng a

m the

lds and

e, at

n reduce

hink the

new.

s cap can

es.

That's good for monkey-wrench resistance. (Spec: "Dropping a standard monkey-wrench into the device shall not short 230VAC onto the main d.c. power bus.")

-- Cheers, James Arthur

Reply to
dagmargoodboat

Add the stray resistances, inductances, capacitances and leakages to that.

Oh, I woudn't worry about damaging the input. A cellphone, a lightning storm, an ESD, dirt or something like that would cause an erratic behavior.

I have several sensor controlled light dimmers; sometimes they get crazy.

One more reason for not liking Tektronix.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

I have used miniature neon lamps on 220 V and photo darlingtons.

A neon lamp is a high voltage low current device which only requires a single low power resistor. Any LED light source would require an extra diode and a high power resistor or some spike suppression if series capacitance is used.

If it is known that the AC lines are always loaded, you could use reed relay tubes with some turns around it.

Reply to
upsidedown

They don't degrade as fast if you don't drive the snot out of them.

Reply to
Spehro Pefhany

That's just dead-chicken-waving and cheap shots. Put in some actual numbers.

With that 1 nF bypass, you can put a 100k resistor in series with the 10 pF and knock out anything much above a megahertz. The 2.4 GHz would be attenuated by over 80 dB with one section, allowing 0.1 pF parasitic capacitance for the resistor. The CPU would have to be pretty finicky to have a problem with that. The 60 Hz won't even notice.

A good EMI resistant design will have a filtered power entry, which is good for another 40 dB at least.

If you're really paranoid, use a two-section RC filter. You can buy a lot of Rs and Cs for the price and board space of your average opto, and avoid having the mains wiring on the CPU board. It wasn't my idea, but I liked it a lot when I saw it.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

You can just as easily package a quad optoisolator in an external probe and run 5 wires back to the CPU board (power, ground, and three signals).

Reply to
sms88

But that takes an extra baby board, unless you're talking about roach wires, and is probably $10 more expensive when you're done. The heat shrink trick is just like Muntzing your version--clip off two of the wires, cut off the baby board, and the thing still works.

What's not to like?

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

It's stingier to use a comparator input, but this DOES assume that you know the HOT wire from the neutral, and that the uC in question is grounded to the AC lines. You're gonna want TWO capacitors or some assurance that HOT and NEUTRAL are sorted out, and a battery-powered uC will need to have some kind of ground reference even if you can reliably determine HOT.

For really cheap isolation, a warming resistor heatsinked to a thermistor (or just diode) bridge can handle the task.

Reply to
whit3rd

Again, the extra cost and complexity doesn't get you anything. You need a baby board for those resistors, you have to have it UL approved, and anyway the response will be very slow. The whole point of AC power monitoring on the processor is to be able to be in a safe state when VDD goes away.

The Tek version actually had sense wires on both hot and neutral, which was a nice touch. By using an ADC input, you can watch for brownouts and brief power drops as well as hard failures. And you can leave most of the approval stuff to the power supply vendor.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Says a great enlightener and a blue sky researcher who never designed anything for production.

What 1nF ?

The capacitance from the power cord to the sense line would be at the order of 1pF. We can count on the chassis potential of ~ 1/2 of the mains. To toggle the digital input reliably, that has to be divided by a factor of ~25. So, we can afford 25pF to the ground. The 25pF is 1e8 Ohm at 60 Hz; dealing with such resistances takes some care. Especially considering the leakage of MCU input that is in the typically in the 10M range.

A mere cellphone will create ~100 V/m at 800 MHz, that will translate up to ~10V at the wire.

The attenuation dramatically depends on how the thing will resonate.

There will be rectification of RF on the high impeadance CPU input, that will run the DC operating point away.

The cost is not so much about Rs and Cs. The cost is in getting them stuffed on the board.

Lousy trick, I wouldn't rely on it.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

I would not use a board, I'd dead bug it, inside some heat shrink, using a surface mount part. It'd cost $2.00 in low quantities, but it's only a single part in the heat shrink, not a bunch of Rs and Cs cobbled together messily.

Reply to
sms88

Good luck getting that through UL.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Now *that's* a cheap shot at the chicken/light bulb/microphone idea.

I like it too. It's clever (no parts) and one of the few suggestions that fits the OPs stated desire for the "simplest way...". Assuming all the AC signals are

60Hz and in phase then adding 1 R at the ADC input, and paralleling the 3 coupling signals, one can tell if any of the 3 signals have died. By varying the length of the coupling wire on each signal one could then tell which signal died. Art
Reply to
Artemus

fits the

the

died.

Using an ADC is considered to be the simplest?

Reply to
Vladimir Vassilevsky

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.