APPROACHING THE FINAL FRONTIER
The RaspPi Zero is the warm blob (yellow rectangle) on the right
side of the figure. The smaller warm blob at
the lower left I think is where I held the PCB
before taking this image. Seeing this makes
me wonder if the heat generated by the Pi
means batteries inside the airframe won’t
need a hand warmer.
The Raspberry Pi runs hotter than the rest of the flight computer PCB (printed circuit board) or
PICAXE. Based on a recommendation of one of my near space friends, Mark N9XTN, I took a thermal
image of the powered-up flight computer (Figure A).
The second command gets repeated four times (once
for each analog measurement). The last line of code is
executed once since there’s only one GPGGA sentence to
store.
seconds before reading another GPS sentence. As a result,
I programmed it to read the GPS every second and then
throw away four sequential sentences.
d0 = (b1*256)+b0 combine the two
bytes to make a word of data
textd0 = str(d0) convert binary
data into text
text = textcount+”,” append a comma to
the end of the string
text = text+textd0 append the first
data to the record count
text = text+GPSSentence append the GPGGA
sentence to the data to store
Storing Data
Analog sensor data is binary by its nature, but the GPS
data is ASCII text. These data types must be converted into
the same format before they can be combined together
and stored in the SD card. Since I’ll use Excel to analyze
the data, I choose to convert all the data into ASCII. First,
however, both bytes from the analog-to-digital conversion
must be combined into a word before it can be converted
into ASCII text (a string variable). The commands to do this
are:
After creating the string of data that the Pi collected,
it’s time to write the text to the file stored on the SD card.
The Python commands to open the file, append the new
data, and close the file look like this:
file = open(Logfile,”a+”) open the log file
and append data
file.write(text) write the data into
the log file
file.close() close the log file
After converting each analog voltage into text, it’s
time to concatenate them together along with the GPS
sentence. The commands to do that are shown next. Note
that the first line of code adds a comma to the string so
that Excel knows where to divide the text data into its
proper fields (I store the flight computer’s data as a comma
delimited file).
It’s taken me a good month to get to this point. I
think it’s worth it, however, even if just for the learning
opportunity. Next time, I’ll talk about the camera that I
found for the Raspberry Pi and how I plan to integrate it
into the flight computer.
With any luck, my RaspPi flight computer will be taking
a trip into near space this summer.
Onwards and Upwards,
Your Near Space Guide NV
94 July/August 2018