RobTillaart / INA228

Arduino library for INA228 current and power sensor
MIT License
1 stars 2 forks source link

INA228 #2

Closed caoxuan19961206 closed 5 months ago

caoxuan19961206 commented 5 months ago

Hello,

I was curious if there is a INA228 of this driver being developed (or in the pipeline) for this chip?

Respectfully, RobTillaart

RobTillaart commented 5 months ago

There is none in the pipeline, however there is a range of sensors that are similar and might just work with this library. You might need to calibrate the shunt and max current.

Do you have a link to the datasheet of the INA228? Did you compare it with the INA226 datasheet? If compatible I might add it as derived class in this library in the future.

(no time at the moment to investigate the INA228)

RobTillaart commented 5 months ago

found sheet - https://www.ti.com/lit/ds/symlink/ina228.pdf

RobTillaart commented 5 months ago

I had a look into the data sheet and it is far from compatible, so the INA226 library won't work.

As time is scarce, I can write a minimalistic library to get you started, made a note in my TODO list. A full library takes I (first) estimate 50-75 hours to complete.

If this answers your question you may close the issue.

RobTillaart commented 5 months ago

@caoxuan19961206 Have you tested -https://github.com/adafruit/Adafruit_INA228?

RobTillaart commented 5 months ago

Created a minimal version in the develop branch here.

not tested with hardware, demo sketch compiles. functionality is minimal and hard coded. Most registers can be read/write with ditto functions. Please open an issue at the INA228 repo if you have remarks.

caoxuan19961206 commented 5 months ago

Thank you very much for your help. Now I can use ina228 to read voltage and current data. It works.

RobTillaart commented 5 months ago

Thank you very much for your help. Now I can use ina228 to read voltage and current data. It works.

Just to be clear, is this with my library https://github.com/RobTillaart/INA228?

Then I know I am "on track" as much of the other functionality builds on top of this.

RobTillaart commented 5 months ago

@caoxuan19961206

Moved the issue to the new INA228 repository so it has the right context.

RobTillaart commented 5 months ago

@caoxuan19961206

Added quite some functionality to the library. If you have time, please verify if it works.

RobTillaart commented 5 months ago

@caoxuan19961206

Develop branch is now functionally complete. If you have time, please verify if it works.

caoxuan19961206 commented 5 months ago

Thank you very much for helping me. I have tested INA228_demo and INA228_dump_config, and they can work normally

RobTillaart commented 5 months ago

@caoxuan19961206

Thanks for testing! I hope that the values you got make sense and are accurate.

One more question, which board do you use?