RPM conter IR sensor

Hello im building a project that basicly consists in a IR Sensor counting RPM on a flywheel, with 107 dents, in having some trouble finding some code that can help me with that, so I hope that someone can give a hand since its my first contact with arduino code.
I've tested a few codes and none of them are giving me the right number of rpm.
Thank you

I've tested a few codes and none of them are giving me the right number of rpm.

Let us have details of the sensor, how you have it connected to the Arduino and example code that gives you the wrong RPM count.

Depending on the engine speed, you may be getting far more pulses than the Arduino can count. It also depends on the response time of your sensor - 107 "dents" sounds like teeth on the ring gear?

Hi,
Does your IR sensor have a IR transmitter to look at, so it can distinguish the dents?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile:

And info on the sensor may be needed too. It may not be able to handle the speed either. There are sensors that do the counting for you and then pass along a number, but that's kind of cheating I suppose. Still, the arduino, even with interrupts, might be hard pressed to count that fast if its an engine. Whats the flywheel diam?

For fast stuff usually we put a magnetic or optical mark on the flywheel and count total revolutions (or halves or quarters)