Arduino Project 10 (2D/3D pictures) – My XBee/Arduino based Wireless Sensor Network (Uno/Mega 2560, 1.0, XBee Series 2)

1. Introduction
I developed this WSN for a coursework on my MSc and I’m hoping others will find this useful or at least interesting :)
I’ve just installed the first parts of this WSN back home to collect sensor data from various outbuildings and it will be part of my new Arduino controlled greenhouse project. I’ll try to port the storage and reporting backend to a Raspberry Pi later this week, initial trials seem to suggest that it should cope well with this task for my size of network.

I’ve also included a zip (9.7, bottom of the post, just above the reference section) with all my source code for this project which includes:

  • all Arduino sketches
  • the database structure and data samples
  • the php file for Flot
  • the php file used by the concentrator to upload data into the MySQL database

As required for this coursework and based on the provided Arduinos and XBee ZNet 2.5 modules I have developed an energy efficient wireless sensor network (WSN) which collects a number of different environmental readings from three nodes. In addition to the coursework requirement to display the acquired data sets in the Arduino IDE I have developed a concentrator node to upload the data sets to a database, as an example made parts of the content in my database visible using Flot [1] and also developed a node which displays datasets on a LCD. Finally an actuator node extracts temperature values from the database and, depending on the values indicates temperatures above a certain threshold by means of green/red LEDs and turns a fan on/of.
I had many additional ideas for further improvements in regards to the network, nodes and sensors which I have included at the end of the report.



2. Network Components
My network currently consist of the following components:

Project 11 network

2.1 Sensor node 0
I have positioned this node in my greenhouse. It submits temperature, humidity, light level and soil moisture/temperature readings to the concentrator.
This node consists of the following components:

  • Arduino Uno
  • XBee shield and XBee ZNet 2.5 module
  • Fan-Can 1 consisting of one temperature (tmp102), humidity (HIH-4030) and light (TEMT6000) sensor
  • One combined soil moisture/soil temperature sensor

Project 11 node0


2.2 Sensor node 1
I have positioned this node in my shed. It submits temperature, light level and water tank level readings to the concentrator.
This node consists of the following components:

  • Arduino Uno
  • XBee shield and XBee ZNet 2.5 module
  • Fan-Can 2 consisting of one temperature (tmp102) and light (TEMT6000) sensor
  • Water tank level meter based on a SRF05 ultrasonic range finder [2]

Project 11 node1


2.3 Sensor node 2
I have positioned this node in my conservatory. It submits temperature and light level to the concentrator.
This node consists of the following components:

  • Arduino Diecimilia
  • XBee shield and XBee ZNet 2.5 module
  • One temperature (tmp102) and light (TEMT6000) sensor

Project 11 node2


2.4 LCD node
This node extracts data from the database via it’s ethernet shield and displays it on a LCD.
This node consists of the following components:

  • Arduino Diecimilia
  • Arduino Ethernet Shield
  • 16×2 LCD

Project 11 lcd


2.5 Actuator node
This node extracts data from the database via it’s ethernet shield and if the temperature reading exceeds a set value switches the LED from green to red and turns on the fan.
This node consists of the following components:

  • Arduino Uno
  • Arduino Ethernet Shield
  • XBee shield and XBee ZNet 2.5 module
  • green/red LED
  • additional 5V psu to close the relay and power the fan
  • 5V/240V 30A relay
  • 12V pc case fan

Project 11 actuator


2.6 Concentrator/coordinator node
I have positioned this node in my shed. It collects the data sets submitted by the sensor nodes and passes them on to the database.
This node consists of the following components:

  • Arduino Mega 2560
  • Sparkfun Arduino Mega ProtoShield which I have modified to include a stackable ICSP header [3]
  • Arduino Ethernet Shield which I have modified to include a stackable ICSP header [4]
  • One XBee shield and XBee ZNet 2.5 module

Project 11 concentrator



3. Database/web server

