time-nuts@lists.febo.com

Discussion of precise time and frequency measurement

View all threads

Re: [time-nuts] Line Frequency

HM
Hal Murray
Sun, Feb 9, 2014 8:38 PM

Does any one have a circuit (tested - operational) for monitoring line
frequency? I'd like something that checks zero crossing so that it is
relatively insensitive to line voltage variations.

I'm assuming you are starting with an AC wall wart and 2 resistors to divide
the voltage down to something within range.

The easy to understand way is to use 2 more resistors to bias your input pin
at the switching threshold and a cap to connect the middle of both pairs.
The circuit would look like a H with 4 resistors on the vertical bars of the
H and a cap on the horizontal bar.  Top left of H connected to AC in, top
right to +V, bottom left and bottom right to ground, and center right to
input pin.

You can do it with 3 resistors.  Replace the lower of the 2 resistor setup
with a pair, one to ground and the other to +V.  Adjust the size of those
resistors so the parallel resistance is the same as the one you are replacing
and the middle voltage is the switching point.  Mumble.  There is a word for
this that I can't remember.  It's used for things like terminating ECL input
signals.

If you are going in to a RS-232 port, you can probably get a useful +V from
one of the modem control signals.  I forget the polarity.  You may have to
hack your software to set it to the right polarity.

--
These are my opinions.  I hate spam.

msimon6808@yahoo.com said: > Does any one have a circuit (tested - operational) for monitoring line > frequency? I'd like something that checks zero crossing so that it is > relatively insensitive to line voltage variations. I'm assuming you are starting with an AC wall wart and 2 resistors to divide the voltage down to something within range. The easy to understand way is to use 2 more resistors to bias your input pin at the switching threshold and a cap to connect the middle of both pairs. The circuit would look like a H with 4 resistors on the vertical bars of the H and a cap on the horizontal bar. Top left of H connected to AC in, top right to +V, bottom left and bottom right to ground, and center right to input pin. You can do it with 3 resistors. Replace the lower of the 2 resistor setup with a pair, one to ground and the other to +V. Adjust the size of those resistors so the parallel resistance is the same as the one you are replacing and the middle voltage is the switching point. Mumble. There is a word for this that I can't remember. It's used for things like terminating ECL input signals. If you are going in to a RS-232 port, you can probably get a useful +V from one of the modem control signals. I forget the polarity. You may have to hack your software to set it to the right polarity. -- These are my opinions. I hate spam.
MS
M. Simon
Sun, Feb 9, 2014 11:11 PM

Hal,

The resistor H bridge with a capacitor in between sounds like a good idea. Yes - I'm starting with a wall wart. About 12 VAC.  Maybe a couple of back to back diodes (zeners?) across the capacitor to make sure the voltage stays in the input range of the op amp/comparator. I like the LT1122 for speed. It is not too pricey. But there is always the ubiquitous LM111 family. I do get the ECL biasing trick you pointed out.

Chris,

Experimenting
is good. Except that to do a valid test I'd have to run the experiments
in parallel. I'm not just using this for triac triggering. I want to
take measurements in real time. i.e. a PC running an FFT will not get me
what I want.

I may ultimately have to create a test set that generates 60.000 Hz and injects a noise signal ( +/- .1V pulses at 100 KHz say) that can be turned off. The 60 Hz need not be extremely accurate. Just stable.

My counter does time triggering so I can do averaging if necessary without the counter swallowing pulses.

Simon

Engineering is the art of making what you want from what you can get at a profit.

On Sunday, February 9, 2014 8:38 PM, Hal Murray hmurray@megapathdsl.net wrote:

Does any one have a circuit (tested - operational) for monitoring line
frequency? I'd like something that checks zero crossing so that it is
relatively insensitive to line voltage variations. 

I'm assuming you are starting with an AC wall wart and 2 resistors to divide
the voltage down to something within range.

