« Just Curious ... | Main | iMovie and Fat32 Don't Mix! »

March 11, 2007

Tutorial: SparkFun ProtoShield Assembly + Use

The Arduino board is an inexpensive, open-source microcontroller board. The development environment is also open-source and freely downloadable.

The Arduino board is sold in the United States by sparkfun.com. Shields are extension boards that can combine with the Arduino main board to extend it's capabilities. That gets us to the main point here. The ProtoShield kit from SparkFun adds a couple of LEDs, switches, and an optional solderless breadboard making prototyping that much simpler.

I recently purchased an Arduino board and ProtoShield, but wasn't able to find much information about assembly and use of the ProtoShield. So, I decided a short tutorial showing how I put together the ProtoShield might be useful to others. Here goes.

First Stage: Planning

Here's what the kit looks like: (note: clicking on any image will popup a larger, legible version)

Here're all the pieces:

Included in the kit are:

  • (1) Printed Circuit Board (PCB)
  • (2) momentary switches
  • (2) LEDs (light emitting diodes)
  • (2) capacitors (.1uF)
  • (2) 330 ohm resitors (orange, orange, brown)
  • (1) 10k ohm resistor (brown, black, orange)
  • (1) 40-pin male header strip
  • (2) 8-pin female header blocks
  • (2) 6-pin female header blocks
  • (2) 4-pin female header blocks

Look at the picture and make sure you can identify all the parts.

I'm assuming here that you can solder (or, are willing to experiment on this project.) If you want some instruction in that regard, the short instructional videos on the NASA radiojove project site are a good start.

The way this board works is that the male headers are attached to the bottom of the board (along with one narrow female one). These fit onto the Arduino USB board to connect the ProtoShield. Components on top of the ProtoShield board add a switch and LEDs you can use for inputs and outputs. Also, female headers on top of the board provide access to the same connections that were originally available on the Arduino board. With the Arduino, the ProtoShield creates a powerful and compact protyping setup.

I'm going to provide step-by-step instructions, but skim down the pictures and look at all the parts and try to get a general understanding of what's going on. It'll make it a lot easier when you're sorting things out later.

Second Stage: Preparation

There are a few things it's probably easiest to do up front so you can just focus on placement and soldering later.

  • Remove one pin from one of the 4-pin female headers
  • Break up the 40-pin male header into sections of the correct length
  • Bend the resistor leads to fit into the board

First, if you look at the short side of the PCB that has the little tab on it, there're three holes right next to the breadboard grid. These are used to connect the reset switch on ProtoShield to the main board. A female header block fits here. But, the shortest block has four pins. So, you have to remove one of the pins so it'll fit. This is easily done with a pair of pliers. Just take hold of the pin on one end and pull it out. Should come easily.

Next, break the long male header into two 8-pin sections, a 6-pin section, and a 4-pin section. Three of the remaining pins will be used later. And, the others can be used as spares. You can use some clippers to cut the header in appropriate spots (there are indents between each pin that make it easy). If you're careful, you can also just use your fingers to snap the header.

Last, bend the leads on the three resistors. If you have small needle-nose pliers, you can use then right next to the resistor body to space the bend (see picture). If not, you can use your fingers to bend the leads down near the body.

Here's a picture of the prepared parts:

Third Stage: Assembly

Now, it's time to start putting parts in the board and soldering them. I generally start with the "shorter" parts close to the board and work towards the taller parts. So, the first parts to go in are the resistors. For now, the parts are inserted from the side of the board with the stenciling on it and soldered on the reverse side. Locate the spot for the 2 330 ohm resistors and the 10k resistor. Insert the leads into the holes. It doesn't matter which direction you put them in, they'll work fine both ways.

Now, turn the board over and spread the leads while you're pressing on the resistors from the other side to hold them in place.

Solder the six connections and clip off the excess leads close to the board.

Next place the two capacitors (see the picture below) spreading the leads as before. Again, it doesn't make a difference which direction you put the capacitors in. Solder and clip the leads.

Next, insert the LEDs. The LEDs are different than the previous components in that direction does matter. The LEDs have one shorter lead and one longer one. Also, if you look at the LED lense from the top, you'll notice that one edge at the bottom is flat. This should be the edge right next to the shorter lead. This is the cathode (the other lead is referred to as the anode). The symbol silkscreened on the PCB shows what orientation to use for the LED. Make sure the flat side of the LED matches the flat side on the board symbol.

To make sure the LEDs sit firmly against the board (more for aesthetics than performance), I'll often use a bit of tape to hold the LED in place.

After placing the LEDs, turn the board and solder one lead of each one. Then, while you're gently pressing the LED from the other side, reheat the connection. The LED may shift a little. This will make sure the LED is sitting squarely on the board. After reheating the first connection, solder the remaining lead of each LED and clip all the leads as before.

