1.8 tft display breakout and shield st7735r preliminary free sample

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

1.8 tft display breakout and shield st7735r preliminary free sample

Adafruit took their popular 1.8" TFT breakout board and remixed it into an Arduino shield complete with microSD card slot and a 5-way joystick navigation switch and three selection buttons! Since the display uses only 4 pins to communicate and has its own pixel-addressable frame buffer, it can be used easily to add a display & interface without exhausting the memory or pins.

New! Adafruit have updated this shield to be "Arduino R3" format compatible so you can now use it with any and all Arduinos or Metros - including the Metro M0 or M4, Arduino Mega, Zero, etc. They also use Adafruit seesaw for the TFT backlight, TFT reset, and button inputs - you can query the buttons and joystick over I2C now, so only 2 pins are needed to communicate with all 8 switches.

The 1.8" display has 128x160 color pixels. Unlike the low cost "Nokia 6110" and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!).

The shield has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as a ultra-low-dropout 3.3V regulator and a 3/5V level shifter so its safe to use with 3V or 5V Arduino compatibles. Adafruit also had some space left over so they placed a microSD card holder (so you can easily load full color bitmaps from a FAT16/FAT32 formatted microSD card), a 5-way navigation switch (left, right, up, down, select) and three tactile buttons marked A BC. The microSD card is not included.

If you just want to display text, shapes, lines, pixels, etc the shield uses the SPI pins (SCK/MOSI/MISO), I2C pins (SDA & SCL) and digital #8. For the microSD card, you"ll also give up Digital #4. This shield works with any Arduino UNO and compatibles, Mega, Zero, etc. If it"s shield compatible, you"re good to go.

Comes as a fully assembled and tested shield with the display, microsd card holder and nav switch as well as a stick of 0.1" header. To finish up and use, you will need to solder on the header onto the shield PCB, a quick 10 minute task.

Display current draw is mostly based on the backlight, with full backlight the current draw is ~100mA, this does not include the SD Card. SD cards can draw 20-100mA based on read/write. Measure current draw in circuit to get precise numbers.

1.8 tft display breakout and shield st7735r preliminary free sample

Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan Republic, Bahamas, Bahrain, Bangladesh, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bosnia and Herzegovina, Botswana, British Virgin Islands, Brunei Darussalam, Bulgaria, Burkina Faso, Burma, Burundi, Cambodia, Cameroon, Canada, Cape Verde Islands, Cayman Islands, Central African Republic, Chad, Chile, China, Colombia, Congo, Democratic Republic of the, Congo, Republic of the, Costa Rica, Croatia, Republic of, Cyprus, Czech Republic, Côte d"Ivoire (Ivory Coast), Denmark, Djibouti, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France, Gabon Republic, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guatemala, Guinea, Guinea-Bissau, Guyana, Haiti, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Ireland, Israel, Italy, Jamaica, Japan, Jordan, Kazakhstan, Kenya, Kiribati, Korea, South, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Liechtenstein, Lithuania, Luxembourg, Macau, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Mauritania, Mauritius, Mexico, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Namibia, Nauru, Nepal, Netherlands, New Zealand, Nicaragua, Niger, Nigeria, Niue, Norway, Oman, Pakistan, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Qatar, Romania, Rwanda, Saint Helena, Saint Kitts-Nevis, Saint Lucia, Saint Pierre and Miquelon, Saint Vincent and the Grenadines, San Marino, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Solomon Islands, South Africa, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Taiwan, Tajikistan, Tanzania, Thailand, Togo, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Turks and Caicos Islands, Tuvalu, Uganda, United Arab Emirates, United Kingdom, United States, Uzbekistan, Vanuatu, Vatican City State, Vietnam, Wallis and Futuna, Western Sahara, Western Samoa, Yemen, Zambia, Zimbabwe

1.8 tft display breakout and shield st7735r preliminary free sample

Hi guys, welcome to today’s tutorial. Today, we will look on how to use the 1.8″ ST7735  colored TFT display with Arduino. The past few tutorials have been focused on how to use the Nokia 5110 LCD display extensively but there will be a time when we will need to use a colored display or something bigger with additional features, that’s where the 1.8″ ST7735 TFT display comes in.

The ST7735 TFT display is a 1.8″ display with a resolution of 128×160 pixels and can display a wide range of colors ( full 18-bit color, 262,144 shades!). The display uses the SPI protocol for communication and has its own pixel-addressable frame buffer which means it can be used with all kinds of microcontroller and you only need 4 i/o pins. To complement the display, it also comes with an SD card slot on which colored bitmaps can be loaded and easily displayed on the screen.

