Go Down

Topic: High Voltage AC Sensor To Arduino (Read 1 time) previous topic - next topic

Mk1_Oz

I am at the beginning stages of scoping out a car data logging project.  I am a relative newbie to the world of electronics but have dabbled a little bit to date.

One of my proposed sensors is a magnetic induction sensor that will provide me an AC signal for engine RPM.  Depending on engine RPM it appears to output from a few volts up to around 50+/- volts.

I have tried to research options for using this sensor with an Arduino but got very confused with the technical jargan!

What options, if any, do i have for using this sensor?  I am thinking there must be some way of effectively converting the signal to a digital square wave.  The signal appears to be quite clean as I have used it for other purposes on my Picoscope.

Changing to a hall effect sensor is not an option but would be the obvious answer.

wvmarle

Converting AC to block signal is easy, use a schmidt trigger for that. The tricky bit may be to find a schmidt trigger that can do +/- 50V or 100V, preferably double that to survive spikes.

This however will make you lose any voltage information of the AC signal. For that, you could use a rectifier (a single diode is enough; I assume both positive and negative signals are equal) + capacitor to smooth out the signal (a rather small one will do for this) + voltage divider + 5V zener to protect your port from over voltage.

That said, it appears that your real question is: how to measure the RPM of the engine. There are lots of RPM sensors out there, what works for you will depend on how you can connect it to your engine and what RPM you expect. Exposure to water, dirt and heat may also limit the choice.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

edgemoron

Can you post a link or brand name / part nr for that sensor? What is it sensing?

Mk1_Oz

It is this one;

http://www.rsshop.com.au/magneti-marelli-speed-sensor.html

I have a trigger wheel mounted to the engine (metallic but not magnetic) and this sensor.  This is the one I want/have to use.

I do not need any voltage information in the signal - the voltage is just a function of RPM but is not to be used to determine that RPM - so the Schmidt trigger sounds like the go.  Never heard of one before so i will research.

...and my real question was as i stated! lol.............

Mk1_Oz

#4
Aug 20, 2017, 08:14 am Last Edit: Aug 20, 2017, 08:23 am by Mk1_Oz
Realised I have heard of Schmidt trigger in relation to debouncing switches.


Looking into Schmidt triggers I think they may be what I need.  However, I have been playing with the following calculator;

http://pcbheaven.com/drcalculus/index.php?calc=st_nonsym_sp

but cannot work out what 'Supply Voltage' really means.  My sensor will output an AC voltage that at low RPM may max at say 4v but at full RPM may max at say 50v.  I need to connect the square wave output to an Arduino so need that output to be 5v.  Is the 'Supply Voltage' 4v, 5v or 50v?  Once I can understand that I can determine what resistors i need to give me the switch points I want.

I don't think a rectifier will work given the requirement to keep the voltage to a level that an Arduino will hande?

Also, as far as i can see, the output of a Schmidt trigger will be proportional to its input?

Further, it appears starting with an Op-Amp (another new term to me!) is the way to go then adding resistors creates the differential switch points?

Learning is hard work.......

wvmarle

#5
Aug 20, 2017, 02:24 pm Last Edit: Aug 20, 2017, 02:24 pm by wvmarle
This should do the job.



D1 lets pass only the positive half of the cycle; C1 stabilises the voltage. 10 uF is plenty big enough, 1 uF is probably enough already, and will help getting faster reaction. Then a 1:11 voltage divider. 50V in brings the voltage on the Arduino down to 4.55V; 5V input gives you 0.45V on the pin. That's a comfortable range for the ADC - your reading there will be a direct measure for your rpm. The 5V zener D2 makes sure the voltage can never be >5V on the pin; this is protection. The zener will leak quite seriously at >4V so the higher voltages may not be very accurate.

Another thing: R1 may need to be more like 15k as a 50V AC usually means about 70V peak, and it's the peak that you are measuring this way.

Mind that higher R1+R2  and larger C1 means the circuit will react slower to changes in RPM (reaction time may be in the order of seconds, depending on the RC constant of the circuit).

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Mk1_Oz

Thanks for taking the time to draw that up.! 

The way my sensor works is that at low engine RPM it outputs a sine wave at low voltage (say +/-4v peaks) but at high RPM those peaks are close to +/-50v.  Although the voltage divider will reduce the 50v to 4.55v will it not reduce the 4v to something like 0.35v? Also this isn't s square wave output to the Arduino?

