Hey guys, im building an Arduino based rpm meter, for input,im winding a coil on the spark plug wire to pick up the pulses, as per calculation the pulse would be 20bps at 5000rpm ,25 at 6000 and so on.
If it crosses 20 pulses per second , i want high out from pin 1 , if it crosses 25 , i want high output from pin 1and 2 and so on..
I have the hardware part almost done. But totally lost on how to detect those pulses from input pins. Please guide me with a code.
Why do you think there "pulses" and not AC? If the spark plug voltage goes from zero to some high value, then immediately back to zero, it will induce an AC voltage in your winding on the spark plug wire.
Please show us a schematic of how you have this all wire up. Draw one by hand an take a picture or scan an post.
Paul
Can you observe the pulse's waveform with an oscilloscope?
I've built such things before, but there can be several pulses during a spark ( it's an oscilliatory system) which could confuse things.
Devices such as the LM2917 are useful.
Allan
Instead of pulse , can i somehow make use of a linear voltage signal?
The voltage from my coil is increasing as rpm increases.
.8v at 1500rpm , 2.6v at 5000 rpm , 3.xx at 7000rpm and so on.
Any way i can use this to trigger digital out pins?
Can you give more info on the actual vehicle/engine you're working on? There are several ways to skin that cat depending on the system type. Trying to take an unconditioned ignition pulse from an inductive source can wreak havoc on the Arduino, electrically. I would recommend an opto-isolater tied into the coil primary side/trigger with a flyback diode in place as well.
As for the code, a search on the forum should net you 1000 ways to accomplish the task at hand.
Ed
Like others have said. I think you're going to need some signal conditioning interface circuitry to get reliable results.
Without actually seeing your signal, I would probably run your induced voltage signal into an op amp buffer, then into a low pass filter (maybe multi stage depending on what your signal looks like), then I would probably use an op amp comparator and tune your reference voltage with a potentiometer. Either set your op amp rail voltage at 7.5V or you will need a zener clamp or some other kind of level shifting circuit going into the micro. This should give you somewhat repeatable results, although it would be interesting to see how much your signal varies every time the plug fires.
Shreesha:
on the spark plug wire
What do you mean by that? Do you mean the high voltage wire going to plug or the 12v wire going to the coil?
...R
Shreesha:
Instead of pulse , can i somehow make use of a linear voltage signal?
The voltage from my coil is increasing as rpm increases.
.8v at 1500rpm , 2.6v at 5000 rpm , 3.xx at 7000rpm and so on.Any way i can use this to trigger digital out pins?
Shreesha:
Instead of pulse , can i somehow make use of a linear voltage signal?
The voltage from my coil is increasing as rpm increases.
.8v at 1500rpm , 2.6v at 5000 rpm , 3.xx at 7000rpm and so on.Any way i can use this to trigger digital out pins?
The voltage is NOT increasing. You are measuring with a digital voltmeter, aren't you. There are just more pulses during the sampling time of the meter.
Paul
Im planning to use a rectifier and a capacitor with a resistor circutary to get a constant dc output, so that,when rpm (pulses)increases the capacitor charges faster thus more voltage .