The schematics for this project is fairly easy as the only thing we will be connecting to the Arduino is the display. Connect the display to the Arduino as shown in the schematics below.

Due to variation in display pin out from different manufacturers and for clarity, the pin connection between the Arduino and the TFT display is mapped out below:

We will use two libraries from Adafruit to help us easily communicate with the LCD. The libraries include the Adafruit GFX library which can be downloaded here and the Adafruit ST7735 Library which can be downloaded here.

We will use two example sketches to demonstrate the use of the ST7735 TFT display. The first example is the lightweight TFT Display text example sketch from the Adafruit TFT examples. It can be accessed by going to examples -> TFT -> Arduino -> TFTDisplaytext. This example displays the analog value of pin A0 on the display. It is one of the easiest examples that can be used to demonstrate the ability of this display.

The second example is the graphics test example from the more capable and heavier Adafruit ST7735 Arduino library. I will explain this particular example as it features the use of the display for diverse purposes including the display of text and “animated” graphics. With the Adafruit ST7735 library installed, this example can be accessed by going to examples -> Adafruit ST7735 library -> graphics test.

The first thing, as usual, is to include the libraries to be used after which we declare the pins on the Arduino to which our LCD pins are connected to. We also make a slight change to the code setting reset pin as pin 8 and DC pin as pin 9 to match our schematics.

Next, we move to the void setup function where we initialize the screen and call different test functions to display certain texts or images.  These functions can be edited to display what you want based on your project needs.

All the functions called under the void setup function, perform different functions, some draw lines, some, boxes and text with different font, color and size and they can all be edited to do what your project needs.

The complete code for this is available under the libraries example on the Arduino IDE. Don’t forget to change the DC and the RESET pin configuration in the code to match the schematics.

Uploading the code to the Arduino board brings a flash of different shapes and text with different colors on the display. I captured one and its shown in the image below.

That’s it for this tutorial guys, what interesting thing are you going to build with this display? Let’s get the conversation started. Feel free to reach me via the comment section if you have any questions as regards this project.

1.8 tft display breakout and shield st7735r preliminary free sample

Adafruit took their popular 1.8" TFT breakout board and remixed it into an Arduino shield complete with microSD card slot and a 5-way joystick navigation switch and three selection buttons! Since the display uses only 4 pins to communicate and has its own pixel-addressable frame buffer, it can be used easily to add a display & interface without exhausting the memory or pins.

New! Adafruit have updated this shield to be "Arduino R3" format compatible so you can now use it with any and all Arduinos or Metros - including the Metro M0 or M4, Arduino Mega, Zero, etc. They also use Adafruit seesaw for the TFT backlight, TFT reset, and button inputs - you can query the buttons and joystick over I2C now, so only 2 pins are needed to communicate with all 8 switches.

The 1.8" display has 128x160 color pixels. Unlike the low cost "Nokia 6110" and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!).

The shield has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as a ultra-low-dropout 3.3V regulator and a 3/5V level shifter so its safe to use with 3V or 5V Arduino compatibles. Adafruit also had some space left over so they placed a microSD card holder (so you can easily load full color bitmaps from a FAT16/FAT32 formatted microSD card), a 5-way navigation switch (left, right, up, down, select) and three tactile buttons marked A BC. The microSD card is not included.

If you just want to display text, shapes, lines, pixels, etc the shield uses the SPI pins (SCK/MOSI/MISO), I2C pins (SDA & SCL) and digital #8. For the microSD card, you"ll also give up Digital #4. This shield works with any Arduino UNO and compatibles, Mega, Zero, etc. If it"s shield compatible, you"re good to go.

Comes as a fully assembled and tested shield with the display, microsd card holder and nav switch as well as a stick of 0.1" header. To finish up and use, you will need to solder on the header onto the shield PCB, a quick 10 minute task.

Display current draw is mostly based on the backlight, with full backlight the current draw is ~100mA, this does not include the SD Card. SD cards can draw 20-100mA based on read/write. Measure current draw in circuit to get precise numbers.

1.8 tft display breakout and shield st7735r preliminary free sample

Other than SPI pins, we need to select three more pins as output. I have selectedPB6 for CS, PC7 for RESET, and PA9 for DC. You are free to choose any other pins also, whatever suits the requirement

1.8 tft display breakout and shield st7735r preliminary free sample

