INA219 Default Settings Question

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
MountainMan370
 
Posts: 34
Joined: Mon May 11, 2020 7:30 pm

INA219 Default Settings Question

Post by MountainMan370 »

I've started using using the Adafruit INA219 Current Sensor with a Arduino Nano. I tested it using an external 5V regulated supply with a 1% 100 Ohm resistor as the load. It works fine and shows very close to the calculated value for the current (50.2 mA vs 50 mA calc). The question I have is what is the default gain setting and the associated measurement range ? The tutorial seems to suggest it's div/8 which gives an upper measurement limit of 400 mA (which is fine for me). Is my assumption correct; if not, what is the default setting / measurement range ? (I tried reading the library file and quite frankly couldn't really tell what it is. I'm 73 and trying to learn this stuff on my own to keep the brain active). Any guidance will be appreciated.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: INA219 Default Settings Question

Post by adafruit_support_mike »

The default settings are explained in detail in the library:

https://github.com/adafruit/Adafruit_IN ... #L193-L254

Without any modification, the settings assume 2A average current and a maximum 32V supply.

User avatar
MountainMan370
 
Posts: 34
Joined: Mon May 11, 2020 7:30 pm

Re: INA219 Default Settings Question

Post by MountainMan370 »

So to change the configuration to get the most sensitive current readings should I change line 70 of the .cpp file from ‘setCalibration_32V_2A();‘ to ‘ setCalibration_16V_400mA() {’ ?

User avatar
MountainMan370
 
Posts: 34
Joined: Mon May 11, 2020 7:30 pm

Re: INA219 Default Settings Question

Post by MountainMan370 »

Sorry, I posted too quickly...
Can I reprogram the gain setting directly in my sketch ? If so, how ?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: INA219 Default Settings Question

Post by adafruit_support_mike »

MountainMan370 wrote:Can I reprogram the gain setting directly in my sketch ?
Yes.
MountainMan370 wrote:If so, how ?
The link above has detailed instructions. It's an 8-step process.

User avatar
MountainMan370
 
Posts: 34
Joined: Mon May 11, 2020 7:30 pm

Re: INA219 Default Settings Question

Post by MountainMan370 »

Thank you. It looks like I had been using an old example that didn't have the "change gain" alternate commands in the sketch. Found everything I needed and adjusted the gain in the sketch .Appreciate the help !

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”