Project squirrel

From CUSF Wiki
Jump to navigation Jump to search

Project Squirrel

Introduction

Project Squirrel aims to explore the feasibility of using an Android phone as a multi-purpose flight computer for high altitude balloon launches.

The project is currently using a Nexus One (kindly donated by Google), running Android 2.2, and an Android Dev Phone 1 (on loan from the Cambridge Computer Lab), running Android 1.6.

Squirrel 1 - 17/06/10

http://farm2.static.flickr.com/1299/4711544919_b4fa1f041e_m.jpg

  • Android Dev Phone 1 (Android 1.6)
  • Running Squirrel Photo 0.1 and Squirrel Log 0.1

The Android phone was launched at on 17/06/10 at 12:01 BST from the Churchill site along with several other payloads (UKHAS launch report), and landed near Bedford 2 hours and 44 minutes later having reached an altitude of 27km.

The phone shut-down at an altitude of 15km, 1 hour and 7 minutes after launch, presumably as a result of the low operating temperature. Photographs were recorded every 10 seconds by Squirrel Photo, which seemed to work fine (see Flickr for some of the photos). Squirrel Log, however, never actually started logging data to the SD card (cause unknown), and so unfortunately no useful GPS or sensor data was recorded.

Also running on the phone was an app called Locate Your Phone, which can send the current location of the phone (street address) by SMS. The idea was that the phone could be texted once it had landed, and it would text back with its location. As the phone was off when it landed, this didn't work. The functionality of this app is now being incorporated into Squirrel SMS.

The phone was slightly frosted over when it was recovered, but booted up successfully, with no apparent lasting damage.

Squirrel 2

  • Google Nexus One (Android 2.2)
  • Running Squirrel Control, Squirrel Log, Squirrel Radio, Squirrel Camera & Squirrel SMS
  • Transmitting on 434.65MHz with Radiometrix NTX2 (FM)

The aim of this second flight is to allow the phone to carry out all 'mission-critical' functions. The most important development is the addition of FM transmission capabilities by means of a small UHF radio module connected directly to the phone via the headphone socket (see photo). This allows the phone to transmit it's location back to the ground so that it can be tracked, and additionally live images using slow-scan television.

Squirrel Log is significantly improved, logging as much useful data as possible to the SD card during the flight (including the Android debug log for post-flight analysis). Squirrel Camera will be alternately capturing photos and recording 720p HD video.

The NTX2 transmitter connected to a 3.5mm audio jack, which can be plugged into the phone directly. The 3 unused pins at the end are for the aerial.=== Task list ===

  • Develop & debug all required apps
  • Build & test FM transmitter with 3.5mm jack connection
  • Test all apps running for extended periods
  • Test battery life, make efficiency improvements
  • Build payload housing & transmitter antenna
  • Final testing then launch

Transmitter

We found that soldering a standard PCB mount 3.5mm audio jack to the NTX2 module worked surprisingly well (the pins pretty much match!), and allowed for an easy connection of the phone to the transmitter. The phone volume can be adjusted so that it has the correct peak-to-peak voltage for the NTX2 input, and as there is no significant DC offset we don't need any inline resistors or other components.

Testing

When connected to a charger, the Squirrel 2 apps have successfully run for over 6 hours on multiple occasions - the only limit is SD card capacity (currently using 8GB, can go up to 32). Using the Energizer XP1000 portable charger (1000 mAh), the phone runs for just over 3.5 hours. If longer flight times are anticipated, Squirrel Camera can be halted below a critical threshold or after a certain time (this is the major battery drain). This battery life may degrade at low temperatures (consider getting a 2000 mAh charging unit?).

Applications

Several apps have been developed (or are in the process of being developed) to carry out specific tasks, using the Android SDK. These are written in Java, using the powerful Android Development Tools (ADT) plugin for Eclipse. The eventual aim is that a set of applications can be created such that an Android enabled device can carry out all of the functions currently undertaken by a conventional flight computer.

The source code for these apps will be made available on the CUSF SVN repository at some point.

Squirrel Camera

Replaces Squirrel Photo, can now record 720p HD video on Nexus One

Incorporates the functionality of Squirrel Photo and video recording into a single app, with full control over capture parameters. For example, it could be set to record 5 minutes of video, take 10 photos, wait 30 seconds, and loop.

The underlying Android CameraService is prone to occasionally crashing in the event of low memory, especially when recording high resolution video (several bugs have been identified in the MediaRecorder framework), and as such extensive measures have been put in place to ensure that any errors encountered are handled intelligently, without affecting the functionality of any of the other apps (as far as possible). In the extreme case of any unexpected exceptions being raised, the app will attempt to restart the phone.

squirrelphoto.png

Squirrel Photo

Download SquirrelPhoto.apk (Android 1.6+)

Squirrel Photo is a time-interval camera app, which takes photographs at regular intervals using the integrated camera. Features include:

  • Adjustable picture settings (specify picture size & picture quality)
  • GPS location storage in photo EXIF metadata.
  • Battery level cut-off (stops photo capture when battery level reaches a critical value)
  • SD capacity monitor (ensures a certain amount of space is left on SD card)

It has been tested extensively on the Android Emulator as well as the Android Dev Phone 1 and Nexus One.

Squirrel Log

Squirrel Log takes advantage of the on-board sensors present on most Android devices, as well as several other data sources, to produce a useful log of the flight. This includes:

  • GPS location & satellite information
  • Accelerometer values
  • Magnetic field
  • Network status
  • Battery statistics (level, voltage, temperature)
  • Android logcat log.

As this app is constantly writing to SD card, various measures are in place to ensure that a 'random' IO failure will not result in problems (each log category controls its own file, and will attempt to re-open it every 30 seconds if an IOException is encountered). Leaving Squirrel Log running for 6 hours results in ~100MB of data being generated!

Squirrel SMS

Squirrel SMS is a simple text message based phone finding app. It will reply to text messages with any available GPS data, or failing that, with its location as determined from the mobile network.

Squirrel Radio

This app operates in conjunction with a Radiometrix NTX2 transmitter connected to the headphone port of the phone, and allows the phone to communicate with the ground when it has no mobile network connection (anywhere above a couple of kilometres). It generates RTTY tones to transmit the payload telemetry to the network of ground-based listeners, using the integrated GPS. Part of the RTTY string is encrypted, as a simple proof-of-concept for a cryptographically secure channel of communication.

Additionally, live images are transmitted using the SSTV (slow-scan television) protocol - a 320x256 image takes roughly 2 minutes to transmit. A sample SSTV transmission generated by this app can be found here.

Squirrel Control

This app serves as a Home screen replacement for Android, and simply allows for the the log and radio services to be launched, and for Squirrel Camera to be started. It also has it's own background service that monitors the other apps, and restarts them if for some reason they stop running. A Bluetooth link can be established with another device so that it can be operated remotely once the phone is secured inside the payload.