Sensing (12V DC) voltage?

I’d like to add a small LTE modem, made with a Raspberry Pi to my truck that will beacon its GPS coordinates to my HA.

I’d like to connect it to a small 12v LiFePO4 battery, so it won’t run down the starting battery. However, I also don’t want to run down the aux battery, either.

So, I need some way to sense the voltage on the aux battery, and if the aux battery voltage is < 13Vish (charging voltage) to start a timer (30 minutes or so). After the timer expires, I’d power down the Pi. That will keep the system from having to reboot during short stops.

Is anybody aware of a device that can measure the voltage on circuit A, on a 12V battery and send a signal someway and/or turn off/open circuit B?

You can use a voltage divider circuit to bring the voltage into the 0-3.3V range. You can then connect this to an analogue pin on an ESP. You can calculate the voltage from this input signal.

A more crude but cheaper alternative where you don’t measure the specific voltage would be to use again a voltage divider that brings it to the forward bias voltage of some transistor. When it drops below your target voltage, the divider’s output must be such that the transistor must/will be off, otherwise on. The output of the transistor can then drive a switch or relay, or even just whatever it is directly, depending on what it is, but there must be some proximity or direct connection between the devices. The first option doesn’t have that requirement, so it can act over a network.

Now that I think about it… Maybe a better way would be to measure the voltage from a circuit that’s only closed when the car is running…

So if there’s > 0 volts on that circuit, the car can be assumed to be running. If I come directly off the battery, the line might become blurred between “running” and “not running” voltages when I factor in a divider.

Do you have an LED somewhere that turns on? If so, you can use a photodiode/detector.