Adafruit INA260 Current + Voltage + Power Sensor Breakout Created by Bryan Siepert Last updated on 2019-07-01 02:19:23 PM UTC
Overview This breakout board may well be the last current sensing solution you every need to buy. Not only can it do the work of two multimeters, but it can do it with amazing precision and flexibility. With it you can measure high or low side DC current, the bus voltage, and have it automatically calculate the power. It can do so over impressive voltage, current, and temperature ranges with better than 1% accuracy, all while delivering the data in an easy to use format over I2C.
How does it work? The voltage across the integrated 2 milliohm (.002 ohms!), 0.1% shunt resistor is measured by the internal 16 bit ADC, allowing for measurements over the impressive current range with a resolution of 1.5 mA.
Pinouts The little chip in the middle of the PCB is the actual INA260 sensor that does all the current and voltage sensing. We add all the extra components you need to get started, and 'break out' all the other pins you may want to connect to onto the PCB. For more details you can check out the schematics in the Downloads page. © Adafruit Industries https://learn.adafruit.
Power Pins The sensor on the breakout requires between a 2.7V and 5.5V, and can be easily used with most microcontrollers from an Arduino to a Feather or something else. Vcc - this is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V GND - common ground for power and logic I2C Logic Pins SCL - I2C clock pin, connect to your microcontrollers I2C clock line.
Assembly Prepare the header strip: Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down. © Adafruit Industries https://learn.adafruit.
Add the breakout board: Place the breakout board over the pins so that the short pins poke through the breakout pads. And Solder! Be sure to solder all 8 pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
You're done with the header strip! Check your solder joints visually. Prepare the terminal block: Place the terminal block inside the board. Make sure it's facing out! Turn the board over so the terminal pins are facing upwards. Solder again! First solder one pin by using the soldering iron to prop up the board. Then use a vice (https://adafru.it/dDJ) or helper hands to hold the board in place while soldering the other pin. © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps. © Adafruit Industries https://learn.adafruit.
Arduino Wiring Connecting the INA260 to your Feather or Arduino is easy: If you are running a Feather (3.3V), connect Feather 3V to board VIN If you are running a 5V Arduino (Uno, etc.), connect Arduino 5Vto board VIN Connect Feather or Arduino GND to board GND Connect Feather or Arduino SCL to board SCL Connect Feather or Arduino SDA to board SDA Connect Vin+ to supply for high side current sensing or to load ground for low side sensing.
Click the Manage Libraries ... menu item, search for Adafruit INA260, and select the Adafruit INA260 library and click Install: Then follow the same process for the Adafruit BusIO library. Example Code The following example code is part of the standard library, but illustrates how you can retrieve sensor data from the INA260 for the Current, Voltage, and Power. Load Demo Open up File->Examples->Adafruit_INA260 Library->ina260_test and upload to your Arduino wired up to the sensor.
#include Adafruit_INA260 ina260 = Adafruit_INA260(); void setup() { Serial.begin(115200); // Wait until serial port is opened while (!Serial) { delay(10); } Serial.println("Adafruit INA260 Test"); if (!ina260.begin()) { Serial.println("Couldn't find INA260 chip"); while (1); } Serial.println("Found INA260 chip"); } void loop() { Serial.print("Current: "); Serial.print(ina260.readCurrent()); Serial.println(" mA"); Serial.print("Bus Voltage: "); Serial.print(ina260.
First we include the library and create an Adafruit_INA260 object to use in the rest of the sketch. #include Adafruit_INA260 ina260 = Adafruit_INA260(); Next, in the setup we call the INA260 object's begin function to initialize the driver and prepare it to read measurements from the sensor. The begin function will return false if it is unable to make a connection to an INA260 sensor. If this happens, double check your power and I2C wiring. if (!ina260.begin()) { Serial.
Python & CircuitPython It's easy to use the INA260 sensor with Python and CircuitPython, and the Adafruit CircuitPython INA260 (https://adafru.it/EGK) module. This module allows you to easily write Python code that reads the humidity, temperature, pressure, 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 Installation of INA260 Library You'll need to install the Adafruit CircuitPython INA260 (https://adafru.it/EGL) library on your CircuitPython board. First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/Amd) for your board. Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find and install these libraries from Adafruit's CircuitPython library bundle (https://adafru.it/uap).
current - The current in milliamps. voltage - The voltage in volts. power - The power in milliwatts For example to print current, voltage, and power levels: print("Current:", ina260.current) print("Voltage:", ina260.voltage) print("Power:", ina260.power) For more details, check out the library documentation (https://adafru.it/EGM). That's all there is to using the INA260 sensor with CircuitPython! Full Example Code import time import board import adafruit_ina260 i2c = board.I2C() ina260 = adafruit_ina260.
Python Docs Python Docs (https://adafru.it/Etg) © Adafruit Industries https://learn.adafruit.
Downloads Datasheets INA260 datasheet (https://adafru.it/EGN) TI design resources (https://adafru.it/EGO) Fritzing object available in the Adafruit Fritzing Library (https://adafru.it/aP3) EagleCAD PCB files on GitHub (https://adafru.it/EGP) Schematic Fabrication Print Dimensions in inches © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
Arduino Docs Arduino Docs (https://adafru.it/Esz) © Adafruit Industries https://learn.adafruit.
© Adafruit Industries Last Updated: 2019-07-01 02:19:23 PM UTC Page 24 of 24