This is my second project with esp easy.
I have a old spinning bike with a display which shows the rpm of cranks/peddels.
The display hardware is broken (corrosion of sweat)
The sensor on the wheel looks like it stil works.
So I like to use this to calculate the rpm.
When I put gnd and D7 to sensor, I get 3 pulses every turn.
now I use the Generic - Pulse Counter to count the pulses.
but how to convert this to rpm.
I have set the interval of the pulse counter to 1 second.
and use these rules to display them on my oled
Code: Select all
on teller#Time do
oledframedcmd, 1, "Time: [teller#Time]"
endon
on teller#Count do
oledframedcmd, 2, "rmp: [teller#Count]"
endon
and some time it goes up or down, I think because sometimes you have for example 2,5 count in a second, which counts as 2.
how can I get beter and more accurate rpm.
I need a quite fast update speed on my display
also esp easy gives me a warning of a daily write limit, I think because the interval of 1 second?
The rpm is between 50 till 120 rpm, not so fast of a fan or motor.
I also try to create a button of D7 and
calulate the miliseconds between the pulses to calculate the rpm.
But this works not very accurate.
use these rules:
Code: Select all
on Button#State do
oledframedcmd, 1, "State:[Button#State]"
oledframedcmd, 3, "time: %uptime_ms% "
if [Button#State] = 0
let,2,60000/((%uptime_ms%-[VAR#1])*3)
let,1,%uptime_ms%
endif
oledframedcmd, 2, [VAR#2]
endon