Dobrica Pavlinušić's random unstructured stuff
INA3221: Revision 5
OUT INA3221 KACITRAN.jpg



all grounds tied together, single input voltage

I have two versions of this modules purple and black, and they seem to have same problem:

Alternative source with better pictures of modifications for multi-voltage support:

Linux setup

root@cubieboard:/home/dpavlin# modinfo ina3221
filename:       /lib/modules/4.19.25-sunxi/kernel/drivers/hwmon/ina3221.ko
license:        GPL v2
description:    Texas Instruments INA3221 HWMon Driver
author:         Andrew F. Davis <afd@ti.com>
alias:          of:N*T*Cti,ina3221C*
alias:          of:N*T*Cti,ina3221
alias:          i2c:ina3221
depends:
intree:         Y
name:           ina3221
vermagic:       4.19.25-sunxi SMP mod_unload ARMv7 thumb2 p2v8

root@cubieboard:/home/dpavlin# i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: 40 -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@cubieboard:/home/dpavlin# echo ina3221 0x40 > /sys/bus/i2c/devices/i2c-2/new_device 
[Sun May 12 14:23:20 2019] i2c i2c-2: new_device: Instantiated device ina3221 at 0x40

root@cubieboard:/home/dpavlin# sensors
pcf8591-i2c-2-48
Adapter: mv64xxx_i2c adapter
in0:          +2.13 V  
in1:          +2.55 V  
in2:          +0.01 V  
in3:          +1.32 V  

ina3221-i2c-2-40
Adapter: mv64xxx_i2c adapter
in1:          +0.02 V  
in2:          +0.02 V  
in3:          +0.02 V  
in4:          +0.00 V  
in5:          +0.00 V  
in6:          +0.00 V  
curr1:        +0.00 A  (max = +16.38 A, crit max = +16.38 A)
curr2:        +0.00 A  (max = +16.38 A, crit max = +16.38 A)
curr3:        +0.00 A  (max = +16.38 A, crit max = +16.38 A)

# setup correct resistors:

root@cubieboard:/home/dpavlin# grep -A 2 ina3221 /etc/rc.local
echo ina3221 0x40 > /sys/bus/i2c/devices/i2c-2/new_device
sleep 1
ls /sys/devices/platform/soc/*.i2c/i2c-2/2-0040/hwmon/hwmon1/shunt*_resistor | xargs -i sh -cx 'echo 100000 > {}'