The easy to understand way is to use 2 more resistors to bias your input pin
at the switching threshold and a cap to connect the middle of both pairs. 
The circuit would look like a H with 4 resistors on the vertical bars of the
H and a cap on the horizontal bar.  Top left of H connected to AC in, top
right to +V, bottom left and bottom right to ground, and center right to
input pin.

You can do it with 3 resistors.  Replace the lower of the 2 resistor setup
with a pair, one to ground and the other to +V.  Adjust the size of those
resistors so the parallel resistance is the same as the one you are replacing
and the middle voltage is the switching point.  Mumble.  There is a word for
this that I can't remember.  It's used for things like terminating ECL input
signals.

If you are going in to a RS-232 port, you can probably get a useful +V from
one of the modem control signals.  I forget the polarity.  You may have to
hack your software to set it to the right polarity.

--
These are my opinions.  I hate spam.

Hal, The resistor H bridge with a capacitor in between sounds like a good idea. Yes - I'm starting with a wall wart. About 12 VAC.  Maybe a couple of back to back diodes (zeners?) across the capacitor to make sure the voltage stays in the input range of the op amp/comparator. I like the LT1122 for speed. It is not too pricey. But there is always the ubiquitous LM111 family. I do get the ECL biasing trick you pointed out. Chris, Experimenting is good. Except that to do a valid test I'd have to run the experiments in parallel. I'm not just using this for triac triggering. I want to take measurements in real time. i.e. a PC running an FFT will not get me what I want. I may ultimately have to create a test set that generates 60.000 Hz and injects a noise signal ( +/- .1V pulses at 100 KHz say) that can be turned off. The 60 Hz need not be extremely accurate. Just stable. My counter does time triggering so I can do averaging if necessary without the counter swallowing pulses. Simon Engineering is the art of making what you want from what you can get at a profit. On Sunday, February 9, 2014 8:38 PM, Hal Murray <hmurray@megapathdsl.net> wrote: >msimon6808@yahoo.com said: >> Does any one have a circuit (tested - operational) for monitoring line >> frequency? I'd like something that checks zero crossing so that it is >> relatively insensitive to line voltage variations.  > >I'm assuming you are starting with an AC wall wart and 2 resistors to divide >the voltage down to something within range. > >The easy to understand way is to use 2 more resistors to bias your input pin >at the switching threshold and a cap to connect the middle of both pairs.  >The circuit would look like a H with 4 resistors on the vertical bars of the >H and a cap on the horizontal bar.  Top left of H connected to AC in, top >right to +V, bottom left and bottom right to ground, and center right to >input pin. > >You can do it with 3 resistors.  Replace the lower of the 2 resistor setup >with a pair, one to ground and the other to +V.  Adjust the size of those >resistors so the parallel resistance is the same as the one you are replacing >and the middle voltage is the switching point.  Mumble.  There is a word for >this that I can't remember.  It's used for things like terminating ECL input >signals. > >If you are going in to a RS-232 port, you can probably get a useful +V from >one of the modem control signals.  I forget the polarity.  You may have to >hack your software to set it to the right polarity. > > >-- >These are my opinions.  I hate spam. > > > > > >
CA
Chris Albertson
Mon, Feb 10, 2014 12:48 AM

On Sun, Feb 9, 2014 at 3:11 PM, M. Simon msimon6808@yahoo.com wrote:

Hal,

The resistor H bridge with a capacitor in between sounds like a good idea.
Yes - I'm starting with a wall wart. About 12 VAC.  Maybe a couple of back
to back diodes (zeners?)

The normal clamp design uses two normal diodes both pointing the same
direction and in series.  Theses span the power supply rails.  Of course
they are installed in the direction where they do not normally conduct.
Your signal goes to the point where the two diodes connect.  No Zeners.
The 1N4000 series or anything like it  would be fine.  If the signal goes
higher than the higher voltage rail then the diode that connects to that
rail will conduct.  A resister in series with the input signal will limit
current to what the diode can handle.  Knowing that you can limit current,
a smaller (and faster) switching diode made be used.

