Datasheet
Python & CircuitPython
It's easy to use the INA219 sensor with Python and CircuitPython, and the Adafruit CircuitPython
INA219 (https://adafru.it/BHQ) module. This module allows you to easily write Python code that reads the current and
more from the sensor.
You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python
thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library (https://adafru.it/BSN).
CircuitPython Microcontroller Wiring
First wire up a INA219 to your board exactly as shown on the previous pages for Arduino using an I2C interface. In
addition connect some load to measure the current from in series to the sensor's Vin- and Vin+ pins as mentioned on
the wiring page (https://adafru.it/BHR).
Here's an example of wiring a Feather M0 to the sensor with I2C:
Board 3V to sensor Vcc
Board GND to sensor GND
Board SCL to sensor SCL
Board SDA to sensor SDA
Python Computer Wiring
Since there's
dozens
of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms,
please visit the guide for CircuitPython on Linux to see whether your platform is supported (https://adafru.it/BSN).
In addition connect some load to measure the current from in series to the sensor's Vin- and Vin+ pins as mentioned
on the wiring page (https://adafru.it/BHR).
Here's the Raspberry Pi wired with I2C:
Pi 3V3 to sensor Vcc
Pi GND to sensor Gnd
Pi SCL to sensor Scl
Pi SDA to sensor Sda
CircuitPython Installation of INA219 Library
Next you'll need to install the Adafruit CircuitPython INA219 (https://adafru.it/BHQ) library on your CircuitPython board.
First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/tBa) for your board.
© Adafruit Industries https://learn.adafruit.com/adafruit-ina219-current-sensor-breakout Page 15 of 20










