Giter Site home page Giter Site logo

elschopi / ti_ina226_micropython Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 4.0 33 KB

Micropython driver for Texas Instruments INA226 power measuring IC

Home Page: https://github.com/elschopi/TI_INA226_micropython

Python 100.00%
micropython texas-instruments ina226 power-measurement micropython-esp8266 micropython-esp32

ti_ina226_micropython's Introduction

  • 👋 Hi, I’m @elschopi
  • 👀 I’m interested in all things electronics, 3D printing, tools and mechanical stuff
  • 🌱 Besides working as a electronics professional (production / QA), I offer 3D printing, design and consultation services
  • 📫 How to reach me: github, email

ti_ina226_micropython's People

Contributors

elschopi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ti_ina226_micropython's Issues

Lack of one space in 202 line of "ina226.py" file

Hi,
I've tried to use this great library and have got an error:
File "ina226.py", line 202
IndentationError: unindent doesn't match any outer indent level

When I add a missing space in line 202 it works fine :)

Best regards and thanks for this library :)

Limit to current measurement

Using a 0,1 Ohm shunt resistor and with the same parameters of the excelent example here at GitHub, I found that couldn´t measure more than 800 mA, aprox, although the design was for 3,6 A.

Looking at the Shunt Voltage Register (01h) I found that it reached the 32 bits max at that current. So it can´t read any more current, although it is design for

Perhaps It is according to "Shunt voltage input range" parameter in page 5 of specificationes, that says 81,92 mV max.

The problem is solved reducing de Shunt resistor.

MY CONCLUSION: apart from calculations, take care of the value of Shunt resistor in order to avoid register 01h reach the limit.

Thank you very much for the files adapting the INA219 micropython software to INA 226. It is very useful for me. And I´ve learnt a lot

Bug in def shuntvoltage

I discovered a bug in the library:

@property
    def shunt_voltage(self):
        """The shunt voltage (between V+ and V-) in Volts (so +-.327V)"""    # no, +-80mV!
        value = _to_signed(self._read_register(_REG_SHUNTVOLTAGE))
        # The least signficant bit is 10uV which is 0.00001 volts
        # NO!! It is 2.5uV
        # return value * 0.00001
        return value * 0.0000025

Chris defined the shunt voltage LSB as 10uV, but the datasheet says 2.5uV (page 24)
Unfortunately my results are still wrong after this correction (by a factor 5 for current and power)

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.