INA219 monitor/Wiring it/04. SCL comes first
Wiring it · 04 of 11

SCL comes first

The header reads GND, 3V3, SCL, SDA: the clock is the third pin and the data the fourth, the reverse of most I²C boards. And the hole marked 3V3 takes anything from 3 to 5.5 V, but whatever you feed it becomes the level on SCL and SDA, because the block's pull-ups end there.

The third pin is the clock

Left to right with the parts facing you: GND, 3V3, SCL, SDA. Most I²C boards, including the TK31 EEPROM and the INA3221, print SDA before SCL. A row of jumpers moved from one of those to this block swaps the two lines.

Nothing is damaged when that happens. The chip simply never recognises its address, so a scan finds nothing and the sketch reports no INA219 — which looks exactly like a dead board. Read the silkscreen, not the wire colours.

BoardSDASCLFeed 3V3 from
ESP32-S3GPIO 8GPIO 93V3
ESP32GPIO 21GPIO 223V3
Arduino UnoA4A55V
Raspberry Pi PicoGP4GP53V3(OUT)

The 3V3 hole sets the bus

Which voltage the bus runs at
ESP32-S3, 3.3 V feed
Your microcontroller
The 3V3 hole is fed from
SCL and SDA
SCL and SDA idle at
3.3 V
Chip reads high above
2.31 V
Answers at 0x40
yes
Right. The bus idles at 3.3 V, the level the ESP32-S3 works at, and the chip reads anything over 2.31 V as high.

The hole is printed 3V3, and it is the chip's own supply, which may be anything from 3 to 5.5 V. The block's two 10 kΩ pull-ups run from SCL and SDA to that same hole, so whatever you feed it is the voltage the two lines rest at.

That makes the rule simple: feed 3V3 from your board's logic rail. 3.3 V on an ESP32 or a Pico, 5 V on an Uno. The chip treats a line as high from 0.7 times its own supply, so a matched feed always leaves a clear margin.

The two ways to get it wrong both come from the pull-ups. 5 V on the hole beside an ESP32 puts 5 V on two of its pins. 3.3 V on the hole beside an Uno fights the Uno's own weak pull-ups to 5 V and lifts the clock above the chip's limit.

Finding it

A scan is the quickest check that the wiring is right. With nothing soldered on the back, the block answers at 0x40.

#include <Wire.h>

void setup() {
  Serial.begin(115200);
  delay(500);
  Wire.begin(8, 9);  // ESP32-S3: SDA 8, SCL 9
  for (uint8_t a = 1; a < 127; a++) {
    Wire.beginTransmission(a);
    if (Wire.endTransmission() == 0) Serial.printf("found 0x%02X\n", a);
  }
}

void loop() {}

When it does not work

A scan finds nothing at all.

Swap SCL and SDA first. Moving jumpers from a board that prints SDA before SCL puts the clock on the data pin, and the chip then never sees its address. It does no damage. If the red LED is off as well, the problem is GND or 3V3, not the bus.

Can I feed the 3V3 hole with 5 V?

Yes, the chip runs from 3 to 5.5 V, and on an Arduino Uno that is the right choice. The catch is the pull-ups: with 5 V on that hole, SCL and SDA idle at 5 V, which an ESP32 or a Pico must not see. Feed it from the same rail your microcontroller's logic runs at.

Why not feed it 3.3 V from an Uno?

An Uno's Wire library turns on the ATmega328P's own pull-ups to 5 V. Against the block's 10 kΩ to 3.3 V that holds the lines at about 3.7 V, which is above the INA219's limit on SCL of its supply plus 0.3 V. Feed the block 5 V on an Uno and the question goes away.

I have other I²C boards with their own pull-ups.

Pull-ups on the same bus add in parallel. Two 10 kΩ pairs make 5 kΩ, which is a normal value; five or six boards each with 10 kΩ start to make the lines hard to pull down. All of them must pull up to the same voltage, which is the rule above again.

Where this goes next

The two pads on the back, and up to four blocks on one bus.

Four addresses

Edit this page — content/books/ina219/scl-comes-first.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

TK119 INA219 Current and Voltage Monitor

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum