Correcting PitS ADC converter

For a balloon mission we bought a Pi-in-the-Sky Board from [1] and put it together with a Raspberry Pi A+. The board offers some ADC converter in order to measure input voltage and current. These values are then sent to ground using the onbard SSDV transmitter. Our board is revision 2.4 and suffering from an overdriven input to the ADC converter.

The input voltage is fed to the ADC converter using a voltage divider consisting of R12 and R13 in the schematics. As they are both 10k resistors this makes an input ratio of 1:1 or 12 meaning that U6 (MCP3426) is supplied with half of the operating voltage. If you power the system with four lithium cells as recommended the IC is applied with more than 3V.

The replaced resistor R13
The replaced resistor R13

The problem is that under normal operating environment this IC measures from -2.048V to +2.048V at max. Therefore the input channel 1 which measures the input voltage is simply overdriven. As a side effect the values of the input channel 2 measuring the current are also incorrect. In our case the telemetrie always reported fixed values of 4.1V and 175mA.

Bugfix

After analysing this error we replaced R12 on the PitS board with a value of 49k. That results in a voltage divider ratio of 1:4.9 or approximately 15. This means we can measure up to 4.9 * 2.048V = 10.0352V. This range is sufficient to measure the input voltage when 4 lithium cells (~ 7V with fresh batteries) are used.

In addition to replacing the resistor we also updated the code for the PitS board in order to calculate correct values with this new input ratio. The changes can be found in github repository under [2]. This code version will fly in to the air on Februar the 20th hopefully. Our mission page can be found at [3] (apparently in German only, but maybe you like the pictures).

References

[1] http://www.pi-in-the-sky.com/
[2] https://github.com/phl0/pits
[3] http://ballon.n18.de