3.1 Database design
For the moment I have decided to collect all data in a single table which is merely due to the fact that I have not had time to make changes to this part of the system and initially was not sure what kind and amount of data I would be able to capture. This database design is not perfect for my nodes which all return different data sets as all of them have different sensors. For the moment this design is useable but once I start to collect bigger amounts of data I’m planning to split the data across several tables with one table per type of node.
I’m currently entering timestamps for each data set once they get entered by means of an insert/update database trigger. I have been experimenting with a secondary SD-card based storage solution which also incorporates a real time clock to bridge downtime on the concentrators ethernet uplink and data backend. To achieve this I’m writing datasets to the SD-card if it is impossible to upload them to the database and, once connectivity is restored, the data sets get uploaded in batches of 20 to make sure the upload after longer breaks doesn’t block the acquisition of fresh datasets. I currently lack a mechanism to upload the stored data sets to the same table as the original timestamps captured by the real time clock would get overwritten by the trigger. I am planning to upload these data sets to a temporary table but have still got to find a way to merge them into the main table without loosing the timestamps.

Project 11 db_structure

Project 11 db_sample


3.2 Database/web server – technical details

  • Intel dual core Atom Mini ITX mainboard
  • RAID5 based on four 1TB 3.5″ hard drives
  • Ubuntu 11.10 [6]
  • Apache 2.2.20 [7]
  • MySQL 5.1.58 [8]
  • phpMyAdmin 3.4.5deb1 [9]

3.3 PHP scripts to link MySQL and ethernet.h
Unfortunately there is no library to talk directly to a database through the Arduino’s ethernet shield. Since the ethernet library supports http GET I have written two php scripts which I call from the ethernet library to enter the provided sensor readings into my database table and extract data to display on my LCD node.
3.4 Reporting
I have decided to use Flot [1] to visualize the data sets and have modified the provided example on plotting time series [5] to show the temperature readings collect by node 1.

Project 11 flot


4 XBee Network

4.1 XBee network – Overview
As suggested in the XBee modules documentation [26] and proven by Lady Ada in her Tweet-a-Watt project [10] it is possible to use a XBee module without an Arduino to acquire data from a sensor but since I wanted to read multiple sensors with each node I decided to base each node on one Arduino with one XBee shield.
The XBee modules we have been provided with as part of this coursework come preloaded with the ZNet 2.5 firmware [11] which implements the ZigBee protocol stack. The XBee modules are incredibly popular for physical computing and sensor network projects as they are very well documented, simple to use and affordable.
Almost all available documentation on Arduino based XBee projects is based on the XBee Series 1 modules which are incompatible to the XBee Series 2 modules we have been provided.
I have decided to leave my modules in their original configuration which spans a basic but energy efficient network consisting of one coordinator and a number of router/end-devices where the later decide among themselves which node would be most appropriate to take the router position. This setup is sufficient for the network I have developed as I am only sending data in one direction, from the nodes to the concentrator, and I don’t expect overlap with other networks.
Where transporting a single character across the link is relatively easy as demonstrated in the “Arduino – Getting started guide” for this coursework [12] with the Arduino IDEs physical pixel example transporting more than this single character adds two additional layers of complexity in form of the XBee API frames and supported data types.

4.2 XBee – API frames:
The first decision I had to make was to decide if I wanted to communicate with my XBee modules by AT commands or through their API. Both modes are available but require different versions of the firmware. I decided to base my network on the API firmware because the API frames are well documented by the manufacturer. I had planned to write a library for transporting small data sets across this network but, shortly after I had deciphered the API frames, found that this was already available in form of the xbee.h library which is what I have used for this coursework [13]. The library has various use cases [14] which unfortunately leaves the Arduino-to-Arduino one as “todo” hence I had to find my own way to implement this scenario.
The xbee.h library works very well for my purposes and since it only requires the data to be stored in an uint8_t payload array and the network address of the concentrator it was very easy to implement.

4.3 XBee – API friendly data types:
For my network I had to find ways to transport my sensor readings by the means of the supported uint8_t array. Where this was straight forward for the humidity reading which results in a value in the range of 0-100 it got more complicated for the temperature with readings in the range of -20 to +35 and the Arduino’s 10bit analog readings which are bigger than the 8bit bytes of the uint8_t array.
For the temperature I have decided to send the value in one byte and use a second byte to indicate if this value is positive or negative. For the analog readings I have decided to split the 10bit value into two 8bit bytes which then get reassembled on the concentrator side.
Although the uint8_t array seemed cumbersome at first I found ways to transport my generated values and the use of this cross platform data type should prove handy if I decide to include other platforms like the Raspberry PI or cheaper sensor nodes.
The array I’m using currently transports the following sensor readings which are then entered into the database. All nodes submit the same data set with the areas they don’t have readings for filled with 0s.

