Build a datalogger for your wireless sensor network

 by salamandersensors
Featured

Step 9: Pack it up, run it and process data

Foam time--cut out holes in foam for the battery, logger and desiccant if using. Poke a hole in the side of the case for the external antenna (if using) and seal with epoxy. The bendable antennas are cool but some have a piece of exposed metal cable that is probably going to leak water into your case. So get a straight one, a waterproof one or just seal it above the bending part.

Running the logger: there is no on switch, you just plug in the battery to the MEGA's power connector. At each power-on or reset, it will start a log with a new number. It can only hold up to 100 log names so be sure to clean off the memory card periodically. The memory card needs to be installed in a card reader for this, cannot read it through the USB cable.

Your data will be readable in Excel or a text editor (TextEdit, WordPad, etc) and should have a column of bytes along with the three different timestamps (milliseconds since logger started, seconds since 1/1/1970, and a more user friendly date-time format) The bytes contain radio packet information, signal strength info (if made available), the name of the radio sending the data, the serial number of the individual sensor that collected the data, and four bytes of sensor data that can be translated to temperature, voltage, pressure, flow rate, light intensity, etc.

What are the occasional lines of different length in the TelosB data? The character 7E sometimes shows up as a data byte about 1 in 256 chance, but it's a special character denoting end of line, so when the TelosB encounters this, it puts an escape character in front of the 7E, and changes the 7E to another character. So it has put 2 characters in place of 1. This escape character must also be escaped. It is possible to decode all this in a perl script. The Java application net.tinyos.tools.Listen does this step automatically when reading from the USB serial port.
 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!