You say you want to hook up a TFT display to an Arduino? Are you joking?
No! For about the price of a familiar 2x16 LCD, you get a high resolution TFT display. For as low as $4 (shipping included!), it's possible to buy a small, sharp TFT screen that can be interfaced with an Arduino. Moreover, it can display not just text, but elaborate graphics. These have been manufactured in the tens of millions for cell phones and other gadgets and devices, and that is the reason they are so cheap now. This makes it feasible to reuse them to give our electronic projects colorful graphic displays.
There are quite a number of small cheap TFT displays available on eBay and elsewhere. But, how is it possible to determine which ones will work with an Arduino? And what then? Here is the procedure:
An assortment of cheap TFT LCDs ($20 ought to get you three or four)
Before you buy, check for Arduino compatibility!
For prototyping and testing:
Tools
We'll begin with a simple one. The ILI9163 display has a resolution of 128 x 128 pixels. With 8 pins in a single row, it works fine with a standard Arduino UNO or with a Mega. The hardware hookup is simple -- only 8 connections total! The library put together by a smart fella, by the name of sumotoy, makes it possible to display text in multiple colors and to draw lines.
Note that these come in two varieties, red and black. The red ones may need a bit of tweaking to format the display correctly -- see the comments in the README.md file. The TFT_ILI9163C.h file might need to be edited.
These babies are quite cheap. See, for example, on eBay: $3.38, delivered all the way from China!
Hardware connections:
LCD pin Arduino pin ------- ----------- 1 LED (backlight) Vcc (3.3v) 2 SCK (slave clock) D13 3 SDA (MOSI) D11 4 A0 (DC) D9 5 RESET Vcc (3.3v) 6 CS (SS) D10 7 Gnd Gnd 8 Vcc Vcc (3.3v)
As mentioned, sumotoy created a library to drive this display. Download the library from sumotoy's site.
This one is a 1.44" display with a resolution of 128 x 128 pixels, and it uses an ITDB18SP driver.
It is 5-volt friendly, since there is a 74HC450 IC on the circuit board that functions as a level shifter. These can be obtained for just a few bucks on eBay and elsewhere, for example -- $3.56 delivered from China. It uses Henning Karlsen's UTFT library, and it does a fine job with text and graphics. Note that due to the memory requirement of UTFT, this display will work with a standard UNO only with extensive tweaking -- it would be necessary to delete pretty much all the graphics in the sketch, and just stay with text.
The hardware connections:
On 11-pin connector -- LCD Pin Arduino Pin 1 Vcc Vcc (3.3v or 5v) 2 Gnd Gnd 3 Gnd Gnd or N/C 4 N/C 5 N/C 6 LED Vcc (3.3v or 5v) 7 CLK SCK D13 / D52 on Mega or Due 8 SDI MOSI D11 / D51 on Mega or Due 9 RS D9 10 RST reset D8 11 CS SS D10 / D53 on Mega or Due
Note that the 8-pin connector is not used.
...
Example sketches for Uno and Mega/Due:
This baby has a row of 11 pins and a second row of 5 pins parallel to it
on the far side of the display. It has 220x176 resolution (hires!) and will accept either 3.3 or 5 volts. It will work hooked up to an Uno, and with a few pin changes, also with a Mega. The 11-pin row is for activating the display itself, and the 5-pin row for the SD socket on its back.
The hardware hookup:
LCD Pin Arduino Pin ------- ----------- 1 Vcc Vcc (5v or 3.3v) 2 Gnd Gnd 3 Gnd Gnd or N/C 4 N/C (not connected) 5 N/C 6 LED (backlight) D3 7 CLK D13 (SCK) 8 SDI D11 (MOSI) 9 RS (register select) D9 10 RST (reset) D8 11 CS (chip select) D10
More information about this display
...
Example sketches for Uno and Mega
This one is a 2.2" (diagonal) display with 176x220 resolution and parallel interface. It has a standard ("Intel 8080") parallel interface, and works in both 8-bit and 16-bit modes. It uses the S6D0164 driver in Henning Karlsen's UTFT library, and because of the memory requirements of same, works only with an Arduino Mega or Due. It has an SD card slot on its back
It's a bit more expensive than the other displays we've discussed, see:
http://www.ebay.com/itm/310698848443
http://www.dx.com/p/elecfreaks-tft01-2-2-2-2-tft-l...
The hardware hookup is likewise a bit more complex. The pins are labeled on the back of the display.
LCD Arduino Mega/Due ---------------------------------------- DB08 D22 DB09 D23 DB10 D24 DB11 D25 DB12 D26 DB13 D27 DB14 D28 DB15 D29 RS (register select) D38 WR (read/write) D39 CS (chip select) D40 RST (reset) D41
Note that in 8-bit mode, the lower eight data lines, DB00 - DB07, are not used.
More information about this display.
The UTFT library.
An example sketch:
This one is a bit of an oddball. It's a clone of the more common HY-TFT240, and it has two rows of pins, set at right angles to one another. To enable the display in 8-bit mode, only the row of pins along the narrow edge is used. The other row is for the SD card socket on the back, and for 16-bit mode. To interface with an Arduino ( Mega or Due), it uses Henning Karlsen's UTFT library, and the driver is ILI9325C. Its resolution is 320x240 (hires!) and it incorporates both a touch screen and an SD card slot.
Buy it here.
http://www.ebay.com/itm/141197618099
At $7.50 + $1.19 postage, this is the most expensive of the displays discussed here, because of the high resolution and the touch screen.
Hardware connections:
The TFT uses the 18-pin connector (J3) along the short side of the display.
Display 1 2 3 4 5 6 7 8 9 Gnd Vcc N/C RS RW RD DB10 DB11 DB12 Arduino Gnd Vcc D38 D39 Vcc D22 D23 D24
Display 10 11 12 13 14 15 16 17 18 DB13 DB14 DB15 DB16 DB17 CS N/C RST N/C Arduino D25 D26 D27 D28 D29 D40 D41
Notes:
The UTFT library:
http://www.rinkydinkelectronics.com/library.php?id=51
Having determined that a particular TFT display will work with the Arduino, it's time to think about a more permanent solution -- constructing hard-wired and soldered plug-in boards. To make things easier, start with a blank protoshield as a base, and add sockets for the TFT displays to plug into. Each socket row will have a corresponding row next to it, with each individual hole "twinned" to the adjacent hole in the adjoining row by solder bridges, making them accessible to jumpers to connect to appropriate Arduino pins. An alternative is hard-wiring the socket pins to the Arduino pins, which is neater but limits the versatility of the board.
Note that the sockets are made from 0.1" female header strips.
The key to an effective DIY shield is a neat and logical layout. Sketching the prospective shield on quadrille (graph) paper may be helpful. A multitester or continuity tester might be useful for detecting wiring and soldering errors.
Here is an ILI9163C 128x128 pixel LCD display socketed in a mini hackduino board.
With the appropriate sketch loaded into the ATM328, it acts as a dedicated display for the Mighty Ohm geiger counter.
What we have learned:
Driver Resolution Uno Mega Due (pixels) --------------------------------------- ILI9163C 128 x 128 X ITDB18SP 128 x 128 X* X X ILI9225 220 x 176 X X X** S6D0164 220 x 176 X X ILI9325C 320 x 240 X X
* Works on Uno in text mode only.
** Should work, but needs tweaking.
"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better." -- Samuel Beckett
These would be nice topics for future Instructables.