Arduino Mini-Shields

by JmsDwh in Circuits > Arduino

90335 Views, 974 Favorites, 0 Comments

Arduino Mini-Shields

532fafe2c6ba5dd45f000035.jpg
temp_-1509327911.jpg
temp_859262312.jpg
temp_515358651.jpg
P1100270.JPG
temp_-1743004976.jpg
P1100252.JPG
temp_1780645535.jpg
temp_-1738124504.jpg
temp_-1698143141.jpg

This is a set of simple, small form-factor, mini-shields that I created almost by accident. As I made more and more of them, I realized that they could be really useful. What started out as a way to use some spare parts, turned into a standardized form factor for a versatile, miniaturized Arduino shield. The added benefit is that they also make a great kit for traveling, or simplified prototyping or for educating kids and beginners about Arduino.

I have been building some custom shields and modules for a while now but while I like the modularity of a shield, they are a little too expensive and large if all you want to add is just a little piece. The modules I make are all small and have to be plugged into a breadboard, which doesn't have that satisfying, finished feeling I'm looking for. I buy a lot of perf board, but the Arduino boards have this annoyingly unusual spacing between the digital pin banks so you have to modify the pins to make them fit. I needed something that was more flexible, lighter weight, and allowed me to change the pins used more easily to avoid conflicts with other shields.


The Mini-Shield Standard
I started making these small modules with standardized pinouts that are mostly plug and play. I call them Mini-Shields and they include everything you need for almost any application. The first 3 pins from the right of each board are connected to the 5v, ground and Digital 2 pins from the Arduino. All of my mini-shields use the following standard and they work pretty well with each other.

Pin |  Pin Function
1    |  5v
2    |  Gnd
3    |  Digital 2 (Hardware Interrupt)
4    |  Analog *
5    |  Digital (PWM)
6    |  Digital (PWM)
7    |  Analog **
8    |  Digital
9    |  Digital (PWM)
* the Real Time Clock module requires analog pin 4
** the Real Time Clock module requires analog pin 5


I liked the idea that these little modules could be added to almost any other shield and you could swap them out as needed. I would then also be able to reuse them in different projects without too much effort. The standardized pinout meant that every one of them could be used in place of the others if everything was wired correctly. Once they are built, they make a good little, rapid prototyping set that would also work as an entry level set for Arduino beginners.

Shield of Mini-Shields
I made a single shield with space for any 3 mini-shields to be connected at the same time. Each mini-shield uses 2 analog pins, and 4 digital pins (plus digital pin 2 which they all share since I have dedicated it for the hardware interrupt feature). I needed to dedicate analog pins 4 and 5 to slot A to ensure the Real Time Clock module would work. Of the 14 digital pins, there are only 6 PWM pins available, so I have dedicated slots B and C to be the PWM mini-shields, so things like the speaker and the full-color LED won't work well if they are plugged into slot A.

 

Parts and Methods

temp_-1990126523.jpg
temp_-462594912.jpg
temp_-1668663713.jpg
temp_-1990126523.jpg
temp_1265561265.jpg
temp_1533137650.jpg
temp_-1504593990.jpg
P1100226.JPG
P1100162.JPG
P1060085.JPG
P1100244.JPG
P1100224.JPG
When all was said and done, I built 7 of these mini-shields. I just kept digging through my spare parts and finding things I could make another board out of. These are the current mini-shields and the main parts that go into them:

IR Mini-Shield - A salvaged IR sensor, a salvaged LED, and 2 buttons
Debounced Button Mini-Shield - An RC circuit with an inverting Schmidt trigger to debounce the output from a tactile switch.
D Pad Mini-Shield - 5 button directional pad connected to a single analog pin
Bar Graph Mini-Shield - Uses a shift register to light an 8 segment LED Bar graph with only 3 digital pins.
RGB Mini-Shield - An RGB LED & trimmer pot + 2 buttons.
Real Time Clock Mini-Shield - an adapter to use my off the shelf RTC module.
Theremin Mini-Shield - A salvaged PC speaker, photo cell & 2 buttons.

Headers
I made all of these mini-shields with parts I had on hand but I hadn't gotten a chance to use. I always keep a lot of male and female headers on hand. More and more, I like to use these right angle headers which only come as male headers, but I have found you can also bend the pins on the female headers to make them lay down along the board as well. I like the 10 packs of straight and right angle headers that they sell at Schmartboard. Most other places only sell the header strips in singles. Unfortunately, they don't sell the female headers there.

