(Update: this project, including a see-through version, was featured at Maker Faire Rome 2013 as a part of the Internet of Things Zurich showcase.)
AirCasting is a citizen sensing project which originated in New York. The AirCasting Android app allows anyone to record and display geotagged environmental measurements on a cloud hosted map.
External AirCasting sensors can be connected to the app via Bluetooth. There is an official AirCasting Air Monitor sensor with Arduino hardware and a 3D printed enclosure. The alternative sensor device presented here was possible because the AirCasting app is open source and uses a simple and open protocol to receive measurements from external sensors.
Gadgeteer is an open convention to build modular hardware initiated by Microsoft Research, based on the open source NETMF framework and toolchain. Mainboards and modules are produced by a small ecosystem of manufacturers. Most modules are open source hardware. Besides being quite expensive, the modules are great for fast hardware prototyping.
So let's begin!
Step 1: Getting Hardware Modules, Enclosure Material and Tools
I had a FEZ Spider (http://www.ghielectronics.com/catalog/product/269, $119.95) laying around, but others are a lot cheaper, e.g. the FEZ Cerberus (http://www.ghielectronics.com/catalog/product/349, $29.95). Any Gadgeteer mainboard that has at least two A, one D, one U and two Y connectors is perfectly fine. The source code is available on Bitbucket.
The original device measures CO, NO2, temperature and humidity. There is a Gadgeteer module for GasSense compatible sensors (http://www.ghielectronics.com/catalog/product/393, $14.95). It comes with an MQ-3 alcohol sensor. I tried to get two better suited drop-in replacement sensors, namely an MQ-135 (http://www.futurlec.com/Gas_Sensors.shtml#MQ135, $6.90) and a CO sensor (http://www.futurlec.com/Gas_Sensors.shtml#COSENSOR, $6.90). Unfortunately, Futurelec could not deliver those yet (after a month). So I kept the MQ-3 as a placeholder and went for the GHI Temp & Humidity module (http://www.ghielectronics.com/catalog/product/344, $17.90) on the other side.
Bluetooth and the sensors require quite a lot of power, so I used the Liquidware Lithium Backpack (http://www.liquidware.com/shop/show/MBP/Lithium+Backpack, $47.36) as it's compact and includes charging circuitry. As far as I know there is no LiPo Gadgeteer module available, but it's easy to solder a non-Gadgeteer module to a breakout module (http://www.ghielectronics.com/catalog/product/405, $4.99) using three jumper wires. For the cardboard prototype a simple battery module was used, which is not needed for the laser-cut version (http://www.ghielectronics.com/catalog/product/394, $27.95).
To transfer measurement data from the device to the AirCasting app a Bluetooth module is required (http://www.ghielectronics.com/catalog/product/312, $39.95). And to initiate the Bluetooth pairing mode we need a button (http://www.ghielectronics.com/catalog/product/274, $4.95).
Note that the device does not include any memory (other than on the mainboard). Measurements are sent to the AirCasting app immediately, so there's no need to store anything.
You'll need cardboard for prototyping (optional) and 3mm MDF wood sheets for laser-cutting. The SKP and DXP files are on Thingiverse. The modules are mounted with M3 nuts and bolts (7 M3 x 10 mm and 8 M3 x 16 mm).
A cutter and a hot glue gun (for cardboard), a laser cutter (for MDF), a metal saw, a screwdriver and a soldering iron were used. Plus a computer running Windows to program the mainboard.
A Nexus S works fine, but any other Android phone with GPS and Bluetooth should do the job as well.
Step 2: Connecting, Programming and Testing the Modules
<Measurement value>;<Sensor package name>;<Sensor name>;<Type of measurement>;<Short type of measurement>;<Unit name>;<Unit symbol/abbreviation>;<T1>;<T2>;<T3>;<T4>;<T5>
e.g. for temperature, a string like "7;Gadgeteer;Gadgeteer Temperature;Temperature;C;degrees Celsius;C;0;10;15;20;25\n" is sent.
On Gadgeteer, using Bluetooth is not as easy as it could be. Mike Dodaro's post points out Eduardo Velloso's library. The library is great, but to make it work with a newer NETMF version (which some main-boards require) further tweaks are necessary.
Here's the Gadgeteer AirCasting source ZIP. Note that the project is named GadgeteerApp3 as I could not manage to rename it and didn't have the nerves to start from scratch. Also note that the Bluetooth module is not included in the wiring diagram. It should be connected to port no 11 on the main-board. If the project does not build you might have to add a reference to the above Bluetooth library and probably also to the Gadgeteer.Serial library.
In case you're new to Gadgeteer, follow e.g. http://www.netmf.com/gadgeteer/get-started.aspx to set up the required tools and get started.
Step 3: Prototyping the Enclosure With Cardboard
Step 4: Laser-cutting the Enclosure
Step 5: Mounting the Modules
The two sensors are inserted vertically into the cutouts from the upper (etched) side. Take care not to break them. Once all the modules are in place, wire them (again) as shown in Step 2. Solder the three jumper wires to the battery adapter (5V, 3V3, GND) and connect them to the LiPo battery.
A little side note: MSR recently donated CC licensed 3D models of many Gadgeteer modules (see http://gadgeteer.codeplex.com/SourceControl/latest > Main > 3D Models > MSR). They come in a format called STEP which seems to require a commercial Sketchup extension. If you can convert STEP to SKP or STL, please consider converting and uploading them to Thingiverse. However, it's also quite easy to draw your own, as done here. Feel free to reuse the nuts and bolts, too.
Step 6: Assembling the Enclosure
Then the lower back panel. The laser-cut battery switch is guided by two bolts. Take care not to break the small battery switch. And yes, the USB port is not accessible once the panel is mounted. That's probably the main design flaw. On the other hand it's quite easy to remove the panel for charging.
Now, make sure the cables are packed flat, then add the top and bottom covers. Everything should gently snap in place. Glue is not needed. In contrary, it's a plus that you can open the device whenever someone asks what's inside.
Step 7: AirCasting in the Field
Gather some friends, walk around in your city and collect data. Or strap it to your bike and use it every day. To get the data out of the app you can either share it at the end of the session (i.e. it's published to this map), or export it as a CSV file.
That's it. Thanks to the originators of AirCasting for the great platform, @dusjagr for the hot glue, Oli at FabLab Zürich, Andy who got me the LiPo, Cuno at Oberon for letting me use the Gadgeteer modules and of course you, for reading all this and spreading the word.