GithubHelp home page GithubHelp logo

ina260's Introduction

INA260 Driver

coverage

Introduction

This Python package provides a platform agnostic driver for the TI INA260 precision power monitor. Conveniently, the INA260 has a built-in sense resistor so it's very easy to integrate into your projects. It can sense from 0 to 36V and up to 15A(!) with 16-bit resolution. Thus, it's perfect for pretty much all hobbyist projects.

The only dependency for this library is smbus2 so provided your I2C device is addressable by that, this library should work (for example on a Raspberry Pi or other dev board).

Examples

from ina260.controller import Controller

c = Controller(address=0x40)

print(c.voltage())
print(c.current())
print(c.power()))

see the example script in the repository. Note that the power measurement is usually not the same as voltage times current unless you read all three registers instantaneously.

Obviously check what address you've set the chip to (there is a table in the datasheet).

Hardware notes

The chip itself is very easy to hook up (although it comes in a VSSOP package which can be challenging to solder if you've not had much experience with SMD soldering).

Be sure to follow TI's guidelines in the datasheet about proper power planes and PCB layout. The package is designed so that your power rail goes in one side and out the other. Otherwise the chip is very easy to integrate and minimally just needs a standard 0.1uF bypass capacitor.

Test suite

This package has a comprehensive test suite which you can use to check that commands are being recieved and interpreted properly. You need pytest. Run with:

python -m pytest test

Coverage is 99% because there should also be a check for reverse current which is obviously difficult to do simultaneously with forward current.

ina260's People

Contributors

frillip avatar jveitchmichaelis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ina260's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.