Perf and Proto Boards
I bought a couple of 2 sided, through-hole plated proto boards that I never found a use for. This project gave me a good chance to use them, but once I used the 2 I had, I started cutting pieces off a large perf board that I got at Radio Shack.

Resistors, Capacitors and Components
At some point I stopped buying one type of resistors and I started buying the assorted packs. It's a much better deal and it's more convenient to use something you have on hand than to run to the store and hope you remember all of the things you needed. If you have a bunch to choose from, you can usually mix and match something to work for you.

Buttons
I have been using a lot of buttons lately, and I ran out of new ones but I had a bunch that I salvaged out of an old DVD player so I was able to reuse those as well. When I junk old electronics, I open them up to see what could be useful. If I find anything good, I cut the parts out with a pair of tin snips and put them away. If I need them later, I will use some desoldering braid to remove the solder and free the part from the circuit board. I used the same process for the buttons, the IR LEDs and the IR sensor that I used in this project.

My Method
The wire I use in my projects is just solid core UTP network wire. I have a big spool of wire, so every so often I cut a few feet off and strip off the outer sheath. The wires inside use the standard CAT5 standard, so I don't have red and black wires like I would prefer. Instead I use Orange for Red and Green for Black. I use Blue for switches and other digital pin leads. I use White Blue or White Green for data and analog pin leads.

Header Markings
I used some paint pens to mark the header pins with colors so you can easily tell what pins are necessary and how they should be hooked up to an Arduino from a breadboard. I marked the 5v pins with Red and the GND pins with Green. I marked digital pins with Blue and I marked analog pins with Yellow. I marked the PWM (digital) pins with White, but I put a dot of color in the middle. For the Full-Color LED, I matched the dot to the color that the pin relates to on the LED. I mark the female header pins with white masking tape and fine tip permanent markers using the same color scheme as above.

IR Mini-Shield Construction

532b0f0d2f7cc6aee10000d2.jpg
2012-07-09_23-42-48_200.jpg
P1100244.JPG
P1100224.JPG
P1100227.JPG
temp_1276588610.jpg
temp_1484570682.jpg
P1100277.JPG
P1100280.JPG
temp_1265561265.jpg
temp_685712516.jpg

This was the first mini shield. I had some parts I wanted to add to my Time and Temp shield, but I had no more room on the shield for the parts. I decided to put them on a daughter board with header pins so it's removable and reusable. I had a few of these 9 x 9 hole proto boards that I hadn't found a use for but it turned out 9 holes was exactly the right size for this project.

I salvaged a few IR LEDs out of old TV remotes, and an IR Receiver from an old A/C unit that I thought I could use on the Time and Temp shield. I also thought it would be nice to add a few buttons, so that I could make a menu for the display.

IR LED
First I tested the IR LED from the remote with 5v from the Arduino. I had to look at the LED through my camera to see the infrared glowing. The camera showed that the LED worked fine but it did get hot, so I assumed it was getting too much power. I tried a few different resistors until I didn't see too much difference between full brightness and when the resistor was placed in series with the led. With a 47 ohm resistor, the LED doesn't overheat anymore and still shows full brightness on the camera screen.

IR Sensor
I found a little information on Adafruit about a similar IR Sensor. The board I took this from had markings that indicated the + and - leads were the same as Adafruit's guide said, so I soldered it along the top of the proto board for clearance of the sensor's eye.

Buttons
I had some extra room, so I had to put a couple tactile buttons in place to fill up the space. I like having extra buttons on my projects because there is always a reason to have some way to trigger a process, especially when you are testing something.

Debounced Button Mini-Shield

temp_1630260444.jpg
Debounce.gif
temp_685712516.jpg
temp_515358651.jpg
temp_567734755.jpg
temp_1265561265.jpg
temp_685712516.jpg
temp_1065793196.jpg
temp_-1489834588.jpg
temp_-1567026124.jpg
temp_1951480803.jpg
temp_515358651.jpg
temp_567734755.jpg
temp_-1984584311.jpg
temp_574978889.jpg
temp_-1651899860.jpg
temp_420179451.jpg
temp_1634571396.jpg

