Measure RPM using LM2917N and ESP32

I want to measure RPM of a metal wheel using an inductive proximity sensor (npn) and a LM2917N which is supose to convert frequency into voltage which I intend to read using an ESP32 since has 12bits ADC.

The wheel has 2 holes which will be "see" by the sensor and a diameter of 50mm. Basically for a complete RPM sensor needs to "see" 2 wholes. Considering the max speed of the wheel which I intend to measure is 5 km/h I made following calculations:

Max rpm of the wheel will be around 530 rpm. For that rpm sensor will get max 1060 pulses per minute which means about 17.67 Hz

Min rpm which I would like to measure is 100 rpm which means about 3.2 Hz.

Now the concerns: I see in LM2917N datasheet that the input voltage can be 0 and 28 V, in my setup will be powered at 12V and supply voltage I assume will be same 12V since proximity sensor is powered also on same power supply as LM2917N.

I am not able to do calculations of the C1, C2 and R1 based on my setup and also have to find a way to put the output voltage in range of 0-3.3V (esp32 limits)

Second help is needed to understand how to match the read voltage to frequency (eg - 1V means 10Hz or rpm...)

Any help will be highly appreciated

Thanks in advance!

Wheel

1 Answer

after reading datasheet : formula is Vo = R1 × C1 × VCC × f

with Vcc=12V, C1=0.1 mF and R1=100K >> V0=0.12V/Hz

for 18Hz, output will be 2.16V

so you can connect directly output to analog input and convert value as

int getRPM() { float V0 = 3.3 * analogRead(A0)/1024; float F = V0 / 0.12; int rpm = F * 60; return(rpm);
}
6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like