Greg Young - I did a windlass sensor, however m...
I did a windlass sensor, however mine a little different.
For “direction” - i sense (using dual opto isolator module) which direction switch (aka solenoid) is activated for the windlass motor …
For the “pulse” output from hall sensor, Im using a LM393 comparator module.
What I have found (in my setup)
- the hall sensor (5V) is at the bow, however it connects via a longish cable (~15m in my case) to the dashboard windlass display/control … over this distance the “pulse” is becoming quite “distorted” … more than likely bevause of capacitance & inductance of the cable (3 core) that runs to the dash.
With a DSO i was able to capture & measure the “pulse” .. and its along way from a perfect “5V square wave” !
In my case it doesnt peak above ~4V, and falls to above 0V, but than has some nasty ringing on trailing edge .
Hence why i needed to use an adjustable comparator module … and after blowing up two input circuits, im just adding protection “diodes” to clamp the negative spike on trailing edge from destroying comparator..
Your setup may be quite different … and Im certain that putting the pulse detector at the windlass (thus avoiding cable loss/capacitance/inductance) from screwing with the pulse would overcome some of these issues
5 Replies
looking at your picture .. it shows “reed switch” (not a hall sensor - which is quite different)
A reed switch should give you a clean pulse, unlike the challenge i ran into with a (existing in OEM setup) hall sensor (powered from 5V)
Not sure what took you down the ADC path? .. which to my mind seems overly complicated?
when you can achieve it using 3 GPIOs.
(one for reading the reed switch pulses… and two using Opto’s for reading which solenoid is engaged … up or down)
the only caveat with either method, is that if you “freewheel” drop your anchor (ie not under winch power) … you have to count pulses and assume
that the anchor is going out …
also i found that I put a “zero it out” condition into my code… once “rode deployed” is less than says 2m …. I assume its fully IN.
that way it keeps it resync’d each time… otherwise over time you can get ‘creep” .. and the counter doesnt go back to zero ..
FWIW
https://github.com/gregsyoung/SensESP-Windlass-Monitor
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
noted on your rationale for hardware and config.
on the repeatsensor and debounce … i had too mess around a bit to get this reliable..
i did some measuremnts of chain/windlass speed … to get an idea of pulse period… and calculated a “likely range” for fast deployment (out) and slow retrieval (IN).
i then used a pulse/sig generator in workshop … to test the code …and tune debounce etc to ensure i didnt “miss” pulse events..
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
its been while since i played with that code…
in my case its a hall effect sensor, so not sure if that changes the pulse width…
.. i would certainly expect a reed switch (aka “mechanical”) to be slower.
but definitely i recall that if i had debounce ‘wrong” its accuracy went down
(i was able to play around with the pulse rate with sig generator, to find a reliable figure that worked for range of “chain speeds” )
mine is a 2400W motor, with 10mm chain , swinging a 60kg anchor … hence its slowish
if you have a DSO, its handly to put it across the reed switch and get an idea of the pulse duration