I have an IN219 sensor module connected up to an ESP32 S3 and a TFT screen and I'm seeing some strange values from the IN219, the wattage value does not seem correct, the current looks OK.
What I'm not sure about is the getBusVoltate_V it seems to be strange and the reason why my power figure is wrong.
My monitoring circuit is (SHUNT) is in series with a bench power supply powering a LED COB module @ 2.63V. The power supply is not connected to the ESP32 at all, no common grounds etc.
The power supply display shows 2.63V, 69mA, 0.1W
I don't understand where the IN219 is getting the bus voltage of 3.17 - 3.55V from.
I assume you mean an INA219 sensor?This is the data sheet. The actual chip version comes along in two versions, there is an A and B version:
The INA219 is available in two grades: A and B. The B grade version has higher accuracy and higher precision specifications. The INA219 senses across shunts on buses that can vary from 0 to 26 V. The device uses a single 3- to 5.5-V supply, drawing a maximum of 1 mA of supply current. The INA219 operates from–40°C to 125°C.
You may also want to note:
Features & Specifications of INA219
Operational Voltage (3 – 5.5 Volts): The INA219 operates between 3 to 5.5 volts, increasing its compatibility with various systems running at either 3.3V or 5V logic level. This feature enhances the module’s flexibility in diverse circuit designs.
Bus Voltage Range (0 – 26 Volts): The INA219 can monitor power supplies within 0 to 26 volts range. This broad range makes the module applicable to low-voltage logic circuits and higher-voltage power supplies.
Current Sensing Range (±3.2A with ±0.8mA resolution): The INA219 can monitor a current range of ±3.2A with a precise resolution of ±0.8mA. This capacity makes it suitable for various applications including power management, battery chargers, and DC motor control, enabling accurate tracking and control of power consumption.
0.1 ohm 1% 2W Current Sense Resistor: The module uses a 0.1-ohm shunt resistor with a 1% tolerance and 2W power rating for current sensing. The low resistance value minimizes power loss, while the 1% tolerance ensures measurement accuracy. The 2W power rating indicates its robustness, supporting current measurements up to ±3.2A.
The uncertainty of your measurement plane will be the algebraic sum of all the error on your measurement plane. You are reading the current using a high side shunt. What is the allowable error of the shunt? I suggest you read the data sheet. I also suggest you give this a read assuming you are using a INA219 Module rather than just the TI Chip. That link should get you going.
That's your problem.
As @oldcurmudgeon already stated.
The INA219 must have common ground with the supply/load to measure voltage and current.
Measuring current without a common ground could damage the INA.
Leo..
Thanks for the replies, I suppose it makes sense that the voltage needs to be references to get an accurate power reading. In the target use case I would not want to link the power grounds because i don't want to break into the supply circuit so I will be OK with just the current measurements.
The two current sense terminals must stay within the voltage limits of the INA too,
which is -0.3volt to 26volt.
And that's only going to safely happen when the ground are shared.
Be prepaired to replace a fried INA219 often if you don't.
Leo..