Work on control module is making good progress – here are pictures of breadboard prototype, PCB and schematics:
GPS
Venus GPS with GPS antenna tracks 14 satellites while consuming as little power as three LED’s. I set it to output two NMEA sentences ($GPGGA and $GPRMC) at 1Hz rate.
TinyGPS library for Arduino does a nice job parsing NMEA output from this GPS.
Pressure & Temperature
BMP085 sensor measures air pressure and temperature. It will track altitude and ascent/descent status in case of GPS malfunction.
Sensor requires quite some code to interface with; I used this and this examples to query the sensor and convert its readings to altitude and temperature values.
Camera
Adafruit camera will provide real-time photo stream. I set the camera to take 640×480 (0.3 megapixel) photos, and each JPEG file is about 50KB in size.
Camera sits on a separate voltage regulator that Arduino can turn on and off. I used Adafruit library to interface with the camera, but modified it to make it work asynchronously.
Camera appears to be very sensitive to infrared spectrum, so all images initially had washed-out colors. With B+W IR/UV cut-off filter, colors become tolerable. Here is comparison:
Transmitter
To transmit telemetry and imagery, I chose long-range XBee module. It operates at 900MHz frequency with maximum 250mW output power, which should be sufficient for 10 miles line-of-sight range. With high-gain antennas the range should double.
There are too kinds of long-range XBee’s: high-speed / low sensitivity and low-speed / high sensitivity. To maximize the range, I’m going with latter one. Data transfer speed will be 10kbps – each JPEG will take about a minute to download. I’ll get a faster radio when NASA approves my budget 🙂
XBee configuration:
ATREÂ Â Â Â Â Â Â Â Â Â Â Reset to defaults ATHP 5Â Â Â Â Â Â Â Â Â Preamble ID ATID 42Â Â Â Â Â Â Â Â Network ID ATDL FFFFÂ Â Â Â Â Â Broadcast all packets ATMT 1Â Â Â Â Â Â Â Â Â Broadcast all packets twice ATCE 2Â Â Â Â Â Â Â Â Â Disable routing ATBD 2Â Â Â Â Â Â Â Â Â Serial speed 4800 bps ATFT D0Â Â Â Â Â Â Â Â Assert CTS at 208 bytes in buffer (128 free) ATWRÂ Â Â Write to memory
A few words on flow control. Since all packets are broadcast twice, effective rate will be half of available 10kbps bandwidth. XBee serial speed is set accordingly to 4800bps. XBee has internal 336-byte buffer and will raise CTS pin when the buffer fills up to 208 bytes – i.e. 128Â free bytes remain. Arduino will use matching 128-byte transmit buffer and transmit data only when space is available in both its own and XBee’s buffers.
Arduino
Choice of processing unit was driven by two factors: (a) 3.3V system (b) multiple serial interfaces. Arduino Mega Pro Mini has 4 serial ports, 8k memory, 256k flash for code / 32k for data, and powers from 3.3V source. All four serial ports are used:
- Serial 0 = I2C interface with pressure/temperature sensor
- Serial 1 = XBee radio
- Serial 2 = GPS unit
- Serial 3 = Camera
In addition, I’m using:
- 4 analog pins for battery and rail voltage measurements
- External voltage reference
- Digital pins for camera on/off, XBee flow-control (CTS), burn wires on/off
Software
Arduino is programmed with ~1,000-line code that implements the following:
- Listens to incoming NMEA messages from GPS and decodes them
- Polls pressure/temperature sensor and calculates altitude and temperature
- Reads battery and rail voltages
- Interfaces with camera and downloads JPEG files
- Every 30 seconds, sends telemetry to ground station
- All other time, continuously sends photos
- Tracks battery voltage; if it drops too low, turns off camera and throttles all transmissions to once a minute
- Tracks distance from “home” location
- Saves telemetry data to internal flash memory
- Receives commands from ground station and executes them
- All data is encapsulated into packets with CRC checksums
- All functions are implemented in non-blocking (asynchronous) manner. The program is interfacing with all components simultaneously.