The Arduino Mega Protoshield Kit – Build Instructions

1. Introduction:
For my new Arduino controlled greenhouse project I lately required a new Arduino Mega Protoshield. I’ve had the nice red Sparkfun one for quite some time now but since I’m using an Arduino Mega 2560 for this project I wanted something that brought up the additional new pins and the ICSP header. The latest original Arduino Mega Protoshield (A000039) was an exact match for my requirements and as a kit available from proto-pic for under £14. How was I meant to resist :)


2. Where’s me instructable:
I’m lazy these days so every new kit I get I open google to look for an instructable. Usually I don’t need the instructions but I have on so many occasions found welcome additional tweaks and project ideas mentioned in said instructables and met so many great people from comments and forum posts that I seems time well spent. Oddly enough, I found nothing for this kit. Worse, I found forum posts asking specifically for this instructable but no valid answers/links.
I get it, this kit isn’t complex so I assume nobody could so far be asked to write this guide, especially since the Arduino Mega isn’t exactly geared towards entry level projects. Still, I’ve decided to take a few pictures while I build and write this post. Even if it’s just to get a few friendly comments or helps to reassure sombody that they are building it as intended it’ll be worth a little bit of my time I think.


3. What’s in the box:
This is what I got with my kit:

  • One Arduino Mega Protoshield Kit
  • Two little push buttons
  • One single row strip of 40 long headers
  • One 18×2 header block
  • Three LEDs (one each of Red, Green and Yellow)
  • Three 220 Ohm Resistors
  • Three 1K Ohm Resistors
  • Three 10K Ohm Resistors
Arduino Mega Protoshield Kit


4. Let’s build:
There is no need to solder the parts in this particular order but this worked for me.

4.1 LEDs and resistors:
Have a look for the corner which is meant to get the two LEDs (look at the top of the shield, if you can read the Arduino logo it’s the top left corner). Fit the two 220Ohm resistors (orientation doesn’t matter with those) and get one red and one green LED. If you look at the bottom side of the shield it’s easy to determine which way round to mount the LEDs. The shorter lead gets connected to ground and it’s easy to see which solder run comes from ground. In other words, the holes closest to the little “1″ are the ones connecting to ground aka the ones for the shorter lead. Solder in place and trim off the surplus leads.

Arduino Mega Protoshield Kit - LEDs 1

Arduino Mega Protoshield Kit - LEDs 2

Arduino Mega Protoshield Kit - LEDs 3


4.2 ICSP header and push button:
If you look at the top of the shield and if you can read the Arduino logo the little push botton goes right next to the logo on the right hand side. The ICSP header then again goes to the right hand side of the push button.

Arduino Mega Protoshield Kit - icsp/button


4.3 Headers:
There is the long row of 18×2 pins for the large pin block on the right hand side of the shield. Once you are done with soldering that one into place snap the long single row of headers into smaller parts to provide the segments required for the groups of pins at the top and bottom edge of the shield. In my case the 18×2 pins were quite a bit shorter than the other header pins so I decided to shorten the pins at the top/bottom.

Arduino Mega Protoshield Kit - headers


5. Conclusion:
It does what I want and I think it does it well. The shield is of very good quality and the design is well thought through, everything seems to be in the right place. The Mega shields tend to be a bit hard to fit onto the actual Arduino Mega literally because of the 1001 pins and especially the giant 18×2 header section. This one isn’t any better or worse than all the other ones I’ve tried. The kit leaves a few spare parts in form of one yellow LED, one push button and a couple of resistors but I’m not entirely sure what they are meant to be good for. I’m open to suggestions :)
The only thing I would critisice, and that’s pure criticism of the kit not the shield itself, it the fact that my kit came with long top/bottom headers but the 18×2 header section consists of pins which are 2/3 of the length at best. Only chance I saw to get all pins inserted was to shorten the top/bottom header pins which works fine but, once mounted onto the Arduino Mega, means there is very little distance between the Arduino Mega and the protoshield which I don’t really like.

FacebookGoogle GmailEvernoteDeliciousShare

Arduino Project 12.1 – My second Arduino controlled greenhouse


This is the first of a series of posts to describe my second Arduino automated greenhouse. It’s simply too big a project to cover everything in one post so I’ve decided to split it into a few smaller posts. In this first part I’m going to quickly describe my water, power and network setup.


