I am using INA3221 3 channel shunt voltage and current measuring module to measure the current through a 12V DC motor. I first tested with some resistors as the load and got the correct readings. (around 250mA ). However when i reduce the load resistor (around 500mA) , INA3221 started to give negative values and also magnitude of these values reduces when i decrease the load resistor furthermore. It happens in all 3 channels. I saw another post with the same issue but there wasn't any reply to that. What could be the reason for this ?
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Can you post some images of your project?
So we can see your component layout.
My connections are like this image.
But i don't think it is a connection issue because i am getting the correct readings at lower loads (250mA - I measured using digital multimeter).
Sound right
The datasheet for the module that is listed on the website doesn't match the one in the picture. Does your module have the three R100 resistors like you show?
There are two types of INA3221 modules. One can measure 3 independent current using its 3 channels while other only can measure 3 loads powered by same power source. I tried with both of these modules with R100 shunt resistors and still the problem occurs. Instead of using <INA3221.h> library in Arduino, i wrote a code for get the shunt voltage values stored in ina3221 chip using I2C communication. Still problem occurs!
I have done the same mistake when writing my code. Shunt voltage through the resistor is expressed in micro volts, so to hold that value int16_t is not sufficient. So have to use int32_t . If we use int16_t , overflow will happen and that why we get negative values.