PCBWAY PCB service

PCBWAY PCB service


Arduino based RPM meter (3D printed case)

In this project we will use the basics of an IR senosr to measure the speed of rotation of a shaft. The idea is to dectect or not the infrared light. Having some sort of reflecting material on the rotating shaft we cold detect a peak of the sensed light and measure the time between those peaks. The measured time is the time that the shaft take to make one full rotation.

Una publicación compartida de ELECTRONOOBS® (@electronoobs) el


This project is simple. The total price is under 10 dollars. If you don't have a 3D printer you should create any kind of small case and fit everything in place. So lets see what we need.

Find the full part list and best prices here:

IR LED and senosr: LINK eBay
Arduino NANO: LINK eBay
LM324 amplifier: LINK eBay
Push button: LINK eBay
Slide button: LINK eBay
OLED screen: LINK eBay
30AWG wire: LINK eBay
Cheap lser diode: LINK eBay
9V battery connector: LINK eBay
9V battery: LINK eBay
drilled PCB: LINK eBay

part list RPM meter arduino

To emit infrared light we need a IR LED and to detect it a IR snesible transistor. Usually you could find those as a one unique module. To amplify the signal I've used the LM324 amplifier. You will also need a 100 ohm resistor and a 4.7k ohm one. To supply the system we will need a basic 9V battery na connector, an Arduino NANO and an OLED screen. The case is 3D printed and you could download the STL files from the next link below:

Download the STL files for the 3D printed case here:


Ok, so how this RPM meter works. Well, we have a IR LED that will emit light. The light will reflect on the surface of the moving part. The reflected light will then touch the sensitive base of the IR sensor.

IR sensor

This IR sensor works exactly like a commune BJT transistor but instead of controlling the current from the collector to the emitter by applying a small current to the base we control the current applying infrared light. The base of this transistor is exposed to the light and when the infrared wave touches the base, the circuit is open and no current flow through the transistor. But when no light is exposed current could flow. So basically, this is a switch activated by light. So, the detection circuit is something like this.

IR sensor

The output will be the emitter of the transistor. We add a pulldown resistor to the output. In this way when the circuit is open the output will be ground and when the circuit is closed the output is a high value, in this case 5 volts because that’s the basic voltage of the Arduino. Actually, the output is a voltage divider between the resistance of the transistor and the pulldown. So, the pulldown should have a high value, in this case 4.7 kilo ohm, so when the transistor is conducting, the voltage drop between the collector and emitter should be very small and all the voltage should drop on the pulldown resistor. Next, we should add a small resistor, around 100 ohms to the positive pin of the infrared LED in order to limit the current and not burn it.

IR sensor

So just like that we've detected IR light. So now if I put something white in front of the IR LED and sensor, light will reflect, the circuit will be open and the output will be 0. When I remove the white object, light will no more touch the sensor and once again the output will be 5 volts. Just like that we could obtain a square wave if a spinning object with a white stripe is placed in front of the sensor.