Read rpm from an old car from alternator W+ wire

Hello, Im trying to get RPM from my old car with no ECU from alternator wire W+, it have 7v signal. I did use pulseIn to read the signal.

In my circuit the ground of arduino is linked to car's ground , Then i did use resistances to reduce 7v in 2 cases.

I will show my Arduino's code first then bellow you will find the schema i did try for bot cases :

    int PulseRPM = pulseIn(RPMPin,1000) + pulseIn(RPMPin, LOW);
    int RPMCal = 0;

    if(PulseRPM > 0)
    {
        RPMCal   = 3000000 / PulseRPM; 
        RPMCal = constrain (RPMCal, 0, 6000);       
    }
    else 
      RPMCal  = 0;
      
    Serial.print("RPM : ");
    Serial.println(RPMCal );
    

in the first circuit i did try 1K and 2.5K like this schema :

In the result i have a ot of noises at idle :

RPM : 950
RPM : 1950
RPM : 950
RPM : 950
RPM : 2550
RPM : 5000
RPM : 1300
RPM : 950
RPM : 1500
RPM : 4000

So I decided to try a second schema :

This Schema has less noises than the first one like you can see:

RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 3050
RPM : 1500
RPM : 950
RPM : 950
RPM : 950
RPM : 1100

But the weird thing is when I turn ON the High beam (200watt in total) the second shema works like a charm :

RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 950
RPM : 950

please any one can help or explain how i could get over it ?

Thank you for taking time and respond

Props for adding a schematic!
Like you said, the problem is likely noise. You could include a small capacitor from A0 to GND to smooth out the signal. You'd have to calculate a suitable value, but I suspect something like 10nF or 100nF would help.

I'd also be inclined to have a look at the signal with a scope to get a feeling for the nature of the problem you're dealing with.

In the second schematic, the 4.6V will be 3.5V because of the additional current drawn by the 2nd set of resistors. The 2.3V then will be 1.75V.

1 Like

I'm pretty sure the W terminal is A/C, it's before the diodes..

~q

Hi, @makavali

The method you are using is measuring the frequency of the ripple from the rectified AC from the alternator, this ripple level is affected by battery condition and load.

You would be better using the points signal to the ignition coil for a more reliable signal, however you will need some extra components to protect your controller from ignition spikes.

Did you Google;

arduino engine tacho

They show other methods.

What model Arduino are you using?
Do you have an oscilloscope?

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

1 Like

I will try 100nF between A0 and gound, thank you for your suggestion.

I do not have a scope, but i think i will install matlab and try to get signal with

I do not have Air conditionner in my car for now

Arduino Nano, I do not have oscilloscope but i will try Matlab

lol, i meant ac voltage..
W is waveform, the ac output before the rectifier diodes..
The frequency follows rpm..
But pretty sure it's AC, alternating current..
~q

Lol my bad !

In this case how i could transform the W wire to direct current ?

diodes to rectify..
Interesting info..

i googled exactly your post title..
lot's of good info..

pretty sure they sell tachs that plug in..

but yes, in reading through some of this..
there will be noise or variations when lights turn on, when batt starts charging..
off the shelf tachs must deal with it??

probably better off sticking a magnet on the crank shaft and use a sensor to read it..

not sure what you need exactly, maybe someone else can offer advice on how you should rectify..

kind of makes sense, full wave rectify 7vac and you should see 14vdc which would be needed to charge a 12vdc batt..

~q

  const uint16_t Sixtousend = 6000;
  uint32_t PulseHIGH = pulseIn(RPMPin, HIGH);
  uint32_t PulseLOW = pulseIn(RPMPin, LOW);
  if (!PulseHIGH || !PulseLOW)return;
 
  uint32_t RPM =  60000000UL / (PulseHIGH + PulseLOW);
  if (RPM > Sixtousend)RPM = Sixtousend;

  Serial.print("RPM : ");
  Serial.println(RPM );
  delay(10);

Have you considered the alternator output will not be a reliable indicator of engine speed?

As @herbschwarz says, In your "second schema" the voltages are wrong. should be 7v: 3.5V: 1.75V to A0

You are using an analog input and a basically sinusoidal waveform - I dont know how successfully pulsein will deal with a signal that isnt a pulse.
If you connect instead to a digital input pin the hysteresis my be enough to overcome noise and give you a decent reading. (explanation here)

I did keep the second schema and used a capacitor, now its working like I want, thank you so much for your help !

1 Like