Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

simplest way to detect 120VAC using a microcontroller

72 views
Skip to first unread message

Jamie

unread,
Sep 1, 2011, 1:31:19 AM9/1/11
to
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

Bitrex

unread,
Sep 1, 2011, 1:51:47 AM9/1/11
to

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


> cheers,
> Jamie

Phil Allison

unread,
Sep 1, 2011, 2:02:51 AM9/1/11
to

"Jamie"

> 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?
>

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


..... Phil


tm

unread,
Sep 1, 2011, 2:20:07 AM9/1/11
to

"Jamie" <jmo...@shaw.ca> wrote in message
news:j3n5dg$3oi$1...@speranza.aioe.org...

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

Phil Allison

unread,
Sep 1, 2011, 2:49:44 AM9/1/11
to

"tm"

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

** 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


Jan Panteltje

unread,
Sep 1, 2011, 4:41:43 AM9/1/11
to
On a sunny day (Wed, 31 Aug 2011 22:31:19 -0700) it happened Jamie
<jmo...@shaw.ca> wrote in <j3n5dg$3oi$1...@speranza.aioe.org>:

I have used optos in the past.

Spehro Pefhany

unread,
Sep 1, 2011, 8:22:50 AM9/1/11
to

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


>
>
>.... Phil
>


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

Fred Bartoli

unread,
Sep 1, 2011, 8:57:12 AM9/1/11
to
Jamie a écrit :

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


--
Thanks,
Fred.

Rich Webb

unread,
Sep 1, 2011, 9:22:45 AM9/1/11
to

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

Phil Hobbs

unread,
Sep 1, 2011, 10:00:55 AM9/1/11
to

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
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

Spehro Pefhany

unread,
Sep 1, 2011, 10:45:45 AM9/1/11
to
On Thu, 01 Sep 2011 10:00:55 -0400, Phil Hobbs
<pcdhSpamM...@electrooptical.net> wrote:

>On 09/01/2011 01:51 AM, Bitrex wrote:
>> On 9/1/2011 1:31 AM, Jamie wrote:
>>> 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?
>>
>> Probably not! If all you need to know is if the signal is active or not,
>> could you maybe use a Hall effect sensor?
>>
>>
>>> cheers,
>>> Jamie
>>
>
>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.

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.

k...@att.bizzzzzzzzzzzz

unread,
Sep 1, 2011, 10:45:29 AM9/1/11
to

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.

Phil Hobbs

unread,
Sep 1, 2011, 10:52:34 AM9/1/11
to

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.

Michael A. Terrell

unread,
Sep 1, 2011, 10:56:13 AM9/1/11
to


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.

m II

unread,
Sep 1, 2011, 11:13:17 AM9/1/11
to
Rich Webb wrote:

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


A field effect chicken?


mike


signature.asc

Rich Webb

unread,
Sep 1, 2011, 11:24:23 AM9/1/11
to

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. ;-)

Michael A. Terrell

unread,
Sep 1, 2011, 11:49:42 AM9/1/11
to


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

Vladimir Vassilevsky

unread,
Sep 1, 2011, 12:11:46 PM9/1/11
to

Phil Hobbs wrote:


> 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.

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
http://www.abvolt.com


lang...@fonz.dk

unread,
Sep 1, 2011, 12:51:24 PM9/1/11
to

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

Phil Hobbs

unread,
Sep 1, 2011, 12:53:54 PM9/1/11
to

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.

hamilton

unread,
Sep 1, 2011, 2:47:43 PM9/1/11
to
On 9/1/2011 10:51 AM, lang...@fonz.dk wrote:
> On 1 Sep., 07:31, Jamie<jmor...@shaw.ca> wrote:
>> 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

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

dagmarg...@yahoo.com

unread,
Sep 1, 2011, 3:05:54 PM9/1/11
to
On Sep 1, 11:53 am, Phil Hobbs

<pcdhSpamMeSensel...@electrooptical.net> wrote:
> On 09/01/2011 12:11 PM, Vladimir Vassilevsky wrote:
> > Phil Hobbs wrote:
>
> >> 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.
>
> > That just asks for EMI and ESD problems, as well as problems with the
> > moisture and contamination.
>
>
> 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.

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).

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

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

SMS

unread,
Sep 1, 2011, 3:07:24 PM9/1/11
to

