Arduino and tachometer from 12V car battery gen

Hi all,

Does anyone have an idea of how to get sensible frequency measurements from the "W" output of a car battery generator? As I understand it, the W gives raw pulses (of up to 15V) AC. Now there must be a way to "tame" this to a LT 5V signal and measure the frequency. Any ideas? :stuck_out_tongue:

I'm not much on car mechanics, but are you talking about the output from an "alternator" or an old fashioned "generator"?
If I ain't mistaken, I believe the output of an alternator comes out in three-phase AC, which is actually three simultaneous AC voltages coming out at once, on three or more conductors. If you read between two of them you should get one AC voltage reading at whatever freq. that might be, and all three freqs. should be the same.

Like I said, I'm not a car mechanic, but three-phase is three-phase, which I haven't worked with or studied for quite a few years, and I'm not even sure if that's how car alternators operate. There are probably circuit diagrams for frequency analysers/counters to be found on the internet; maybe one or more of them could be applied to an Arduino.

I'm sorry I can't be of much more help, but thought I would add some information.

Thank you for that Patrick,

You are right, I am talking about a n alternator. And the "w" pin on the alternator gives a pulse I want to read the frequency of, this is only from one of the magnets, so it should be one phase only. Anyone done something similar?


You could rectify it and then use a voltage divider. Since you won't be drawing hardly any current this should work. Then just count the pulses. You can set the arduino to interrupt on a pin when it reaches a certain threshold. Just make the interrupt handler increment a counter.

Thanks a lot both of you, you really helped me on thight track


I was trying to build a digital tachometer readout and took a signal off the low tension line of the distributor through a 24k resistor to a digital input with an 11k pull down (odd values because they were what I had to hand):

Low tension from distributor >---[24k]---o---> input 2

I used the interrupt to count the pulses and then divided them by 2 (2 pulses per revolution).

I only tried it once on an old 4 cylinder VW engine and didn't blow anything up, I'm sure there are better ways to protect the input but it worked for me!

Good luck.

For some reason on I feel silly using the word "zener" in two posts on the same day...

I am sure there is a yet better way to protect the Arduino, but a 5 volt zener with the anode (unstriped positive end) to ground is probably the minimum. Any thing over 5 volts gets shunted to ground.

zener zener zener :stuck_out_tongue:

Zener diode it is then!

On some motorcycles, the electronic tachometer gets its input from the output of the electronic ignition. That's the same output that feeds the low side (primary) of the ignition coil (transfmormer). This output comes out as pulses.

To be used as input to the tachometer, the pulses are fed to a frequency to voltage converter, such as an LM2917 IC chip, which converts those pulses into a varying dc voltage that varies in proportion to the pulse frequencies. Of course, the pulse frequencies are in direct proportion to the engine RPM.

Once those pulses are converted into varying dc, the tach circuitry just reads that varying dc as a volt-meter would. The LM2917 chip was made specifically for this purpose, and Information on the chip can be found on the internet. Here's a location: [u][/u]

However, counting those pulses is a problem, because the ignition coil causes a lot of ringing and distortion and will give a counting circuit a lot of problems to deal with, which results in miscounts, discounts and no-accounts in the kings court. ;D(old joke). I know this, because I tried to do that, and it didn't work so good. But, I did try the LM2917 route and it worked for my purposes.


I forgot to mention that, the 12v pulses from an electronic ignition need to be dropped to less than 5v before applying them to a microcontroller ckt. On my motorcycle, I fed the ignition pulses to a 220K res. in series with 110K res to ground, then took the voltage pulses from across the 110k to ground, which resulted in pulses of less than 5v. I tried using a 5v Zener diode across the 110K, but I found that Zener's require a certain level of current to operate properly and that the 220k res. was restricting the current to a level that was too low for the Zener to operate properly. So took the zener out, since it wasn't working anyway.
So I use a clipper circuit to clip the pulses to whatever voltage level I want. Here's where you can find info on clipper ckts*.:frowning:*

In place of the clipper ckt. battery I used a 3.3 voltage regulator, and it worked.


FYI GrumpyMike just provided this in another post
input protecton

so what did you do

how i make mine rpm reader?


Actually I haven't gotten any farther, it's still on the project list, but I'll probably use a hall effect sensor on the flywheel to measure the RPM. Simpler that way I guess.


If you are using a high enough series impedance, then the internal diodes should be sufficient to protect the chip.

No No no, that is bad bad bad.

Look at the chorus of one of by favourite songs
"Will you still care" by The Crockets for my true answer.

No No no, that is bad bad bad.

It is close to impossible to argue against taking protective measures except with your wallet and there is also a short and long term side to that argument going both ways.

Nevertheless I'm curious to see/understand the technical justification as to why additional protection is needed. Keeping in mind also that the built-in diodes have a forward voltage of 0.3V whereas whatever external diodes you add are likely to have a significantly higher forward drop.

There's also an application note from Atmel where they suggest to use (or abuse if you like) the protective diodes for a zero-cross mains detection (one mains phase connected to a digital input pin with only a a high series resistor). In this note they state that the protective diodes are good to 1mA.

So then why should we add additional protection?

wich is the safest method to read the data

sry but i am not an engineer so my thoughts might be wrong

i also have some pcs of the above

tip35n NPN 25A
s8050 NPN 1.5A
irfz44n MOSFET 25A

thanks a lot

i made them yesterday

the fisrt

i thinh i should decrease the amps with the 3 parallel resistors

and the three resistors in series should decrease the voltage

the second one gives an HIGH 5V output when the input i at 12V
but i dont know if the LM7805 is working so fast

in the 3rd sircuit the though is to drive the transistor with the pulse

the output is on 5V from the voltage regulator and the amps are decreaced with the 2kOhm

the code is ready already

the rev burner gives an output the same as the cars singal
because it drives real tachos
except it is running on 5V

i am not sure which pin on the car is the ouput
i will test them all

For a petrol engine it is common to use the negative terminal on the coil as a tach input signal. This signal (decaying sinus) peeks at +/- 200V for every ignition pulse (2 times per RPM for a 4 cylinder 4 stroke engine, 3 for a 6 cylinder etc.). For this type of input, a single rectifier diode plus a peek detector (could be a simple voltage divider) wired to a digital input pin works well.

For a diesel engine it is common to use the W output from the alternator as a tach sensor. This is a pulse train at approximate alternator output voltage (e.g. in the 13.7V to 14.4V range against Gnd). The pulse rate is proportinal to engine RPM, but typically not in a 1:1 ratio so calibration is needed. I would wire this input directly to an Arduino digital pin through a large series resistor (e.g. 100k) and then count pulses using interrupts. You would need another tach to figure out the calibration constant needed for your RPM calculation unless you can get documentatioin on the alternator RPM to engine RPM ratio from the car manufacturer.

i have an audi 80 model of 1980 for testing

does the alternator has W wire

all the alternators have the W output?

An opto-isolator will allow you to do safe level conversion and will protect your Arduino from the nastiness of an automotive environment.

You can make one using an IR LED and a photo-transitor to do this for you. Figuring +15V a 2.1v 20ma LED you'd need a 680ohm resistor. Use the calculator here

or use R = (VS - VL) / I I.E. R=voltage source-voltage led divided by current (15-2.1)/0.02 = 645 and pick the next higher standard value.

Then hook up a the photo-transistor, this gives a digital output with a high of +5 volts

Once you get it working you can put them together with heat shrink or tape. This provides pretty good isolation.

You can buy these but that's no fun:)

This is a tad expensive but it can drive a signal farther due to the external transistors.