I’ve decided to share how we solved the problem with measuring the voltage of the groundstation battery. First question: Why would we want to know what the voltage is? It is absolutely critical that we know the health of our ground station during any launch. This includes the battery health. Lithium Ion batteries have a tenancy to suddenly stop working… for the voltage to suddenly dive south.
We choose to use a Rasberry-Pi Model 2 as the Groundstation computer; because it is extremely fast. The problem with the Rasberry Pi is that it does not have any ADC inputs. Not sure why these were not included on the Rasberry-Pi. Not to worry, what we did was get a very small Arduino (a Mini Pro Arduino 3.3 volt version) board and connected it up to the i2c on the Rasberry Pi. Then we created a program on the Arduino that configures it as a i2c Slave. Its sole purpose was to get the ADC reading on A0 input and provide that to the master i2c process on request.
We then created a C program on the Ardunio that connects to this Arduino device and requests the A0 value. We then adopted the PERL script to call this executable to get the A0 value. Within the PERL script we do the necessary conversions to convert the ADC value to the voltage.
The great thing is that if I need any more serial ports or Analogue portsow PWM outputs, then I can very easily just wire up another one and modify the programs to allow access to them!
Brilliant!
On the topic of ‘flight management’, I made created a new Alert based on the Groundstation voltage. If the voltage of the Groundstation falls below a certain level, we alerted of this fact. So there is no need to continually monitor voltage.