Arduino RPM Counting
Since we're going to be counting the RPM for a CPU fan, first we need to realize that we're using an IR break-beam that counts every interruption. This is great, except we do need to realize that the CPU fan has 7 blades. This means 7 interrupts is 1 RPM.
If we keep track of the interrupt count, we can know that every 7th interruption means 1 full rotation has just occured. Similarly, if we keep track of the time it takes for every full rotation to occur, we can then easily calculated the full RPM.
We'll use the formula seen above in our code to calculate the RPM. The formula is rock solid, the accuracy of our tachometer will now depend upon how well our Arduino can keep track of the time between interrupts and full rotation counts.
Since we're going to be counting the RPM for a CPU fan, first we need to realize that we're using an IR break-beam that counts every interruption. This is great, except we do need to realize that the CPU fan has 7 blades. This means 7 interrupts is 1 RPM.

If we keep track of the interrupt count, we can know that every 7th interruption means 1 full rotation has just occured. Similarly, if we keep track of the time it takes for every full rotation to occur, we can then easily calculated the full RPM.

We'll use the formula seen above in our code to calculate the RPM. The formula is rock solid, the accuracy of our tachometer will now depend upon how well our Arduino can keep track of the time between interrupts and full rotation counts.