Whole house generator battery and run monitor

I have an older whole house generator that I would like to monitor. The two things I want to monitor are the battery voltage and whether it is running or not. From what I have been reading, this could be done with ESPhome. I’m hoping to get some advise on what components would be best for this setup. I will admit that I am new to the ESPhome world, but am willing to learn as I go.

What I was thinking of doing was coming off the main battery (12v DC) and stepping it down to 3-5v to power a INA3221 3-channel monitor. From this, I could connect channel 1 to the main battery to monitor its voltage. The generator has a trickle charge system so the main battery should stay topped off. I have had a bad charger in the past that was overcharging the batteries and causing them to explode, so it would be nice to see if that was happening again.

I could then hook another channel to a point on the generator that only gets voltage (12-14v) when it is running. This will allow me to know when it has started up.

If this would work, I would then need to figure out how to get that info to home assistant through wifi. I’m thinking the INA3221 needs to be hooked up to a ESP8266 or something similar that ESPhome can communicate with. I haven’t got that far in my research yet.

Before I keep going down this hole, I wanted to get opinions and make sure I’m at least headed in the right direction. Their may be much easier ways of accomplishing this. I appreciate any input you can offer.

the_buzz_man

The INA3221 is well documented with examples on the ESPHome site:

1 Like

Thanks! I have a similar project and this board should be perfect!

To the OP: For power to devices like this, I’ve found 12VDC USB outlets handy. They’re cheap on line, sold for vehicles and boats. Just be aware that if you’re powering it off the starting battery, there will be a significant voltage drop during starting.

Something I will need to test and see if it falls too low.

Just as a follow up in case anyone was interested, I was able to compete this project. I was able to do everything I needed by tapping into some points on the transfer switch that is inside the house. Below is a diagram I drew up showing what was done:

There is a point in the transfer switch that gets battery voltage when the generator is placed in “auto” mode. From there, I could power the ESP32 (via a 3.3v stepdown) and also monitor the battery voltage for over or under voltage (via a 5x divider). I also tapped into one of the main legs that gives 120v when the generator is running. From there it went through an AC120v to DC5v transformer, then through another 5x divider feeding to the ESP32.

Below is a screenshot of what I am monitoring on HA:

I’m satisfied with the results. I know it could have probably been done an easier way, but it was a good learning experience for me. If anyone has any questions, don’t hesitate to reach out.

the-buzz-man