Electronics > Beginners

INA219 voltage/current sense module - Modifying the Library for 0.01R resistor

<< < (3/5) > >>

castingflame:
Good idea.

I did look at the library code and it does an IF statement on 16v that looks like it is auto-switching from 16v to 32v range.

But I agree, it would be better to have the correct ranges of volts and amperes for accuracy.

I'll message him. :-+

tooki:

--- Quote from: castingflame on October 15, 2018, 09:26:02 am ---I did look at the library code and it does an IF statement on 16v that looks like it is auto-switching from 16v to 32v range.

--- End quote ---
Auto-switching based on what?

Zanshin:
Greetings,

I'm the author of the library and will look into changing the range for the INA219 from the current 0-16V to 0-32V (of which only 0-26 is allowed per data sheet). I took a quick look at the datasheet and can't for the life of me find out what implications this setting might have, I made the assumption that restricting the range to the lower 0-16V would increase precision, but I can't find anything in the specifications to support that assumption. If the setting does indeed affect precision, I might change the library to automatically change the precision, i.e. if the voltage exceeds 16v on the lower setting and an overflow occurs, switch to 32V and re-read. Along the same lines, if the voltage is in the 32V range and the voltage drop below 16V then keep the higher range under the assumption that it will once again exceed the 16V threshold.

tooki:
Page 23 of the INA219 datasheet says that it’s 4mV LSB in either range. Maybe it’s a compatibility mode for an older chip or something? ’Cause I’m with you, for the life of me I also don’t see anything in the datasheet that would indicate any reason not to use the full range.

Zanshin:
I've found a couple of INA219 chips and will check changing the impact of switching voltage range. The library currently does a sort of auto-range upon device initialization which limits the range to 0-16 if the first reading is within that range, otherwise it leaves the current state. This assume that the devices still has its startup settings. I think I will correct that, since it means that once a INA219 is in the lower 0-16V range it cannot go above that without getting reset. And if the range makes no difference then I can keep it at the higher range and remove that code completely.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod