simplest way to detect 120VAC using a microcontroller

fits the

are

varying the

died.

Sounded like the OP already had one and wanted to use it. So, yes. Art

Reply to
Artemus
Loading thread data ...

"Vladimir Vassilevsky"

** Not with any scope I ever saw or would want to use - the chassis is always securely bonded to safety ground.

The OP has not indicated that this is the case with his project, so a method that involves sensing from active to neutral and isolates both from the uP is preferable on safety grounds.

.... Phil

Reply to
Phil Allison

Cheap shots are a bit of a habit with you, aren't they?

And I've had boards (time and frequency standards for the first direct broadcast satcom system, SpaceTel from AEL Microtel) that were in continuous production for over 10 years. One of my other designs was the first commercial atomic force microscope, which was manufactured for over 20 years.

The one I suggested in my answer to Spehro. 4.7M to Vref and ground, bypassed by 1 nF to ground.

With 40 dB from the power entry and 80 from the little one-pole RC filter, that's a huge scary 10 uV at the micro. What was the problem again?

No it doesn't, it's two filters in cascade. Even if you connected the cell phone directly to the line input through any matching network you like, it wouldn't be a problem. There's a good 120 dB of attenuation in the way--watts become picowatts. And another RC section will drive that so far into the mud as to be unmeasurable, all for another 5 cents.

At 10 uV? Give me a break.

So you're worried about the cost of an 0402 resistor and capacitor, compared with two AC power connections, an opto, a diode, a resistor, another capacitor, and safety approval? C'mon.

That's okay with me.

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

l

ue

nge

day.

Jimmy Brandt, 6th grade, a buddy of mine--a classic offender. He, and some experience carefully analyzing speech turned the "um" filter into an avalanche detector: (small um) =3D=3D> big pulse.

-- Cheers, James Arthur

Reply to
dagmargoodboat

rote:

g a

the

s and

at

reduce

nk the

ew.

cap can

I used some Avago units last year, 10MBPS IIRC, spec'd for 1mA.

-- Cheers, James Arthur

Reply to
dagmargoodboat

al

lue

e
.
e

zy.

1) it's in a shielded box. 2) 25pF is 8 ohms @ 800 Mhz. A 100k resistor into 25pF knocks 10v @ 800MHz down to 800uV. 3) Why wonder when you can measure? Random 22(?) AWG wire, alongside a test lead with thick insulation, 15cm contact: 3.5pF.

-- Cheers, James Arthur

Reply to
dagmargoodboat

Probably not - the cap will send any line transients right directly into your µP - PHUT!.

Stick any ol' diode (one that's good for at least 200V, 1N400x series is cool) in antiparallel with the LED of an optoisolator, and 120K in series with that parallel circuit, to the 120V.

Then, just read the output of the opto, and you're done. I know you can get dual optoisolators, but I don't know if they come more than 2 to a package.

Have Fun! Rich

Reply to
Rich Grise

So, all of the millions of FM and AM/FM line powered radios that used a piece of hookup wire wrapped around the line cord all exploded from stray RF? What a drooling idiot.

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

Not if you use Vladimir's cell phone to cook the chicken. :)

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

Well, it does local calls to Moscow, which needs a bit of power. ;)

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

Threads wander. I thought it was an interesting aside, even if it didn't precisely fit what the OP asked for.

If _both_ pieces of wire are UL/CSA approved for the full mains voltage then I think they could avoid much further examination for safety. But you couldn't have the mains wire snaking around near a PCB or whatever without some care.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Hi,

Thanks for the links, the AC input optocoupler method is probably the way to go since the AC lines are already connected to the PCB. The series capacitor method is more cool and uses less power (no power wasted in the LED series resistors) but has the drawback of requiring an ADC and/or comparator, and also is probably not as immune to voltage spikes as an optocoupler. I will try to use the optocouplers at 1mA input current to save power and hope that works :D

cheers, Jamie

Reply to
Jamie

It may not matter for your application, but I have run into trouble by making "AC inputs" *too* low current. The problem is that many sources have a significant leakage current even when nominally "off". For example any switch with a contact arc suppressor across it, like many industrial PLC outputs. So the leakage current is enough to energise your "low current" input.

--

John Devereux
Reply to
John Devereux

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

I have in in use with 1 mA as 240 V detector for some time, CNY17-3 IIRC. But the circuit was a bit more complicated.

Reply to
Jan Panteltje

I remember having to put UL-approved sleeving on some special (low voltage) wires, even though there was no conceivable safety issue even if they were to short directly to the mains.

Yes, they will want to look at everything, particularly if you ask their opinion on what they need to look at.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Sure, but that's all common sense. I've done a few UL approved products in the last couple of years. The process involved a fair amount of paperwork but there were no modifications needed to the hardware for UL (CE caused some issues unrelated to safety).

All components also need to be traceable back to the manufacturer's UL approval at any production inspection (quarterly).

Reply to
krw

I agree. It is slick, though could be a manufacturing nightmare.

Reply to
krw

Wish I had those three years ago. I used some that were spec'd for 10mA. The curves fell off the chart at 1mA but that's where I used 'em anyway. I couldn't stand the impedance loss otherwise. Today I'd likely use one of the ADI thingies.

Reply to
krw

There is AC in the box but it was engineered properly the first time. ;-)

There was an issue about which nut to put the ground connection under, but no big deal. The only other issue was labeling.

Reply to
krw

Have you ever seen a keyboard cable catch fire? I have, on a IBM built XT computer that I had just sold to someone. No damage to the computer, but the keyboard was destroyed. If the cord had been on a flammable surface, it would have started a fire.

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

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.