Temperature (two bytes, one for value and one for -/+ flag)
Humidity (one byte)
Light (two bytes for 12bit analog reading)
Soil temperature (two bytes for 12bit analog reading)
Soil humidity (two bytes for 12bit analog reading)
Water level in my rainwater storage tank (one byte)
Node identifier (one byte)

Node 0 currently sends the most data consisting of all the above values except the water level reading which is the reason for my 10 byte array (2+1+2+2+2+1=10)
uint8_t text[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};


5 Sensors currently in use for this project

5.1 HIH-4030 [15]
Honeywell provide a comprehensive data sheet for this analog humidity sensor and it consumes very little power (200uA). The output is very easy to process since it is nearly linear. The maximum output voltage drops by a given amount per degree C over 0 degree C which makes it easy to calculate the correct humidity reading with the aid of a temperature reading (TEMP102).

5.2 TEMT6000 [16]
Commonly used for backlight dimming this is a simple but very accurate and fast reacting analog light sensor with a range adapted to human eye responsivity. It acts like a transistor hence the greater the incoming light the higher the analog voltage it provides.
It’s output is linear and it’s slight temperature dependency is negligible for the temperature range I’m working with for this coursework.

5.3 TEMP102 [17]
This is a very accurate and very small digital I2C temperature sensor which is accessed via a two wire serial interface (Arduino pin 4/5). It only consumes 10uA and comes with the benefit that each sensor can be configured with it’s unique hardware address (via further pins on the break out board) which allows for several of these sensors to be accessed through the same two wire interface. Given the fact that the Arduino in it’s original form is limited in regards to analog pins (5 on the standard Arduino/16 on the Arduino mega) this seems a very valuable feature.

5.4 Soil temperature/humidity sensor
I have designed and built this sensor myself and the first prototype consists of a thermistor to measure the soil temperature and a pair of galvanised nails to measure soil humidity. I have enclosed the thermistor in epoxy resin to make the sensor water proof and am planing to do the same with the solder points which connect the nails to their wires. The nails are also covered by a fixed length of heat shrink tubing to avoid corrosion as far as possible and also ensure measurements are taken at similar depth across several sensors. I’m planning to base further sensors on digital temperature sensors simply because I now have a variety of them which I would like to test.
There seems to be a direct correlation between soil humidity and soil temperature. Initially I was planning to take soil humidity measurements at fixed room temperatures to make them comparable. This would work well in a fully climatised greenhouse but seems unworkable for smaller residential greenhouses like mine.
I’m currently collecting data to work out the correlation between soil temperature and humidity to develop an algorithm and apply a correction factor to make soil humidity readings comparable across different soil temperatures.
Although the nails are galvanised I still expect a certain amount of electrolysis corrosion. My current sketch is trying to limit this as it only runs current through the nails when measurements are being taken and also reverses the current flow after a reading has been taken. The sensor has now given reliable readings for over two weeks and I’m hopeful that it will be enough to clean it at the end of each summer.

Project 11 soil_sensor

5.5 Water tank level meter
I have designed and built this sensor myself [18] to measure the water level in the underground storage tank I use to store rainwater. I have based this sensor on the SRF05 ultrasonic range finder we have been provided with as part of this course work. The range finder is mounted inside the tank collar pointing downwards to measure the distance between the sensor and the water level. Like the Fan-Cans I have decided to fit this sensor into and an enclosure which also has two LEDs at the top to signal 5V arriving at the sensor and a heartbeat to indicate measurements being taken.

Project 11 tank

Project 11 tank_fritz

