Tony - Does anyone have sample code to sense vo...

Does anyone have sample code to sense voltage for a duration? SV Topaz has inspired me to hook up some components to capture on/off cycles of bilge pumps using Signalk
3 Replies
gregy
gregy2w ago
depending on pump wiring and how your detecting “pump is running”. options on the hw side could be - opto isolator module, or relay … to give you a clean isolated input to sensESP gpio. and you then use sensesp to simply read the state of the input, and send state to skserver. not certain what you mean by “duration “? are you trying to measure the duration?
Ed
Ed2w ago
Measure voltage, feed it to influx and make it visible with Grafana. It will show when and for how long on/off.
gregy
gregy2w ago
@Tony this might be of some help … its 2 years old, so built on earlier version (i think) of sensESP, its setup for 8 inputs, looks for an active high on GPIO inputs , and polls each inout every 2 seconds. (there are alternate ways to also use interupt driven inputs in sensESP) .. but for my purpose this worked fine. https://github.com/gregsyoung/BucketList-Alarm-Interface-sensESP
Want results from more Discord servers?
Add your server