2 Guide Contents Guide Contents Overview Connecting the Breakout Testing the Display Breakout High Speed SPI Wiring Assembling the Shield Cut the Header Sections Insert the Headers into an Arduino Add the Shield And Solder! Testing the Shield Reading the Joystick Graphics Library Displaying Bitmaps Breakout Wiring Example Sketch Downloads Adafruit Industries Page 2 of 25

3 Overview This tutorial is for our 1.8" diagonal TFT display. It comes packaged as a breakout or as an Arduino shield. Both styles have a microsd interface for storing files and images. These are both great ways to add a small, colorful and bright display to any project. Since the display uses 4-wire SPI to communicate and has its own pixel-addressable frame buffer, it requires little memory and only a few pins. This makes it ideal for use with small microcontrollers. The shield version plugs directly into an Arduino with no wiring required. The breakout version can be used with every kind of microcontroller. The 1.8" display has 128x160 color pixels. Unlike the low cost "Nokia 6110" and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!). And the LCD will Adafruit Industries Page 3 of 25

4 always come with the same driver chip so there"s no worries that your code will not work from one to the other. Both boards have the TFT soldered on (it uses a delicate flex-circuit connector) as well as a ultra-low-dropout 3.3V regulator and a 3/5V level shifter so you can use it with 3.3V o r 5V power and logic. These also include a microsd card holder so you can easily load full color bitmaps from a FAT16/FAT32 formatted microsd card. And on the Shield version, we"ve added a nifty 5-way joystick navigation switch! You can pick up one of these displays in the Adafruit shop! 1.8" 18-bit color TFT breakout ( 1.8" 18-bit Color TFT Shield ( Adafruit Industries Page 4 of 25

5 Connecting the Breakout There are two ways to wire up these displays - one is a more flexible method (you can use any pins on the Arduino) and the other is much faster (4-8x faster, but you are required to use the hardware SPI pins) We will begin by showing how to use the more flexible method. You can use any 4 or 5 pins for this method. We"ll show using pins 4, 5, 6, 7, and 8 and once you have it working, you can change those pins around in the wiring and in the sketch. Start by wiring the power pins. Adafruit Industries Page 5 of 25

6 Connect the leftmost pin to Ground and the next pin to +5V. Connect the rightmost pin (backlight) to 5V as well. If you plug in the Arduino you should see the backlight turn on. Next connect the RESET TFT reset pin) and D/C (TFT data/command selection pin). Adafruit Industries Page 6 of 25

7 The RESET pin (3rd from the left) connects to Arduino pin 8. The D/C pin (4th from the left) connectso to pin 7 Finally we"ll connect the remaining digital pins, TFT_CS (TFT chip select), MOSI (data sent to TFT) and SCK (clock sent to TFT) Adafruit Industries Page 7 of 25

8 Note that you need to skip a pin on the TFT after D/C - the next wire is from TFT_CS which is 6th from the left. This goes to digital pin 6. MOSI (7th from the left) connects to digital pin 5 and finally SCK (8th from the left) connects to digital pin 4. That"s it! If you want to change the wiring, you can use any pins but don"t forget to change the top of the sketch to match! //You can use any (4 or) 5 pins #define sclk 4 #define mosi 5 #define cs 6 #define dc 7 #define rst 8 // you can also connect this to the Arduino reset Adafruit Industries Page 8 of 25

