Mobile Urban Pollution: Prototype One


Summary | Pollution Device | GPS Device | Jornada | Software | Critique

Summary

This prototype which is near completion, reads and record GPS position, time from GPS unit, pollution data (CO in parts per million) and temperature.


Learian ICOM

The pollution device comes from Learian.

Protocol

In Continuous mode device reports:

CO_ppm  CO_base_ppm temperature battery_level\n\n

every second. It stops after 10 minutes. E.G. :

 2.5    1.1    26.3    12.0

 2.5    1.1    26.3    12.0

 2.6    1.1    26.3    12.0

 2.6    1.1    26.3    12.0

 2.6    1.1    26.3    12.0

 2.4    1.0    26.4    12.0

The device is based around a PIC, and it generates a menu over the serial line, if it is not in continuous mode and you send a "\n".

 Learian Designs Ltd.
 Micro-Logger

 Software version 1.00
 Program checksum D872


 Setup menu

 A - Set Real Time Clock
 B - Enter serial no.
 C - Display input data
 D - Calibrate Logger
 E - Current Logger status
 F - Upload data records
 G - Clear records

 Please make your selection - 

to initialise, and or re-initialise after 10 minutes, you send "C\r". For the first initialisation, you need to read four lines of
0.0   0.0   0.0   0.0
you may be able (based on experience with hyperterminal and preliminary testing with complete device) to keep sending a "C\r" every second, but that occasionally generates a series of dozens of echoed "C"s the first time you do it.

Connection

Device support 9600 8-N-1 rs232. The box itself has a non-standard round connector, that supplies rs232 as well as power pins. The recharger cable is separate to the cable we have for rs232.

Here is the data wiring diagram (5-pin, 9-pin and also USB sync cable).


GPS

Protocol

The current GPS unit is a Garmin Etrex Vista. It talks NMEA/ASCII 4800. The current software includes a customised version of the JEEPS library to do NMEA parsing and also WGS84 to OSGB coordinate conversion.

Connection

The ETrex has a custom connector.

JP Jornada 568

We are using a HP Jornada 568. This currently run Pocket PC 2002. The device usually comes with a USB cradle for synchronising to a device. We have (via Cliff Randell) a cable to connect to the cradle socket on the Jornada and give a female DB9 serial connector. The connector is has the "dumb terminal" wiring since usually it is for connecting to a PC. Thus a male-male cross-over cable is required to make this into a connector suitable for connecting devices. This port is named COM1 under Pocket PC 2002.

CF Serial Card

The Jornada only has one serial connector, so we added a 2nd with a Socket Serial I/O CF Card, available from www.peak-uk.co.uk. This adds a 2nd, flexible COM port. A driver needs installing via a desktop, but then it can be configured under the Pocket PC system menu to present any serial port name. We call it COM2.

Software

Run-Time

For real-time display on the Jornada, we use currently the "gpsread" read software written by AJS. This supports rendering on Pocket PC using PocketGL and on Win32 with GLUT. This means that as a backup or test, the devices can be plugged into a laptop. The Win32 version can also be build in PocketPC simulation mode, which allows small-form factor rendering issues to be sorted out without resorting to the slow debuggining cycle on the PocketPC. The application supports logging, and the applications support test modes where they read from two captured serial stream, or from their own logging data.

Win32 Operation

TBD options.

PocketPC Operation

TBD options.

Software Projects

There are two main workspaces: In gps_read.sln there are three projects: Note that for the gps_read.PGL, the PocketGL simulator is built directly into the application project since it had not yet been successfully extracted as an external library.

In gps_read.vcm there are three projects:

all three support file loading and serial access.

Configuration is straightforward for gps_read.Net, it supports command line arguments such as "-f gps_filename pollution_filename" for pre-recorded NMEA data (e.g. generated by VisualGPS) and pollution data , or "-c COM1 COM2" for setting the serial port for the GPS and the serial port for the ICOM respectively. In PocketGL versions, since these are designed for use on PocketPC which has no user-configurable command line, the choice is hard-coded in Main.cpp.

Notes

Jeeps was originally written for UNIX - much functionality has been disabled to get it to compile for Win32. In particular we replaced jeeps' serial functionality. Writing cross-platform serial code isn't fun and it should be imported from a cross-platform library. However these libraries rarely support WinCE (NSPR and VRJuggler/Gadgeteer apparently don't).

Timing functionality may be broken in WinCE (see comments in code), but Win32 isnt't tested either to see if standard time.h functions as expected.

Uploading

Currently log files are uploaded by hand.

Critique

Device does give all the data required for interesting experiments on modelling and visualisation of . It gives accurate time logs