Use a quad AC Input opto-coupler, i.e. Vishay ILQ620 or NEC PS2505-4 or
equivalent. Look at page 5 of the app note at:
<http://i2c2p.twibright.com/datasheet/6n139_an.pdf>. You'll just need a
pull-up resistor on the collector of each output. Probably don't need
the inverter shown there since you can program the microcontroller for
high or low detection.

Be sure to look at the difference between a DC input and AC input
opto-coupler. You can use a DC input part for AC but you'll need an
external diode.

<http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&productId=320725&catalogId=10001>

<http://www.newark.com/jsp/search/productdetail.jsp?SKU=58K1694&CMP=AFC-GB100000001>

Note to our favorite troll: I have no association with Jameco or Newark.

John S

unread,
Sep 1, 2011, 3:33:10 PM9/1/11
to

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

Jan Panteltje

unread,
Sep 1, 2011, 3:43:53 PM9/1/11
to
On a sunny day (Thu, 01 Sep 2011 09:45:29 -0500) it happened
"k...@att.bizzzzzzzzzzzz" <k...@att.bizzzzzzzzzzzz> wrote in
<ge6v57dlpkfh577sb...@4ax.com>:

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.

SMS

unread,
Sep 1, 2011, 4:07:52 PM9/1/11
to

LOL, ever since being in Toastmasters with the "ah counter" it's much
more noticable when people speak like that, and I try to catch myself
and not do it.

k...@att.bizzzzzzzzzzzz

unread,
Sep 1, 2011, 4:12:17 PM9/1/11
to
On Thu, 01 Sep 2011 19:43:53 GMT, Jan Panteltje <pNaonSt...@yahoo.com>
wrote:

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.

Phil Hobbs

unread,
Sep 1, 2011, 4:17:01 PM9/1/11
to

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.

dagmarg...@yahoo.com

unread,
Sep 1, 2011, 4:25:30 PM9/1/11
to
On Sep 1, 3:17 pm, Phil Hobbs <pcdhSpamMeSensel...@electrooptical.net>
wrote:

> On 09/01/2011 04:12 PM, k...@att.bizzzzzzzzzzzz wrote:
>
>
>
> > On Thu, 01 Sep 2011 19:43:53 GMT, Jan Panteltje<pNaonStpealm...@yahoo.com>

> > wrote:
>
> >> On a sunny day (Thu, 01 Sep 2011 09:45:29 -0500) it happened
> >> "k...@att.bizzzzzzzzzzzz"<k...@att.bizzzzzzzzzzzz>  wrote in
> >> <ge6v57dlpkfh577sb37umfqs0lmjd04...@4ax.com>:
>
> >>> On Thu, 1 Sep 2011 02:20:07 -0400, "tm"<No_one_h...@white-house.gov>  wrote:
>
> >>>> "Jamie"<jmor...@shaw.ca>  wrote in message

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

Vladimir Vassilevsky

unread,
Sep 1, 2011, 4:30:59 PM9/1/11
to

Phil Hobbs wrote:

> On 09/01/2011 12:11 PM, Vladimir Vassilevsky wrote:
>>
>> Phil Hobbs wrote:
>>
>>> 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.
>>
>>
>> That just asks for EMI and ESD problems, as well as problems with the
>> moisture and contamination.
>>

> Why? If it's bypassed to ground with 1 nF, that's a 100:1 voltage
> divider or thereabouts.

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

> 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.

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.

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

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

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

One more reason for not liking Tektronix.

upsid...@downunder.com

unread,
Sep 1, 2011, 4:43:10 PM9/1/11
to
On Wed, 31 Aug 2011 22:31:19 -0700, Jamie <jmo...@shaw.ca> wrote:

>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?

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.

Spehro Pefhany

unread,
Sep 1, 2011, 5:00:57 PM9/1/11
to

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


Phil Hobbs

unread,
Sep 1, 2011, 5:22:48 PM9/1/11
to

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.

sms88

unread,
Sep 1, 2011, 5:33:40 PM9/1/11
to
On 9/1/2011 2:22 PM, Phil Hobbs wrote:

> 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.

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).

Phil Hobbs

unread,
Sep 1, 2011, 5:37:14 PM9/1/11
to

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?

whit3rd

