OpenMarine
RPM via GPIO pulses - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3)
+--- Thread: RPM via GPIO pulses (/showthread.php?tid=5218)



RPM via GPIO pulses - SY Kalinka - 2024-03-03

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 ?


RE: RPM via GPIO pulses - Boatingbaileys - 2024-03-06

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.


RE: RPM via GPIO pulses - SY Kalinka - 2024-03-13

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:-)


RE: RPM via GPIO pulses - petere101 - 2024-03-14

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.


RE: RPM via GPIO pulses - Blue Ocean - 2024-03-17

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.


RE: RPM via GPIO pulses - Sailoog - 2024-03-19

I was never happy with the rpm pulse code in OpenPlotter v3.x.x. We used a python code from here (search RPM): https://abyz.me.uk/rpi/pigpio/examples.html

pigpio is no longer available in RPi5 so we have to rewrite this code. I am working in openplotter-gpio v4.x.x right now, any example of RPM in python?