1. Power

I’ve built this greenhouse myself and since I knew I wanted to automate it I fed 240V (armoured 4mm cable) and mains water (blue plastic pipe) in from underneath through the base. The 240V connection feeds two IP54 sockets which I rarely use apart from powering tools during maintenance tasks and a fused spur to supply the IP66 flourescent light fitting and associated IP66 light switch.


2. Water

The blue polypipe connects to a copper adapter which then phases out into two lever taps. One of them is usually connected to a hose reel and the other one is now feeding the automated watering pipeline :) This pipeline runs round the inside bottom of the whole greenhouse with so far five 12V solenoid valves T-ing off of it. I used 13mm irrigation pipe for the water run up to the valves and behind them I’ve gone down to smaller 5mm irrigation pipeline which then feeds several adjustable 30l/h irrigation bubblers. For the bigger plants I use one bubbler per pot while they are still young but once they grow up and develop long enough roots one of them should be enough to water the tray underneath the pots. The trays up on the staging only house smaller pots anyway so they all get flooded by one bubbler each.





3. Network

I’ve pulled over two CAT6 lines from the shed next doors. One currently supplies gigabit ethernet and the other one 9V DC to feed the Arduino and 12V for the solenoid valves. The Arduino is going to upload statistics to my MySQL storage back-end through a network shield and I’m planning to display samples of this data with a LCD in the greenhouse as well as a second LCD in my hallway. While I’m at it I’m also planning to get the same Arduino to collect weather data (outside temperature, humidity, wind speed etc) and upload it into my database for displaying on the hallway LCD. If I ever find the time I’d also like to make this data available through a web service so I can tap into it with a little Android/iOS app.

My latest addition is a chunky IP54 ABS box to house all the circuitry and I’ve already fitted the first three plugs which are going to connect the fan out lines to connect the solenoid valves and soil humidity/temperature combo sensors.


Next Steps:

I’ve got most of the circuitry for the distribution box built up and tested and the two fan cans (soda can with a little fan, humidity, light and temperature sensors)  are ready to go in as well. Biggest task left on my list is probably somewhere between wiring it all up and building all the soil humidity/temperature combo sensors. I shall report back with another post in the near future :)

FacebookGoogle GmailEvernoteDeliciousShare

Arduino Project 11 (2D/3D pictures) – Measuring a water tank level v2 (HC-SR04 Ultrasonic Rangefinder/Arduino Uno/1.0)

1. Introduction:
I made a water level sensor a little while a go to measure the water level in my underground rainwater harvesting tank. Thanks to the Jubilee I found time to finally setup the first part of my Arduino/Xbee wireless sensor network and the first sensor node was also meant to read from this water level sensor. I was somewhat surprised when it only returned 0s so I went and had a closer look. How the slug got into the enclosure is still a mystery to me… but looking at the bright side (after the uncontrolled swearing) I now had a reason to build a much better water level sensor :)

water level sensor vs slug


2. Add a few new bits…:
I’ve based the new sensor on the little perf-board from my sensor in Arduino project 6 but swapped the SRF05 for a HC-SR04 and mounted the result into a little square IP65 enclosure from Maplin.
Last shopping spree on ebay has resulted in me now being in possession of five HC-SR04 ultrasonic range finders which are very much a cheap “alternative to the SRF04. These work with the same code I used for the old sensor and have the same pins.

HC-SR04 top

HC-SR04 bottom

Since Vishay provided me with a whole bunch of free 10KΩ thermistor samples (I’m planning to use these for my soil humidity/temperature sensors for the upcoming Arduino controlled greenhouse v2 project) I added one of those to the perf-board together with the matching 10KΩ resistor.


3. Stir…:
- Remove the angled pin headers from the HC-SR04 and solder wires directly to the sensors control board
- drill two eyes into the top of the enclosure for the sensor eyes
- drill two more tiny wholes into the bottom of the enclosure for the LEDs
- mount sensor and perf-board into enclosure
- pass wire into the enclosure and connect everything up
- seal the holes with hot glue
- mount new sensor into collar of water tank




HC-SR04 Fritzing

tank sensor v2 Fritzing files


4. Serve:

