Be careful as this can be truncated by integer math
2000/60 = 166 Hz in integer math, but with proper rounding you get 167 Hz. ALthough the difference is not much it may add up.
To get max precision you should measure over longer time, an unsigned long counter that counts the pulses; divide it by millis() and you get the average freq over the longer time.
Of course if you want a very reactive freq measurement you better restart counting every second.
:~ if your bike is a 4-stroke engine, you get a spark every 4 engine revolutions. If your bike is a 2-stroke engine, you get a spark every 2 engine revolutions.
2000RPM/60=33.3Hz crankshaft speed = 8.33Hz (4 stroke) or 16.67Hz (2 stroke) ignition frequency.
prairiemystic:
:~ if your bike is a 4-stroke engine, you get a spark every 4 engine revolutions. If your bike is a 2-stroke engine, you get a spark every 2 engine revolutions.
2000RPM/60=33.3Hz crankshaft speed = 8.33Hz (4 stroke) or 16.67Hz (2 stroke) ignition frequency.
I have a bike which has single cylinder... And there is one spark at every revolution.. Its a Royal Elfield bullet
I read also your posting in the Programing Section.
Thank for the link about to build and idea to get a signal from the spark plug wire.
I will try that setup using my car and a lawn mower. A very interresting project.
prairiemystic is correct that type of set-up to get "RPM" from a spark plug wire depend of the type of motor you have.
I check the circuit, it use a 555 to "clean" the pulse and send to a uController like the Arduino. The 555 use R1 = 18 K and C1 = 100 nF Time of the 555 = 1.8 mS pulse. I just hope that the spark plug pulse from the sensor is shorter than the 555 pulse.
@ prairiemystic
Do you think Canadian Tire will carry those type of sensors ? If not, I will no choise to build the "inductive" type.
prairiemystic:
:~ if your bike is a 4-stroke engine, you get a spark every 4 engine revolutions. If your bike is a 2-stroke engine, you get a spark every 2 engine revolutions.
2000RPM/60=33.3Hz crankshaft speed = 8.33Hz (4 stroke) or 16.67Hz (2 stroke) ignition frequency.
Incorrect. If it is a 4-stroke engine, you get 1 spark in each cylinder per 2 revolutions. if it is a 2-stroke engine, you get 1 spark in each cylinder every revolution.
So dc42, you are correct. Sorry prairiemystic.... I still whant to know how can I get that sensor ( capacitive or inductive ) from Canadian Tire or UAP in Toronto.
I will go to Canadian Tire, here in Toronto ( they have a few of them here ), ask for that type of sensor, if not available, well I will build an inductive type ( a circle ferrite - a donut -( not from Tim Horton XD ) big enough to fit the spark plug cable , I try to find an open type ferrite( like a current meter )) , or a radio type ferrite, loop some enamel wires ( from discard TV yoke ), maybe 50 turn ??? to 100 turn ??? and a circuit to "pick-up" the signal and send to a 555 monostable ( to clean the signal ) and send to an Arduino to count and display RPM. Experiment is a must in this case. And I maybe do a program on a another Arduino to simulated a pulse - like an engine, sending through a opto-coupler, the receiver part connect to the other Arduino with the counter program to test the software.
Sorry I got confused with single-coil dual-winding/two cylinder bike engines, they fire on exhaust stroke. The Royal Enfield is a 4-stroke some models with dual-sparkplug, so I figure 2 revs/spark.
2000RPM/60=33.3Hz crankshaft speed/2 = 16.67Hz ignition frequency.
At 800RPM =6.67 Hz, at 8,000 RPM = 133.3Hz
At 800RPM =150msec, at 8,000 RPM = 15msec between pulses
A capacitive ignition sensor can be made with a couple turns of wire wrapped around the spark-plug wire and then into the 555 circuit. I have never found a source for inductive pickups. You can make one with a split ferrite core (like EMI snap-on cores).