Go Down

Topic: Fixing the INA3221 breakout board (Read 2386 times) previous topic - next topic

Rendoh

May 19, 2018, 01:40 pm Last Edit: May 19, 2018, 01:41 pm by Rendoh
I was reading about the INA3221 breakout board in this thread https://forum.arduino.cc/index.php?topic=501980.0  .  Channels 1, 2 and 3 are connected respectively to In-1, In-2 and In-3 pins of the INA3221. In+1, In+2 and In+3 are connected together to POW pin.
So I tried to fix the board by cutting the traces connecting one side of the 3 shunt resistors to the POW pin, then I cut all the traces connecting the GND input pins to ground then I resoldered some wires between each shunt and the input pins. By analogy to the INA219,  GND input became the V+ (connected to power supply),  the Channel input became V- (connected to load +).
I tried the 3 channels and now they work independently with 3 independent power rails with connected grounds

Rendoh

forgot to attach this file

Memmy

Excellent work. Im fiddling with the same modules atm.

Created an account just to say thanks :)

chetan06soni

Hii...
Am facing some problem with these modules, I have connected a resistor 1K resistor to it for measuring the current through it, but in serial monitor I get only 1.6mA value, voltage value seems to be correct.


Thank you.

MorganS

Hii...
Am facing some problem with these modules, I have connected a resistor 1K resistor to it for measuring the current through it, but in serial monitor I get only 1.6mA value, voltage value seems to be correct.


Thank you.
The problem is in the code you didn't post.
"The problem is in the code you didn't post."

chetan06soni

#5
Jul 12, 2018, 05:35 am Last Edit: Jul 12, 2018, 05:20 pm by chetan06soni
The problem is in the code you didn't post.
Thanks for the reply, here is the code I've used,

Code: [Select]
//
//   SDL_Arduino_INA3221 Library Test Code
//   SDL_Arduino_INA3221.cpp Arduino code - runs in continuous mode
//   Version 1.1
//   SwitchDoc Labs   January 31, 2015
//
//
// This was designed for SunAirPlus - Solar Power Controller - www.switchdoc.com
//



#include <Wire.h>
#include <SDL_Arduino_INA3221.h>

SDL_Arduino_INA3221 ina3221;

// the three channels of the INA3221 named for SunAirPlus Solar Power Controller channels (www.switchdoc.com)
#define LIPO_BATTERY_CHANNEL 1
#define SOLAR_CELL_CHANNEL 2
#define OUTPUT_CHANNEL 3

void setup(void)
{
 
Serial.begin(57600);
Serial.println("SDA_Arduino_INA3221_Test");

Serial.println("Measuring voltage and current with ina3221 ...");
ina3221.begin();
}

void loop(void)
{

Serial.println("------------------------------");
float shuntvoltage1 = 0;
float busvoltage1 = 0;
float current_mA1 = 0;
float loadvoltage1 = 0;


busvoltage1 = ina3221.getBusVoltage_V(LIPO_BATTERY_CHANNEL);
shuntvoltage1 = ina3221.getShuntVoltage_mV(LIPO_BATTERY_CHANNEL);
current_mA1 = -ina3221.getCurrent_mA(LIPO_BATTERY_CHANNEL);  // minus is to get the "sense" right.   - means the battery is charging, + that it is discharging
loadvoltage1 = busvoltage1 + (shuntvoltage1 / 1000);

Serial.print("LIPO_Battery Bus Voltage:   "); Serial.print(busvoltage1); Serial.println(" V");
Serial.print("LIPO_Battery Shunt Voltage: "); Serial.print(shuntvoltage1); Serial.println(" mV");
Serial.print("LIPO_Battery Load Voltage:  "); Serial.print(loadvoltage1); Serial.println(" V");
Serial.print("LIPO_Battery Current 1:       "); Serial.print(current_mA1); Serial.println(" mA");
Serial.println("");

float shuntvoltage2 = 0;
float busvoltage2 = 0;
float current_mA2 = 0;
float loadvoltage2 = 0;

busvoltage2 = ina3221.getBusVoltage_V(SOLAR_CELL_CHANNEL);
shuntvoltage2 = ina3221.getShuntVoltage_mV(SOLAR_CELL_CHANNEL);
current_mA2 = -ina3221.getCurrent_mA(SOLAR_CELL_CHANNEL);
loadvoltage2 = busvoltage2 + (shuntvoltage2 / 1000);

Serial.print("Solar Cell Bus Voltage 2:   "); Serial.print(busvoltage2); Serial.println(" V");
Serial.print("Solar Cell Shunt Voltage 2: "); Serial.print(shuntvoltage2); Serial.println(" mV");
Serial.print("Solar Cell Load Voltage 2:  "); Serial.print(loadvoltage2); Serial.println(" V");
Serial.print("Solar Cell Current 2:       "); Serial.print(current_mA2); Serial.println(" mA");
Serial.println("");

float shuntvoltage3 = 0;
float busvoltage3 = 0;
float current_mA3 = 0;
float loadvoltage3 = 0;

busvoltage3 = ina3221.getBusVoltage_V(OUTPUT_CHANNEL);
shuntvoltage3 = ina3221.getShuntVoltage_mV(OUTPUT_CHANNEL);
current_mA3 = ina3221.getCurrent_mA(OUTPUT_CHANNEL);
loadvoltage3 = busvoltage3 + (shuntvoltage3 / 1000);

Serial.print("Output Bus Voltage 3:   "); Serial.print(busvoltage3); Serial.println(" V");
Serial.print("Output Shunt Voltage 3: "); Serial.print(shuntvoltage3); Serial.println(" mV");
Serial.print("Output Load Voltage 3:  "); Serial.print(loadvoltage3); Serial.println(" V");
Serial.print("Output Current 3:       "); Serial.print(current_mA3); Serial.println(" mA");
Serial.println("");

delay(2000);
}

