ESP 8266 + 2x INA219 up to 15amp

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Normal user
Posts: 1
Joined: 17 Oct 2019, 17:18

ESP 8266 + 2x INA219 up to 15amp

#1 Post by massivenr » 17 Oct 2019, 17:51

Hello friends.

I'm looking for some kind of help, ideas, solution. I have been looking around the internet but with no luck with finding good solution.

I would like to monitor two voltage and two current flows (one 0-19V; 0-15A, second 12V 0-15A) using only one ESP8266 with the possibility of sending data to Domoticz. This will be used in a small PV system to collect data on charging and output.
I found threads that INA219 can operate and measure the high value of current if the shunt resistor will be changed.
I have tried to find a simple answer but just couldn't. Maybe here I will find a person who could explain and help me with this in a step by step process.

A few questions at the beginning:

1. Is the ESP8266 able to read values from two INA219 (set at two different I2C addresses)?
2. Could someone calculate the value of the shunt resistor to get the possibility of measurement 0-19V and 0-15A on one of the INA219 (input from PV) and constant 12V (0-15A) on second INA219 (load)
3. How and what changes need to be done in ESPEasy firmware to get correct values after change of the shunt resistor?

I will be greatly appreciated and I believe that will help lots of others too.

Regards. Mario

Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: ESP 8266 + 2x INA219 up to 15amp

#2 Post by Domosapiens » 17 Oct 2019, 20:42

Did you do your homework and study the wiki? ... fulltext=1
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: ESP 8266 + 2x INA219 up to 15amp

#3 Post by Drum » 20 Oct 2019, 11:27

Here is another good place to look, they document things really well and have a forum for questions. The software you can probably figure out from the arduino code in the docs, but the hardware would be in the forum or you would have to ask and perhaps they can tell you if the design can handle 19A even with a different resistor. 12V at 15A is a lot for this I think. I think it would melt it.... If I read correctly it requires AWG 10 wire. If I remember correctly, this must go in line so all that current would have to pass through the traces on the board. Pretty sure it would melt or maybe sparks and flames. ;) ... t/overview

Normal user
Posts: 312
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: ESP 8266 + 2x INA219 up to 15amp

#4 Post by Wiki » 21 Oct 2019, 17:19

Drum wrote: 20 Oct 2019, 11:27 [...]
If I remember correctly, this must go in line so all that current would have to pass through the traces on the board. Pretty sure it would melt or maybe sparks and flames. ;)
No, the current musn't go through the lines of the pcb. Unsolder the internal shunt resistor marked R100 off the INA219 pcb and put an external shunt resistor directly into the power line you want to measure. Then connect the IN+ and IN- of the INA219 before and behind the resistor accordingly. It will work fine without any current through the board - no blue smoke, no sparks.

Depending on the shunt you choose, you have to adopt the calculation of the current to get the correct results using the formula section of the plugin.

if you want to connect a second INA219 to your ESP you have to change the address of the second INA219 by shortening its onboard solder pins and configure the task for the second INA accordingly. But be aware, that the GND of all three components - ESP, INA219 #1 and INA219 #2 - have to be the same.

Code: Select all

pi@raspberrypi:~ $ man woman
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

User avatar
Normal user
Posts: 775
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP 8266 + 2x INA219 up to 15amp

#5 Post by ThomasB » 26 Oct 2019, 00:50

Just thought I'd share some tips on using the INA219 "Adafruit" type module with an external shunt. I'm using one ($2 Chinese clone) with an ESP32 to measure up to 200 Amps. My project does not use ESPeasy, but the overall concept remains the same.

If you enjoy the math then Adafruit's published information will help you calculate the INA219 configuration settings. But another method is to create a test application with the INA219 library and example (by johngineer) found here:
The example code makes it easy: Plug in some values and it will configure the INA219 and display the config settings. You can record the info and use it in your own code with your chosen INA219 library. I had to modify this library to support my 200A application, but no changes should be needed for 15A.

My shunt is in a very noisy environment at the end of 12cm long twisted pair wires. So I added the filter circuit that is found in the chip maker's INA219 data sheet. It's just two 10 ohm resistors and a 0.1uF ceramic cap. I used 0805 size SMD resistors and a through-hole cap. A couple trace cuts and a bit of solder and the filter is installed.

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests