0

[SOLVED] Change shunt resistor on INA219?
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

[SOLVED] Change shunt resistor on INA219?

by garethw on Fri Apr 12, 2019 4:23 pm

Hi Boys and Girls,

Newbie here so sorry if I'm not posting to the right place. I'm trying to measure current draw on a load (network switch, via an inverter), running from a battery with a solar charger providing some top up.

I have an INA219 connected to a Pi via i2c, Everything seems to be working but something is not quite right somewhere. I have tested the load with my clamp meter and get about 2.2Amps peak so I thought the INA219 with the standard .1 Ohm shunt would be ok. I ordered some 0.01 Ohm 50w shunts just in case...

First time round, I powered it all up and it worked fine, I left it running for a few hours and it kept working but I had failed to add the supply 0v -> Ground connector so was not getting a good voltage read.

I removed the load, shutdown the pi and removed the power, connected the ground, powered the pi and started the python script logging, applied the load and the INA shuts down with a (I didn't make a note of the exact error) "current over range" warning.

So, I figured I'd swap in one of the 0.01 Ohm resistors and that's where I have got stuck. The data sheet says that an advanced user could do this, clearly that makes me not an advanced user but could someone help with some pointers...

1/ do I need to remove the existing 0.1 Ohm resistor (logic is telling me that because I'm adding a lower resistance I can just leave the larger one in place)
2/ What will be the best way to add the 0.01 Ohm Resistor, Does it just need to be across the load and therefore I could just wire it into the INA load+ and load- along side the actual load?

Again, apologies for the possible really newbie questions. Any help (including "go read thing page") would be appreciated.

Gareth
Last edited by garethw on Mon Apr 15, 2019 1:00 pm, edited 1 time in total.

garethw
 
Posts: 3
Joined: Fri Apr 12, 2019 3:40 pm

Re: Change shunt resistor on INA219?

by adafruit_support_mike on Sun Apr 14, 2019 2:46 am

There are a few options:

The first is to desolder and remove the existing 0.1 Ohm resistor, and solder a new 0.01 Ohm resistor onto the pads. That isn't hard if you're comfortable soldering. It's easiest to bend a piece of solid copper wire so it fits on both sides of the resistor, and heat the wire with the tip of your soldering iron. The copper will carry heat to the solder joints at both ends of the resistor, and they'll melt at the same time. Then you can just pull the resistor off with the wire.

You can also piggyback a new 0.01 Ohm resistor directly on top of the existing 0.1 resistor. The catch is that you'll end up with the parallel resistance of the two: 0.0901 Ohms. You can make the parallel resistance end up at 0.01 Ohms by using a 0.011 Ohm resistor, if you can find one.

You can also use parallel resistors that aren't directly connected to the INA219 PCB. A bundle of nine 0.1 Ohm resistors will have 0.011 Ohms of parallel resistance, and when you put those in parallel with the existing 0.1 Ohm on the PCB, you end up with a total parallel resistance of 0.01 Ohms. That approach has several advantages, the first being that you get a much higher power rating than you'll find in a single resistor. If each individual resistor is rated for 1W (10A through 0.1 Ohm), ten of them in parallel will have a combined rating of 10W (100A). Second, only 10% of the load current actually flows through the INA219's sense resistor, which helps protect the board. Third, the tolerances of multiple resistors tend of cancel, so a bundle of ten 1% resistors in parallel will have an average tolerance of about 0.3%. That makes your readings more accurate.

No matter which option you choose, you'll have to reconfigure the INA219 so it knows you're using a smaller current-sense resistor. The INA219 library has a fairly large section that explains how to calculate the configuration parameters.

adafruit_support_mike
 
Posts: 56406
Joined: Thu Feb 11, 2010 2:51 pm

Re: Change shunt resistor on INA219?

by garethw on Sun Apr 14, 2019 3:30 am

Hey Mike,

Thanks for the pointers. The 0.01 Ohm resisters I have are massive panel mount ones so a direct swap is out. It sounds like my best plan will be to pull the existing resistor from the board (nice tip with the copper wire) and connect the new one in parallel across the connectors.

Will give it a go and see what happens.

Thanks again.

garethw
 
Posts: 3
Joined: Fri Apr 12, 2019 3:40 pm

Re: Change shunt resistor on INA219?

by garethw on Mon Apr 15, 2019 12:58 pm

Happy to report that after de-soldering the original resistor (which I ended up doing with two irons as I couldn't make the copper wire trick work) and putting the resistor across the load and +ve / -ve load terminals it all seems to be working and recording currents of > 3.2 Amps.

There was a bit of a wobble initially with it not working because the auto-ranging seemed to be playing up but that seems to have resolved its self.

Thanks team.

garethw
 
Posts: 3
Joined: Fri Apr 12, 2019 3:40 pm

Re: [SOLVED] Change shunt resistor on INA219?

by adafruit_support_mike on Tue Apr 16, 2019 11:43 pm

Glad to hear it's working for you. Happy hacking!

adafruit_support_mike
 
Posts: 56406
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.