INA219 Calibrate external shunt
Moderators: grovkillen, Stuntteam, TD-er
INA219 Calibrate external shunt
Hello everybody
I am brand new here in the forum.
And find Espeasy a nice thing.
Unfortunately, I do not have to find any understandable solution to include a certain shunt over the INA219 in order to measure larger loads.
Unfortunately I haven't quite got that with the calibration of the new resistance value.
Have looked at the Adafruit_INA219 ut don't really understand it yet
My goal is to be able to measure in the range of 15-20A and 23-25V.
A little test:
Wemos with mega-20200410
INA219 /INA219B breakout board
12V / 5W lamp
Laboratory power supply read the following values : 11.30V 0.321A 3.61W
without an external shunt: The values are correct so far, when I get only 10.72V at the sensor
now with shunt:
My external resistance is a 50A 75mV shunt.
how do I have to calibrate this now and what does the formula look like, and where do I have to enter the values?
I am brand new here in the forum.
And find Espeasy a nice thing.
Unfortunately, I do not have to find any understandable solution to include a certain shunt over the INA219 in order to measure larger loads.
Unfortunately I haven't quite got that with the calibration of the new resistance value.
Have looked at the Adafruit_INA219 ut don't really understand it yet
My goal is to be able to measure in the range of 15-20A and 23-25V.
A little test:
Wemos with mega-20200410
INA219 /INA219B breakout board
12V / 5W lamp
Laboratory power supply read the following values : 11.30V 0.321A 3.61W
without an external shunt: The values are correct so far, when I get only 10.72V at the sensor
now with shunt:
My external resistance is a 50A 75mV shunt.
how do I have to calibrate this now and what does the formula look like, and where do I have to enter the values?
Re: INA219 Calibrate external shunt
Some basic concepts that may help out are discussed here: https://www.letscontrolit.com/forum/vie ... f=5&t=3334
- Thomas
- Thomas
Re: INA219 Calibrate external shunt
many thanks ThomasB I have already read this posts.
in my version (mega-20200410) i can also do that set measuring range. it is possible to calibrate the resistance with my version EspEasy ? or do I have to use a sketch?
how do i do it
or can i do it with a formula? (https://www.letscontrolit.com/wiki/inde ... asyFormula)
Thanks a lot
in my version (mega-20200410) i can also do that set measuring range. it is possible to calibrate the resistance with my version EspEasy ? or do I have to use a sketch?
how do i do it
or can i do it with a formula? (https://www.letscontrolit.com/wiki/inde ... asyFormula)
Thanks a lot
Re: INA219 Calibrate external shunt
This plugin does not seem to have a calibration option in the plugin, so you should then use the formula field.
For example if you need to apply a correction factor of 2, you fill in:
Just make sure to calibrate voltage without any load (or else you will have a voltage drop over de cables from the power supply to the INA219).
The current must be calibrated separately.
The power output is computed based on the uncorrected voltage and current, so you must use both corrections in the formula field of the power.
For example voltage correction is x1.1 and current is x2.1. Then P = (U*1.1) x (I*2.1) => so the power correction is: %value%*1.1*2.1
Regarding the used setting for the INA219.
This setting changes a gain in the INA219.
The best gain is where you have the max. reading at the max. value you will encounter. (+ some margin)
For example if you need to apply a correction factor of 2, you fill in:
Code: Select all
%value%*2
The current must be calibrated separately.
The power output is computed based on the uncorrected voltage and current, so you must use both corrections in the formula field of the power.
For example voltage correction is x1.1 and current is x2.1. Then P = (U*1.1) x (I*2.1) => so the power correction is: %value%*1.1*2.1
Regarding the used setting for the INA219.
This setting changes a gain in the INA219.
The best gain is where you have the max. reading at the max. value you will encounter. (+ some margin)
Re: INA219 Calibrate external shunt
Thank you very much TD-er for your explanation.
I was able to calibrate the voltage across the formula field
The current field doesn't seem to work. Or I'm doing something wrong no matter what I enter the value goes to 0,000
I was able to calibrate the voltage across the formula field
The current field doesn't seem to work. Or I'm doing something wrong no matter what I enter the value goes to 0,000
Re: INA219 Calibrate external shunt
i test without shunt the formula field works. Can shift the decimal places, for example.
with shunt I always get 0,00000
can it be that the plugin does not count with 4 digits behind the decimal point?
with shunt I always get 0,00000
can it be that the plugin does not count with 4 digits behind the decimal point?
Re: INA219 Calibrate external shunt
I guess the shunt is then incorrectly wired or you simply are using the wrong A/D range for the current measurement.
A typical 50A shunt has a resistance of a few mOhm (75 mOhm typical)
So that means the voltage over the shunt is a few mV per amp current.
The shunt often has 2 terminals to connect the power lines and 2 smaller terminals to connect the current sensing lines.
I guess it would be best to show how you wired the shunt to the INA219.
A typical 50A shunt has a resistance of a few mOhm (75 mOhm typical)
So that means the voltage over the shunt is a few mV per amp current.
The shunt often has 2 terminals to connect the power lines and 2 smaller terminals to connect the current sensing lines.
I guess it would be best to show how you wired the shunt to the INA219.
Re: INA219 Calibrate external shunt
...and don't forget to unsolder the R100 on the INA219 board.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: INA219 Calibrate external shunt
That's for sure a good thing to do, but still if it is parallel to the big shunt there should be some reading.
The present shunt has a larger resistance, so it should make the total resistance a little less than it should be.
If it were the same value, the total resistance is halved.
Re: INA219 Calibrate external shunt
Hello friends
yesterday I connected it like this now like this the current field reacts like yesterday 0.0000 A
if i add or subtract it sets a fixed value (without sensor data)
if I multiply or differentiate I get 0.00000
yesterday I connected it like this now like this the current field reacts like yesterday 0.0000 A
if i add or subtract it sets a fixed value (without sensor data)
if I multiply or differentiate I get 0.00000
Re: INA219 Calibrate external shunt
You should not wire that shunt to Vin, but parallel to the existing big shunt.
Or like mentioned by Wiki, replace the existing shunt.
So that means soldering and not wiring it via a screw terminal on the INA219 board you have.
That's the only way you can use it, as the voltage drop over the shunt is very low.
So the ADC in the INA219 only expects a range of less than a volt.
See datasheet page 5: https://www.ti.com/lit/ds/symlink/ina21 ... 8159302471
Soldering on the existing shunt may be hard as it is probably connected to rather large PCB traces which have vias to the other side, also connected to big PCB traces.
Or like mentioned by Wiki, replace the existing shunt.
So that means soldering and not wiring it via a screw terminal on the INA219 board you have.
That's the only way you can use it, as the voltage drop over the shunt is very low.
So the ADC in the INA219 only expects a range of less than a volt.
See datasheet page 5: https://www.ti.com/lit/ds/symlink/ina21 ... 8159302471
Soldering on the existing shunt may be hard as it is probably connected to rather large PCB traces which have vias to the other side, also connected to big PCB traces.
Re: INA219 Calibrate external shunt
Hello, i have to capture this thread and have a question. ESP Easy Beginner and not that great with english, so sorry in advance...
I want to measure DC current with my external Shunt 100A/75mV and a INA219 with the R100 (internal shunt) desolderd... The Shunt is connectet to the Pins on the INA219 Board.
The Board is a D1 Mini Clone flashed with the ESP Easy 20210802 normal esp8266 4m1m.
When i´m adding a new INA219 device on the website the only thing i can change is the "Measure range".
I already read some other threads, but something is missing for me, i´m stuck....
Do i have to change anything else? If i´m getting it right in my brain, the shunt resistance is different now, it changed from R100 (0.1Ohm) to 0,00075Ohm (75mV/100A=0,00075Ohm), so i have to change something somewere to get the right measured output value. But where and what? Or am i wrong and it works with the 32V 2A setting and i only have to fine adjust it with a formular?
Please help me, i´m starting to get confused...
I want to measure DC current with my external Shunt 100A/75mV and a INA219 with the R100 (internal shunt) desolderd... The Shunt is connectet to the Pins on the INA219 Board.
The Board is a D1 Mini Clone flashed with the ESP Easy 20210802 normal esp8266 4m1m.
When i´m adding a new INA219 device on the website the only thing i can change is the "Measure range".
I already read some other threads, but something is missing for me, i´m stuck....
Do i have to change anything else? If i´m getting it right in my brain, the shunt resistance is different now, it changed from R100 (0.1Ohm) to 0,00075Ohm (75mV/100A=0,00075Ohm), so i have to change something somewere to get the right measured output value. But where and what? Or am i wrong and it works with the 32V 2A setting and i only have to fine adjust it with a formular?
Please help me, i´m starting to get confused...
Re: INA219 Calibrate external shunt
Have you tried the "formula" field?
Re: INA219 Calibrate external shunt
Not yet, i´m still in the Breadboard-Phase and theory... Can i just add a factor on the formular side and everything works out of the box with the Voltage up to 32V DC and a current over the external 100A/75mV Shunt with the desolderd R100 Onboard-Shunt? That would be great.
Thanks in advance
Andy
Thanks in advance
Andy
Re: INA219 Calibrate external shunt
Yep, you can make quite complex formula if you want.
See here an example to convert from Celsius to Fahrenheit: https://espeasy.readthedocs.io/en/lates ... ula#values
Refer to the value in the formula with %value%
See here an example to convert from Celsius to Fahrenheit: https://espeasy.readthedocs.io/en/lates ... ula#values
Refer to the value in the formula with %value%
Re: INA219 Calibrate external shunt
Alright, that sounds great.
I only have to make the formular fitting for my 100A/75mV Shunt instead of the SMD R100 0.1Ω original Shunt and i don´t have to change anything in the sources and the plugin ino´s?
If that is the case and when i get it right from your earlier Post on this thread:
viewtopic.php?p=29199#p29199
I get the shunt resistance of U/I = 0.075V/100A = 0.00075Ω = 0.75mΩ
The INA219 original Shunt is a R100 SMD Resistor with 0.1Ω = 100mΩ and the max. Current is 3.2A.
Max. Voltage for the Original Shunt is then R*I = 0.1Ω * 3.2A = 0.32V = 320mV.
For me it would mean that i have a expected range of U/R = 0.32V / 0.00075Ω = 426,66A
The Factor for my Formular would then be 0.1 / 0.00075 = 133.33
So in my Formular field i would insert %value%*133.33 and it would work with the original Resistor desolderd and the new Shunt connected?
One more.... is this then only for the Current formular field or does it also affect the Voltage and or Power ??
thanks and best regards
Andy
I only have to make the formular fitting for my 100A/75mV Shunt instead of the SMD R100 0.1Ω original Shunt and i don´t have to change anything in the sources and the plugin ino´s?
If that is the case and when i get it right from your earlier Post on this thread:
viewtopic.php?p=29199#p29199
I get the shunt resistance of U/I = 0.075V/100A = 0.00075Ω = 0.75mΩ
The INA219 original Shunt is a R100 SMD Resistor with 0.1Ω = 100mΩ and the max. Current is 3.2A.
Max. Voltage for the Original Shunt is then R*I = 0.1Ω * 3.2A = 0.32V = 320mV.
For me it would mean that i have a expected range of U/R = 0.32V / 0.00075Ω = 426,66A
The Factor for my Formular would then be 0.1 / 0.00075 = 133.33
So in my Formular field i would insert %value%*133.33 and it would work with the original Resistor desolderd and the new Shunt connected?
One more.... is this then only for the Current formular field or does it also affect the Voltage and or Power ??
thanks and best regards
Andy
Re: INA219 Calibrate external shunt
I'm not such a math buff, but that does look quite plausible.
You could, of course, do a calibration, by using a calibrated amps meter in series with this one. Maybe it needs a small adjustment.
With a next release of ESPEasy (the PR is still pending), there is a change in the resolution of calculations in those formulas, where then the number of decimals set for the Value will be used. Currently that's fixed at 2 decimals for formulas, so that may now give somewhat less accurate results then expected.
You could, of course, do a calibration, by using a calibrated amps meter in series with this one. Maybe it needs a small adjustment.
With a next release of ESPEasy (the PR is still pending), there is a change in the resolution of calculations in those formulas, where then the number of decimals set for the Value will be used. Currently that's fixed at 2 decimals for formulas, so that may now give somewhat less accurate results then expected.
/Ton (PayPal.me)
Re: INA219 Calibrate external shunt
Yep, the formula is for that task value.
So the input (%value%) is from that task value and the output is also stored instead of what would otherwise be the %value%
Some examples I documented yesterday: https://espeasy.readthedocs.io/en/lates ... k-formulas
The formula part will indeed not have the full resolution mathematically speaking, which is fixed in the next build that will be made.
Also the more elaborate formula stuff documented there (using standard conversions and referring to other variables) is then also possible.
But just multiplying a factor is already possible for years, so that's no problem.
So the input (%value%) is from that task value and the output is also stored instead of what would otherwise be the %value%
Some examples I documented yesterday: https://espeasy.readthedocs.io/en/lates ... k-formulas
The formula part will indeed not have the full resolution mathematically speaking, which is fixed in the next build that will be made.
Also the more elaborate formula stuff documented there (using standard conversions and referring to other variables) is then also possible.
But just multiplying a factor is already possible for years, so that's no problem.
Re: INA219 Calibrate external shunt
Thank you so much for sorting it out, getting it right and point me in the right direction. I thought i was on the right track, what i was, but i was unsure and had something in mind that was missing... That i only have to adjust it with a "multiplier" was too easy for me, that´s what got me confused...
I think i will wire it up tomorrow and test it with the Batteries...
@TD-er Thank you
I think i will wire it up tomorrow and test it with the Batteries...
@TD-er Thank you
Who is online
Users browsing this forum: No registered users and 95 guests