I use this diode clamp setup an an Anemometer that produces AC current with
frequency proportional to wind speed.  The diodes clamp the voltage (which
can get up to 12V i a storm) just fine.  I'm using a cheap lm311.

But if this is feeding an RS232 port, the port is designed to handle about
+/- 12 volts so you'd only be protecting from shorts and other accidents.

Zeners are good for lightening protection.  So are MOVs and you might want
these on anything connected to mains power but in your application I'd just
use a handily "spike bar" aka "surge protector".

--

Chris Albertson
Redondo Beach, California

On Sun, Feb 9, 2014 at 3:11 PM, M. Simon <msimon6808@yahoo.com> wrote: > Hal, > > The resistor H bridge with a capacitor in between sounds like a good idea. > Yes - I'm starting with a wall wart. About 12 VAC. Maybe a couple of back > to back diodes (zeners?) The normal clamp design uses two normal diodes both pointing the same direction and in series. Theses span the power supply rails. Of course they are installed in the direction where they do not normally conduct. Your signal goes to the point where the two diodes connect. No Zeners. The 1N4000 series or anything like it would be fine. If the signal goes higher than the higher voltage rail then the diode that connects to that rail will conduct. A resister in series with the input signal will limit current to what the diode can handle. Knowing that you can limit current, a smaller (and faster) switching diode made be used. I use this diode clamp setup an an Anemometer that produces AC current with frequency proportional to wind speed. The diodes clamp the voltage (which can get up to 12V i a storm) just fine. I'm using a cheap lm311. But if this is feeding an RS232 port, the port is designed to handle about +/- 12 volts so you'd only be protecting from shorts and other accidents. Zeners are good for lightening protection. So are MOVs and you might want these on anything connected to mains power but in your application I'd just use a handily "spike bar" aka "surge protector". -- Chris Albertson Redondo Beach, California
MS
M. Simon
Mon, Feb 10, 2014 5:07 PM

The op amp(s) I have in mind do not allow rail to rail inputs. Some of them will reverse the output if the input goes too negative. Since I'm only interested in signals near zero a couple of back to back diodes across the op amp input is the way to go.

 

Engineering is the art of making what you want from what you can get at a profit.

On Monday, February 10, 2014 12:49 AM, Chris Albertson albertson.chris@gmail.com wrote:

On Sun, Feb 9, 2014 at 3:11 PM, M. Simon msimon6808@yahoo.com wrote:

Hal,

The resistor H bridge with a capacitor in between sounds like a good idea. Yes - I'm starting with a wall wart. About 12 VAC.  Maybe a couple of back to back diodes (zeners?) 

The normal clamp design uses two normal diodes both pointing the same direction and in series.  Theses span the power supply rails.  Of course they are installed in the direction where they do not normally conduct.  Your signal goes to the point where the two diodes connect.  No Zeners.  The 1N4000 series or anything like it  would be fine.  If the signal goes higher than the higher voltage rail then the diode that connects to that rail will conduct.  A resister in series with the input signal will limit current to what the diode can handle.  Knowing that you can limit current, a smaller (and faster) switching diode made be used.

I use this diode clamp setup an an Anemometer that produces AC current with frequency proportional to wind speed.  The diodes clamp the voltage (which can get up to 12V i a storm) just fine.  I'm using a cheap lm311.

But if this is feeding an RS232 port, the port is designed to handle about +/- 12 volts so you'd only be protecting from shorts and other accidents.

Zeners are good for lightening protection.  So are MOVs and you might want these on anything connected to mains power but in your application I'd just use a handily "spike bar" aka "surge protector".  

--

Chris Albertson
Redondo Beach, California

