Measuring RPM (Frequency) with MIO

Topics about the Hardware of Revolution Pi
Post Reply
STHU
Posts: 16
Joined: 20 Feb 2019, 09:33

Measuring RPM (Frequency) with MIO

Post by STHU »

Hi everyone,
I'd like to measure the frequency of an RPM sensor connected to DigitalInput_1 of a MIO module. Software is Node-Red.
The sensors output is OC, the pullup-resistor of the MIO is active.

When I config DigitalInput_1 as digital input (digitalIn) and apply a low frequency, I can see the value changing from 0 to 1 and back according to the input. So the electrical part should be ok.

But is there a way to measure the frequency of the input signal (in Hz or so)?

I followed the example, but can not read anything that correlates with the input frequency.
If necessary, configure the duty cycle at PwmDutycycle_1.
... headscratch
The frequency and duty cycle are displayed at Fpwm_PulseCount_1 .
... that shows a fixed value (23975)

Setting IO_Mode_1 to pulseln and reading DutyCycle_PulseLength_1 just delivers 0 or 1 and sometimes (random) different values.


Any hints?

Thanks
Stefan
STHU
Posts: 16
Joined: 20 Feb 2019, 09:33

Re: Measuring RPM (Frequency) with MIO

Post by STHU »

Two side notes to ... lets say "mentally lesser gifted Users" - like me:

The value to switch the pullups off or on is 0 or 1 (as mentioned in the manual) per IO-Pin (as NOT mentioned in the manual).
Means: 0 is all off, 1 sets DigitalInput_1 to 1, 2 sets DigitalInput_2 to 1, 3 sets DigitalInput_1 and DigitalInput_2 to 1 ... and so on up to 15.

The second "yielding well of misunderstandings" might be the term "pullup" itself. Its not a pullup as you would see it in general electronics - for 24V I would say 10k or so.
The MIOs pullups deliver 200mA (250mA peak). My poor little RPM-Sensor can sink 20mA - well, it could. :(
It seams that when the pullup for an IO-Pin is activated, the output-driver switches on. The driver IC is short circuit protected an can deliver up to 200mA.

Greez
Stefan
Post Reply