MorganS

Please use code tags.

Please tell us where you got that library from.
"The problem is in the code you didn't post."

chetan06soni

I got the library from SwitchDocs, here is the link - https://github.com/switchdoclab/SDL_Arduino_INA3221

MorganS

I get a 404 error on that link. Please post the link again with URL tags so that it is clickable.
"The problem is in the code you didn't post."

chetan06soni

#9
Jul 26, 2018, 04:41 pm Last Edit: Jul 26, 2018, 04:42 pm by chetan06soni
Sorry for lack of my knowledge on how to use the forum.
Here is the link, please help me. Here is the Link

chetan06soni

I get a 404 error on that link. Please post the link again with URL tags so that it is clickable.
Hii..
I got it working, I made wrong connections. I followed the datasheet and connected, but the CJMCU 3221 module require different connections.

Thank you for your time.

HSWD

Thanks @Rendoh. Its working...  :)

C4lculated

I was reading about the INA3221 breakout board in this thread https://forum.arduino.cc/index.php?topic=501980.0  .  Channels 1, 2 and 3 are connected respectively to In-1, In-2 and In-3 pins of the INA3221. In+1, In+2 and In+3 are connected together to POW pin.
So I tried to fix the board by cutting the traces connecting one side of the 3 shunt resistors to the POW pin, then I cut all the traces connecting the GND input pins to ground then I resoldered some wires between each shunt and the input pins. By analogy to the INA219,  GND input became the V+ (connected to power supply),  the Channel input became V- (connected to load +).
I tried the 3 channels and now they work independently with 3 independent power rails with connected grounds

I haven't tried this yet but just looking at the images something looks odd to me... Shouldn't there be another cut?
I've marked the trace that I'm talking about with a green circle:


Hi,
I know this is an old thread, almost 1 year now but I have just taken delivery of this board and have been a little confused.
I noticed all the grounds are connected together and thought that was a little strange to the point that it looks like it will not work and will cause damage if connected the way it first appears.

However, after reading this thread and the original one, am I to assume that I can connect a supply (+ve) to the POW pin and then take my load from each channel (1, 2, 3).  NOT using any of the ground connections and then this board will function on the high side and monitor 3 independent loads but from a single supply.

If that is correct, then it is fine, I would run my loads off the same supply anyway.

Thanks
Martin

C4lculated

However, after reading this thread and the original one, am I to assume that I can connect a supply (+ve) to the POW pin and then take my load from each channel (1, 2, 3).  NOT using any of the ground connections and then this board will function on the high side and monitor 3 independent loads but from a single supply.

If that is correct, then it is fine, I would run my loads off the same supply anyway.

Thanks
Martin

Could you please show a schematic of an example circuit that you intent to connect? I can't infer it from the text.

Go Up