Espeasy mega right formula for INA219 current
Moderators: grovkillen, Stuntteam, TD-er
Espeasy mega right formula for INA219 current
Hi,
I have an Ina219 and a wemos d1 mini. I got done the correct wiring and and the sensor gets the current value. I measure the battery current. However, the value is incorrect. The multimeter gives a higher value than ina219. Is there any syntax espeasy formula line with which I could get calibrated to the correct value and what variables are needed for syntax? % value% + 0.130 Is this correct or can it be written in a more professional way?
Newbie question I guess..
I have an Ina219 and a wemos d1 mini. I got done the correct wiring and and the sensor gets the current value. I measure the battery current. However, the value is incorrect. The multimeter gives a higher value than ina219. Is there any syntax espeasy formula line with which I could get calibrated to the correct value and what variables are needed for syntax? % value% + 0.130 Is this correct or can it be written in a more professional way?
Newbie question I guess..
- Attachments
-
- 15865349102191203812756145803432.jpg (3.49 MiB) Viewed 14323 times
-
- 15865346562483992012884159467476.jpg (2.06 MiB) Viewed 14323 times
-
- Screenshot_20200410_151129_com.android.gallery3d.jpg (151.69 KiB) Viewed 14323 times
Re: Espeasy mega right formula for INA219 current
You can apply the calibration in the formula field and indeed it is probably something like this:
As advice.
Try to measure a few currents with both the multimeter and the INA219 in series and see if it is a constant offset.
I would expect the offset to be linear, and not a simple offset.
So more something like this:
(5% as a random example)
The used shunt does have a tolerance so I would expect you should only correct for that tolerance. A constant offset is not something I would expect.
Code: Select all
%value% + 0.130
Try to measure a few currents with both the multimeter and the INA219 in series and see if it is a constant offset.
I would expect the offset to be linear, and not a simple offset.
So more something like this:
Code: Select all
%value% * 1.05
The used shunt does have a tolerance so I would expect you should only correct for that tolerance. A constant offset is not something I would expect.
Re: Espeasy mega right formula for INA219 current
A 130mA offset seems excessive for the circuit shown in the photo. As a sanity check, please provide the measurement's variation when you compare the DMM's reading to the INA219A.
Meter = ? mA (in series with battery lead, input of Vreg)
INA219 = ? mA
Be sure to record the INA219A current while the DMM is still wired in series with the battery.
- Thomas
Meter = ? mA (in series with battery lead, input of Vreg)
INA219 = ? mA
Be sure to record the INA219A current while the DMM is still wired in series with the battery.
- Thomas
Re: Espeasy mega right formula for INA219 current
Well, if the leads in the photo are used to draw a (significant) current, then I guess the voltage has dropped significantly when it arrives at the consumer.
If that consumer is a resistive load, then the measured current can be quite a bit lower.
So make sure (as also said by Thomas) to measure the current with both the multimeter and the INA219 in series.
Otherwise it is impossible to find a proper calibration offset.
If that consumer is a resistive load, then the measured current can be quite a bit lower.
So make sure (as also said by Thomas) to measure the current with both the multimeter and the INA219 in series.
Otherwise it is impossible to find a proper calibration offset.
Re: Espeasy mega right formula for INA219 current
...and never ever try to calibrate a voltage/current sensor using a breadboard and think your results would be reliable - it will be an endless story. Take the readings at the momen as they are. Calibration of voltage/current readings only makes sense in a ready soldered circuit, believe it.
But nevertheless, playing around with a breadboard following the suggestions of ThomasB and TD-er is a pretty good practice for a lateron following reliable calibration.
But nevertheless, playing around with a breadboard following the suggestions of ThomasB and TD-er is a pretty good practice for a lateron following reliable calibration.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
- dynamicdave
- Normal user
- Posts: 257
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: Espeasy mega right formula for INA219 current
I've just lashed up a INA219 with a Wemos D1 Mini (FW=mega-20191003) and get correct readings
I've got a 330 ohm resistor across the 3v3 rail (so the current should be 10mA).
As you can see from the screen-shots the current is 10mA.
The only differennce I can see is I'm using a "Measure range" of 16V, 0.4A
PS:
I've just flashed the Wemos with mega-20200410 and the INA219 gives correct readings on all settings,
so it might be worth trying that.
I've got a 330 ohm resistor across the 3v3 rail (so the current should be 10mA).
As you can see from the screen-shots the current is 10mA.
The only differennce I can see is I'm using a "Measure range" of 16V, 0.4A
PS:
I've just flashed the Wemos with mega-20200410 and the INA219 gives correct readings on all settings,
so it might be worth trying that.
Re: Espeasy mega right formula for INA219 current
Wiki wrote: ↑11 Apr 2020, 05:20 ...and never ever try to calibrate a voltage/current sensor using a breadboard and think your results would be reliable - it will be an endless story. Take the readings at the momen as they are. Calibration of voltage/current readings only makes sense in a ready soldered circuit, believe it.
But nevertheless, playing around with a breadboard following the suggestions of ThomasB and TD-er is a pretty good practice for a lateron following reliable calibration.
Yes, I think it was the case here. No after I soldered all parts /wiring it seems the values are right. Thank you for support.
Re: Espeasy mega right formula for INA219 current
Thank you for information, I will give it a try.dynamicdave wrote: ↑11 Apr 2020, 09:49 I've just lashed up a INA219 with a Wemos D1 Mini (FW=mega-20191003) and get correct readings
I've got a 330 ohm resistor across the 3v3 rail (so the current should be 10mA).
As you can see from the screen-shots the current is 10mA.
The only differennce I can see is I'm using a "Measure range" of 16V, 0.4A
PS:
I've just flashed the Wemos with mega-20200410 and the INA219 gives correct readings on all settings,
so it might be worth trying that.
ScreenShot027.png
ScreenShot026.png
Re: Espeasy mega right formula for INA219 current
I think it was too this wires and loose connections. After soldering values changed close to the DMM readings. Thanks.ThomasB wrote: ↑10 Apr 2020, 20:21 A 130mA offset seems excessive for the circuit shown in the photo. As a sanity check, please provide the measurement's variation when you compare the DMM's reading to the INA219A.
Meter = ? mA (in series with battery lead, input of Vreg)
INA219 = ? mA
Be sure to record the INA219A current while the DMM is still wired in series with the battery.
- Thomas
Re: Espeasy mega right formula for INA219 current
I made few changes (battery voltage I measured from wemos A0 pin, and INA219 sensor is for solarpanel current reading), and I got it running now. Thanks all!
(Added some pictures if someone is interested doing similar project)
(Added some pictures if someone is interested doing similar project)
- Attachments
-
- domoticz.jpg (148.76 KiB) Viewed 14255 times
-
- INA219 under the pcb between CN3791 and Wemos
- mounted pcb.jpg (190.91 KiB) Viewed 14255 times
-
- Finished result
- enclosure+sensor+solarpanel.jpg (48.44 KiB) Viewed 14255 times
-
- Schematics
- lake_water_temperature_solarpowered.jpg (133.01 KiB) Viewed 14255 times
Who is online
Users browsing this forum: No registered users and 59 guests