ESP32 devkit connection to scan a INA219 sensor

Can anyone please share a working circuit for Esp32 devkit to scan the INA219 as a I2c...im having a hard time scanning that as only esp wroom 32 circuits are available with GPIO pins but devkit has D pins ... thanks for reading and replying

It also has GPIO numbers.
See this

The defaults are:

GPIO 21 (SDA)
GPIO 22 (SCL)

1 Like

First read the pinned post re 'How to get the most from the forum.'
We don't do the work here; that can be contracted at the Paid consultancy category.
I don;t fully understand youir question, Pics are generally better than word salads.
It sounds like you think GPIO pins are different from digital pins. Different boards label the pins differently, but there are maps available online (randomnerds site is a good resource) that show you what a Digital pin is called in GPIO style and vice versa.

Keep in mind that the esp32 dev boards come in several pinouts, some are 30 pins, some 38, which are the 'official' numbers, but I think I have some from China that are different from either of those.

I moved your topic to a more appropriate forum category @reetam.

The Nano Family > Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, when creating a topic please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

The official Arduino NANO boards that support the ESP32 attempt to map the pins to the D notation rather than the GPIO to look like other Arduino boards. This leads to much confusion then using other ESP32 boards.

I have never used the NANO versions so I just use the GPIO numbers and things mostly "just work".

If you are still having problems when using the correct pins then it is probably a hardware problem.
Do you have pull-up resistors on the I2C pins?
Does your INA219 operate at 3.3V?

The spec sheet says 3-5.5v for the interface, 26v max for the monitored supply.


this is the exact components i have and the circuit i made to scan the INA219

#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;

void setup() {
  Serial.begin(115200);
  delay(1000);

  Wire.begin(21, 22);

  Serial.println("INA219 Test");

  if (!ina219.begin()) {
    Serial.println("INA219 not found");
    while (1);
  }

  Serial.println("INA219 found");
}

void loop() {
  // even empty loop is REQUIRED
  delay(1000);
}

the output im getting is

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4744
load:0x40078000,len:15672
load:0x40080400,len:3164
entry 0x4008059c
INA219 Test
INA219 not found

Thanks for replying

Hi, @reetam
Welcome to the forum.

Do you have a DMM? Digital MultiMeter?

Have you tried 4K7 pullup resistors on the SCL and SDA lines?
That is a 4K7 resistor from SDA to 3V3 and a 4K7 resistor from SCL to 3V3.

Tom.... :smiley: :+1: :coffee: :australia:

Run the WireScan example to see if it finds the INA.
It is under Files->Examples->Wire

Are all the connections to the INA219 soldered?
Which board do you have selected?

hello tom thanks for replying i will surely try the connection with the resistors thanks for replying

That board already has pull-up resistors. Adding additional resistors may cause it to fail

hello jim, i tried the Wire example but still it cant find the I2c device now maybe the sensor can be broken .

If WireScan can't find it then it may well be damaged.
Do you have any other I2C devices you could try with WireScan?

Did you solder on the headers?

yes i soldered the headers , i have a DHT22 but not right now i will surely try that or try the INA219 with arduino .this INA219 is new too :frowning: .... anyways thanks for replying can you suggest any replacement of INA219 which can be used for Voltage and current both

There is nothing wrong with the INA219, I think you just got a bad board.
What is the max current and voltage you want to measure?

right now i just want to check it is working or not and max voltage will around 12 volt.

It can measure a max current of 3.2A
If you need a higher current then you need a different board.

I've tried my DHT22 and it works fine so I'm assuming my INA219 is damaged...I've ordered



these two (voltage sensing module and ACS712 30A)...
They will be fine right for sensing current and and Voltage for a 3 pack of Lithium ion cell (3.7volt each..approx 12volt).
Thanks for replying