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.