INA219 Default Settings Question
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
INA219 Default Settings Question
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.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: INA219 Default Settings Question
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.
https://github.com/adafruit/Adafruit_IN ... #L193-L254
Without any modification, the settings assume 2A average current and a maximum 32V supply.
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
Re: INA219 Default Settings Question
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() {’ ?
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
Re: INA219 Default Settings Question
Sorry, I posted too quickly...
Can I reprogram the gain setting directly in my sketch ? If so, how ?
Can I reprogram the gain setting directly in my sketch ? If so, how ?
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: INA219 Default Settings Question
Yes.MountainMan370 wrote:Can I reprogram the gain setting directly in my sketch ?
The link above has detailed instructions. It's an 8-step process.MountainMan370 wrote:If so, how ?
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
Re: INA219 Default Settings Question
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 !
Please be positive and constructive with your questions and comments.