5.6 Fan-Can
I did not want to leave the sensors completely exposed to the elements but also provide a certain amount of air flow through their protective enclosure. Therefore I have mounted all the above sensors into an empty soda can (top/bottom removed) which has a little 12V fan mounted at one end to suck air through the can. The Fan-Can is connected to the Arduino with left over CAT6 cable and a little piece of perfboard inside the Fan-Can provides means to connect the sensors and some additional features in form of:
1x on/off switch
1x power LED (5V coming from the Arduino)
1x “heart beat” LED (Arduino pin 13 to indicate measurements being taken)

Project 11 fan_can

Project 11 fan_can_fritzing


6 Power saving

6.1 Power saving – ATMega328
With the Arduino platform being geared towards rapid development and DIY enthusiasts the manufacturers don’t appear to have spent much time on trying to make it energy efficient. As much as I appreciate their considerations in regards to their main user base I don’t think this wise as many projects will be battery operated and the ATMega has well documented potential to be more energy efficient. After studying the ATMega328 data sheet I quickly found the nacroleptic library [19] which implements the ATMega328s power saving features to limit power consumption of the Arduino while the board idles during “delay-phases”. Since these “delay-phases” make up the huge majority of time with my nodes only taking measurements for 2-3 seconds every three minutes savings during “delay-cycles” would obviously translate almost directly into power savings across the whole nodes uptime.

6.2 Power saving – ATMega328 – A practical experiment
I have setup the following two experiments to determine the effect of using the nacroleptic library:

Measuring equipment:

  • Mc Voice DF1730SB DC power supply 0-30V 0-3A
  • Fluke 17B Digital Multimeter (mA setting, limited to 400mA, accurate to 0.01mA)

6.2.1 Arduino (Diecimilia), idling
no power saving: 29mA
narcoleptic library: 8.9mA
Use of the nacroleptic library reduces the power consumption by almost 70%.

6.2.2 Arduino (Diecimilia), idling with full node 2 setup
no power saving: 51mA
narcoleptic library: 71mA
Although the XBee module adds over 40mA use of the nacroleptic library still reduces the power consumption by about 28%.

6.2 Power saving – XBee
The XBee module could be put to sleep with AT commands from Arduino but waking the XBee module from sleep requires a 5V signal to the XBee modules pin9. Although this is very easy to achieve by connecting one digital Arduino pin to the Xbee’s pin9 this would require soldering on the XBee shield. Since I’ve only borrowed these from the University I have decided against this modification.


7 XBee related ICSP header modifications
In addition to the 3.3V, 5V and digital pin zero and one [20] the XBee shield uses the ISPC header for communication. In theory this should not cause problems but in reality most currently available shields still don’t pass the ICSP header through to shields above them. I found this problematic as I wanted to combine an ethernet shield and the XBee shield on my data concentrator. After successful tests with wires connected from the underside of an Arduino to the XBee shield and an ethernet shield in between I decided to remove my ethernet shields original ICSP header and replace it with a more appropriate connector which I made myself. More details about this project and a similar one which describes the same modification for an Arduino Mega prototyping shield can be found on my blog


8. Discussion
I have based my network on a similar design as the one presented by Boonsawat et al in their paper [21] at the ECTI-CARD 2010 but rather than basing it on SquidBee [22] I have decided to write the underlying system myself. Not only did this allow me to gather valuable experience but I have also been able to implement features like better power saving. Since I am now familiar with all parts of the underlying system and have chosen a cross-platform data type for the XBee array I will be able to replace several components of my network with cheaper and more energy efficient components without having to redesign the whole system.

The Arduino platform is very suitable for rapid prototyping but in regards to unit price, power efficiency and lack of certification not perfect for permanent installations or commercial/industrial applications. There are wireless sensor network projects like Libelium’s Squidbee which are based on Arduino and XBee and are commercially available but, due to the limitations mentioned are now geared towards the hobbyist/enthusiast market. Libelium have spawned off a second generation of product called Waspmote which provides the same benefits but, due to use of an optimized underlying platform now fulfils all criteria (power efficiency, range, standardisation, certification) to make it viable for commercial/industrial use.


9. Possible improvements
I have investigated suitable components which would allow me to improve the components of my network and already acquired most of them as free samples from appropriate manufacturers.

