Micropython library for the TI INA219 voltage/current sensor
Micropython library for the TI INA219 voltage/current sensor
https://github.com/chrisb2/pyb_ina219
I have written this library based on one I wrote for the Raspberry Pi. It supports the INA219 voltage, current and power monitor sensor from Texas Instruments. The intent of the library is to make it easy to use the quite complex functionality of this sensor.
Its currently under development, with the next step being porting the unit tests from the Raspberry Pi version. Manual testing shows the functionality working as expected.
Feedback and suggestions welcome. I am quite new to MicroPython.
Chris
I have written this library based on one I wrote for the Raspberry Pi. It supports the INA219 voltage, current and power monitor sensor from Texas Instruments. The intent of the library is to make it easy to use the quite complex functionality of this sensor.
Its currently under development, with the next step being porting the unit tests from the Raspberry Pi version. Manual testing shows the functionality working as expected.
Feedback and suggestions welcome. I am quite new to MicroPython.
Chris
Re: Micropython library for the TI INA219 voltage/current sensor
I have updated this library to use machine.I2C instead of pyb.I2C, so it should now work on all MicroPython hardware, though I have only have a pyboard to test with. Let me know if you successfully use it with other hardware.
Chris
Chris
Re: Micropython library for the TI INA219 voltage/current sensor
Very nice! I wonder if we could move this thread to the "Drivers for External Components" section?
Re: Micropython library for the TI INA219 voltage/current sensor
I looked around for an option to do that, but could not find one, maybe an Admin can do it?
thanks,
Chris
thanks,
Chris
Re: Micropython library for the TI INA219 voltage/current sensor
Moved to driver section...
Re: Micropython library for the TI INA219 voltage/current sensor
I have now verified this library works with an esp8266 (NodeMCU clone), see Using the Library on an ESP8266
Re: Micropython library for the TI INA219 voltage/current sensor
I have now verified this library works with an esp32 (Lolin32 Lite), see Using the Library on an ESP32
Re: Micropython library for the TI INA219 voltage/current sensor
Hello all,
I am searching for a micropython driver for the TI INA226, and as this is its little brother, I guessed I might as well ask here instead of opening a new thread.
I'm quite new to (micro)python (or programming in itself), so writing my own library is out of the question
On another note, would it be possible to convert a python library to a micropython one, or vice versa?
Best regards and thanks in advance,
Chris
I am searching for a micropython driver for the TI INA226, and as this is its little brother, I guessed I might as well ask here instead of opening a new thread.
I'm quite new to (micro)python (or programming in itself), so writing my own library is out of the question
On another note, would it be possible to convert a python library to a micropython one, or vice versa?
Best regards and thanks in advance,
Chris
Re: Micropython library for the TI INA219 voltage/current sensor
I had a quick look at ina226 datasheet and it seems to me to be pretty similar to ina219, it might not be to hard to make appropriate changes to my library by carefully reading both data sheets. I would pay particular attention to the calibration algorithm.
Micropython to Python should not be hard, but going the other way can be tricky due to resource limitations on mcu. I wrote the ina219 library for Raspberry Pi ( https://github.com/chrisb2/pi_ina219) first, it was easy to convert. Perhaps start by looking at my two libraries will help you convert https://github.com/neutronstriker/INA22 ... ardvark.py.
Regards,
Chris
Micropython to Python should not be hard, but going the other way can be tricky due to resource limitations on mcu. I wrote the ina219 library for Raspberry Pi ( https://github.com/chrisb2/pi_ina219) first, it was easy to convert. Perhaps start by looking at my two libraries will help you convert https://github.com/neutronstriker/INA22 ... ardvark.py.
Regards,
Chris
Re: Micropython library for the TI INA219 voltage/current sensor
I derived once an Adafruit driver to work with the INA219. At that time, the Adafruit stuff was still easy to deal with. So the only thing to change was the way of reading and writing to I2C. I uploaded my version to https://github.com/robert-hh/INA219.