They are $$$
I looked more thoroughly, some sensors are the $50 range (assume inductive) and others are in the $125 to $300 range (Hall?)
I did resistor jumper testing from 1M to 10k and engine doest stops but then i connect 1k and it stalls.
I connected the sensor input to 10k resistor and other end to ardunio pin-2 setup as INPUT. Without connecting grounds, its counting pulses. I pushed a paddle little bit and the count went up.
but count and pulses from sensor does not match.
Thanks.
See post #12 #15 and #20
volatile int IRQcount=0;
int pin = 2;
int pin_irq = 0; //IRQ that matches to pin 2
unsigned long startTime=0;
unsigned long nowTime=0;
void setup() {
Serial.begin (9600);
startTime = millis();
pinMode(pin, INPUT);
attachInterrupt(pin_irq, IRQcounter, RISING);
}
void IRQcounter() {
IRQcount++;
}
void loop() {
if ( millis()-startTime >= 1000)
int result = IRQcount;
Serial.print(F("Counted = "));
Serial.println(result);
IRQcount = 0;
startTime = millis();
}
}
At engine idle, it gives, +- 171 pulses/interrupts. with 1K resistor.
While +- 150 pulses/interrups with 10k resistor.
The pulses do respond when accelator paddle is pressed.
Thanks.
The interrupt pin is very sensitive to noise. Use the 1K
You need to make the wires between the Arduino and sensor much much shorter. It's probably picking up noise from the spark plug wires.
Also the ground from the Arduino should connect to the Engine ground not through the door catch.
Don't hold the Arduino in your hand it just makes noise pick-up worse.
Try changing:
pinMode(pin, INPUT);
attachInterrupt(pin_irq, IRQcounter, RISING);
To:
pinMode(pin, INPUT_PULLUP);
attachInterrupt(pin_irq, IRQcounter, FALLING);
Thanks, so much for your powerful tips. I will give due consideration to interference factor as well as Interrupt pull up code suggestion . In my car nearly all the wires from sensors and to outputs goes in one-two harness.
Actually the purpose of project is pick EGR Valve. This above code scenario will act as safety measrues. If RPM gets belows 2000RPM then EGR Valve has to be turned off. otherwise engine shutoff and car may lose brakes.
Isn't there a tach output from the ECU or distributer that you could use?
For rpm measurement, this is the only sensor. The dash meter reads this rpm reading through ecu-bus.
i have read the rpm, load values through ELMDino libarary by connectinh UNO with ELM327 on bluetooth.
The car is has Coil-injector setup and no distributor.
OK
So basically I think it's just a noise and grounding problem.
At least now you have it working so that it does not kill the engine.
Yes, thanks for your kind help, i am ready to assemble all things and hope, everything goes right.
i am also thankful to @JohnRob for his kind suggestion. @JohnRob if you have any suggestion, please keep me updated.
Thanks
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.