Posts: 11
Threads: 4
Joined: Jan 2023
Reputation:
0
Hi,
I have rigged up a npn proximity switch and are using the "pulses" setup in OP.
I have glued two magnets to the flywheel for the pick up and played around with the measuring rate both in the "pulses" settings and in KIP, however the RPMs are bouncing quite a lot. I suspect that it misses one of the magnets periodically but before i glue more on or remove one, I would like to know if anybody has this running reliable and stable ?
Posts: 250
Threads: 18
Joined: Nov 2020
Reputation:
29
In the new version of KIP, there is a sampling option on the path menu. Try upping this and it might smooth the data out. I went about this a different way and use an ESP but I do the same thing in the esp code.
Interested in your results on this as I want to do something with pulse on the Pi.
Posts: 11
Threads: 4
Joined: Jan 2023
Reputation:
0
When increasing the sampling period the reading got smoother but it still lost half the counts every 10 seconds or so. Also tried to adjust the "rate" in OP GPIO pulses but that did not seem to change anything...not sure what its for actually??
Ended up removing one of the magnets from the flywheel and now have a stable reading:-)
Posts: 3
Threads: 0
Joined: Jan 2024
Reputation:
0
2024-03-14, 04:59 AM
(This post was last modified: 2024-03-14, 04:59 AM by petere101.)
Most of the NPN proximity switches operate at plus 6V which is way to high for a RasPi or esp32. I made a solution a long time ago using any input with a pullup resistor (or using the internal one on a '32. Connect a diode to the input that blocks the 12V from hitting the pin. When the NPN activates, the voltage on the sensor line drops to zero, thus pulling the GPIO low. So, your interrupt routine must be set to FALLING_EDGE. Works perfectly. Power your NPN from 12V.
Posts: 33
Threads: 4
Joined: Sep 2019
Reputation:
0
Is code available for reading these rpm pulses without having OP installed? I do have SignalK running and use KIP intensively. I could do it via SensESP but I have the Raspberry nearby so would like to skip the unneeded WiFi step.
Posts: 343
Threads: 6
Joined: Mar 2016
Reputation:
12
2025-09-19, 07:42 AM
(This post was last modified: 2025-09-19, 07:44 AM by holgerw.)
for RPM the CPU has to count every input signal, measure its frequency and sum it up for the result.
at the same time it also has to receive wifi.
both are timecritical.
the wifi has higher priority, so there will be some events on the RPM signal getting lost.
better use an little ESP32 chip to do all the RPM input as an helper device. often little microcontrollers have an internal counter chip integrated. this will do most of the worktask. there are some good libraries to send the data to signalk. i often use SensESP for this stuff.
ym2c - holger
Posts: 343
Threads: 6
Joined: Mar 2016
Reputation:
12
2025-09-19, 09:32 PM
(This post was last modified: 2025-09-19, 09:33 PM by holgerw.)
Hey Kalinka
as i just found out, your RPM Code also uses Interrupts, so the pi does not need to poll the port.
this task should be possible even if the cpu is really busy. so the python code can work problemless.
you could finetune it with this Constant:
self._watchdog = 200 # Milliseconds.