unread,
Sep 1, 2011, 5:42:55 PM9/1/11
to
On Thursday, September 1, 2011 7:00:55 AM UTC-7, Phil Hobbs wrote:
> On 09/01/2011 01:51 AM, Bitrex wrote:
> > On 9/1/2011 1:31 AM, Jamie wrote:
> >> Hi,
> >>
> >> I would like to detect if 3 different 120VAC signals are active

> 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

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.

Phil Hobbs

unread,
Sep 1, 2011, 5:49:59 PM9/1/11
to

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.

Vladimir Vassilevsky

unread,
Sep 1, 2011, 6:04:48 PM9/1/11
to

Phil Hobbs wrote:

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

> With that 1 nF bypass,

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.

> you can put a 100k resistor in series with the 10
> pF and knock out anything much above a megahertz.

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

> The 2.4 GHz would be
> attenuated by over 80 dB with one section, allowing 0.1 pF parasitic
> capacitance for the resistor.

The attenuation dramatically depends on how the thing will resonate.

> The CPU would have to be pretty finicky
> to have a problem with that.

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

> 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.

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

> It wasn't my idea, but
> I liked it a lot when I saw it.

Lousy trick, I wouldn't rely on it.

sms88

unread,
Sep 1, 2011, 6:07:50 PM9/1/11
to
On 9/1/2011 2:37 PM, Phil Hobbs wrote:
> On 09/01/2011 05:33 PM, sms88 wrote:
>> On 9/1/2011 2:22 PM, Phil Hobbs wrote:
>>
>>> 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.
>>
>> 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).
>
> 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.

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.

Phil Hobbs

unread,
Sep 1, 2011, 6:27:23 PM9/1/11
to

Good luck getting that through UL.

Artemus

unread,
Sep 1, 2011, 6:32:18 PM9/1/11
to

"Phil Hobbs" <pcdhSpamM...@electrooptical.net> wrote in message
news:4E5FF7A8...@electrooptical.net...

>
> That's just dead-chicken-waving and cheap shots.

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

>
> 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.

> Phil Hobbs

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


Vladimir Vassilevsky

unread,
Sep 1, 2011, 6:33:56 PM9/1/11
to

Artemus wrote:

Using an ADC is considered to be the simplest?

Artemus

unread,
Sep 1, 2011, 6:37:18 PM9/1/11
to

"Vladimir Vassilevsky" <nos...@nowhere.com> wrote in message
news:ffednfAcS-_Olf3T...@giganews.com...

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


Phil Allison

unread,
Sep 1, 2011, 6:38:19 PM9/1/11
to

"Vladimir Vassilevsky"

>
> 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.


** 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

Phil Hobbs

unread,
Sep 1, 2011, 6:39:24 PM9/1/11
to

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.

>
>> With that 1 nF bypass,
>
> What 1nF ?

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

>
> 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.
>
>> you can put a 100k resistor in series with the 10 pF and knock out
>> anything much above a megahertz.
>
> A mere cellphone will create ~100 V/m at 800 MHz, that will translate up
> to ~10V at the wire.

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?

>
>> The 2.4 GHz would be attenuated by over 80 dB with one section,
>> allowing 0.1 pF parasitic capacitance for the resistor.
>
> The attenuation dramatically depends on how the thing will resonate.

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.

>
>> The CPU would have to be pretty finicky to have a problem with that.
>
> There will be rectification of RF on the high impeadance CPU input, that
> will run the DC operating point away.

At 10 uV? Give me a break.

>
>> 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.
>
> The cost is not so much about Rs and Cs. The cost is in getting them
> stuffed on the board.

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.

>
>> It wasn't my idea, but I liked it a lot when I saw it.
>
> Lousy trick, I wouldn't rely on it.

That's okay with me.

SMS

unread,
Sep 1, 2011, 7:09:23 PM9/1/11
to
On 9/1/2011 3:27 PM, Phil Hobbs wrote:
> On 09/01/2011 06:07 PM, sms88 wrote:
>> On 9/1/2011 2:37 PM, Phil Hobbs wrote:
>>> On 09/01/2011 05:33 PM, sms88 wrote:
>>>> On 9/1/2011 2:22 PM, Phil Hobbs wrote:
>>>>
>>>>> 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.
>>>>
>>>> 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).
>>>
>>> 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.
>>
>> 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.
>
> Good luck getting that through UL.

Where did the o.p. state that he wanted to bring the design through UL?
I've brought a bunch of products through UL (and CSA and TUV) and have
the gray hair to prove it.