I had another of these 9x9 through-hole plated proto boards so I figured I would make another module that I could use in the same port. I have a section of one of my breadboards devoted to a hardware debounced switch. This way I can hook the switch up to the hardware interrupt on Arduino and begin a new instruction in the middle of a loop. The interrupt pins need to be debounced with hardware because there is no way to use the wait delay to debounce on the interrupt.

There is a really good explanation of hardware debouncing and interrupts on these websites...
http://www.jeremyblum.com/2011/03/07/arduino-tutorial-10-interrupts-and-hardware-debouncing/
http://arduino.cc/en/Reference/attachInterrupt#.UyXvl4XLIyz

Directional Pad Mini-Shield

temp_-1958121821.jpg
Dpad.gif
temp_567734755.jpg
temp_-1921079255.jpg
temp_1631294643.jpg
temp_574978889.jpg
temp_567734755.jpg
temp_-1489834588.jpg
temp_1065793196.jpg
temp_-1743004976.jpg
temp_-1984584311.jpg
temp_515358651.jpg
temp_-1929106661.jpg
temp_1663136283.jpg
temp_-1269641210.jpg
temp_-1489834588.jpg
Serial Monitor.PNG
Serial Monitor3.PNG

Since the original idea was to add some new inputs for my Time & Temp shield project, I thought a directional pad would be nice. I remembered this post on the Arduino site that only uses 1 analog pin for all of the buttons. Because the resistances are mapped out so nicely, it even allows for the Arduino to recognize combinations of any 2 keys pressed at the same time.

I was trying to use parts I had on hand and I was running out of buttons, so I had to salvage 4 of these buttons from the A/C unit's control panel. I have a set of standard resistors from Radioshack that is getting a little picked over, but I was still able to make something work by combining a few resistors to get the desired resistance.

I had to use 4 resistors for buttons 2 and 3 to make the 390 and 680 values described in this example, and as a result my actual resistance was slightly different, so I had to run the following test code to see what the analog reading would be for each button, and update the button array to allow for these values (usually 1 number above/below the example on the Arduino site).


Test Code:

int analogpin = 3; // analog pin to read the buttons

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println( analogRead(analogpin));
}

Bar Graph Mini-Shield

temp_-1587101826.jpg
Bar_Graph.gif
Bar-Graph-Mini-Shield.png
temp_-59273479.jpg
temp_219440598.jpg
temp_-1921079255.jpg
temp_919049309.jpg
temp_-59273479.jpg
temp_-1958121821.jpg
temp_-1990126523.jpg
temp_46111501.jpg
temp_-1587101826.jpg
temp_160618122.jpg
temp_-1668663713.jpg
temp_-722464580.jpg
temp_-754511188.jpg
temp_-910028189.jpg
temp_-316812471.jpg
temp_919049309.jpg
temp_1630260444.jpg
temp_-1921079255.jpg

I was thinking of other things that would be useful as a mini-shield and I thought I might like to have an LED bar graph circuit, complete with a shift register on it. I have a nice tricolor bar graph, but its a 10 segment one, and my shift register is only 8 bits. I remembered I had these 8 segment (2 per line) LED displays with a strange pinout and I figured this would be a good chance to use them.

With the shift register driving the LED display on the mini-shield, I can get away with only using the 3 digital pins to light up all 8 LEDs. Otherwise, I couldn't put this on the mini shield since I only have 4 digital pins dedicated to each mini shield. Even if I used the shared pin 3 on the mini-shield connector, I would only have 5 digital pins to drive 8 segments. The shift register makes it possible to drive more LEDs without exceeding your available pins.

Parts
74HC595 Shift register - These shift registers are great for increasing the number of output pins so you can drive many LEDs from just 3 pins on the Arduino. You can daisy chain them together to get even more output pins, you only need to change your code to allow for the additional shift registers. There is a good tutorial for these here.

LED 8 segment bar graph - I have these in a couple different colors because I was trying to string a lot of them together with daisy chained shift registers. The ones I used here were not what I expected so they were never used.

Resistor Network - I have 2 different kinds of these, Isolated and Bussed. This one is isolated so it contains 8 separate resistors, but I dragged a line of solder down the outgoing leads to tie the grounds together. If I had used the bussed one, I could have just used the one common lead for the ground, but I would have been wasting 7 additional resistor leads.







RGB LED Mini-Shield

