Read Rpm from car tacho's WPM signal?

Hi to all. I want to make a tachometer with my arduino but I have the following problem!
I have transformed a code I found to the internet and when I feed the arduino with voltage pulse at the pulses per second I want with a pulse generator and use tha interrupt it works fine and I see the revs that the car engine has at the specific pulses per second! Now when I tried to connect that to thecar tachometer (after the cirquit that the tacho has inside and gives the 5v PWM signal to the system that moves the indicator) and the code I have doesnt work. Does anyone have an idea what can I do to make that work? Thanks...
My code :

float start;
float elapsed;
float speedk;    
void setup()
{
  attachInterrupt(digitalPinToInterrupt(2), speedCalc, RISING); 
  start=millis();
  
  
  Serial.begin(9600);
  
}

void speedCalc()
{
  elapsed=millis()-start;
  start=millis();
  speedk=(60/(elapsed/1000)); 
}

void loop()
{

  Serial.print(int(speedk));
  Serial.print(" rpm ");
  
  Serial.println(int(elapsed));
  Serial.println(" ms/rev      ");
  delay(50); 
}

So I need to convert the code to read PWM signal?

How is your circuit wired to the car?

Does the car and the Arduino share a common ground connection?

Yes! But the signal is PWM and the code I think is not for that!

Panosrc:
and the code I have doesnt work.

What does this mean? Do you get any output from the Arduino?

Does the Arduino lock up?

Can you output serial statements to see where the code isn't work?

Does it always read zero?

connect that to thecar tachometer (after the cirquit that the tacho has inside and gives the 5v PWM signal to the system that moves the indicator) and the code I have doesnt work. Does anyone have an idea what can I do to make that work?

How do you know what the signal you have picked up looks like? Have you used a scope? Do you have documentation on the tachometer?

DuaneDegn:
What does this mean? Do you get any output from the Arduino?

Does the Arduino lock up?

Can you output serial statements to see where the code isn't work?

Does it always read zero?

Yes I have some output to the serial monitor but it is absolutely wrong numbers and it chand a little to the engine revs to high rpm.

Yes I have scope the tacho signal and its a sqare signal and tge code cannot read that!

Car instruments such as speedometers and tachometers, often use an air core guage.

These have two coils at right angles to each other. By varying the current through the two coils, you can alter the direction of the resultant magnetic field.. A magnet attached to the pointer aligns itself with the magnetic field,

The current through one coil is proportional to the sine of the angle that you want the pointer to display, the other current is proportional to the cosine of the angle that you want the pointer to display.

These meters do not use PWM.

Yes I have scope the tacho signal and its a sqare signal and tge code cannot read that!

it is absolutely wrong numbers and it chand a little to the engine revs to high rpm.

What is the repetiton frequency of the square wave pulse to the tach? When you have the tacho signal on the scope, does the time time it is high change with the engine revs? If so, what is the range on the length of time the signal is high from idle to top rev?

It's possible the tach is a 270 degree servo and then it will be a simple matter to read the pulse width with the Arduino, (using an interrupt triggered on the rising and falling edge to determine the start and end times), map it to rpm, and display or do whatever with the data.