External Supply + Shunt Resistor

When using the expansion ports in conjunction with a shunt resistor and external supply (want to measure current with 7.2v), there’s a limit on the resistor value one can use. Is one not able to go above 22 ohms?

First of all, note that you can’t measure on the high-side of a 7.2V supply using the ADC input, the 5V maximum voltage from ground applies to the ADC pins as well due to the ESD protection we use. To measure current in a 7.2V system you have to measure over a low-side shunt, where ADC- is connected to supply ground and ADC+ is connected to device ground.

We have limited the supported ADC shunt resistor range to what we believe includes all IoT use-cases but we’re always listening to our customers if there’s something we might have overlooked (1mOhm results in a full-scale reading of +/- 81.92A with a step size of 2.5mA and 22Ohm results in +/- 3.72mA with a step size of ~0.1µA). The main issue measuring current in the µA range is that the leakage current flowing into the ESD protection and the input stage of the INA226 used for the ADC input pair degrades the measurement. A 1Ohm resistor is typically the largest shunt recommended, resulting in a full-scale reading of just over +/- 81.9mA and the step-size is 2.5µA.

What shunt resistor value were you looking to use?

When using a low-side shunt, where should AGND be connected? Device ground or supply ground?

I think it would be good if you have a picture of this setup, i.e. measuring with a high voltage power supply, here: https://www.qoitech.com/help/otii/hardware/connecting-to-the-main

AGND should always be connected to the most negative node, which would be the supply ground/ADC- in this case. AGND, DGND and Main- are all internally connected to system ground.

The low-side shunt use-case isn’t fully supported due to the fact that energy isn’t possible to calculate correctly due to the fact that the voltage sensing happens between the ADC+ pin and AGND, but it’s a good suggestion to add a note about it in the documentation including that limitation.