The o.p. is trying to monitor three different 120V signals. I don't
think he wants to use the Tektronix method, however clever.

Phil Hobbs

unread,
Sep 1, 2011, 7:22:29 PM9/1/11
to

The OP sort of faded out when the discussion got a bit louder. Anyway,
beyond making the suggestion, I wasn't staying too close to the OP's
exact issues. If it's a hobby project, any of the above methods are
probably fine, except the one that uses a direct connection to the mains.

I'm not saying this is the only way to do it. I just don't like to see
a pretty idea get rubbished, even when it isn't my idea. Pretty ideas
are so, well, pretty.

I've had beautiful Tek scopes and not-so-good ones--the last new one I
bought (or badgered my employer into buying, rather) was a TDS7704
around 2007. I didn't like it nearly as well as my 11801C, even though
it cost some ridiculous amount of money.

At that time, I was dismayed to find that I had to explain to Tek
_factory_engineers_ that a scope lives and dies by its step response.
(They were giving me all this frequency response nonsense--1% overshoot
is a lot harder to get than 1 dB flatness.) So I was glad to see
somebody applying a bit of imagination in the good old Tek tradition.
Maybe they're starting to recover.

Jamie

unread,
Sep 1, 2011, 8:23:56 PM9/1/11
to
SMS wrote:

It's about time some one came up with the correct answer!

Yes, the AC opto-coupler are the answer.

Jamie


dagmarg...@yahoo.com

unread,
Sep 1, 2011, 9:19:52 PM9/1/11
to
On Sep 1, 3:07 pm, SMS <scharf.ste...@geemail.com> wrote:
> On 9/1/2011 12:05 PM, dagmargoodb...@yahoo.com wrote:
> > On Sep 1, 11:53 am, Phil Hobbs  wrote:

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) ==> big pulse.

--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Sep 1, 2011, 9:21:04 PM9/1/11
to
On Sep 1, 3:12 pm, "k...@att.bizzzzzzzzzzzz" <k...@att.bizzzzzzzzzzzz>
wrote:
> On Thu, 01 Sep 2011 19:43:53 GMT, Jan Panteltje <pNaonStpealm...@yahoo.com>

> wrote:
>
>
>
> >On a sunny day (Thu, 01 Sep 2011 09:45:29 -0500) it happened
> >"k...@att.bizzzzzzzzzzzz" <k...@att.bizzzzzzzzzzzz> wrote in
> ><ge6v57dlpkfh577sb37umfqs0lmjd04...@4ax.com>:
>
> >>On Thu, 1 Sep 2011 02:20:07 -0400, "tm" <No_one_h...@white-house.gov> wrote:
>
> >>>"Jamie" <jmor...@shaw.ca> wrote in message

> >>>news:j3n5dg$3oi$1...@speranza.aioe.org...
> >>>> 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
>
> >>>How about three opto-isolators, resistors, and zeners to set thresholds and
> >>>provide noise immunity.
>
> >>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.
>
> >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.
>
> 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.

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

--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Sep 1, 2011, 9:47:47 PM9/1/11
to

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

whit3rd

unread,
Sep 1, 2011, 10:01:52 PM9/1/11
to
On Thursday, September 1, 2011 5:23:56 PM UTC-7, Jamie wrote:
> SMS wrote:
>
> > On 8/31/2011 10:31 PM, Jamie wrote:
> >
> >> Hi,
> >>
> >> I would like to detect if 3 different 120VAC signals are active using a
> >> microcontroller,

> Yes, the AC opto-coupler are the answer.

An optocoupler is only part of the answer, of course; you require
wired connections to all the AC signals, and current limiting
resistance for the optocoupler inputs, and pullup resistors
on the outputs. If the output has to remain stable, you'll
need a retriggerable monostable to stretch the AC pulses into
a static logic level.

An LED optocoupler requires typically 4 mA to reliably turn on,
and (from 120VAC) that means a maximum resistance of 36 kOhms,
so you'll dissipate about half a watt. Capacitive or inductive
probes are easier to make power-efficient.

A small signal transformer might be the same price as an optoisolator.

Rich Grise

unread,
Sep 1, 2011, 10:54:06 PM9/1/11
to
Jamie wrote:
>
> 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?

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


SMS