The op amp(s) I have in mind do not allow rail to rail inputs. Some of them will reverse the output if the input goes too negative. Since I'm only interested in signals near zero a couple of back to back diodes across the op amp input is the way to go.   Engineering is the art of making what you want from what you can get at a profit. On Monday, February 10, 2014 12:49 AM, Chris Albertson <albertson.chris@gmail.com> wrote: > > > > >On Sun, Feb 9, 2014 at 3:11 PM, M. Simon <msimon6808@yahoo.com> wrote: > >Hal, >> >>The resistor H bridge with a capacitor in between sounds like a good idea. Yes - I'm starting with a wall wart. About 12 VAC.  Maybe a couple of back to back diodes (zeners?)  > > >The normal clamp design uses two normal diodes both pointing the same direction and in series.  Theses span the power supply rails.  Of course they are installed in the direction where they do not normally conduct.  Your signal goes to the point where the two diodes connect.  No Zeners.  The 1N4000 series or anything like it  would be fine.  If the signal goes higher than the higher voltage rail then the diode that connects to that rail will conduct.  A resister in series with the input signal will limit current to what the diode can handle.  Knowing that you can limit current, a smaller (and faster) switching diode made be used. > > >I use this diode clamp setup an an Anemometer that produces AC current with frequency proportional to wind speed.  The diodes clamp the voltage (which can get up to 12V i a storm) just fine.  I'm using a cheap lm311. > > >But if this is feeding an RS232 port, the port is designed to handle about +/- 12 volts so you'd only be protecting from shorts and other accidents. > > >Zeners are good for lightening protection.  So are MOVs and you might want these on anything connected to mains power but in your application I'd just use a handily "spike bar" aka "surge protector".   > >-- > >Chris Albertson >Redondo Beach, California > >
RL
Robert LaJeunesse
Mon, Feb 10, 2014 5:47 PM

Do you intend to use this wall wart to power the circuit as well? I hope not, as a capacitor input rectifier scheme will result in decidedly non-sinusoidal current on the transformer secondary. Given a low-cost transformer with noticeable inductance and resistance the resulting waveform distortion could have unpleasant consequences for your application.

When using 12VAC into a zero crossing detector be on the lookout for oscillation problems. The dV/dt may not be fast enough to swing the comparator (amplifier?) through its linear range cleanly. It might prove advantageous to use an op-amp to gain up the input, while providing clean clipping to the sine wave, before the comparator. In the past I have used a comparator as a zero-crossing sine to square converter with an AC coupled feedback scheme that gave about 50mV of input overdrive. The overdrive decayed to well less than the comparator offset before the next zero crossing, there was good hysteresis and it was asymmetrical to get a good zero cross detect. Worked pretty nice if I recall correctly.

Bob LaJeunesse


From: M. Simon msimon6808@yahoo.com
To: Hal Murray hmurray@megapathdsl.net; Discussion of precise time and frequency measurement time-nuts@febo.com
Sent: Sunday, February 9, 2014 6:11 PM
Subject: Re: [time-nuts] Line Frequency

... I'm starting with a wall wart. About 12 VAC.  ...

Do you intend to use this wall wart to power the circuit as well? I hope not, as a capacitor input rectifier scheme will result in decidedly non-sinusoidal current on the transformer secondary. Given a low-cost transformer with noticeable inductance and resistance the resulting waveform distortion could have unpleasant consequences for your application. When using 12VAC into a zero crossing detector be on the lookout for oscillation problems. The dV/dt may not be fast enough to swing the comparator (amplifier?) through its linear range cleanly. It might prove advantageous to use an op-amp to gain up the input, while providing clean clipping to the sine wave, before the comparator. In the past I have used a comparator as a zero-crossing sine to square converter with an AC coupled feedback scheme that gave about 50mV of input overdrive. The overdrive decayed to well less than the comparator offset before the next zero crossing, there was good hysteresis and it was asymmetrical to get a good zero cross detect. Worked pretty nice if I recall correctly. Bob LaJeunesse >________________________________ > From: M. Simon <msimon6808@yahoo.com> >To: Hal Murray <hmurray@megapathdsl.net>; Discussion of precise time and frequency measurement <time-nuts@febo.com> >Sent: Sunday, February 9, 2014 6:11 PM >Subject: Re: [time-nuts] Line Frequency > > >... I'm starting with a wall wart. About 12 VAC.  ... >