n00b, Measuring RPM from an electronic HEI distributor using interrupts?

Hi all,
I'm new here and am gradually getting my head around programming the Arduino.
I am making an automotive project and would like to combine several items to produce a display on a 5 inch screen or possibly multiple smaller screens to show my cars AFR, RPM, TPS and MAP sensor inputs.

So far, I have completed the TPS section where the Arduino reads the input from a TPS connected to the throttle bracket on my carb and then displays the result as a percentage on a small 16x2 LCD screen.
The MAP sensor will be very similar to code.
The AFR will have to take an input voltage and then compare it to values in a table and then output the reading in a range from 9.0 - 20.8

The bit I am working on at the moment is looking to see how to convert the pulse signal from my HEI distributor and read it on the Arduino and convert it to an output between say 0 and 7000rpm. I have started to research this and it looks like using interrupts may be the way to go.
Has anyone had any experience of this and if so, could you possibly point me in the right direction in how I might go about achieving my desired results. I'm happy to look at links to pages where this has been done, videos, or posts to parts of code that I may be able to modify to suit my purpose.

Thank you in advance, any and all tips or advice greatly appreciated. Oh, and I am very new to this so it may take me a while to research any tips given to gain a good understanding of what is going on.

It would be a big help if you would explain all your acronyms.


There are lots of projects for the canbus system out there.

Maybe using google may help a little in your quest.

Or more canbus links specific to arduino


It would be a big help if you would explain all your acronyms.


Robin2, sorry my bad.
AFR Air Fuel Ratio
TPS Throttle Position Sensor
RPM Revs Per Minute
MAP Manifold Absolute Pressure
At the moment, as per my post, I’m purely looking for advice with measuring and displaying the output from an electronic distributor to a 16x2 LCD.
There is a cable that comes from the distributor to the rev counter so I could tap into this for the input signal. I will try and find out what sort of waveform the distributor cable outputs but I would assume I could use the hi/low state of a digital input.
I found this on the Fritzing site and wondered if I removed the code for the speed controller, would something like this work if I was to connect the tach output to pin A6 and use digital read instead of analog read.
Appreciate your input.

include<LiquidCrystal.h>                            // Include LCD Library

LiquidCrystal lcd (12,11,5,4,3,2);                   // Initializing LCD Pins

int pwm = 9;                                         // PWM (motor) is connected to digital pin 9
int pot = A0;                                        // Potentiometer connected to analog pin A0
float value = 0;                                     // Inital Case for Potentiometer (Completely OFF)
int percent;                                         // Potentiometer opening percentage as integer
float rev = 0;                                       // Inital Case for Motor (Stop)
int rpm;                                             // Revoluation per minute, unit of speed measuring as integer
int oldtime = 0;                                     // Starting
int time;                                            // Save time as integer

void isr () {                                        // Interrupt service routine
  rev ++;

void setup() {
  lcd.begin(16,2);                                   // Initialize LCD
  attachInterrupt(0,isr,RISING);                     // Attaching the interrupt

void loop() {
  detachInterrupt(0);                                // Detaches the interrupt
  time=millis()-oldtime;                             // Finds the time 
  rpm=(rev/time)*60000;                              // Calculates RPM
  oldtime=millis();                                  // Saves the current time
  value=analogRead(pot);                             // Reads the speed control POT
  analogWrite(pwm,value);                            // Sets the desired speed
  percent=(value/255)*100;                           // Finds the duty cycle %
  lcd.print(" RPM");
  lcd.print("   ");

There are lots of projects for the canbus system out there.

Maybe using google may help a little in your quest.

Or more canbus links specific to arduino


Bob, Thanks. I perhaps should have mentioned the car I am working on is a 1981 Corvette and as such has a very rudimentary engine control system that is now not in service. It does have an ODB1 port but as the ECM is no longer hooked up, its all old school.
V8 engine, carburetor, distributor.
I've built an add on TPS and will do the same for the MAP sensor. For the AFR, I have welded an o2 boss into the exhaust and will be using an Innovate wideband sensor and controller. This will have both a wideband and narrowband output which I will use for my display input.

You will find a good mix of OLD SCHOOL and new school with those links.
You are not the first to add on some electronics to older cars with Arduino so always add "arduino" to the end of your searches.

Many NON ECM approaches can be had.
Just take one part at a time as you seem to be doing and get that working before adding a second part and make sure that also works as a single entity before combining it with the previous section.
Then you can be assured that each works and that any errors will be in the combination code not the stand alone.

Some more quick examples using "non ecm arduino" as the search parameters
ECM and ECU can both be used in the search btw,

Thanks, I have indeed been searching for Arduino related tach tachometer rpm meter etc.
I'm not looking to build an ECM/ECU.

I want to add a few sensors to my engine so I can display their outputs on a screen. This information will in turn be used by myself to aid tuning the car.
I'm currently working on displaying the RPM. My idea is to read the signal from tachometer by taking the signal from the distributor and using the Arduino to convert it to a numerical display. I was just looking for a few pointers from those that have already done something similar or have an idea what the best things are for me to research.