unread,
Sep 1, 2011, 10:58:40 PM9/1/11
to

Unlikely, since he'll need three of them.

Yes, he'll need a resistor on the input, but on the output a capacitor
is sufficient to have a static logic level, no need for a retriggerable
monostable. Even the capacitor isn't really needed, as you could sample
the input on the micro-controller multiple times to be sure you detect
if there's a logic high at any time.

Michael A. Terrell

unread,
Sep 1, 2011, 11:13:04 PM9/1/11
to

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.

Michael A. Terrell

unread,
Sep 1, 2011, 11:14:49 PM9/1/11
to

Artemus wrote:

>
> Phil Hobbs wrote:
> >
> > That's just dead-chicken-waving and cheap shots.
>
> Now *that's* a cheap shot at the chicken/light bulb/microphone idea.


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

Phil Hobbs

unread,
Sep 1, 2011, 11:28:47 PM9/1/11
to
On 09/01/2011 11:14 PM, Michael A. Terrell wrote:
>
> Artemus wrote:
>>
>> Phil Hobbs wrote:
>>>
>>> That's just dead-chicken-waving and cheap shots.
>>
>> Now *that's* a cheap shot at the chicken/light bulb/microphone idea.
>
>
> Not if you use Vladimir's cell phone to cook the chicken. :)
>
>

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

Spehro Pefhany

unread,
Sep 2, 2011, 12:08:32 AM9/2/11
to

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"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com

Jamie

unread,
Sep 2, 2011, 1:15:01 AM9/2/11
to
On 9/1/2011 12:07 PM, SMS wrote:
> On 8/31/2011 10:31 PM, Jamie wrote:
>> 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
>
> Use a quad AC Input opto-coupler, i.e. Vishay ILQ620 or NEC PS2505-4 or
> equivalent. Look at page 5 of the app note at:
> <http://i2c2p.twibright.com/datasheet/6n139_an.pdf>. You'll just need a
> pull-up resistor on the collector of each output. Probably don't need
> the inverter shown there since you can program the microcontroller for
> high or low detection.
>
> Be sure to look at the difference between a DC input and AC input
> opto-coupler. You can use a DC input part for AC but you'll need an
> external diode.
>
> <http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&productId=320725&catalogId=10001>
>
>
> <http://www.newark.com/jsp/search/productdetail.jsp?SKU=58K1694&CMP=AFC-GB100000001>
>
>
> Note to our favorite troll: I have no association with Jameco or Newark.

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

SMS

unread,
Sep 2, 2011, 1:23:59 AM9/2/11
to

Yet it's done all the time on boards that have the power supply and
logic together on one board, and these systems get UL approved, with the
appropriate warning labels and the infamous "finger test,"
<http://www.ergonomicsusa.com/accJFP10.html>.

UL wants to look at all boards, even those without high voltage on them.
I used to work for a large Taiwanese motherboard company. There were
several UL issues on motherboards even though there was no high voltage.
You needed picofuses near the KB and Mouse connectors because they were
worried about shorts in the KB and Mouse cables with 20+ amps of +5V
available from the power supply. You needed two levels of protection to
prevent the board from trying to charge the non-rechargeable lithium
backup battery. You needed UL approved material for the board. You
needed a UL approved back-up battery.

John Devereux

unread,
Sep 2, 2011, 4:33:15 AM9/2/11
to
Jamie <jmo...@shaw.ca> writes:

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

Jan Panteltje

unread,
Sep 2, 2011, 5:00:56 AM9/2/11
to
On a sunny day (Thu, 01 Sep 2011 15:12:17 -0500) it happened
"k...@att.bizzzzzzzzzzzz" <k...@att.bizzzzzzzzzzzz> wrote in
<5kpv57p4a9jalnvba...@4ax.com>:

>On Thu, 01 Sep 2011 19:43:53 GMT, Jan Panteltje <pNaonSt...@yahoo.com>


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

>><ge6v57dlpkfh577sb...@4ax.com>:
>>
>>>On Thu, 1 Sep 2011 02:20:07 -0400, "tm" <No_on...@white-house.gov> wrote:
>>>
>>>>
>>>>"Jamie" <jmo...@shaw.ca> wrote in message
>>>>news:j3n5dg$3oi$1...@speranza.aioe.org...


>>>>> 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
>>>>

