My brain is fried trying to figure this out (which is sad)…
This is only partially related to HA as ideally I will monitor multiple things from it in the end.
I am trying to find a way to monitor/measure a battery’s voltage and possibly current/power and then feed that via MQTT back to my broker. From there I can build automations on how to react/respond. [an OLED/LED/Bar display is okay as well just not as needed as the MQTT]
Ideally I need it to be accurate to the hundredths.
I’ve looked for arduino/nano/pi/esp32 options and have just not found anything good/great.
Thanks! The battery is 12V 55AH AGM so probably 15V max, 20ish to be safe. The battery drives a few regulators (12V, 6V, 5V) for various needs on the InMoov robot.
Many of the projects I have googled had the resolution to say 12.1V as opposed to 12.09V.
I’ll check this out as an ESP32 would be ideal. Also reviewing some arduino nano options.
I’ve done this for my motorbike, which is plugged into a battery tender.
I forget the actual code, it’s been a couple of years, but it’s using an 8266 with a voltage reducer, together with esphome. This bypasses mqtt and uses the esphome system to automatically generate the entity in Home Assistant
If you search for “esphome battery monitor” you should find quite a few other projects, hopefully this gives you a pointer on the route.
That’s like the safe and simple (ultra low budget) version indeed. Such a ready made voltage divider and a d1 mini for example costs probably less than $3 (without shipping) from the country of origin.
As @Corey_Johnson wanted not only have voltage but also current/power readings he needs a little bit more hardware (like some ina*** board as suggested ).
Sure, the native api from esphome mostly makes mqtt obsolete and with it all the time debugging and fiddling with it
Have now found the esphome code I’m using for mine. The sensor reduces the voltage down so that the 82166 can measure it (they have a low voltage threshold). The multiplier in the code then multiplies it back in HA to the true voltage. It took some trial and error whilst measuring the actual voltage with a multimeter but it’s pretty accurate for me.
The sleep did seem to work okay and reduced parasitic drain a lot, but now I’m using a tender I stopped needing it as it now measures directly onto the charging wires from that.
Wow, thank you. I’ve ordered the parts as well as some for other approaches but will try this. I have other 8266 and esp32 devices so this will fit right in.
Hi i need something similar to messure the amount of volts on the internal power grid here. Since the P1 is alredy used, i asumed it should be possible to put some device that sends out the voltage messurements every minute over mqtt and from there i pick it up in HA … i want to figure out of there there are power peek s in the grid here. Some guidance to built this is appriciated.