Reading rpm from car

I’m trying to make an truck RPM reader where it will output a signal once the RPMs exceed a set-point, this i believe i can easily code, what i am having trouble is having to know what circuit to build for the best performance.

I have 2 approcahes into what im trying to build, a simple RPM and a complex.(not really complex.)

Simple: have a potenciometer as a set point and simply read the alternator’s frequency and when the reading gets over the mapped value on the pot the output led will light up.

Complex: have a setpoint or maybe more than one set point that will light up 1 or more outputs, depending on the quantity of setpoints.

My problem:

I don’t know whats the best way to actually shift down the signal to get it into the arduino, in the Simple approach a voltage divider might do the trick, but yet im not sure if i could trust the not so stable voltages the alternator outputs. I’m looking for the cheapest but reliable way on doing this. I’m researching on what opto-coupler i could use since from my understanding the voltage is not always stable so I’m not sure if that is a good approach.

for the complex one, I’m not sure how i can know a way of actually knowing the RPM since these trucks are diesel fueled and i don’t have a spark-plug where i could sense the voltage on it to know revs, any suggestion into this approach?

The following code works reading a signal from a frequency generator but at 5v levels.

int Htime;              //integer for storing high time
int Ltime;                //integer for storing low time
float Ttime;            // integer for storing total time of a cycle
float frequency;        //storing frequency
float mapper;
int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 13;
int sensorValue = 0;
void setup()
    pinMode(ledPin, OUTPUT);
void loop()
    sensorValue = analogRead(sensorPin);
    Htime=pulseIn(8,HIGH);      //read high time
    Ltime=pulseIn(8,LOW);        //read low time
    Ttime = Htime+Ltime;
    frequency=1000000/Ttime;    //getting frequency with Ttime is in Micro seconds

      digitalWrite(ledPin, HIGH);
      digitalWrite(ledPin, LOW);

pato_llaguno: I don't know whats the best way to actually shift down the signal to get it into the arduino,

What do you know about the signal? What voltage? Positive or negative? Pulse width? Pulse voltage? The input pins read HIGH for any voltage over Vcc*0.6 (3V) and LOW for any voltage under Vcc*0.3 (1.5V). If it is a "12V" signal you should be safe with a 'divide by three' voltage divider. That would give you a HIGH signal for 9V to 15V and LOW for any signal under 4.5V

The alternator output is rectified DC, so it's unlikely you will get any viable signal there. Is the truck mechanical injection or electronic injection? if it has a computer in it, chances are it has a tachometer input. If not, you might try a hall effect sensor and a small magnet on the crankshaft dampener running off 5v.

Hi, I presume you have a diesel motor and usually the alternator is used for a tacho signal. If so your alternator will have an extra output terminal that supplies the [u]rectified AC[/u] for tacho signal.

You will have to cal your tacho with an external tacho, because of belt/pulley ratios.

Tom... :)

How about attaching a piezo directly to the engine? Read the frequency as if it were a musical tone.

It would be helpful to know what signal is available to detect RPM. It would be really helpful to have an oscilloscope captured waveform to design around.

The alternator may have a tap for the purpose of signalling RPM which would be either one of the three phases (a sine wave) or a rectified version of that. If so then it just needs to be squared up and presented to the microcontroller at the proper voltage levels.

If there is no RPM tap available then it should be possible to detect ripple on the three phase rectified output of the alternator, the (nominal) DC bus. This would require a DC block, low pass filtering to mitigate impulse noise, probably some amplification, and conditioning to the proper digital voltage levels.