July 26, 2010

Arduino Custom Shield With Extra Long Stackable Headers

Since my custom Arduino shield for LCD (and analog-in) does not fit very well (in the picture my custom shield over the Ethernet Shield over the Arduino board) because the standard pin headers are a bit short,

I have created my own longer ones.I've taken standard male and female pin headers cut to size (two strips 8 pins long and one strip 13 pins long, both male and female, removing one pin in the middle of the 13 pins male one to adapt to Arduino strip). Then I've soldered toghether the corresponding male/female strips:

The strips fits very well on the board:

This way I won't have any problem in fitting any shield on top of any board...

July 18, 2010

Custom Arduino Shield (for LCD and Analog Input)

I got this cheap Arduino proto-board shield from the bay:

It has for example reset button, an extra momentary pushbutton, a couple of LEDs, a mini-pad to solder small SMD components and have access to them:

I wanted to make a custom shield to interface to an LCD (compatible with LiquidCrystal library) and to interface to three linear pots to get three different analog input sources. Since I wanted this shield to be stackable with the Arduino Ethernet Shield, I've chosen the following pin mapping for the LCD:

LCD:           Arduino:
 1 (GND) ----- GND
 2 (5V) ------ 5V
 3 (CNTR) ---- Trimmer
 4 (RS) ------ 7 (Digital)
 5 (RW) ------ GND
 6 (EN) ------ 6 (Digital)
 7 -----------
 8 -----------
 9 -----------
10 -----------
11 (D4) ------ 5 (Digital)
12 (D5) ------ 4 (Digital)
13 (D6) ------ 3 (Digital)
14 (D7) ------ 2 (Digital)
15 (+LGHT) --- +5V
16 (-LGHT) --- GND

This mapping means you need to initialize the LiquidCrystal library in the code as follows:

int numRows = 2;         // LCD number of rows
int numCols = 16;        // LCD number of columns
int pinRS = 9;           // LCD RS connected to digital pin 9
int pinEN = 8;           // LCD EN connected to digital pin 8
int pinD4 = 7;           // LCD D4 connected to digital pin 7
int pinD5 = 6;           // LCD D5 connected to digital pin 6
int pinD6 = 5;           // LCD D6 connected to digital pin 5
int pinD7 = 4;           // LCD D7 connected to digital pin 4

LiquidCrystal lcd(pinRS, pinEN, pinD4, pinD5, pinD6, pinD7);  // LCD library initialization

Here are the steps to add a strip to connect the three pots as analog inputs:

Here are the steps to wire a strip to connect the LCD (having also a trimmer for contrast adjustment and a jumper to enable/disable backlight):

Adding the female strips cut to size:

Here is the wiring of the analog inputs following the previous schema:

Here is the wiring of the LCD connector, following the previous schema:

Using a 90 degree bended strip:

making the 3-wire connectors for the pots:

then using a piece of cardbox to install the pots in a more useful panel (cuts thanks to an x-acto knife):

Then, preparing the LCD soldering a straight strip:

preparing the LCD connector after some cables salvaged from old electronics and a 90 degree bended strip:

and using another piece of cardbox to install the LCD and to host the shield behind the panel (cuts thanks to an x-acto knife):

Since the holes in the LCD are very thin, I opted for this fixing using single core wire and plastic tube for spacers:

That's all!

July 11, 2010

Easy Ethernet Crossover Adapter

Ordered an Ethernet Shield for Arduino... So I need an Ethernet cross cable... but I don't feel like making my own (I have plenty of straight cables around). That's why I moved to make an Ethernet Crossover Adapter, to be able to use any straight cable as cross-cable when needed.

Plenty of info on the Web on Ethernet Cables. From here the pinout of an Ethernet Plug:

And here is the different pin mapping of a straight through cable and a crossover cable:

So I've started sacrifying one cable to get this one (the paper strips for easy pin reference):

Using a normal ethernet patch-panel socket it's very easy to make connections...

...just passing the cables in the proper places following the Crossover pinout connection schema...

...pressing them well and cutting the extra cables...

...then using some insulating tape to finish it up:

To test it I've used a cheap LAN Cable Tester got from the bay. First, here is a straight cable:

and here is how it is connected (straight through pinout):

Then, after adding the Cross Adapter to the cable:

here is the new connections (crossover pinout):