I love to learn but to be honest i am on the edge of my knowledge/ability

wvmarle

Thanks for taking the time to draw that up.!
No problem. Took a few minutes maybe, including posting it here. Just a quick sketch.

Quote
The way my sensor works is that at low engine RPM it outputs a sine wave at low voltage (say +/-4v peaks) but at high RPM those peaks are close to +/-50v.  Although the voltage divider will reduce the 50v to 4.55v will it not reduce the 4v to something like 0.35v?
Here is the thing about sine waves: the peak is a lot higher than the average. If you're measuring mains voltage, you see 220V on your multimeter, yet the peaks of that voltage are at about 360V. For your system it works the same, so if you say 4V is that the average or is that peak?

Quote
Also this isn't s square wave output to the Arduino?
No - this will be a very constant voltage, no peaks, and the voltage you get out is the peak voltage rather than the average. So you can put in 4V AC and get out about 6V DC. So before hooking this up to your Arduino you really should take a multimeter and measure what voltages you get across the capacitor.

This way you can measure the voltage without having to worry about waveforms, as you said your voltage is a direct measure for the RPM so this sounds like the simplest way of doing this.

If you really want square wave output, you gt a different circuit. I think you'd best use an OpAmp for that. Use the voltage divider/zener combo as above to protect the input of the OpAmp, and let it produce a square wave. The output will be a wave between 0V and 5V, regardless of the input voltage. Use a circuit like this if what you're after is the frequency of the signal. This you can measure using a pulseIn() call (measure the duration of a single pulse - for low frequency signals) or by counting the number of waves for a period of time using an interrupt.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Mk1_Oz

My 4v i mentioned is the peak figures (+/-) as is the 50v figure.

Right. Using the sine wave signal as a frequency from which to drive RPM is what u want.

My understanding is that an op-amp becomes a schmitt trigger by adding a few resistors that determine the upper and lower voltage on/off points.  Using your zener bits to limit the voltage in (ie limit my max of +50v peak) to the op-amp to whatever it can handle is great.  At low RPM when the sensor output is around 4v peak the zener bits probably wont be needed.  I guess this will also remove the negative part of the sine wave which is surplus to my needs anyway.

Ok i am starting to get somewhere.

Not being very good at this stuff i wish there was an off the shelf part to just make this all happen! !!

wvmarle

The zener just won't do anything at the 4V levels, it's protection. You still need a resistor between the input signal and the zener. I'm sure there are folk here with much more experience with OpAmps that can suggest specific circuits, or do a Google search for this.

Basically you wire the OpAmp as comparator, so whenever the voltage of your signal is the slightest bit (in practice a few mV) above your reference (could be GND), the output will be at Vcc.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

MorganS

It still looks like you are barking up the wrong tree. Get a sensor which works at the Arduino's voltage to begin with. Hall effect or proximity sensors are perfect for this.

If it is a reasonably modern car with OBD2 then plug into that and use the engine's own sensors.
"The problem is in the code you didn't post."

Mk1_Oz

No barking. Using what i have already. I know a hall effect sensor would be better but i don't have one installed on this engine. Only an induction sensor.  Very old car. ....

I have spent slot of time looking into schmitt triggers and they appear to be my immediate solution.  One thing i have not been able to work out (most tutorials are pegged at a higher knowledge level than mine) is what is connected to the +Vcc and -Vcc points.  The attached pic seems reasonably standard. On the triangle V2 is my ac sine wave and V1is ground.  Rdiv1 and Rdiv2 take care of the upper and lower trigger points. The output is the output (i want +5v or 0v). But what is +Vcc and -Vee. Is this a +5v input and ground ie that gets outputed as the square wave? Sorry to be stupid.....

wvmarle

The negative rail is often connected to GND for single supplies. See this page for examples.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Mk1_Oz


MarkT

If you put the tachogenerator signal through a series resistor through a pair of back-to-back diodes you'll
get a nice 1.2V peak to peak signal whose voltage is relatively insensitive to the speed.  Try 10k or so.

This diode clipping circuit is commonly used for limiting voltage of an ac signal or protecting an input.
http://www.electronics-tutorials.ws/diode/diode-clipping-circuits.html
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up