One of the things I'm going to do is read the victron smartshunt through the ve direct port. This smartshunt will measure my second battery (first one is used for starting my engine and the second one is for the "home function" of the camper).
Whenever I'm in the camper, I'll turn on the 12v system, and then the power usage will be displayed on my central system, which is a raspberry pi with touch screen. When the 12v system is turned on, these readings will be done every 1 to 30 seconds (haven't determined yet what to choose). But whenever the 12v system is turned off, these measurements need to be done once every hour or so. After these readings, the esp will go in deep sleep mode, while the last readings will be saved in the RTC memory.
Now here is my problem. The 12v system will be somewhere between 12 and 16 volts (idle and when charging is happening or other influencing systems are turned on). I just can't figure out how to read if the 12v system (that's not always 12v) is turned on or off. I only need a binary value if it is on or off.
Could you guys advice me on this?