>>>>How about three opto-isolators, resistors, and zeners to set thresholds and
>>>>provide noise immunity.
>>>
>>>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.
>>
>>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.
>
>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.

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.

Spehro Pefhany

unread,
Sep 2, 2011, 6:51:13 AM9/2/11
to
On Thu, 01 Sep 2011 22:23:59 -0700, the renowned SMS
<scharf...@geemail.com> wrote:

>Yet it's done all the time on boards that have the power supply and
>logic together on one board, and these systems get UL approved, with the
>appropriate warning labels and the infamous "finger test,"
><http://www.ergonomicsusa.com/accJFP10.html>.

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.

>UL wants to look at all boards, even those without high voltage on them.
>I used to work for a large Taiwanese motherboard company. There were
>several UL issues on motherboards even though there was no high voltage.
>You needed picofuses near the KB and Mouse connectors because they were
>worried about shorts in the KB and Mouse cables with 20+ amps of +5V
>available from the power supply. You needed two levels of protection to
>prevent the board from trying to charge the non-rechargeable lithium
>backup battery. You needed UL approved material for the board. You
>needed a UL approved back-up battery.

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

k...@att.bizzzzzzzzzzzz

unread,
Sep 2, 2011, 11:34:51 AM9/2/11
to

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).

>You needed two levels of protection to
>prevent the board from trying to charge the non-rechargeable lithium
>backup battery. You needed UL approved material for the board. You
>needed a UL approved back-up battery.

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

k...@att.bizzzzzzzzzzzz

unread,
Sep 2, 2011, 11:39:06 AM9/2/11
to
On Thu, 01 Sep 2011 16:17:01 -0400, Phil Hobbs
<pcdhSpamM...@electrooptical.net> wrote:

>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.

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

k...@att.bizzzzzzzzzzzz

unread,
Sep 2, 2011, 11:41:30 AM9/2/11
to

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.

SMS

unread,
Sep 2, 2011, 11:51:31 AM9/2/11
to
On 9/2/2011 8:34 AM, k...@att.bizzzzzzzzzzzz wrote:

> 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).

You're lucky. If there's high voltage AC on the board or inside the box,
they have all sorts of requirements, down to the type of nuts to use for
grounding to the chassis. I recall at one point they were being stubborn
about some new rule they had and I told them that we would just stick
with CSA and not do UL because our customers would accept either
certification. They backed down.

k...@att.bizzzzzzzzzzzz

unread,
Sep 2, 2011, 12:02:32 PM9/2/11
to

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.

Michael A. Terrell

unread,
Sep 2, 2011, 5:39:12 PM9/2/11
to

SMS wrote:
>
> UL wants to look at all boards, even those without high voltage on them.
> I used to work for a large Taiwanese motherboard company. There were
> several UL issues on motherboards even though there was no high voltage.
> You needed picofuses near the KB and Mouse connectors because they were
> worried about shorts in the KB and Mouse cables with 20+ amps of +5V
> available from the power supply.


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.

Michael A. Terrell

unread,
Sep 2, 2011, 5:52:11 PM9/2/11
to

Phil Hobbs wrote:
>
> On 09/01/2011 11:14 PM, Michael A. Terrell wrote:
> >
> > Artemus wrote:
> >>
> >> Phil Hobbs wrote:
> >>>
> >>> That's just dead-chicken-waving and cheap shots.
> >>
> >> Now *that's* a cheap shot at the chicken/light bulb/microphone idea.
> >
> > Not if you use Vladimir's cell phone to cook the chicken. :)
>
> Well, it does local calls to Moscow, which needs a bit of power. ;)


KGB surplus, no doubt!

sms88

unread,
Sep 2, 2011, 7:33:59 PM9/2/11
to

I haven't seen it happen, but the threat was real enough to require
those fuses. Those power supplies are capable of a lot of current,
though I'd think that the board trace would fry before the cable would
catch fire. What was kind of bad is that people often blew the fuses by
powering stuff of the +5V from keyboard and mouse connector since the
picofuses were only 1/2 amp. At least with USB, the port shuts down only
temporarily if there's an over-current condition.

What was surprising is that there were customers that didn't care about
UL/CSA/TUV and we built boards with a zero ohm resistor instead of the
fues for them. This could not have saved more than 4-5 cents (for two
fuses), but the margins on motherboards are so terrible that they were
watching the pennies. Ditto for the back-up batteries. The Tadiran UL
approved batteries were more expensive than the non-UL batteries so the
Tadiran batteries were used only on boards going to customers that cared.

