Searching \ for 'slow sine wave freq counter' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/method/math.htm?key=sine
Search entire site for: 'slow sine wave freq counter'.

Truncated match.
PICList Thread
'slow sine wave freq counter'
2002\10\02@012948 by Jason Thrasher

flavicon
face
Hi all,
For my first pic app, I'm trying to use a 16f84's TMR0 to measure the period
of a slow, weak, sine wave from a sensor.  Since the sensor is analog, does
anyone know of a good way to square the wave up nicely to 0-5V logic levels?
Any recommendations for conditioning circuits?

The sine signal is generated by a stationary coil with a magnet spinning
next to it.  The signal looks like a  2~10mV p-p wave at about 5-200 Hz (the
rate of the magnet).

I'm using a 32.768kHz crystal and TMR0 to track time.  RB0 is set to work as
an interrupt, which is the input from the sine wave signal (or conditioning
circuit).  My program is (appears) working properly with the interrupt when
I manually connect RB0 from +5V to GND to trigger it.

I've looked at the LM311 comparator, and tried a circuit with one, but I can
only get it to detect noise from jiggled wires, and not the small signal.
It's a damn good noise detector.

thanks for any input,
Jason

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@020604 by mpoulton

flavicon
face
How about a comparator with the sensor connected across the
inputs?  The output will go high during the positive half
cycle and low during the negative half.  That would probably
be just what you want.  If you use a PIC with an internal
comparator, you won't even need additional components.

---- Original message ----
>Date: Tue, 1 Oct 2002 22:10:17 -0700
>From: Jason Thrasher <.....jasonKILLspamspam@spam@POWERWEBDEV.COM>
>Subject: slow sine wave freq counter
>To: PICLISTspamKILLspamMITVMA.MIT.EDU
>
>Hi all,
>For my first pic app, I'm trying to use a 16f84's TMR0 to
measure the period
>of a slow, weak, sine wave from a sensor.  Since the sensor
is analog, does
>anyone know of a good way to square the wave up nicely to 0-
5V logic levels?
>Any recommendations for conditioning circuits?
>
>The sine signal is generated by a stationary coil with a
magnet spinning
>next to it.  The signal looks like a  2~10mV p-p wave at
about 5-200 Hz (the
>rate of the magnet).
>
>I'm using a 32.768kHz crystal and TMR0 to track time.  RB0
is set to work as
>an interrupt, which is the input from the sine wave signal
(or conditioning
>circuit).  My program is (appears) working properly with
the interrupt when
>I manually connect RB0 from +5V to GND to trigger it.
>
>I've looked at the LM311 comparator, and tried a circuit
with one, but I can
>only get it to detect noise from jiggled wires, and not the
small signal.
>It's a damn good noise detector.
>
>thanks for any input,
>Jason
>
>--
>http://www.piclist.com#nomail Going offline? Don't
AutoReply us!
>email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in
the body
>
>
--
Mike P.
MTP Technologies
KC0LLX

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@114315 by Wagner Lipnharski

flavicon
face
From 2 to 10mVpp is not difficult to use any comparator, even the old
LM339, but this sensor output being magnetic pickup can be tricky, any
slower rotation of the magnet can drop down the pickup coil output so much
that the comparator can start to miss pulses. Anyhow, at this voltage level
you should take all possible extra care for noise, using shielded cable or
at least twisted pair.

To avoid most noise, the best deal would be to use a differential
amplification away from the Comparator power rails (Ground or VCC).

The R100 and 100nF cap offer a better filtered power to the bridge.

The Trimpot R2k2 should be adjusted to offer few +microVolts to the (-)
comparator input, so it will keep its output low when no signal from
pickup.  It would also compensate the lack of precision of the R100k
resistors and some possible temperature variations. Adjust the R2k2 for the
worst case, so it should work fine in all other situations.

This should not be a problem, but you "may" try to find the best polarity
for the pickup installation on the bridge.  In one way, the comparator will
detect the incoming magnet, the other way it will detect the magnet going
away.  As the comparator will be powered by pure 5V (no double supply), you
will have a single positive output when the magnet would be passing by.

Some pickup coils have a magnetized nucleus, sometimes for those, you get a
stronger signal when certain magnetic polarity alignment is done with the
moving magnet or piece of metal (metal gear or dent in a wheel).


        +5V
         o
         |
       R100
         |
         |
 .-------o----------.         +5V
 |       |          |          o
 |     R100k      R100k        |
 |       |          |      |-_ |
_|_      o---COIL---o----(+)  '-_
---      |          |      |     '.___ out
 |100nF  o---------------(-)   _-'
 |       |          |      |_-'|
 |     R100k      R100k    '   |
 |       |          |          |  Comparator
 |     R2k2<--.     |         _|_
 |       |    |     |         GND
 '-------o----o-----'
         |
        _|_
        GND


You can try also this combination, but I will not bet much on it:

        +5V
         o
         |
       R100
         |
         |
 .-------o             +5V
 |       |              o
 |     R100k            |
 |       |          |-_ |
