Introduction: Pi to Display Fairly Simple
This is about connecting a Raspberry Pi directly ( that is without extra circuitry) to a 2 x 16 character LCD display. It works on all models except that odd plug-in one. Four connection methods can be used. In DIRECT there are only three components plus a USB battery (see photo) (OK, I've shown a terminal to connect the battery to). The other methods use an intermediate board which connects LCD Character Display to the Raspberry Pi pins. The software, apart from changing the GPIO addresses, is the same for each.
You will need:
1. the display. The common one is 2 x16 characters (£1.50 Sodial) or any other in the range 2 x 8 to 4 x 40.
2. a 2 x 13 pin socket for the pins on the Raspberry Pi (or the 2 x 13 plug for a ribbon cable) (90p each)
3. a 10kohm miniature variable resistor (potentiometer) (24p)
4. For three of the layouts a piece of 0.1" matrix board ( minimum size 1.5 x 4.5 cm) (Kemo EO13 @cpc.co.uk) To break the (16 x 10 cm) board into strips, deeply score a line along the "clear" line with a craft knife, on both sides and snap. If it doesn't snap score it deeper. Score and snap to length. ( Hint make 6,or 9 or12 or more wide. Length 16 holes minimum.
Long nosed pliers, thin insulated link wire, pins, soldering iron and solder.
The connections from the Raspberry Pi are 6 GPIOs , +5v and 0v
The software on a memory card, can have a routine for LCD character displays (on wiring pi.co. uk. or RpiBlog) The software must run Python after loading. The difficulty with the direct connection is that all 26 pins of the Raspberry Pi are covered and more connections can't be made. (See why below) When using an intermediate board, it allows other connections to be made (Using a 40 pin Raspberry Pi and a 26pin socket allows connections to be made to 14 pins. Note that if using the 26pin socket on 40 pin Raspberry Pis the end of the socket may bend pins 27 and 28 ) The software can be written to test the unused pins. Can also be used to check the polyfuses. When using an intermediate board I2C and buffers made be added (see diagrams)
Push the pins of the socket through the holes in the edge of the display.
Look carefully at the other row of pins on the socket The display has gold plated strips that go right to its PCB edge, and very close to that row of pins. Much to close to connect to and not touch the display board. Pull them out!
WHICH ONES ?
The ones that will blow up, damage and stop the Raspberry Pi if they touch other pins. Others that are not required.
+5v pins 2 and 4 Blows fuses (4 is next to 0v(6) specially for this) and are "fairly likely to damage " ( Quote from Raspberrypi.org ) if touched to the Gpio pins (e. g. pin 3).
+3v3 pins 1 and 17. Either to 0v are show stoppers. Pin 17 is a pest! Take 50mA from 3v3 (eg LEDs) and the software throws a wobbly. It is probably better to use an external 3v3 supply for I2C and SPI
0v Do we need all of them (to short out things)? Pins 6, 9, 14, 20, 25, (and 30, 34, 39 ) .Only one is essential..
"Others" will make contact /connection along the edge and on the back of the LCD board. (DIRECT only)
Luckily it is easy to remove and replace the socket connections.
PULLING OUT THE SOCKET CONNECTIONS (not the Raspberry Pi ones)
Grab a pin with the long nosed pliers a little way from the bottom and push down. Now press down with the pliers closed until it is level. On the other side grab the pin sticking out with the pliers and pull out. To replace just push in.
ASSEMBLING DIRECT TO SOCKET. (See Connection Methods )
Remove all except the seven pins 3, 6, 7, 18, 19,21, 23. Put the display board on the pins (check two free holes on the left) and solder five pins. Now put a bit of solder on the two remaining pins, a bit of solder on the edge of the display nearest to each pin and it bridges! With thin wire, link hole 5 to hole 1, down and back to hole 16. Now link hole 2 to hole 15. Shorten the wiper (the middle) leg of the potentiometer and push into hole 3. Push the other two into the holes 1 and 2 on the display. Now solder. Two connections to the USB battery are required from 16 ( 0v) and 15 (+V). (yes, two thin wires will go in a hole).
(Note that in the figure shown in "application", the battery is not essential as the display can be powered from the Raspberry Pi , and the display has been moved to right. Look carefully, hole 1 only is visible at the left end of the display. In "application", Pin 5 on display is wired to pin7 on socket not to 0v. If this is an issue, cut off pin 7 as well and make link as above.)
ASSEMBLING THE "RIGHT ON BOARD "
Remove pins 4, 6, 20. Yes only remove three. Put tri-pad board on 2 x13 socket copper side up and (important!) a clear gap between pads up the centre of the board. Check that one hole is clear on the left hand side. Solder the potentiometer on the bottom, close alongside the end of the socket, wiper (w) on right. Solder pins 2, 8, 10, 22, 24, 26 19 and 9. Make solder bridges from 19 and sideways from 8. (see Building Methods) Solder in seven pins (see Building Methods) to align with holes 2, 4, 6, and 11, 12,13,14 on the display.
The 0v link. Solder wire through tri-pad by 9; This then goes through hole for 0v (under hole 1) at the end of 2 x 13 socket; solder but leave 2cm of stripped wire above the board. After putting and soldering the display on the pins, it will go through the display at hole 1 (insulate) then link to hole 5. Note gap between display and board must greater than 0.2 cm to avoid shorting the back of the display on the intermediate board.
ASSEMBLING " LEFT ON BOARDS"
Remove pins 1, 3, 4, 9, 25. Align tri-pad board on socket (as above). Solder pin 2, 5, 6, 10 , 19,21, 23, 26. and make solder bridges at 2 4* 10, 26. Solder in potentiometer in convenient place (w to 4*) Solder in 8 pins (note;- for LOWER, pins can go on display ) for holes 2, 3, 4, 6, 11,12,13,14. Fit 0v link from pin 6 to under hole 1 up to hole 1 and then to 5. Check the back of the display for a (usually 100ohm) current limiting resistor. If so, the LED can be connected to +V and 0v directly from the display, or be linked to the intermediate board ( if it is long enough).
The possible positions of buffer integrated circuits ULN2003/2803) are shown mounted below the board. The intermediate board has to be at least 9 holes wide to accommodate either buffer. If ends of resistors are used instead of pins or tactile switches mounted on top of the intermediate board the mess is as photo.. "Blob" board can be used but requires a lot of careful soldering (but less pin pulling). Strip board requires a bit of cutting and a lot of links. Excellent description of connecting directly via a prototype board with software on RpiBlog.