CHDK Camera (High-resolution still images and data logging)

The CHDK-Hacked A480 used in EDGE2

Imaging, while very exciting, was not the primary mission of the EDGE2 flight.  However, it's worth mentioning that the tried-and-true Canon PowerShot A480 camera came through again, with stunning pictures and useful data.  A couple of favorites are shared below, but it's the useful data part that this writeup will focus on - many people don't know that with a couple of simple lines of code in an intervelometer script (a program that makes the camera take pictures automatically), a CHDK-hacked camera can be turned into a temperature datalogger.

Let's start with the basics.  CHDK stands for Canon Hack Development Kit, and it's a very cool project designed to help users of many Canon cameras wring absolutely the most functionality possible out of their devices.  It's a common thing to fly a CHDK-modified camera on high-altitude balloon flights, and the results can be stunning.

Can you find Pike's Peak in this picture?

As mentioned earlier, though, the CHDK scripting functionality can provide useful data about the flight.  The CHDK scripting language (a variant of BASIC) allows for file logging, and, with some formatting tricks, the data saved can be imported directly into your favorite spreadsheet program.

There are two CHDK commands on which this functionality relies heavily: the print_screen n command and the get_temperature n command.  The print_screen command takes one numeric argument and creates a LOG_xxxx.txt file in the /CHDK/LOGS directory, and from that point on, any information sent to the screen of the camera (using the print command) gets written into the file as well.  The get_temperature command also takes a numeric argument, and returns the temperature observed by the optics temperature sensor, the CCD temperature sensor, or the battery temperature sensor (as equipped), depending on the argument passed to the function.  Results come back in degrees C, and (here's the trick) by using a comma-separated values file structure, the resulting log file can be understood by spreadsheet programs natively.  For example, here's the log file from the EDGE2 flight (the only change made was to change the extension from .txt to .csv; you can open it with a spreadsheet program or a text editor):

EDGE 2 CHDK Log File
The log file generated by the CHDK script on the Canon A480 on the EDGE2 flight.
LOG_0001.csv
Comma separated value file [5.4 KB]

Using the data above, even a quick line plot of the temperature data captured can be telling:

Line plot of the optics temperature data captured using the CHDK script

Note that the temperature recorded is not the ambient temperature; it's the temperature (in this case) of the optical temperature sensor on the inside of the A480.  Want to see how we did that, and perhaps use it for yourself?  Feel free... the CHDK script is below.  It's really pretty simple, and there are functions in there that can be used to enable taking a picture at the maximum zoom level every nth picture... the file below is exactly what we flew on EDGE2, so some of the code isn't used (we've found in previous flights that zoomed-in pictures just aren't as fun).  Feel free to contact us if you have questions about it, and we'll do what we can to help.  Keep in mind, though that CHDK in general, and this script are offered with no warrantee, and there's no guarantee that it won't destroy your camera.  Here's the source:

Data Logging Intervalometer Script
User configurable intervalometer script with temperature data logging to the /CHDK/LOGS directory on a CHDK SD card. Don't forget to change the extension to .bas on the CHDK file system.
balCam.txt
Text document [1.2 KB]

Now for the fun stuff... here's a picture from near the ~88,500' apex of EDGE2:

View from near the apex of EDGE2.

And a view of the landing site from on the way down:

You can see where we landed from here... approx. 28,000' AGL.