9.1 Alternative temperature sensors
To avoid having to deal with slow acting thermistors which require algorithms to translate their results into useable readings I have decided to go with slightly more expensive digital sensors.
For smaller areas I2C based sensors seem a very good choice and I have made good experiences with multiple sensors on one I2C line even across several meters as long as the cable is well shielded (CAT6 works well). The temp102 sensors I’m using at the moment are limited to four per line which is not idea to get room temperature averages or measure soil temperatures across bigger areas. I have managed to extend this up to 32 tmp102 sensors on a single I2C line with the aid of 4051 multiplexers [24] but am likely to switch to tmp175 sensors (Texas Instruments have kindly provided me with samples of this sensor) which allow up to 32 sensors per I2C line. The tmp175 come in a less DIY friendly 8-SOIC package which I had to make breakout boards for [25] but this seems worthwhile to remove the need for multiplexers/I2C extenders. Most digital sensors also come with further features like min/max values stored in separate registers and alarm functions. The most advanced sensors like the DS1629 also incorporate a real time clock.
If price of the temperature sensors became an issue I would probably put more investigations into thermistor ICs like the MCP9700 which Microchip kindly provided me with samples of. This sensor is cheap, has a reasonable range of -40C to +125C, is calibrated and very easy to read thanks to it’s linear output. It is still quite slow to react to temperature changes compared to a digital sensor but this might not be relevant in the majority of scenarios outside of industrial process control scenarios.
I have just started to investigate temperature sensors along the lines of the DS18B20 which are based on the Dallas 1-Wire interface (Maxim have provided me with samples of the DS18B20). They appear to have a very reasonable range, appear to react fast (conversion in 750ms) and come with the added benefit that they only need two lines (data and ground) as they can draw power directly from the powered data line.
I have not found time to play with it but Maxim have also provided me with samples for their DS1629 which, in addition to the functionality along the lines of the DS18B20 also includes a real time clock.

9.2 Alternative processors
The ATMega range which is currently being used is not ideal in regards to energy efficiency not at least proven by the fact that the next generation of Arduino Mega boards will be based on customised ARM processors. I would have preferred to make the transition slower and initially migrate to the ATiny range which would be suitable for basic sensor nodes but Amtel have so far not provided me with samples. Microchip on the other hand have been been very supportive and provided me with samples across most of their PIC range from the basic 8bit RE46C144 for basic nodes up to the
16bit dsPIC33EP512 with 122 I/O pins and powerful 32bit PIC32MX795F512.
I’m currently in the process of designing breakout boards for the above to start testing them and expect the 16bit to be the best choice for the average sensor nodes I envisage.

9.3 Alternative storage
The Arduino platform has support for reading/writing to sd-cards and readers are currently incorporated in various shields including the official network shield I’m using as part of my concentrator. I have used Lady Ada’s data logger shield [23] with very good results which also incorporates a real time clock to add a time stamp to data sets.
I have also acquired and tested I2C EEPROMs in form of 25LC1024 samples I got from Microchip which are much faster than SD-cards but unfortunately also much offer less storage space.
Both SD-cards and EEPROMs, once combined with a real time clock, appear viable choices for storage of data sets with SD-cards being more viable for huge amounts of data with long periods between read/write cycles and EEPROMS more appropriate for small amounts of data or scenarios where data sets are captured in very short intervals.

9.4 Alternative wireless
Although the XBee wireless modules are very well made and superbly documented by they are relatively expensive and not entirely ideal for various projects I have in mind.

9.4.1 For an automated greenhouse
This would very likely consist of a wired/wifi concentrator and nodes connected via 433Mhz modules which would be sufficient for the size of even a medium sized commercial greenhouse and more than capable of transporting the amount of data needed.

9.4.2 For industry/process automation
I would expect to find existing wifi technology on place which would be the easiest way to implement but in regards to reliability, especially for industry processes, it is far more likely that this would be based on CAT6 ethernet.

9.5 Alternative server/concentrator
The perfect data backend for my purpose would be:

  • energy efficient
  • able to run LAMP
  • ability to drive a screen, preferably 22″+ and hdmi to allow tvs and computer screens of a size that allows bigger amounts of data to be visualized
  • at least wired network connectivity
  • preferably also wireless connectivity in form of wifi, XBee or 433Mhz to eliminate the need of a data concentrator in smaller networks
  • support for non magnetic storage devices