9 Testing the Display Breakout Once you have the display wired up, its time to test your wiring by uploading the example code we have written. Again, we suggest using an Arduino to test. Download our Arduino library (see bottom of page) from github by clicking on Do wnlo ad in the top right corner. Uncompress the folder and rename it Adafruit_ST inside the folder you should see the Adafruit_ST7735.cpp andadafruit_st7735.h files. Install the Adafruit_ST7735 library foler by placing it in your arduinosketchfolder/libraries folder. You may have to create the libraries subfolder if this is your first library. You can read more about installing libraries in our tutorial ( Restart the Arduino IDE. You should now be able to select File > Examples > Adafruit_ST7735 > graphicstest sketch. Upload the sketch to your Arduino wired as above. Once uploaded, the Arduino should perform all the test display procedures! If you"re not seeing anything - first check if you have the backlight on, if the backlight is not lit something is wrong with the power/backlight wiring. If the backlight is lit but you see nothing on the display make sure you"re using our suggested wiring. Adafruit Industries Page 9 of 25

10 High Speed SPI Wiring If you want to connect to the display and have high-speed data transfer (4-8x faster) you"ll have to use the hardware SPI system. This is optimized to be faster than the flexible wiring method (because its built into the hardware of the chip) but you are required to use the hardware SPI pins! On Atmega 328/168/8 type Arduinos ("classic" type) the hardware SPI pins are 11 (MOSI), 13 (SCK) and 10 (CS). For Megas it is 51 (MOSI), 52 (SCK), and 53 (CS). The CS pin can be a different pin but if you use any other pin you must still have the hardware SPI CS pin (10 or 53) as an output! We will also change the TFT_CS pin to be pin 10 and D/C to be pin 9 (you can change these two later but pin 10 must always be an output for hardware SPI to work). Select the File > Examples > Adafruit_ST7735 > graphicstest_highspeed sketch. Upload the sketch to your Arduino wired as above. In the sketch we changed the pin definitions. //#define sclk 13 // for MEGAs use pin 52 //#define mosi 11 // for MEGAs use pin 51 #define cs 10 // for MEGAs you probably want this to be pin 53 #define dc 9 #define rst 8 // you can also connect this to the Arduino reset Adafruit Industries Page 10 of 25

11 To use the hardware SPI, we commented out this line // Option 1: use any pins but a little slower // Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst); and uncommented this line: // Option 2: must use the hardware SPI pins // (for UNO thats sclk = 13 and sid = 11) and pin 10 must be // an output. This is much faster - also required if you want // to use the microsd card (see the image drawing example) Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst); Now when you run the graphics test you"ll notice its much faster If you want to usethe microsd card and TFT at the same time, you"ll need to use the hardware SPI because the SPI pins are shared between the two. See the bitmaps tutorial below for details on how to do this. Adafruit Industries Page 11 of 25

12 Assembling the Shield The shield comes with all surface mount parts pre-soldered. All that remains is to install the headers! Cut the Header Sections Cut the breakaway header strip into sections to fit the holes on the edge of the shield. You will need 2 sections of 6- pins and 2 sections of 8 pins. You can use wire-cutters as shown or pliers to snap them apart between pins. Adafruit Industries Page 12 of 25

13 Insert the Headers into an Arduino To align the header strips for soldering, insert them (long pins down) into the headers of an Arduino. Note that for R3 and later Arduinos, there will be an extra 2 unused pins on the end closest the USB and DC power jacks. Add the Shield Place the shield over the header strips so that the short pins stick up through the holes. Adafruit Industries Page 13 of 25

14 And Solder! Solder each pin to assure good electrical contact. For tips on soldering see the Adafruit Guide to Excellent Soldering ( Adafruit Industries Page 14 of 25

15 Testing the Shield You can test your assembled shield using the example code from the library. Download our Arduino library (see bottom of page) from github by clicking on Do wnlo ad in the top right corner. Uncompress the folder and rename it Adafruit_ST inside the folder you should see the Adafruit_ST7735.cpp andadafruit_st7735.h files. Install the Adafruit_ST7735 library foler by placing it in your arduinosketchfolder/libraries folder. You may have to create the libraries subfolder if this is your first library. You can read more about installing libraries in our tutorial ( Restart the Arduino IDE. You should now be able to select File > Examples > Adafruit_ST7735 > graphicstest sketch. Upload the sketch to your Arduino wired as above. The shield uses the "Classic Arduino" SPI wiring and will perform best with Atmega 328-based Arduinos such as the Uno or Duemilanove. But it will also work with the Leonardo or Mega. To use with the shield, modify the example code pin definitions as follows: #define sclk 13 #define mosi 11 #define cs 10 #define dc 8 #define rst 0 The Example code has 2 options for defining the display object. Uno, Duemilano ve and other Atmega 328-based processors can use the "Option 2" version of the constructor for best performance: Adafruit Industries Page 15 of 25

16 Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst); Mega and Leo nardo users should use the "Option 1" version of the constructor for compatibility: Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst); Be sure to select only one option and comment out the other with a pair of //"s. // Option 1: use any pins but a little slower //Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst); // Option 2: must use the hardware SPI pins // (for UNO thats sclk = 13 and sid = 11) and pin 10 must be // an output. This is much faster - also required if you want // to use the microsd card (see the image drawing example) Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst); Adafruit Industries Page 16 of 25

17 Reading the Joystick The 5-way joystick on the shield is great for implementing menu navigation or even for use as a tiny game controller. To minimize the number of pins required, the joystick uses a different resistor on each leg of the control to create a variable voltage divider that can be monitored with a single analog pin. Each movement of the joystick control connects a different resistor and results in a different voltage reading. Adafruit Industries Page 17 of 25

18 In the code example below, the CheckJoystick() function reads the analog pin and compares the result with 5 different ranges to determine which (if any) direction the stick has been moved. If you upload this to your Arduino and open the Serial Monitor, you will see the current joystick state printed to the screen. You can use this code as the input method for your menu system or game: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); } #define Neutral 0 #define Press 1 #define Up 2 #define Down 3 #define Right 4 #define Left 5 // Check the joystick position int CheckJoystick() { int joystickstate = analogread(3); if (joystickstate < 50) return Left; Adafruit Industries Page 18 of 25

