This breakout board will solve all your multi-rail power-monitoring problems. Instead of struggling with up to 6 multimeters, you can just use the handy…
I have connected the red wire from my LiPo battery through one of the channels on INA3221, and my program is recording voltages around 3.5v.
However a simple voltage monitor connected to the red and black wires at the Solar Power Manager 5V’s battery screw terminals shows 4.05v, and my multimeter between the same screw terminals shows 4.04v.
I am wondering, is this because I have connected the INA3221 to my ESP32 via the boards Qwiic connector with 3v3 signalling and power ?
I think I may have found the problem - it’s because ESPHome doesn’t log everything to its web interface. ESPHome does log a lot more to its uart/USB interface, and so I changed from powering the ESP32 by USB from the Power Manager … to USB from my PC.
So now I suspect the GND is a bit confused …
the PC is supplying 5V and connecting GND via USB to the ESP32;
the ESP32 is connecting GND to the power manager via i2c connection,
and i guess that’s not the same level of GND as at the battery’s connector
Years back i blew up the serial interface card of a borrowed minicomputer by plugging the different power cords into different wall sockets which, (being an old building) were on different fuses.
So long as the ESP is only being powered by one source it will be fine. Looking at the schematic for the board, the High power side of the board is separated from the low side of the board.
Dan I certainly don’t feel that anything has been sorted.
Out of desperation I came up with a theory for why the INA3221 is measuring a different voltage than the multimeter - and I mentioned it here hoping to get some confirmation, or guidance on what else to check.
The schematic only confuses things further.
I understood that I normally we should measure between VCC and GND. Measuring VIN+1 against VIN-1 gives only a tiny reading … which suggests that the configuration diagrams are all wrong, and VIN-1 should actually be connected to the battery’s GND.
More investigation required …
And in the meantime I have been tidying my wiring ready for deployment (using a physically smaller ESP32-S3-zero) … and all my sensors have stopped responding Thinking that I may have killed all my i2s devices (again) I instead found that the S3-zero is not putting out 3v3 any more. And that the 3v3 buck module from aliexpress is actually outputting 9V … thanks Have ordered some more parts from Core and waiting.
How do you have it wired at the moment? Would it be possible to send through a picture of your hardware and a wiring diagram?
(This will be key to figuring out where the issue might lie)
The schematic helps only if you read the datasheet, this photo along with the other resources in the download section helped me understand this part
That will depend on how you have everything connected, as long as GND comes back to this device you ought to be seeing the same reference, though if you have other devices connected (like the solar manager - that could be low-side switching) they could account for the ~1V drop.
Please don’t connect this board like that, the only thing between it will be the current shunt, and will quickly deplete your battery
Hi Donald, Liam
Have just taken notice of this threads I don’t know the exact circumstance.
Donald.
That is correct, you are measuring the very small voltage developed across the very low value shunt resistor. That is how the current through it is calculated.(within the IC).
No No No. As Liam says that will put the shunt directly across the battery with disastrous results. V? - connects to the load positive which puts the shunt in series between the supply and load. That is correct.
If this board is supposed to measure the high side supply voltage I think there is a monumental mistake here. It can measure current by measuring the small voltage across the shunt as a differential input but without a ground connection to the supply there is NO WAY it is possible to measure supply voltage. I have not read any text on this board but looking at the pics and schematic I can see no provision to connect the battery negative to the board at all. If there is none it cannot possibly measure the supply voltage.
So Donald unless you can find a battery (or supply) negative connection you can’t measure the supply voltage. There may be more information in some text description somewhere but I have not looked far so have not found anything.
Cheers Bob
Hi Donald, Liam
Add on to above
Found the data sheet for that OC used on this board.
It would seem that the device can indeed measure Supply voltage.
BUT the supply ground (all supply grounds if more than 1) have to be connected to IC “Ground” which I assume is the point marked “Gnd” on the board. This will be OK . If more than 1 supply all the grounds will be connected which is probably going to happen anyway.
You have not shown this connection and I have not checked but I would not be surprised if there is no mention in any text. I am not going to do a thorough search I will leave that up to you but I don’t believe this function can happen without the ground being connected.
Here is the relevant block diagram so you can see what happens.
I wasn’t going to unless there was overwhelming recommendations to do so.
I initially bought an INA3221 board off aliexpress (which of course has no documentation or support), and found several reports that there is a major fault with the board and it needs to be wired very differently.
So I bought the Adafruit board from Core so that (a) I could be sure of what I am buying, and (b) because of Adafruit’s worked example (which you linked to) - which may or may not apply to any other board.
I have been tidying up the wiring ready for deployment … but it does still look rather messy, especially with all the red wires.
The Digital LED Voltmeter and battery are connected to the Power Manager’s Batt IN screw connectors, with the V+ going through the INA3221’s channel 1 (at the left end in this picture). I have double checked that the wiring is matching this segment of the wiring diagram for my power module.
The only connection to the microcontroller is the Stemma QT i2c connection on the INA3221 board. The relays are applied to the Solar panel and USB inputs
The difference between multimeter and Digital LED Voltmeter isn’t too significant - unlike the measurement of 3.42v which INA3221 is reporting to ESPHome.
[18:06:10][D][sensor:093]: 'greenhouse Battery Voltage': Sending state 3.42400 V with 2 decimals of accuracy
[18:06:10][D][main:534]: ### battery is <3.5v (3.42) ###
[18:06:10][D][sensor:093]: 'greenhouse Battery Current': Sending state 0.00440 A with 2 decimals of accuracy
[18:06:10][D][sensor:093]: 'greenhouse Solar Voltage': Sending state 0.25600 V with 2 decimals of accuracy
[18:06:10][D][sensor:093]: 'greenhouse Solar Current': Sending state 0.00000 A with 2 decimals of accuracy
[18:06:10][D][sensor:093]: 'greenhouse USB-in Voltage': Sending state 0.00000 V with 2 decimals of accuracy
[18:06:10][D][sensor:093]: 'greenhouse USB-in Current': Sending state 0.00440 A with 2 decimals of accuracy
As you can appreciate I want my automation to take action when the voltage gets down to 3.3v … but not when the voltage is actually 3.7v