Read RPM and SPEED from ECU EDC15

I have a 2002 car with EDC15 ECU, I want to read RPM and Speed throw ECU.

I did get RPM wire (7volts) and Speed wire (11volts) directely from ECU and linked it to arduino nano using resistances to reduce voltage.

when I compile I get always ZERO for both speed and RPM.

Any suggestions please. Thanks

Please show your circuit, particularly the inputs

maybe worth having a look at post can-an-arduino-perform-this-task-pulse-counter which is also measuring RPM

what microcontroller are you using?

here is my schema hop its clear

You're using analog pins A4 and A7 (int rpm_freq = A4; int speed_freq = A7;) for reading frequency signals with interrupts, but analog pins don't support interrupts on most Arduino boards, including the Nano. That's why your ISR functions never trigger, and both speed and RPM stay zero. Use digital pins that support interrupts, like D2 or D3 on Arduino Nano.

have you an oscilloscope or logic analyzer to look at the signals?

I will use D9 and D10 that are free on my arduino, and let you know, thank you for your suggestion

Unfortunately I do not have !

I can confirm that the code works (with the pins changed) on an Arduino Uno R3, with pulses sent from a function generator.

I am using pins D2 and D3, for r.p.m and speed.

Here is an oscilloscope trace showing a frequency of 100Hz (=3000rpm) applied to pin D2, and 71Hz (=100 mph/kmph) applied to D3, together with the results from the serial monitor:

The speed is reading 3002 rpm rather than 3000 rpm because my Arduino clock frequency is not exactly 16MHz.

There are only certain pins that can be used for interrupts.

There is a list of of the pins that can be used at: docs.arduino.cc/language-reference/en/functions/external-interrupts/attachInterrupt/

For an Arduino Nano you can only use the ones recommended by dhamu.
(They are the pins that I used when I tested your code in post #9.)

I did try D9 and D10 but not working. Thank you for this information, I will try know D2 for RPM and D3 for Speed and let you know. Thank again

You are right, just test it and it works like a charm ! Thank you again

Glad to hear you got it working.

It's worth getting a low cost logic analyser.
You can get them from around 10 £/$/€. They use the free PulseView software.

Here's how it records your code:


You can see the pulses on pins 2 and 3, and use cursors to measure their frequency.

Pin 1 has the serial output on it. You can zoom in to see how it is decoded:

I will order one right now I found it on eBay. Very interesting how it can analyze.

Thank you again buddy.

1 Like