After connecting it to the Arduino Uno everything woked well with the same code as before. So I added a bit more code to read out the additional thermistor which also went well.
The result is now my first wireless sensor node which collects temperature, light level and water level which are then uploaded in 3min intervals by the XBee-to-Ethernet concentrator into my MySQL database :)

FacebookGoogle GmailEvernoteDeliciousShare

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

Arduino Project 9 (2D/3D pictures and videos) – How to connect a Texas Instruments BQ32000 Real Time Clock (BQ32000DR, Uno, 1.0)

1. Introduction:
I went on free sample spree a little while ago and then got myself a few “younametheDIYunfriendlypackage”-to-DIP adapters off ebay (more details on the adapters are in one of my previous posts (DIP adapters to convert less DIY friendly packages (SOP, SOIC, TSSOP, MSOP, SSOP, SOT, LCC, LGA)). This is the first little chip from my free sample batch I’ve soldered onto one of the adapters to make it breadboard friendly.

I’m going to use one of those on a XBee-to-Ethernet concentrator in my wireless sensor network to add a time stamp to data frames which I’m buffering locally onto a SD-card on the concentrator during ethernet down time.

For all those who prefer a video instructable, please head over to YouTube to find both a 2D and 3D video instructable based on this post:


2. Tech spec:
Package: SOIC-8
I2C Interface
Ambient Operating Temperature: –40°C to 85°C
Supply Voltage Range: 3V to 3.6V

Texas Instruments BQ32000 Main product page

BQ32000 data sheet


3.Where to get one/many:
The BQ32000DR is free to sample from TI, their price chart lists them for £0.75 in 1k quantities.

Farnell will sell you a single one for £1.85 (Link to Farnell)


4. Let’s hook it up:
Since we can’t easily connect the SOIC-8 package to the Arduino I’ve soldered it onto a SOIC-to-DIP adapter.

bq32000 on dip adapter

Looking at page two of the data sheet we connect it to the Arduino Uno as follows:

BQ32000 Pin4 -> Arduino GND
BQ32000 Pin5 -> Arduino Analog Pin 4 (SDA)
BQ32000 Pin6 -> Arduino Analog Pin 5 (SCL)
BQ32000 Pin8 -> Arduino 3.3V

Looking at page 3 of the same data sheet (and because I’ve had a look in the Arduino forum where people didn’t get the DS1307 to work without I2C pullup resistors ;) ) we also need to connect SDA and SCL with one 4.7KΩ pullup resistors to the Arduino’s 3.3V supply.


BQ32000 Fritzing files

As usual for a RTC the BQ32000DR also has a battery pin and a battery connected to this will get trickle charged from the main power supply. Both the main power supply and the battery connection should get capacitors on permanent circuits but for this little demo we’ll get away without the capacitors and battery.
I’m not going to spend much time explaining the IRQ pin, have a look at page 5 of the data sheet if you think it might be useful to you. Baseline, for a permanent circuit add another 4.7KΩ pullup resistor between 3.3V and IRQ (just like we did with the SDA/SCL lines) to ensure this get’s turned off when the BQ32000 is running off it’s battery.

Project 9 Arduino BQ32000


5. Let’s talk to it:
Since the BQ32000 is code and pin compatible with the popular Dallas/Maxim DS1307 RTC we can borrow the DS1307 Arduino library to talk to our BQ32000DR RTC :)

This version of the library works with the Arduino 1.0 IDE:
DS1307 Library
Simply unpack, copy the resulting DS1307 folder to your Arduino IDE library folder and open your Arduino IDE. You’ll now find the the examples I’m using under File/Examples/DS1307.

Let’s start with DS1307_demo_en. Upload, start the serial monitor and you should get more instructions on how this sketch works. Basically you paste a string into the serial monitor, hit send and thereby set the BQ32000DR to the current date/time.
The format is straight forward, just one typo to watch out. Make sure you replace the “A” in “A[00-49]” with a Y when setting the year. This is my example string:
h13m43s00D05M06Y12 R

Which gives me the following result in the serial monitor:

Project 9 terminal demo output

Now the second example, ds1307_rtc. This is very much the same as DS1307_demo_en just with the interactive part stripped out. The current time/date simply get set as variables in the void setup loop which runs once whenever the Arduino starts up before it moves on to loop through whatever you have sitting in void loop.