My current backend is a dual core Intel Atom based Mini ITX board with a raid5 consisting of four 1TB magnetic hard drives. Although this is sufficient it is not as energy efficient or portable as I would like.
The recently announced Raspberry PI would suit my purposes very well and I have preordered two units. Unfortunately the manufacturers have had various difficulties over the past few months and I am still waiting for the first boards to be shipped.

9.6 Node side error checking
Currently the nodes send their data sets without a check if the data has been received by the coordinator. Although easy to implement through the xbee.h library I have not yet included this feature due to lack of means on my sensor nodes to visualize data beyond a simple heartbeat. A LCD display as in use on my LCD node would work well for this purpose but would draw far too much power for a battery powered node. I’m currently planning to use LED based TDCR1050 four digit clock displays which I have acquired as free samples from Vishay to visualize feedback after each measuring cycle in regards to the acquired sensor data, if the package has been received by the coordinator and other error states like low battery power.

9.7 Source files

Project 11 source code


10 References

[1] Ole Laursen. (2012). Flot (Version 0.7). Available from

[2] Arduino Project 6 – Measuring a water tank level (SRF05 Ultrasonic Rangefinder/Arduino Mega 2560/Arduino Uno/1.0) (2012). Oxford: Peter Haban. Retrieved 13/03/2012, from the World Wide Web:

[3] Arduino Project 4 – Sparkfun Arduino Mega ProtoShield with stackable ICSP header (2012). Oxford: Peter Haban. Retrieved 09/03/2012, from the World Wide Web:

[4] Arduino Project 5 – Adding a stackable ICSP header to the Arduino Ethernet Shield (micro-SD/R3 version) (2012). Oxford: Peter Haban. Retrieved 10/03/2012, from the World Wide Web:

[5] Flot Examples (2012). Aalborg: Ole Laursen. Retrieved 15/04/2012, from the World Wide Web:

[6] Canonical Group Limited. (2012). Ubuntu (Version 11.10). Available from

[7] The Apache Software Foundation (2012). Apache (Version 2.2.20). Available from

[8] Oracle Corporation (2012). MySQL (Version 5.1.58). Available from

[9] phpMyAdmin devel team (2012). phpMyAdmin (Version 3.4.5deb1). Available from

[10] Tweet-a-Watt Build a wireless home-power monitoring system (2011). New York: Limor Fried. Retrieved 15/04/2012, from the World Wide Web:

[11] ZigBee PRO Stack enables Larger, Denser, Sleepier, More Mobile, Secure and Resilient ZigBee Networks (2012). Cambridge: Ember Corporation. Retrieved 15/04/2012, from the World Wide Web:

[12] Arduino: Getting Started Guide (2012). Oxford: Peter Haban. Retrieved 15/04/2012, from the World Wide Web:

[13] Andrew Rapp (2012). xbee-arduino, Arduino library for communicating with XBees in API mode (Version 0.3). Available from
[14] xbee-api, A Java API for Digi XBee/XBee-Pro OEM RF Modules, XBeeUseCases (2011). Andrew Rapp. Retrieved 15/04/2012, from the World Wide Web:

[15] HIH-4030/31 Series Humidity Sensors (2008). Minneapolis: Honeywell International. Retrieved 15/04/2012, from the World Wide Web:

[16] TEMT6000X01, Ambient Light Sensor (2012). Selb: Vishay Electronic GmbH. Retrieved 15/04/2012, from the World Wide Web:

[17] TMP102, Low Power Digital Temperature Sensor With SMBus™/Two-Wire Serial Interface in SOT563 (2007, revised 2008). Dallas: Texas Instruments. Retrieved 15/04/2012, from the World Wide Web:

[18] Arduino Project 6 – Measuring a water tank level (SRF05 Ultrasonic Rangefinder/Arduino Mega 2560/Arduino Uno/1.0) (2012). Oxford: Peter Haban. Retrieved 13/03/2012, from the World Wide Web:

[19] Peter Knight (2010). narcoleptic, Sleep library for Arduino (Version 1a). Available from

