cancel
Showing results for 
Search instead for 
Did you mean: 

Proximity sensor and STM32F030R8T6 for RPM Measurement

Nimit Vachhani
Associate III

Greetings Friends.

I want to interface proximity sensor with STM32F030R8T6 for measurement of RPM. I need guidance on how to make it possible and easy with out the use of PLL ic .

I was thinking of interfacing proxy sensor output to STM32 pin and take it as external input. Each and every external interrupts will be incriminating the counter value and after every 1 second i will calculate the rpm.

The above method stated is my plan but i don't know how much practically it will be helpful.

Any other suggestions are welcomed.

2 REPLIES 2
T J
Lead

There are many ways forward.

usually to measure time you count HClocks.

You have a free running timer at high clocking rate(lowPrescaler), with InputCapture enabled on a pin.

then in the InputCapture interrupt, you have the current timer value captured as the pin received the active edge.

this is a TimerCount Value at the time of the edge. Edge1

now you need to wait for the next edge. Edge2

subtract the two timerValues to get the difference in timerCounts BETWEEN edges

then with that timer count, and you know the timer clocking frequency,

if you clock the timer at 16MHz, and you have 247 counts between Edges,

16E6 / 247 = 64.77KHz.

Nimit Vachhani
Associate III

Hi,

Thanks for the reply. Actually i don't know how much maximum input frequency of pwm signal i can measure with STM32F030R8. The signal generated by Proxy Sensor is one kind of PWM signal with fixed width, i think so. So what will be max frequency that i will be able to detect...