6. Conclusion:
As one would expect from Texas Instruments, a very nice no-nonsense RTC :)

FacebookGoogle GmailEvernoteDeliciousShare

Arduino Project 8 (2D/3D pictures) – how to make your own SOIC-8 breakout boards from scrap (tmp175, Uno, 1.0)


Texas instruments were kind enough to provide me with samples of their tmp175 digital temperature sensor. They don’t come in the most DIY friendly package hence I had to make a breakout board before I could get the Arduino to talk to one of them.

The breakout board:
I’m sure they are available somewhere but I didn’t want to wait for another delivery and have a generous amount of IT scrap. So I set out to find something in the heap which I could chop up and which would have the same pitch as the tmp175s pins. The donor part was quickly identified as an old PCI network card, the bit that gets inserted onto the PCI slot was a perfect match in regards to pitch. So out comes the Dremel, on goes the diamond cutting disc and off comes the bit I want :)

The resulting bit of PCB wasn’t big enough to fit both sides of the sensor on it hence I’ve used two smaller parts, one for each side. I’ll check for more suitable cards with a wider area to solder onto at some point, AGP cards might be better for this purpose.

I’ve soldered each sensor pin to it’s own copper trail, drilled little holes, fed the cables through and soldered them to the copper trails. The result might not be pretty and would benefit from a bit of support underneath (hot glue or a bit of plastic…) but it’s free and it works :)

Reading from a tmp175:

The tmp175 has three address pins which means we can have up to 27 of them on one I2C strain. Quite a move up from the tmp104 I played with in Project 7 which is limited to just four. Quick glanze at the TI reference pdf ( and the first address option on page 8 is to connect all three address pins to ground which sets the sensor to a binary address of 1001000 (or 0×48 in hex which is what the wire library tends to digest in sketches). TI recommend pull up resistors for sda/scl and a capacitor but for this quick test I got away without them.

Once connected up it’s straight forward to read temperatures. There are additional registers to set min/max temperatures to trigger alarms on the alarm pin if the actual values move outside the specified range but for this project I’ve decided to keep the sketch simple and just read the current temperature.
The following sketch will print the temperature from a tmp175 on address 1001000/0×48 to the serial monitor.

Arduino sketch to read tmp175

I like this sensor, the possibility to have 27 of them on one I2C line makes it a good candidate for getting average readings. The I2C lines will obviously limit the range but this will still be a great sensor for confined space projects and it’s very easy to talk to.

FacebookGoogle GmailEvernoteDeliciousShare

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)


I bought a few tmp102 sensors on matching breakout boards from SparkFun to take measurements around the greenhouse. Apart from the fact that this sensor is tiny, very energy efficient and responsive I mainly decided to go for these instead of thermistors because they are digital (no need for endless conversions) and since they are I2C they can all be connected to the same two wires. This model is limited to four devices per I2C bus which is enough for what I want to do. If you need more you will find plenty of tmpXYZ choices on TI’s website. I’ll start with connecting the maximum of four tmp102 sensors to one Arduino Uno board, mainly to explain how the addressing scheme works and then move on to a setup which allows for multiples of four sensors to be read with the same Arduino Uno with the help of 4051 multiplexers.

Some cold facts on the tmp102 before we start:
Low Power Digital Temperature Sensor with SMBus/Two-Wire Serial Interface in SOT563
resolution of 0.0625C
range of -40C to +125C
SMBus and two-wire interface compatibility
up to four devices on one I2C/TWI bus.
1.4V to 3.6VDC supply range

And some links with with more details:


1. The theory:
The idea is simple. Imagine the I2C interface like a little network. You connect your sensors to the two wires (analog pin 4+5 on the Arduino Uno), configure each sensor to have it’s own hardware address and then just send out a request through the two wires to talk to which ever address you want.


2. Let’s connect the first one:
Connect the sensor as follows:

On the tmp102 breakout board: -> On the Arduino Uno board:
V+  -> 3.3V
SDA -> analog pin 4
SCL -> analog pin 5

With the help of this sketch we can now get the current temperature reading form our first sensor.



3. Let’s connect some more:
To get more than one of these sensors to work on our I2C network we need to configure each one of them with it’s own hardware address. This is achieved by connecting the breakout boards ADDO pin to different Arduino pins. The four possible options are:

On the tmp102 breakout board: -> On the Arduino board: -> Translates to network address:
ADDO -> GND -> 1001000 -> 0×48 -> 72
ADDO -> 3.3V -> 1001001 -> 0×48 -> 73
ADDO -> SDA -> 1001010 -> 0×48 -> 74
ADDO -> SCL -> 1001011 -> 0×48 -> 75


Once all four sensors are connected the following sketch will get the current temperature reading form all four sensors.



4. Anything else it can do?
I didn’t expect much more from a temperature sensor, in fact this is a lot for such a tiny package. Still, it’s got a few more tricks up it’s sleeve. The TI manual mentions a few more registers towards the end, in addition to the current temperature this sensor also stores it’s configuration and highest/lowest temperature readings in registers which are accessible via I2C. I doubt that many people are going to be interested in the configuration register and further options of this sensor, feel free to consult the manual for further details. I can see use for the min/max temperature registers for stand alone setups (I tend to store sensor readings in a database) and the following sketch will display the content of the current/max/min temperature registers for all four sensors.



5. One more to go:
I had ordered five of these tmp102 sensors since I was afraid I might kill one during “testing”. They have proven very hardy, even running them on 5V or connecting various pins wrongly doesn’t seem to have caused my testing sensor any obvious damage. Obviously I couldn’t resist to try and make the fifth one work as well ;)


6. 2×4051=32xtmp102…
To prove that it is possible to read multiple strains of 4xtemp102 I’ve setup a little experiment with two 4051 multiplexers and two tmp102s which are both set to a 72 address by connecting their ADD0 pins to ground. Multiplexer nr1 (which is going to control all the SDA pins) has it’s z pin connected to analog pin 4 and multiplexer nr2 (which is going to control all the SDC pins) has it’s z pin connected to analog pin 5. Both multiplexers have their s0-2 pins connected to the same digital pins 8/9/10 which allows to select the eight different strains of tmp102s we can now start to connect. I’m sticking to two for the moment but this setup is obviously easily extendable.
For anyone who isn’t familiar with the 4051 there is a good introduction on the playground (


The following sketch will set the multiplexers, read both 72 tmp102s in turn and prints the result to the serial monitor.


FacebookGoogle GmailEvernoteDeliciousShare

Arduino Project 6 – Measuring a water tank level (SRF05 Ultrasonic Rangefinder/Arduino Mega 2560/Arduino Uno/1.0)


I’m harvesting rainwater from a couple of outbuildings via 110mm underground pipes connected to an underground storage tank. Since I want to stay on top of the water level in the tank and also had a SRF05 ultrasonic rangefinder sitting in a box I thought I’d put it to good use and measure the water level in the storage tank. The result is collected by an Arduino Mega 2560 and uploaded to a mysql database with the help of an ethernet shield but this is obviously optional.

The Basics:

The theory behind this sensor is easy to understand. It works pretty much like a bat hence sends out an ultra sonic pulse, waits for it to come back and depending on the time between the two events we can then calculate the distance between our sensor and the nearest obstacle. I’ve put the sensor including a little bit of perfboard with a switch and some LEDs into an enclosure and mounted it to the inside wall of the tanks collar facing down towards the bottom of the tank/water. To get the sensor connected to the Arduino Mega 2560/Uno there are four cables to connect before we can upload a sketch for testing purposes. Apart from reading from the sensor the sketch also blinks the onboard pin13 LED after each measurement and prints the result to the serial monitor.


Connect the sensor as follows:

Red -> Arduino 5V

Yellow -> Arduino digital pin 7

Lilac -> Arduino digital pin 8

Black -> Arduino GND

Upload the following sketch, open the serial monitor and you should see some results.



3. Let’s make it pretty and “put it in the hole”:

I didn’t want to just hot glue the sensor to the inside of the tank due to the humidity in there. Unfortunately I’ve currently run out of the water proof enclosures/cable glands I tend to use so I had to improvise. I also made a little perfboard which includes a switch to cut power to the sensor and board, one red LED to indicate 5V arriving on the perfboard and one yellow LED as a heart beat indicator to flash between measurements. I’ve mounted all this inside the plastic cap of an aerosol can with the LEDs sticking out the top. The two sensor eyes look out the bottom which is sealed with a bit of plastic with holes cut into it to let the sensor eyes poke through. Add a generous amount of hot glue to seal the gaps and we’re ready to mount the sensor inside the collar of the water tank.

The following sketch will print the result to the serial monitor and use the onboard pin13 LED and the perfboard LED as heart beat indicators between measurements.


FacebookGoogle GmailEvernoteDeliciousShare

Arduino Project 5 – Adding a stackable ICSP header to the Arduino Ethernet Shield (micro-SD/R3 version)


I’m currently working on a bit of coursework which includes XBee shields and XBee 2.5 ZNet modules. Since I want one of my nodes to form a bridge between the XBee network and my existing ethernet network I bought an Arduino Uno and one of the new ethernet shields with micro-SD slot. The pictures are for the older non R3 micro-SD ethernet shield but I’ve got an R3 one as well and the layout appears identical (apart from the new pins which are of no concern for this exercise) hence the procedure will be identical.

1. The problem:

The issue is obvious, the ethernet shield doesn’t pass the ICSP pins through to the next layer hence the XBee shield has nothing to plug into. Initially I wasn’t sure if there could be more than one shield using the ICSP headers so I sneakily soldered wires to the underside of an old Diecimila and the underside of an XBee board. With the ethernet shield between the two I could receive data from the XBee network and upload said data to my mysql database via the ethernet shield. So I got out the tools :)