[20] Shield Pin Usage. Arduino team. Retrieved 15/04/2012, from the World Wide Web:

[21] V. Boonsawat, J. Ekchamanonta, K. Bumrungkhet, and S. Kittipiyakul, “XBee wireless sensor networks for temperature monitoring,” In the Second Conference on Application Research and Development (ECTI-CARD 2010), Chon Buri, Thailand, May 2010.


[23] Logger Shield, Datalogging for Arduino (2011). New York: Limor Fried. Retrieved 15/04/2012, from the World Wide Web:

[24] Arduino Project 7 (2D/3D pictures) – How to read up to 32 tmp102 temperature sensors with one Arduino by using 4051 multiplexers (Arduino Uno/1.0) (2012). Oxford: Peter Haban. Retrieved 13/03/2012, from the World Wide Web:

[25] Arduino Project 8 (2D/3D pictures) – how to make your own SOIC-8 breakout boards from scrap (tmp175, Uno, 1.0) (2012). Oxford: Peter Haban. Retrieved 08/04/2012, from the World Wide Web:

[26] XBe e® ZNe t 2.5/XBe e -PRO® ZNe t 2.5 OEM RF Modules, Product Manual v1. x.4x – Z igBee Protocol (2012). Minnetonka: Digi International Inc. Retrieved 19/04/2012, from the World Wide Web:

FacebookGoogle GmailEvernoteDeliciousShare

Raspberry Pi Project 1 (2D/3D Pictures) – XBMC media streamer


The friendly postman left me a “you weren’t home” card yesterday so I got curious since I didn’t expect any deliveries. Farnell had given me a delivery slot for next week (28/05/2012 onwards) but a quick look into my profile confirmed that they had already sent it :) Followed by the usual 24hr wait and a somewhat restless night I finally managed to collect my first Raspberry Pi from my local main post office (at the other side of town, obviously) and documented the following “in car un-boxing” with a very happy tweet+picture :) Since I’ve been blessed with mandatory attendance at a XML training course although I have just passed a far more complex postgrad module on the matter of structured and unstructured data I had luckily already had time to prepare a repository of RasPi boot images and associated “stuff”. The following is a quick description of my first attempts to get some use out of the little board and at the end a couple of thoughts on further projects.

Raspberry Pi

1. To stream or not to stream:

Personally I don’t think that’s a real question hence the fact that during the refurb of our semi I decided to pull a bunch of AV cables as thick as my arm through the crawl space underneath the floor boards from the media center (<- she would call it the front room…) to the cupboard underneath the stairs. Said cupboard now also houses the main fan-out points for the down stairs ethernet and DVB-T wall sockets. I had a basic Intel quad core based machine in there for quite some time to basically stream video content off the central raid server and experiment with ripped HD content (<- motivated by the fact that I do own HD-DVDs and a USB HD-DVD/BluRay writer but no stand alone home cinema HD-DVD player). I think there aren’t many “stream my stuff” apps that I haven’t tried over the years and where I’m too lazy to mess with Ubuntu+VLC XBMC has proven to be a nice couche potato type front end. Since the old streaming PC was finally retired a few months ago in preparation of this setup I set out to get it to work on the RasPi. Mainly to avoid having to hook up the quad core portable to watch the last and final episode of Desperate Housewives…


2. XBMC vs Raspbmc:

Initially I thought about simply messing with the original Raspberry Pi Debian image ( to see how hard it would be to get XBMC into that but thanks to my postgrad modules I now routinely write spec and google for about half an hour before I embark on any new project. As usual this saved me about an hours worth of compiling for ARM and god knows what simply due to this website and the links on it with the two current main projects for XBMC based RasPi images: . The contenders were quickly identified as OpenELEC ( and Raspbmc (

I’ve tried both and as much as I like the idea behind OpenELEC it’s simply not quite there yet, mainly due to the fact that it feels a lot slower which is obviously the main problem on such a power poor board. Although the current Raspbmc image ( is classified as Beta it’s already very usable, boots and reacts fast and dealt well with the plugins I threw at it. Personally I’d put this down to the fact that the developer behind Raspbmc is the same guy that brought XBMC and 1080p decoding to the 1st gen Apple so he knows how to deal with underpowered platforms.


3. Raspbmc – ready, steady, boot:

Personally I got tempted to play around with the non-HDMI screen sockets but they don’t seem to be implemented yet due to missing drivers so the little thing went up against a 50″ plasma. I haven’t bothered yet to try and connect the 3.5 mm jack headphone socket to the Yamaha 6.1 Amp and I’m not sure how well Raspbmc deals with above HDMI-stereo or real 5.1 output via the 3.5mm jack at the moment but since the audio chips seems very boring standard stuff I’d assume it should simply work or require minimal work at best which I’m sure will be finished until the final image goes out.

AV wise I’ve set this up as HDMI only to the plasma with video as 1080p/60hz and stereo audio through the same HDMI cable to the TV.

I’ve seen various posts of people who tried XBMC on their RasPi with very poor results due to very slow SD-cards so I got something reasonable fast in form of a 8GB SanDisk Ultra (SDHC, 4, 15MB/s) which seems sufficient to give the little board enough I/O umpf. Building bigger lists of files can take a second or two and the same goes for listing available options in some of the plugins which scrape data off the interweb but keeping in mind the underlying system and the fact that Raspbmc is still Beta this is not only usable but actually quite impressive. The current RasPi only has a 10/100 NIC which makes sense as the chip in front of the NIC simply wouldn’t handle more (especially on the upstream side) so I’m hoping that the next version comes with a decent gigabit NIC which should be beneficial once the board is meant to crunch HD content or scrape tons of data off some website/service.


4. Raspbmc – plugins (UK):

Installing the plugins is simply down to copying the extracted files into a folder on the RasPi boot SD-card or installing the usual repositories. I’ve only tried TV ones so far which work very well. iPlayer for TV and radio works straight away after copying the plugin over, even BBCHD works stutter free! The 4oD still has this annoying bug and I’vd forgotten how to fix it but the 5oD one works without the need to turn on the brain and rewrite the messy perl script that comes with these two. TVcatchup also installs but even in low resolution the video stutters which I think is down to the codec it uses. From what I gather the RasPi doesn’t deal to well with MPEG2 but I haven’t really looked into the spec details of the GPU yet. I’d assume all this is fixable as soon as more people have the boards and feed back bugs.


5. Raspbmc – smb streaming:

No real surprises here, streaming from an Ubuntu based Samba share is simple to setup and works without flaws. I’ve tried xvid and high resolution h2.64 files and all play without stuttering which I still find amazing for a board this size :) I’ll do more tests to find out where the limits of the GPU are and which codecs it digests best but I’d assume that it should deal with all the files people usually watch and it should at least match if not even exceed capabilities of functionality built into most recent TVs/BluRay players. It surely outperforms my one year old plasma and BluRay player in regards to capabilities as a media player.


6. What next:

As usual, lots of ideas in my head :) Apart from the fact that I want to establish what the board is actually capable of with Raspbmc in regards to max video/audio rates I’d also like to test more of the XBMC plugins and hopefully I’ll get lovefilm to work on this so I won’t be sent to the mail box again ;) In regards to non media streaming projects I’m planning to try and talk to all sorts of ICs and Arduino shields once I’ve figured out what the pins do  and soldered a few dirty adapter boards. I remember this Gert-board thing and Lady Ada had a RasPi proto board in one of her blog posts but I’m not sure if either are actually on sale yet. I think the first think I’m going to try to talk to will be I2C sensors and an XBee Series 2 modules simply because I’ve got some kicking about but if I get enough spare time I want to replace the back-end of my current wireless sensor network with a RasPi. It simply needs to suck up data frames from the XBee and then store them in an internal MySQL database. Since it’s got an ethernet port it could obviously serve flot graphs on the data through Apache like my current Mini-ITX back-end but this should be a lot more portable and energy efficient. Last but not least, if said graphs and more stats/details on the sensor nodes could appear on a touch screen mounted to the back of the RasPi I would have a full MySQL storage an graphical reporting backend running off 5V and possibly even off a mid sized solar panel hence off grid :) Oh, and I still need a decent case…

FacebookGoogle GmailEvernoteDeliciousShare

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress

Hit Counter provided by seo company