532871bf9d29c9adc6000072.jpg
RGB_LED.gif
Full-color-LED-mini-shield.png
temp_2072763858.jpg
temp_-1990126523.jpg
temp_219440598.jpg
temp_-1668663713.jpg
temp_-784731053.jpg
temp_-1946583991.jpg
temp_-1921079255.jpg
temp_-1958121821.jpg
temp_-1587101826.jpg
temp_160618122.jpg
temp_-784731053.jpg
temp_157813473.jpg
temp_-754511188.jpg
temp_1386207969.jpg
temp_-1990126523.jpg
temp_919049309.jpg
temp_-316812471.jpg
temp_1215712656.jpg
temp_-1474340217.jpg

I have a few different kinds of full color RGB LEDs that I occasionally hook up on a breadboard, but when I need space on a breadboard they go right back in a drawer. I thought one of these might make a good mini shield. To take up the rest of the space, I included a few more buttons and a trimmer pot because they are always handy.

I went to the product page on Sparkfun and looked at the datasheet. These have apparently been discontinued, but it's basically the same idea for any full color RGB LED. This one happens to be a common cathode LED, if you have a common anode LED, wire the common pin to 5v instead of to the ground like I did.

To pick the resistors, I went to this page and plugged in the values I got from the product page. This site recommended a 150Ω resistor, but the LED was still too bright and hurt my eyes to look at it, so I ended up going with 220Ω resistors.

I soldered the LED, the 2 switches and the 10k trimmer pot to the perf board first, then I worked on adding the other pieces. I tied the 5v leads and the ground leads together and worked on tying the LEDs, and switches to the digital pins and the wiper of the potentiometer to one of the analog pins. If I had thought more about this, I would have reversed the polarity on the trimmer pot, because I have to turn the knob to the right to decrease and left to increase, which is counter-intuitive.



Theremin Mini-Shield

53305885c6ba5df0f3000028.jpg
Theremin.gif
temp_-1492915935.jpg
532b0fc22f7cc6be8d000118.jpg
temp_-1504593990.jpg
temp_1533137650.jpg
temp_-1270065942.jpg
temp_-1871390386.jpg
temp_2019930634.jpg
temp_1125045086.jpg
temp_-1531803194.jpg
temp_-363737712.jpg
temp_-507475121.jpg
temp_418279932.jpg
temp_-2131226474.jpg
temp_538037312.jpg
temp_122985993.jpg
Photo-Cell Serial Monitor.PNG

This one originally started out as just a speaker shield because I had a PC speaker I salvaged from an old motherboard. Then I remembered I had a Photoresistor or Light Dependent Resistor (LDR) that I salvaged from a nightlight and I decided halfway through the project to include the LDR as well. So I decided to bundle the parts necessary for a pseudo-theremin onto one mini-shield.

I used these guides on Adafruit for the general circuit layout and code.
http://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds/pseudo-theramin
http://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds/arduino-code

Real Time Clock Mini-Shield

533650d0d535cf651d0000a9.jpg
temp_-1408019937.jpg
temp_2019930634.jpg
temp_1792949945.jpg
temp_1226443529.jpg
temp_23362848.jpg
temp_-1756754398.jpg

I like this Real Time Clock module a lot. It allows you to keep perfect time while your Arduino is busy doing other things. I added some female headers to another project to allow me to plug this in and use it, but now I want to be able to use it as a mini-shield, so I decided to make an adapter board.

This module is really simple to wire up, it only needs 5v power, ground, and analog pins 4 and 5. To make this adapter, I just needed to wire up the Arduino's analog pins 4 and 5 as the 2 analog pins in the mini-shield connector.

Adafruit has a very nice guide to using this module with Arduino.

Shield of Mini-Shields

temp_-870038514.jpg
Shield of Shields.gif
Shield of Mini-Shields_pcb.png
temp_1630260444.jpg
temp_-59273479.jpg
temp_-1587101826.jpg
5329bba0dbf3ec50420000fb.jpg
5329bde7dbf3ec7930000024.jpg
temp_-1756754398.jpg
532b10992f7cc63aef00006a.jpg
temp_-1523549787.jpg
temp_-1695547764.jpg
532e1679f92ea1ab96000035.jpg
temp_-1408019937.jpg
temp_1484570682.jpg
532e189af92ea1ab96000037.jpg
temp_-1698143141.jpg
temp_276555560.jpg
temp_1649609766.jpg
temp_2019930634.jpg
temp_756140882.jpg
temp_75771935.jpg
temp_-1474340217.jpg
temp_-1531803194.jpg
temp_1577020848.jpg