2. Removing the existing ICSP headers:

I started by removing as much solder as possible from the top solder points of the header with de-soldering braid to make my life easier later on when trying to get the actual header pins out. Then snip off the black plastic part of the header but leave as much of the actual pins as possible attached to the board (makes it easier to get hold of them when you are trying to pull them out). Heat the pins up one by one and pull them out.


3. Tidy up:

I still had a few holes blocked with left over solder. Again de-soldering braid is your friend but you could probably just as well use a Dremel type tool with a tiny drill to clean the holes.


4. Fit and solder the new ICSP stackable header:

Like in Arduino Project 4 I used an 8-pin header and cut it down to two 3-pin ones with a Dremel and diamond cutting disc. Feel free to use whatever you have available, these 6-pin headers will be available somewhere but I just wasn’t patient to search for them ;) Fit the new header to an Arduino board and attach the ethernet shield above with the new ICSP pins fed through the appropriate holes in the ethernet shield. This would be a good point in time to take whatever second ICSP enabled shield you want to fit on top of your ethernet shield and check that it’s female ICSP header actually reaches the new ICSP pins you are about to solder in place. If you are happy with the result heat up the soldering iron. Two pins are rather close to the micro-SD slot so be careful not to connect them to the metal housing of the micro-SD slot.

FacebookGoogle GmailEvernoteDeliciousShare

Arduino Project 4 – Sparkfun Arduino Mega ProtoShield with stackable ICSP header


Since I’m planning to extend the greenhouse Arduino system before the next wave of plants go in I decided it was time to upgrade myself to an Arduino Mega 2560. All my existing shields appear to work with it but for trying new ideas out in the wild I prefer protoshields over breadboards so I got a Mega protoshield as well. There are more modern Mega protoshields around which pass through the IOREFF and ICSP pins by default but I still prefer this one as the kit is available in the UK, comes with stackable headers and has a large continuous prototyping area.


1. Inspection, let’s have a look at what we’ve bought:

My kit came with:

(1) Printed Circuit Board (PCB)

(1) momentary switch

(2) LEDs (one green, one red)

(2) 330 ohm resistors (orange/orange/brown)

(1) 10k ohm resistor (brown/black/orange)

(12) 8-pin stacking headers

Have a look at the picture below to make sure you’ve got everything you need (getting stuck half way through is terribly annoying) and know which part is which.


2. Count your headers (and don’t get angry…):

Before we start to solder we need to deal with the little issue of SparkFun supplying the wrong sort of headers. At closer inspection you will find that the header closest to the position of the switch is actually a 6-pin and that there is no way to make up 18 pins (for the two rows of 18 pins that make up the giant double row header section) from 8-pin headers. No idea why SparkFun don’t supply other headers but such is life so we’ll have to deal with it. There are three main ways forward, pick whatever you feel most comfortable with:

a. Buy yourself seven 6-pin headers. This solves the problem rather elegantly, provides the best finish but obviously means you need to invest more cash and probably drive to your local component dealer or wait for some online shop to deliver to your door.

b. Chop up the 8-pin headers. Make one 6-pin header and create the big header section from four 8-pin headers and two 2-pin headers (again from chopping up one of the 8-pin headers). This will work but if you fit the 2-pin headers to the ends of your giant header area they will tend to bend outwards hence make it difficult to attach the prototype shield to your Arduino Mega. If you want to go down this route I’d suggest to keep the 2-pin headers in the middle of the giant header area.

c. Chop up 8-pin headers to make up 6-pin ones. The latest version of this kit now has twelve 8-pin headers included (earlier versions only came with eleven) hence you should have just enough headers to do this (five to be used as 8-pin, one to be chopped down to 6-pin, six to be chopped down to 6-pin for the giant header area, makes up the twelve we got in our kit).


 3. Soldering the resistors:

We’ve got two types, 10k Ohm and 330 Ohm ones. If your eye sight is good enough you’ll find they are easy to identify by their colour bands but you can just as well put a meter against them. Have a look at the PCB, there is a little area in the lower left corner between the LEDs and the switch with little rectangles which have numbers in them. The number match up with our resistor values hence this is where we solder in our resistors. Orientation doesn’t matter for resistors, just make sure you put them into the right place. Feed the tails through the holes, solder at the back and clip off the excess tails.



4. Soldering the switch:

The switch goes into the area on the right hand side just next to the resistors we’ve just soldered. Just as with the resistors orientation isn’t critical, if you can get it mounted it’ll be fine. The legs of the switch are meant to be slightly bent, this will hold the switch in place while you solder.



5. Soldering the LEDs:

We’ve got two of those, one red and one green one. Unfortunately the one’s I got with my kit were both translucent hence the only way to find out which is which is to “make ‘em glow” :)

I’ve used an Arduino Uno for this and uploaded the Blink sketch. Attach the longer leg of the LED to pin13 and the shorter leg to the ground pin right next to it. Better make a note of which LED is which.

The soldering area for our LEDs is in the lower left corner of the board. The green LED is meant to go into the left position (STAT) and the red LED into the right position (POWER). Obviously nobody forces you to stick to this but I find it makes life easier to stick to a fixed colour scheme. If yours is different feel free to change the order or use different LEDs.

Keep in mind orientation matter with LEDs, if you look at their translucent body you will find one of the sides is slightly flattened. Check the board and the LED area and you will find that the round circles which mark the LEDs positions are flattened one one side in the same way. Make sure you fit the LEDs the right way (left/STAT/green one with the flattened side facing right, right/POWER/red one fir the flattened side facing left). As before with the resistors, feed the tails through the holes, solder at the back and clip off the excess tails.


6. Cutting the headers:

This will obviously depend on whatever tools are available to you. A wide range of scissors or sharp knifes should do the trick but keep in mind that the black plastic is a tough material to cut through and actually encloses bits of metal. I assume you can watch out for your own fingers…

I am the lucky owner of a Dremel with a matching little diamond cutting disc which makes the whole exercise rather painless and quick. If you want the result to be pretty feel free to use a bit of sanding paper to smooth the rough edges.


7. Soldering the headers:

Next step is to solder all the headers, if you put all the 8-pin ones in and turn the PCB over it is easy to solder them and the board will be nice and stable. Then repeat the same with the 6-pin header and the giant header section at the end of the PCB.



8. Adding an ICSP header

This protoshield does not come with ICSP headers but if one is prepared to sacrifice a bit of prototyping area they are easy to add. If you want to use an ethernet or XBee shield above this proto shield you are going to need these headers. I turned an 8-pin header into two 3-pin ones for this purpose. Once you’ve got them cut to the correct size simply fit them onto the header on the Arduino board and fit the protoshield on top with the new ICSP header pins fed through the appropriate holes in the prototyping area. Solder the six pins to the prototyping area of your protoshield and you’re done and ready to use ICSP dependent shields above your protoboard.



9. Further thoughts:

Apart from the fact that I can’t see an easy way to feed the IOREF pin through due to the switch which is located directly above it this protoshield is perfect for what I want to do.

FacebookGoogle GmailEvernoteDeliciousShare

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

Hit Counter provided by seo company