We sold boards to a major computer store chain (now defunct) who had
every store become a UL certified factory, and UL inspectors went to
their stores to inspect their "factory." Once some boards got shipped to
them from Taiwan with non-UL batteries and the UL inspectors caught it.
I had to explain to the factory why they had to use the more costly
batteries because they couldn't fathom it.

Spehro Pefhany

unread,
Sep 2, 2011, 7:57:41 PM9/2/11
to
On Fri, 02 Sep 2011 16:33:59 -0700, the renowned sms88
<scharf...@geemail.com> wrote:

>
>
>We sold boards to a major computer store chain (now defunct) who had
>every store become a UL certified factory, and UL inspectors went to
>their stores to inspect their "factory." Once some boards got shipped to
>them from Taiwan with non-UL batteries and the UL inspectors caught it.
>I had to explain to the factory why they had to use the more costly
>batteries because they couldn't fathom it.

Ah, these days you just explain that they must be "UL marked" and the
factory takes care of the rest.

Jamie

unread,
Sep 2, 2011, 9:57:53 PM9/2/11
to
Rich Grise wrote:

> Jamie wrote:
>
>>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?
>
>
> 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
>
>

Actually, what works very well and I do this at work to protect
inputs is to use TVS diodes, the bipolar types in the 1.5k class. Just
select
the value you need for it to clamp at and they work very nicely.

Jamie

Michael A. Terrell

unread,
Sep 2, 2011, 11:34:01 PM9/2/11
to

sms88 wrote:
>
> On 9/2/2011 2:39 PM, Michael A. Terrell wrote:
> >
> > SMS wrote:
> >>
> >> UL wants to look at all boards, even those without high voltage on them.
> >> I used to work for a large Taiwanese motherboard company. There were
> >> several UL issues on motherboards even though there was no high voltage.
> >> You needed picofuses near the KB and Mouse connectors because they were
> >> worried about shorts in the KB and Mouse cables with 20+ amps of +5V
> >> available from the power supply.
> >
> >
> > 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.
>
> I haven't seen it happen, but the threat was real enough to require
> those fuses. Those power supplies are capable of a lot of current,
> though I'd think that the board trace would fry before the cable would
> catch fire. What was kind of bad is that people often blew the fuses by
> powering stuff of the +5V from keyboard and mouse connector since the
> picofuses were only 1/2 amp. At least with USB, the port shuts down only
> temporarily if there's an over-current condition.


You have to remember that the keyboard connector was quite close to
the power connector on the real IBM XT motherboard. All the + 5V
current from the power supply was available trough a very wide internal
trace.


> What was surprising is that there were customers that didn't care about
> UL/CSA/TUV and we built boards with a zero ohm resistor instead of the
> fues for them. This could not have saved more than 4-5 cents (for two
> fuses), but the margins on motherboards are so terrible that they were
> watching the pennies. Ditto for the back-up batteries. The Tadiran UL
> approved batteries were more expensive than the non-UL batteries so the
> Tadiran batteries were used only on boards going to customers that cared.


A small Zero ohm will get quite hot if the current is high enough,
and either open or melt the solder.


> We sold boards to a major computer store chain (now defunct) who had
> every store become a UL certified factory, and UL inspectors went to
> their stores to inspect their "factory." Once some boards got shipped to
> them from Taiwan with non-UL batteries and the UL inspectors caught it.
> I had to explain to the factory why they had to use the more costly
> batteries because they couldn't fathom it.

Robert Baer

unread,
Sep 3, 2011, 12:42:57 PM9/3/11
to
Jamie wrote:
> 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
Absolutely NOT.
If anything, use a voltage divider.

whit3rd

unread,
Sep 3, 2011, 4:35:47 PM9/3/11
to
On Thursday, September 1, 2011 7:58:40 PM UTC-7, sms88 wrote:
> On 9/1/2011 7:01 PM, whit3rd wrote:

> > A small signal transformer might be the same price as an optoisolator.
>
> Unlikely, since he'll need three of them.

Not that unlikely; DigiKey sells a quad surface mount transformer
(553-1439-ND) for about $1 in quantity; the lowest cost optoisolator
I see is a quad for $0.80. It's not clear how the added cost
of a one watt dropping resistor for the LED will affect the economics.

