I’m trying to read the RPM of my motorcycle engine. The ECM sends a 12v square wave signal to the clocks, one pulse per crank revolution. I have converted this 12v square wave to a 5v square wave and attached it to an Arduino Interrupt pin. I am using the following circuit.
I am able to get rpm readings, and they seem to aggree with the tachometer. Until the rpm reaches around 8,000 rpm. Once I get above this value my readings go haywire and I get very high readings, up to 30,000 rpm. I think that I must be getting false detection’s once the rpm gets so high.
I remembered that I had another Arduino board with a conditioning circuit already attached (For a VR crank sensor). I attached this to the bike to see if I had any issues with the Arduino, I increased the rpm to around 10,000 and it was reading fine. I didn’t increase the RPM any higher as it was getting late and a reving motorcycle is quite noisey. Here is the circuit that was attached to this other Arduino. Pretty much the same apart from it has a series capacitor (This circuit was used to condition an AC signal to a square wave).
I am going to add a capacitor to the first circuit, to see if that has the same effect.
Did I just get lucky or is this the way to remove noise from a square wave signal? If not, what should I be doing to remove the noise effectively?
At 8,000 rpm the Arduino should be recieving a signal with a frequency of around 135Hz (one pulse per crankshaft revolution). I believe the noise is coming from the ignition coils, so this is a 4 stroke engine, 2 ignition events per crankshaft revolution. So it should be a frequency of 270Hz.