The last of the components to add to the board are the switches. The orientation doesn't matter as long as they fit properly in the associated holes. They should clip solidly in place (press on them until they're flush with the board). Turn the board over and solder the eight leads.

Now, come the male headers placed on the bottom of the board to connect to the Arduino. Locate the two 8-pin sections of the male headers. Turn the board over so you're looking at the bottom. Insert the shorter side of the pins in the two 8-hole sections as shown in the picture. Make sure to insert the headers towards the outside of the board, and not in the inside row of holes. If you do this incorrectly, the board will not mate properly with the Arduino board. Use a bit of tape to hold the pins in place and turn the board over.

To solder these in, solder the connection at the end of each header. Do not solder the intervening pins. Now, reheat the connection at one end and press the header gently from the other side to make sure it's properly seated (watch your fingers, the pin will get hot). Now, reheat the connection at the other end while pressing on it to make sure it is seated correctly. Repeat this procedure with the second header. Now, remove the tape and turn the board over and check to make sure both headers are aligned and even. If not, reheat and reposition the leads until it is correct. Once the headers are in place, solder the remaining 12 connections.

Repeat the procedure for the four and six-pin male headers located across the board on the other side of the breadboard grid.

The last connector to solder on the bottom of the board is the female header from which you removed a pin. Look at the picture for placement. Make sure the missing pin is located on the correct side. If it is reversed, it may not fit next to the processor on the Arduino board. Tape the header down and solder as before making sure it is flush to the board and aligned before soldering the center connection.

Now, all that's left is to install the female headers to the top of the board and three pins to connect to the LEDs and input switch. Turn the board over so you're looking at the top. Insert the two 8-pin female headers in the proper holes next to the 8-pin male headers (on the other side of the board). Use tape to hold them in, and use the same method of tacking down the opposing ends, then reheating to make sure the connectors are flush and square with the board. When you're satisfied with the positioning, solder the remaining 12 connections.

Repeat for the six and four-pin connectors as well as the 6-pin connector at the end of the board for bluetooth.

We're down to the last three connections. Prepare three single-pin male headers by snipping them off the row of remaining pins.

Using tape to hold them, insert the short end of a pin in the board for each of JC1, JC2, and JC3. These are a little tricky being so small, but take your time to make sure they're positioned correctly. Turn the board and solder each connection. You can reheat and reposition if necessary.

Before you plug the ProtoShield board into the Arduino, there's one final thing to do. It turns out that the switch labelled "s2" is right over the casing for the USB cable on the Arduino and will short out if it's not insulated. First make sure the leads from the switches are trimmed close to the board.

Then, cover the bottom of the board with some electrical tape (I used two layers) so the switch doesn't contact the USB casing. Another option would be to cover the USB case with tape instead of the circuit board. Either should work fine.

That's it. You're done assembling the ProtoShield. If you're going to use the Shield for experimenting, I highly recommend that you get the small solderless breadboard that SparkFun also sells. It has foam tape backing and can be attached to the top of the finished ProtoShield as shown in this photo:

Using the ProtoShield

So, now that you've finished the ProtoShield, you might be asking yourself "now, what?" Here are a couple of quick examples using the blink_led and digital_read_and_blink sketches (programs) from the Arduino web site. These examples assume you've installed the necessary drivers and the IDE from the Arduino site. There's extensive documentation there, so I won't duplicate it here.

First, mate the ProtoShield and the Arduino board. To do this, line the headers and pins up carefully and apply pressure until they are firmly seated.

I made several simple jumpers from solid copper wire (#22, I think). On one end I soldered a small alligator clip and on the other I removed about 1/4" of insulation. These allow me to easily connect an i/o pin or breadboard location to either of the LEDs or the switch on the ProtoShield.

When you install the development environment for the Arduino (IDE), numerous example sketches are included. You can find them in the File>Sketchbook>Examples menu. "led_blink" is a very simple sketch to hook up (with or without the ProtoShield).

Here's one way to do it with the shield. All you have to do to connect an LED on the ProtoShield to the digital output pin using one of alligator jumpers. Insert the bare end into #D13 and attach the clip to JC3 (or JC2). Then load and run the sketch according to the instructions on the Arduino site. Since the ProtoShield extends the reset button from the Arduino board to the Shield, it's easy to press it just before uploading the sketch from the IDE as required. If all works well, the LED should begin blinking after a few seconds.

The second example, digital_read_and_blink, uses the switch and an LED.

The switch is wired to pin #D7. To do this, connect a jumper between #D7 and JC1. For the LED, use the same wiring as before between pin #D13 and JC3 (or, JC2). As with the LEDs, the ProtoShield has already wired the switch correctly with the 10k resistor so that you don't need to duplicate this wiring when using it. Loading and running the digital_read_and_blink example should work.

That's it. I hope this guide to assembly and use of the ProtoShield has been helpful. Happy processing!

Posted by bob | 1:18 AM | permalink

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?