Maker Pro
Maker Pro

signal converter FROM SINE TO SQUARE WAVE

J

jovic_kunic

If anyone could help it would be great. I have a sensor that is
connected to a flywheel of a car, the sensor measures the speed of
flywheel. There is an output coming from the sensor and it is a sine
wave, I would like to convert that sine wave into a square wave so the
microcontoller can read it. There is no power to the sensor it has a
magnetic coil inside it. If anyone know how to do that or any logic
gates that I could use, or that I could build it. Itwould be a great
help. Thank you
 
E

Eeyore

jovic_kunic said:
If anyone could help it would be great. I have a sensor that is
connected to a flywheel of a car, the sensor measures the speed of
flywheel. There is an output coming from the sensor and it is a sine
wave, I would like to convert that sine wave into a square wave so the
microcontoller can read it. There is no power to the sensor it has a
magnetic coil inside it. If anyone know how to do that or any logic
gates that I could use, or that I could build it. Itwould be a great
help. Thank you

Use a comparator or high gain amplifier ( squarer ). You need to provide more
info if you want more detailed advice.

Graham
 
S

sparc

if the voltage is high enough ... 5V or more ...but less than 15 ...you
could use a 40106 (schmitt trigger).
 
J

jovic_kunic

It is a magnetic sensor which in rightt next to the flywheel maybe 5mm
away. Sensor does not require power, it just outputs a signal. That
signal is a sinewave. The voltage that I am using is 12V car battery.
For my controller to read that signal it needs to be a square wave 0 -
5V. So what I bassicaly need is something between the sensor and
microcontroller that will convert that sine wave signal to a square
wave. I am using that signal so when flywheel spins at 1000 RPM, gives
the command to controller to do something, and than when flywheel spins
at 900 RPM gives the command to controller do something else.

Thank you
 
S

Stanislaw Flatto

jovic_kunic said:
If anyone could help it would be great. I have a sensor that is
connected to a flywheel of a car, the sensor measures the speed of
flywheel. There is an output coming from the sensor and it is a sine
wave, I would like to convert that sine wave into a square wave so the
microcontoller can read it. There is no power to the sensor it has a
magnetic coil inside it. If anyone know how to do that or any logic
gates that I could use, or that I could build it. Itwould be a great
help. Thank you
KISS = Keep It Simple, Stupid.
A single transistor on the 5V rail with the sensor connected to it by a
protective arrangement of resistors and diodes ( the voltages produced
are varying by the speed of magnetic field changes, and may be way off
the transistor limits).
You can use any 'inverter' or NAND gate for this function but if you
gooffed the multiple chip says "bye, bye!" (read the opening line;^))

Have fun

Stanislaw
Slack user from Ulladulla
 
jovic_kunic said:
If anyone could help it would be great. I have a sensor that is
connected to a flywheel of a car, the sensor measures the speed of
flywheel. There is an output coming from the sensor and it is a sine
wave, I would like to convert that sine wave into a square wave so the
microcontoller can read it. There is no power to the sensor it has a
magnetic coil inside it. If anyone know how to do that or any logic
gates that I could use, or that I could build it. Itwould be a great
help. Thank you

I believe the LM2917 would be helpful. You can get both a square wave
and DC proportional to the RPM out of it, and it will run on 12V.

W.J. Lentz
 
R

Rich Grise

It is a magnetic sensor which in rightt next to the flywheel maybe 5mm
away. Sensor does not require power, it just outputs a signal. That
signal is a sinewave. The voltage that I am using is 12V car battery.
For my controller to read that signal it needs to be a square wave 0 -
5V. So what I bassicaly need is something between the sensor and
microcontroller that will convert that sine wave signal to a square
wave. I am using that signal so when flywheel spins at 1000 RPM, gives
the command to controller to do something, and than when flywheel spins
at 900 RPM gives the command to controller do something else.

Thank you

Please bottom-post, it's the convention here.

You still haven't said what voltage is coming from this sensor - it
makes a significant difference in what kind of circuit you use.

Thanks,
Rich
 
S

Sjouke Burry

jovic_kunic said:
If anyone could help it would be great. I have a sensor that is
connected to a flywheel of a car, the sensor measures the speed of
flywheel. There is an output coming from the sensor and it is a sine
wave, I would like to convert that sine wave into a square wave so the
microcontoller can read it. There is no power to the sensor it has a
magnetic coil inside it. If anyone know how to do that or any logic
gates that I could use, or that I could build it. Itwould be a great
help. Thank you
I did this from a brake sensor in the rear wheel of a
car.
The problem to solve was:
a: safety.
Solved by picking the signal off with a
10Mohm resistor,so whatever you do to the other
end,it will not change the sensor voltage.
b: From low speed to high speed the signal varied
between zero and 300 volts.
Solved by putting a capacitor to ground,
differentiating to get rid of the speed dependency.
It turned out to give a signal of 4 volt peek to peek,
flat from almost no speed to top speed.
Applied that to a CMOS smittrigger,where the
protection diodes of the gate lifted the signal to
between 0 and 4 volts,and a nice square output
from .3 miles per second to 150 MPS.
Used that to trigger the interrupt bit of printer
port on my computer, and presto, had a nice
speed readout.
The interrupt speed turned out to high, took care
of that with a 4 bit counter to reduce frequency.
Your signal should behave somewhat the same way,
but you might need different components, so you
have to do some experimenting.
 
J

jovic_kunic

The voltage coming out of the sensor varies with speed of flywheel it
goes between
0 to 40 V.
 
J

jovic_kunic

Are you saying that your firt sending a signal through a resistor than
grounding it with capacitor than through a schmitt trigger, and than
you used a 4 bit counter to lower the frequency.
 
S

Sjouke Burry

jovic_kunic said:
Are you saying that your firt sending a signal through a resistor than
grounding it with capacitor than through a schmitt trigger, and than
you used a 4 bit counter to lower the frequency.
Yep.
 
J

James Waldby

Sjouke said:
I did this from a brake sensor in the rear wheel of a
car. [...]
the protection diodes of the gate lifted the signal to
between 0 and 4 volts,and a nice square output
from .3 miles per second to 150 MPS.
Used that to trigger the interrupt bit of printer
port on my computer, and presto, had a nice
speed readout.
The interrupt speed turned out to high, took care
of that with a 4 bit counter to reduce frequency.
....

The speeds you mention are fairly high (.3 miles per second
is 1080 miles per hour, and if MPS is meters per second,
that's around 335 miles per hour, or if you again mean
miles per second, 540000 miles per hour) so it's perfectly
understandable about the interrupt speed running high.

-jiw
 
S

Sjouke Burry

James said:
Sjouke said:
I did this from a brake sensor in the rear wheel of a
car. [...]
the protection diodes of the gate lifted the signal to
between 0 and 4 volts,and a nice square output
from .3 miles per second to 150 MPS.
Used that to trigger the interrupt bit of printer
port on my computer, and presto, had a nice
speed readout.
The interrupt speed turned out to high, took care
of that with a 4 bit counter to reduce frequency.

...

The speeds you mention are fairly high (.3 miles per second
is 1080 miles per hour, and if MPS is meters per second,
that's around 335 miles per hour, or if you again mean
miles per second, 540000 miles per hour) so it's perfectly
understandable about the interrupt speed running high.

-jiw
Ha. mph you jester.(I am used to km/uur)
 
Top