20 Graphics Library We"ve written a full graphics library specifically for this display which will get you up and running quickly. The code is written in C/C++ for Arduino but is easy to port to any microcontroller by rewritting the low level pin access functions. The TFT LCD library is based off of the Adafruit GFX graphics core library. GFX has many ready to go functions that should help you start out with your project. Its not exhaustive and we"ll try to update it if we find a really useful function. Right now it supports pixels, lines, rectangles, circles, round-rects, triangles and printing text as well as rotation. Two libraries need to be downloaded and installed: first is the ST7735 library ( (this contains the low-level code specific to this device), and second is the Adafruit GFX Library ( (which handles graphics operations common to many displays we carry). Download both ZIP files, uncompress and rename the folders to "Adafruit_ST7735" and "Adafruit_GFX" respectively, place them inside your Arduino libraries folder and restart the Arduino IDE. If this is all unfamiliar, we have a tutorial introducing Arduino library concepts and installation ( Check out the GFX tutorial for detailed information about what is supported and how to use it! ( Adafruit Industries Page 20 of 25

21 Displaying Bitmaps In this example, we"ll show how to display a 128x160 pixel full color bitmap from a microsd card. We have an example sketch in the library showing how to display full color bitmap images stored on an SD card. You"ll need a microsd card such as this one ( You"ll also need to download our SD library modified to allow faster reads (these changes will hopefully be added to arduino v23) but for now you can download the new library here ( Download the library by clicking the Do wnlo ads button and uncompressing the folder. Replace the files in yourarduino IDE/libraries/SD folder (make a backup of course) and restart the IDE. You"ll also need an image. We suggest starting with this bitmap of a parrot. ( If you want to later use your own image, use an image editing tool and crop your image to no larger than 160 pixels high and 128 pixels wide. Save it as a 24-bit color BMP file - it must be 24-bit color format to work, even if it was originally a 16-bit color image - becaue of the way BMPs are stored and displayed! Copy the parrot.bmp to the microsd card and insert it into the micro SD card holder on your shield or breakout board. Adafruit Industries Page 21 of 25

22 Breakout Wiring Shield users can skip directly to the "Example Sketch" section. Wire up the TFT as described on the High Speed SPI Wiring page. Test that your wiring is correct by uploading the graphics test sketch with the high speed SPI line uncommented and the flexible-low-speed wiring commented. Once you are sure that the TFT is wired correctly, add the two wires for talking to the SD card. Adafruit Industries Page 22 of 25

23 Connect CARD_CS (the unconnected pin in the middle) to digital pin 4 (you can change this later to any pin you want). Connect MISO (second from the right) to the Arduino"s hardware SPI MISO pin. For Classic arduinos, this is pin 12. For Mega"s this is pin 50. You can"t change the MISO pin, its fixed in the chip hardware. Example Sketch Load the spitftbitmap example sketch into the Arduino IDE. Breakout users can use the code as-is. Shield users only: You will need to edit the sketch for the shield pinout as follows: // Edit for Shield Pinouts! #define SD_CS 4 // Chip select line for SD card #define TFT_CS 10 // Chip select line for TFT display #define TFT_DC 8 // Data/command line for TFT #define TFT_RST 0 // Reset line for TFT (or connect to +5V) Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); Now upload the spitftbitmap example sketch to the Arduino. It should display the parrot image. If you have any problems, check the serial console for any messages such as not being able to initialize the microsd card or not finding the image. Adafruit Industries Page 23 of 25

25 Downloads Adafruit GFX library ( Adafruit ST7735 library ( (See our detailed tutorial for installation assistance ( You may also be interested in the datasheet for the display ( and display driver chip ( Adafruit Industries Last Updated: :00:53 PM EDT Page 25 of 25

1.8 tft display breakout and shield st7735r preliminary free sample

The 1.8" display has 128x160 color pixels. The TFT driver (ST7735) can display full 18-bit color. The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector).

In the below example, Node32-Lite and this 1.8-inch LCD. Please refer to the tutorial here: ST7735S interfacing with ESP32 to make the connections, Arduino library installation, and modification needed for it to works on this LCD.