I made the same filter, using a 5v zener, 4,7 resistor and a .47uf capacitor, so the W signal from alternator enter the filter, and go out to pin 9 in arduino. the ground of the filter go to the car and arduino, in this case it dont show anything, but if i remove the ground of the arduino it the messy but i get some reading.
have some pics from the parts attached
I have a vw transporter t4 with w rpm signal from the alternator similar as the dude from the other thread.
runing this same code:
const int pulsePin = 9;
int pulseHigh;
int pulseLow;
float pulseTotal;
float freq;
float rpm;
int polos = 12;
void setup()
{
pinMode(pulsePin, INPUT);
Serial.begin(9600);
}
void loop()
{
pulseHigh = pulseIn(pulsePin,HIGH);
pulseLow = pulseIn(pulsePin,LOW);
pulseTotal = pulseHigh + pulseLow;
freq = 1000000/pulseTotal;
rpm = (60*freq)/polos;
Serial.println(rpm);
}
Erik_Baas:
1: foto3.gif shows "inf" 4 times. Does that mean "infinite"?
2: Please try this: put in "Serial.writeln()" statements for pulseHigh, pulseLow, pulseTotal and freq. I'd like to see the result...
1: i dont know.
2: see the pictures foto5 below i have change from int to long and still get INF, pic "allground" it arduino groundet to the filter and the car, "noarduinoground" its filter grounded to the car but not on arduino, and "no car grounded" its the filter grounded to the arduino but not to the car (and looks like the best and consist result).
One remark though: "float pulseTotal;" should be "long pulseTotal;". After all it's the sum of long pulseHigh and long pulseLow, so it will never have decimals.
Can you measure the voltage on Arduino pin 9 (preferably with an oscilloscope)? The capacitor or the zenerdiode may be defect (shorted internally).
One remark though: "float pulseTotal;" should be "long pulseTotal;". After all it's the sum of long pulseHigh and long pulseLow, so it will never have decimals.
Can you measure the voltage on Arduino pin 9 (preferably with an oscilloscope)? The capacitor or the zenerdiode may be defect (shorted internally).
Ok, ill change pulsetotal to long, i just copy the mk2guy threat code. he said that it works, but not for me, i have change the capacitor already, stupid question, can it be 650v or need to be 16v or near? i didnt find lower voltage, and its .47uf same as 0,47 right? im not a eletronic expert, just basics. ill try other zener.
and i dont have a osciloscope, ill try to get one for test.