After I had a few of these mini shields, I thought I might like to use them together on one shield. That way I could have a nice ready-made kit that would allow many different combinations of sensors and outputs. I made a new full size shield that I could plug up to 3 mini shields into. 2 ports are vertical and 1 is laying down.

When I laid out the pins, I had to think about what kind of mini-shields would go where. The RTC mini-shield needs to have analog pins A4 and A5 because they aare required by the library. My RGB LED and Theremin mini-shields both need 3 PWM capable pins, and since the UNO has 6 PWM pins, I would like to use 3 for shield B and 3 for shield C. My debounced button mini-shield needs to have either digital pin D2 or D3 to access the hardware interrupt, since D3 is also a PWM pin, I decided to use D2. Since I really only need this for 1 shield right now, and I can't imagine needing 2 interrupting shields, I decided to connect D2 to all 3 mini-shield ports.

As I explained earlier, this is the standard mini-shield pin layout:

Pin | Pin Function
1 | 5v
2 | Gnd
3 | Digital 2 (Hardware Interrupt)
4 | Analog *
5 | Digital (PWM)
6 | Digital (PWM)
7 | Analog **
8 | Digital
9 | Digital (PWM)
* the Real Time Clock module requires analog pin 4
** the Real Time Clock module requires analog pin 5

And here is the layout for all 3 mini-shield header ports:

Mini-Shield Pin | Arduino Pin

A1 | 5v
A2 | Gnd
A3 | Digital 2 (Hardware Interrupt)
A4 | Analog 5 (Required for RTC module)
A5 | Digital 7
A6 | Digital 8
A7 | Analog 4 (Required for RTC module)
A8 | Digital 12
A9 | Digital 13
---------------------------------
B1 | 5v
B2 | Gnd
B3 | Digital 2 (Hardware Interrupt)
B4 | Analog 3
B5 | Digital 9 (PWM)
B6 | Digital 10 (PWM)
B7 | Analog 2
B8 | Digital 4
B9 | Digital 11 (PWM)
---------------------------------
C1 | 5v
C2 | Gnd
C3 | Digital 2 (Hardware Interrupt)
C4 | Analog 0
C5 | Digital 3 (PWM)
C6 | Digital 5 (PWM)
C7 | Analog 1
C8 | Digital 1
C9 | Digital 6 (PWM)




Adding Mini-Shields to Existing Projects

temp_-1688014317.jpg
temp_973291778.jpg
P1100221.JPG
P1100226.JPG
P1100162.JPG
temp_-1829743341.jpg
temp_1705786901.jpg
temp_2099081674.jpg
temp_1649609766.jpg
temp_576730470.jpg
temp_1684087003.jpg
temp_1935907272.jpg

I bent some of the wires on the shield out of the way so I could squeeze the row of 9 female header pins in place.

I bent the pins on the headers so they will clear the screen and the module I built will lay flat. Unfortunately, I had to bend the header back up to solder in the holes underneath it. I don't know if it would have been simpler to solder the header in after I soldered the jumper wires to the Arduino digital pins, or if that would have caused other confusion. This worked out, but its tough to bend something flush to the board. Usually to get a perfect bend, you have to go slightly past where you want it, and I didn't have the room to do that here.

The Time and Temp shield was the first board I added the mini-shield port to, so this one was kind of shoehorned into place. I didn't come up with my pin standard until later, but this one still follows most of the standards I defined later.

The mini-shield on my tank robot is not finished yet. I need to decide what is important and what will not interfere with any of my other shields. Currently I have an DSRobot motor controller shield and a Sparkfun Xbee shield that the mini-shield port is soldered to in the prototyping area. The Xbee shield has a bluetooth module plugged into the Xbee port.

Finish

P1100252.JPG
P1100246.JPG
P1100255.JPG
P1100261.JPG
P1100304.JPG
P1100308.JPG
P1100306.JPG
temp_-1743004976.jpg
temp_-404199613.jpg
temp_1843491774.jpg
temp_1345886157.jpg
temp_-1181689916.jpg

I'm very happy with how these mini-shields came out. I have a couple others in mind for future projects and I think it would be handy to make a simple adapter for every pre-made module I can find. Specifically, I have my eye on an ultrasonic sensor adapter for my tank robot and a humidity sensor for my Time & Temp shield.