星宇

unread,
Sep 25, 2011, 9:26:57 PM9/25/11
to
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
On 9月2日, 上午4时07分, SMS <scharf.ste...@geemail.com> wrote:
> 9/1/2011下午12:05,dagmargoodb...@ yahoo.com写道:
>
>
>
>
>
>
>
>
>
> > 09月01日上午11:53,菲尔霍布斯
> > <pcdhSpamMeSensel...@ electrooptical.net“中写道:
> >>在2011年9月1日下午12:11,弗拉基米尔Vassilevsky写道:
> >>>菲尔霍布斯写道:
>
> >>>>在新的示波器,TEK这heatshrinking一块正常
> >>>>联播线AC线布线外,一个小值
> >>>>电容器,交流电源线的绝缘特性。
>
> >>>这只是要求EMI和ESD的问题,以及问题与
> >>>水分和污染。
>
> >>为什么呢?如果绕过地面1 nF的,这是一个100:1的电压
> >>分压器或左右。即使没有,你必须有一个
> >>相当惊人的扣球得到足够的电流通过10 pF的损害
> >> PIC的输入保护。
>
> >>还等什么,如果你得到水分在高温下收缩?它可能会改变
> >>由百分之几的电容。
>
> 它看起来很酷至少对我进行简单的交流检测。我
> >只是这样做不同的,使用一个变压器(我不想高压交流
> >关闭我的设备)。
>
> >>无论如何,告诉它泰克 - 大卫琼斯的拆解,昨日公布。
>
> 他啊,可这个,啊,切约5分钟,他的啊,视频,嗯,如果
> >啊,他这个,不要说“嗯”和“啊!”
>
> > ;-)
>
> LOL,自从在演讲“啊计数器”多
> 更为显着,当人们这样的发言,我试图抓住自己
> 并没有这样做。

LED Grow Light http://www.szjcxgdled.com

星宇

unread,
Sep 25, 2011, 9:27:30 PM9/25/11
to
On 9月2日, 上午4时12分, "k...@att.bizzzzzzzzzzzz" <k...@att.bizzzzzzzzzzzz>
wrote:
> 上周四,2011年9月1日19时43分53秒(格林威治标准时间),扬Panteltje <pNaonStpealm... @ yahoo.com >
> 写道:
>
>
>
>
>
>
>
>
>
> >在一个阳光灿烂的日子(星期四,2011年9月9时45分29秒-0500 01)发生
> >“K...@ att.bizzzzzzzzzzzz“<K...@ att.bizzzzzzzzzzzz>中写道
> > <ge6v57dlpkfh577sb37umfqs0lmjd04...@ 4ax.com>:
>
> >>在周四,2011年9月1日2时20分07秒-0400,“以旧换新”<No_one_h...白house.gov写道:
>
> >>>“杰米”<jmor...@ shaw.ca>撰写于邮件
> >>>新闻:j3n5dg $ 3oi $ 1...@speranza.aioe.org...
> >>>>嗨,
>
> >>>>我想检测是否使用3种不同的120VAC信号积极
> >>>>微控制器,它是安全,只使用一个1KV陶瓷电容器
> >>>> 120VAC信号,并把它们送入微控制器的ADC?
>
> >>>>的欢呼声,
> >>>>杰米
>
> >>>如何三个光隔离器,电阻和齐纳二极管的阈值设置和
> >>>提供抗噪声能力。
>
> >>你会需要一个反并联二极管,在整个隔离二极管
> >>至少。一个二极管/电阻串联线额定电容可以减少
> >>功耗颇有几分(10毫安* 240V变热)。我不认为
> >>齐纳是必要的,但可能是有用的。
>
> >是,二极管,但你并不需要10毫安。
> >这些optos都低得多的电流呈线性关系,
> >所以如果你使用100微安,光电1:10,
> >那么你必须在10 uA的光电晶体管,
> > 10 UA在5V约0.5 MOmh拉,确定CMOS输入引脚,
> >添加一个小电容,所以它是一个50赫兹或60赫兹的低通,
> 也对尖峰,RFI保护。
>
> 一个人的我用过真正得到下一个mA松鼠,和时新。
> 他们降低了不少,随着时间的推移。希望10毫安规格。 A系列第
> 降低功耗,但。
0 new messages