Limiting AC signal to 5v

Hi, I'm just getting starting with Arduino and electronics.

For my project I'm measuring a magnetic pickup sensor, and I want to detect with Arduino every time the signal crosses 0 from + to - and measure timing.
Problem is, when speeds are high, the voltage generated can go up to 40+V (and consequently also down to -40V).
How do I limit the voltage to 5v for the Uno without degrading readability or timing of the AC signal?
I only need to obtain the timing of the signal crossing 0 from + to -, measuring amplitude is not necessary.
I'm sorry if the answer to this is obvious lol

Maybe this as a basis: Zero-Crossing Detectors Circuits and Applications

1 Like

It's not
This is a classic zero cross detector circuit, it will work with input voltages from about +/-25mV up to +/-60V with a max frequency of 10KHz

Thanks a lot, however, do you have the file i can open with PSIM, so I can simulate and understand it further?
Thanks again

1 Like

No, you will have to redraw the schematic

1 Like

I thought the blue signal was supposed to give a single pulse every time 0 is crossed, not just when it's positive. Am I doing something wrong? I imported the simulation model through the TI website

No, that is how a simple zerocrossing detector works.
You can make it more complicated if you want by adding an edge detector but
in your arduino you can detect both edges. Let the software do some of the work.

1 Like

Where is the Y axis ?

You can use an interrupt to "catch" the rising edge.

Even a short pulse has a finite pulse width...

Here are some simple over-voltage and negative voltage protection circuits.

You can increase the current limiting resistor to between 1K and 10K. The 100 Ohm resistor MAY result in too much current-draw from whatever is generating the signal.

Optical isolation is also pretty-much foolproof, but at 40V the opto-isolator may also need some protection.

1 Like

image

Is this a VR sensor for detecting a rotating shaft?

It is a distributor for flat-6 engine, trying to make a test bench to measure mechanical advance.

Thanks Jim and all for help btw

I've used the GM HEI ignition modules in some applications. They are designed to interface to those magnetic pickups.

I've bought the components and done the wiring, and I'm not getting the results I see on my ltspice simulation and I don't understand why.

First of all it doesn't vary from 0 to 5v but from around 1.5v to -4.5v at lower frequencies, and between 3v and -2v at higher frequencies. I thought this could still be usable for my arduino code, but at higher frequencies the voltage dips in the middle of the the HIGH value:

I've checked my wiring and it's correct, the only issue I can see is how I've wired my ground connections, I've used the bus strip to connect all ground connections to the Arduino GND.
Also, although I don't think this should change anything, it's worth mentionning that I've used a LM393P, 1N914TR and a 0.1uF capacitor instead of the indicated components as those were the available ones. I have also connected one of the connectors of the input signal to the gnd bus strip.
Other thing is that the 12v source used is also connected to a dc motor controller for spinning the distributor. The circuit uses the positive terminal of the 12v generator and the ground terminal isn't used.

image

You need to have DC coupling.

Can you post some images of your project?
So we can see your component layout.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

What @TomGeorge already pointed out
Those pickups don't output a sinewave but something that looks like a positive spike followed by a negative spike. It may be crossing zero at those dips.
Don't know if you scope is fast enough to see narrow glitches

Thanks, selecting dc coupling has solved the 0 to 5 issue, but the dips are still happening, and they're definitely not supposed to be there.
My wiring is messy, but the crocodile clips you see are the 12v connected to the dc motor controller.
The black and grey wires is the input signal.

My oscilloscope is a single channel, thats all I have for now. I can send a picture of what the input signal looks like tomorrow, but from what I could see those dips in the high value aren't supposed to happen.

5V zener + bias


+
image

I made a mistake . That circuit will only work with the LM339. For the LM393 it will have problems once the input amplitude goes above 10V.

This circuit should work bettor and only needs a 5V source. So a possibly dirty 12V supply is eliminated.

The coil represents your pickup. Note that neither lead is grounded.