_|_      o---------(-)  '-_
---    COIL         |     '.___ out
 |100nF  o---------(+)   _-'
 |       |          |_-'|
 |     R100k        '   |
 |       |              |  Comparator
 '-------o             _|_
         |             GND
        _|_
        GND


In this one, you can change the value of the pair R100k to change
sensitivity, but no very low values, since in this circuit you are forcing
a dc current through the coil.


Wagner Lipnharski - email:  wagnerspamspam_OUTustr.net
UST Research Inc. - Development Director
http://www.ustr.net - Orlando Florida 32837
Licensed Consultant Atmel AVR _/_/_/_/_/_/




Mike P. wrote:
{Quote hidden}

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Wagner Lipnharski - UST Research Inc
Orlando FLorida - USA - http://www.ustr.net
/_/_/_/ Atmel AVR Consultant /_/_/_/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@121140 by Wagner Lipnharski

flavicon
face
Wagner Lipnharski wrote:
> From 2 to 10mVpp is not difficult to use any comparator, even the old
> LM339, but this sensor output being magnetic pickup can be tricky, any
> slower rotation of the magnet can drop down the pickup coil output so
> much that the comparator can start to miss pulses. Anyhow, at this
> voltage level you should take all possible extra care for noise,
> using shielded cable or at least twisted pair....

[snip]

wow, I just sent it once... hmmm, what happened? I received 3 of them.

Wagner.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@121553 by Dale Botkin

flavicon
face
On Wed, 2 Oct 2002, Wagner Lipnharski wrote:

> wow, I just sent it once... hmmm, what happened? I received 3 of them.

Someone's mail server is bouncing messages back to the list, I'm looking
for the culprit now.

Dale

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@143317 by Mike Singer

picon face
Wagner Lipnharski wrote:
> From 2 to 10mVpp is not difficult to use any comparator, even the old
> LM339, but this sensor output being magnetic pickup can be tricky, any
> slower rotation of the magnet can drop down the pickup coil output so
much
> that the comparator can start to miss pulses. Anyhow, at this voltage
level
> you should take all possible extra care for noise, using shielded
cable or
> at least twisted pair.
> To avoid most noise, the best deal would be to use a differential
> amplification away from the Comparator power rails (Ground or VCC).
.
.
.
Wagner Lipnharski wrote in "2-tran boost circuit; 5v -> 13v":
> Sometimes I understand the effort for the search the best possible
solution
> using the simple components. But also, sometimes I suggest to move and

> use actual available technology, something that, by the way, is just
here
> based on our own requirements and demands for a better and easier
solution.

Really, why not "use actual available technology"?
Why not to amplify the signal and use PIC's 10-bit Analog-to-Digital
Module?
There are PIC software masters on the List, who could easily implement
the kind of  "Fast Fourier Transform" or " The Goertzel Algorithm".

Mike.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@151203 by Wagner Lipnharski

flavicon
face
Mike Singer wrote:
{Quote hidden}

Anyway, it needs to amplify the signal, since 2V / 10 bits = less than 2mV
for the pickup coil output in low speed. Applying direct the PIC ADC it
will not be enough to load the ADC at a confortable level.  At this level
the signal to noise ratio is small, what requires a differential amplify.
I really don't see the reason to apply a FFT just to recognize a rotational
magnet. Once you detect the pulse and let the comparator amplify it to the
extreme, a nice square pulse will be available to any port pin. But
everything is possible, there are crazy people all around to do all sort of
strange things, me included.

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Wagner Lipnharski - UST Research Inc
Orlando FLorida - USA - http://www.ustr.net
/_/_/_/ Atmel AVR Consultant /_/_/_/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@155929 by Mike Singer

picon face
Wagner Lipnharski wrote:
> ... But everything is possible, there are crazy people all
> around to do all sort of strange things, me included.

And me also: instead of just writing few words on a paper
with a pen, I sometimes print them from MS Word,
incapsulating millions bytes of code, billions PC transistors,
0.18 micron technology, HDD MR stuff , inc jet etc.

Mike.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2002\10\02@163843 by Mike Singer

picon face
Wagner Lipnharski wrote:
> Anyway, it needs to amplify the signal, since 2V / 10 bits = less than
2mV
> for the pickup coil output in low speed. Applying direct the PIC ADC
it
> will not be enough to load the ADC at a confortable level.  At this
level
> the signal to noise ratio is small, what requires a differential
amplify.
> I really don't see the reason to apply a FFT just to recognize a
rotational
> magnet. Once you detect the pulse and let the comparator amplify it to
the
> extreme, a nice square pulse will be available to any port pin. But
> everything is possible, there are crazy people all around to do all
sort of
> strange things, me included.

Another "crazy" enough to be interesting approach:

1. Voltage to frequency converter, battery powered.
2. Optocoupler
3. PIC, counting pulses
4. PIC software (rather complex)

Mike.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspamspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...