Giter VIP home page Giter VIP logo

ina226_we's Introduction

INA226_WE

An Arduino library for the INA226 current and power sensor module using a shunt of 0.1 Ohm. You can also use it for the INA226 IC and a resistor of your choice (example: Continuous_With_Resistor_Value.ino).

It allows to set current ranges, number of samples per measurement, conversion ranges. You can chose between continous, triggered and power down mode. Conversion ready and limit alert modes are also implemented.

I attached a list of public functions and a fritzing scheme for the example sketches.

If you work through the examples I recommend to do it in the order of Continous -> Triggered -> PowerDown -> Continous_Alert_Controlled -> Limit_Alert -> Limit_And_Conversion_Alert

You find further details here:

https://wolles-elektronikkiste.de/ina226 (German)

https://wolles-elektronikkiste.de/en/ina226-current-and-power-sensor (English)

New since version 1.2.8: compatibility mode

When I developed the library I did not choose the best enum names for the measure modes. E.g. "POWER_DOWN" is also used in INA219_WE. If you have problems then uncomment the line: #define INA226_WE_COMPATIBILITY_MODE_ in INA226_WE_config.h and use "INA226_POWER_DOWN" instead of "POWER_DOWN". Do the same for "CONTINUOUS" (-> INA226_CONTINUOUS) AND TRIGGERED (-> INA226_TRIGGERED).

Quality of small shunt INA226 modules

I have made mixed experience with INA226 modules which have a shunt smaller than 0.1 ohms. I experienced significant deviations from expected values. The reason is that some modules have poor traces and connections which result in an unwanted extra resistance. The most extreme I tested had an R010 shunt (= 0.01 ohms), but showed a resistance of 0.021 ohms. Accordingly, the measured values were more than double compared to the real currents. I short-circuit the shunt (see photo below), so that, theoretically, I should not measure any shunt voltages anymore. But I still measured shunt voltages and currents and these represented exactly the deviations my experiments before I short-cut the shunt.

20220816_114858

But there are also good modules. The one below has a shunt of 0.002 ohms and the results of my measurements were very close to the expected values.

INA226_R002

ina226_we's People

Contributors

davidcliddell avatar generationmake avatar igortasuke avatar wollewald 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ina226_we's Issues

Error checking in readRegister

Hi,

readRegister misses error checking of the i2c calls. If for example requestFrom fails, i.e. returns 0, or no data is available, the function returns 0. This causesgetBusVoltage_V to return zero when there is a problem with the i2c bus, so we don't know if the read failed or actually reading zero voltage.

Soft WDT reset

Hi, I used Continuous_With_Resistor_Value.ino and didn't change anyting. Specific contents are as follows

Soft WDT reset

stack>>>

ctx: cont
sp: 3ffffd60 end: 3fffffc0 offset: 01a0
3fffff00: 60000314 3ffee820 00000001 40202d10
3fffff10: 3ffee820 00000000 00000000 40202d72
3fffff20: 3ffee820 3ffee593 00000004 40202f0e
3fffff30: 00000000 00000040 3ffee591 3ffee7d4
3fffff40: 3fffdad0 00000006 00000002 3ffee7d4
3fffff50: 3fffdad0 00000006 3ffee591 4020304c
3fffff60: 40201906 3ffe884b 3ffee548 402013e8
3fffff70: 3fffdad0 00000031 3ffee548 402015df
3fffff80: 00000d1b 00000008 3ffee548 4020166b
3fffff90: 3fffdad0 3ffee6b8 3ffee548 4020107c
3fffffa0: feefeffe 00000000 3ffee7c0 40202238
3fffffb0: feefeffe feefeffe 3ffe85e0 40100e4d
<<<stack<<<

Measure high current

Can this support high current? If I want to measure high current(Up to 30A), how can this be achieved? Thank you !!!

Multiple INA226s

Hi and thank you for your work!

Is it possible to use this library whenhaveing multiple INA226 modules? If so how can this be achieved?

Thank you!

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.