Tutorial – Arduino and ILI9325 colour TFT LCD modules

Learn how to use inexpensive ILI9325 colour TFT LCD modules in chapter fifty of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – A tutorial on the Arduino universe. The first chapter is here, the complete series is detailed here.


Colour TFT LCD modules just keep getting cheaper, so in this tutorial we’ll show you how to get going with some of the most inexpensive modules we could find. The subject of our tutorial is a 2.8″ 240 x 320 TFT module with the ILI9325 LCD controller chip. If you look in ebay this example should appear pretty easily, here’s a photo of the front and back to help identify it:

There is also the line “HY-TFT240_262k HEYAODZ110510” printed on the back of the module. They should cost less than US$10 plus shipping. Build quality may not be job number one at the factory so order a few, however considering the cost of something similar from other retailers it’s cheap insurance. You’ll also want sixteen male to female jumper wires to connect the module to your Arduino.

Getting started

To make life easier we’ll use an Arduino library “UTFT” written for this and other LCD modules. It has been created by Henning Karlsen and can be downloaded from his website. If you can, send him a donation – this library is well worth it. Once you’ve downloaded and installed the UTFT library, the next step is to wire up the LCD for a test.

Run a jumper from the following LCD module pins to your Arduino Uno (or compatible):

  • DB0 to DB7 > Arduino D0 to D7 respectively
  • RD > 3.3 V
  • RSET > A2
  • CS > A3
  • RW > A4
  • RS > A5
  • backlight 5V > 5V
  • backlight GND > GND

Then upload the following sketch – Example 50.1. You should be presented with the following on your display:

If you’re curious, the LCD module and my Eleven board draws 225 mA of current. If that didn’t work for you, double-check the wiring against the list provided earlier. Now we’ll move forward and learn how to display text and graphics.

Sketch preparation

You will always need the following before void setup():

and in void setup():

with the former command, change orientation to either LANDSCAPE to PORTRAIT depending on how you’ll view the screen. You may need further commands however these are specific to features that will be described below. The function .clrScr() will clear the screen.

Displaying Text

There are three different fonts available with the library. To use them add the following three lines before void setup():

When displaying text you’ll need to define the foreground and background colours with the following:

Where red, green and blue are values between zero and 255. So if you want white use 255,255,255 etc. For some named colours and their RGB values, click here. To select the required font, use one of the following:

Now to display the text use the function:

where text is what you’d like to display, x is the horizontal alignment (LEFT, CENTER, RIGHT) or position in pixels from the left-hand side of the screen and y is the starting point of the top-left of the text. For example, to start at the top-left of the display y would be zero. You can also display a string variable instead of text in inverted commas.

You can see all this in action with the following sketch – Example 50.2, which is demonstrated in the following video:

Furthremore, you can also specify the angle of display, which gives a simple way of displaying text on different slopes. Simply add the angle as an extra parameter at the end:

Again, see the following sketch – Example 50.2a, and the results below:

Displaying Numbers

Although you can display numbers with the text functions explained previously, there are two functions specifically for displaying integers and floats.

You can see these functions in action with the following sketch – Example 50.3, with an example of the results below:


Displaying Graphics

There’s a few graphic functions that can be used to create required images. The first is:.

which is used the fill the screen with a certain colour. The next simply draws a pixel at a specified x,y location:

Remember that the top-left of the screen is 0,0. Moving on, to draw a single line, use:

where the line starts at x1,y1 and finishes at x2,y2. Need a rectangle? Use:

where the top-left of the rectangle is x1,y1 and the bottom-right is x2, y2. You can also have rectangles with rounded corners, just use:

instead. And finally, circles – which are quite easy. Just use:

where x,y are the coordinates for the centre of the circle, and r is the radius. For a quick demonstration of all the graphic functions mentioned so far, see Example 50.4 – and the following video:

Displaying bitmap images

If you already have an image in .gif, .jpg or .png format that’s less than 300 KB in size, this can be displayed on the LCD. To do so, the file needs to be converted to an array which is inserted into your sketch. Let’s work with a simple example to explain the process. Below is our example image:


Save the image of the puppy somewhere convenient, then visit this page. Select the downloaded file, and select the .c and Arduino radio buttons, then click “make file”. After a moment or two a new file will start downloading. When it arrives, open it with a text editor – you’ll see it contains a huge array and another #include statement – for example:


Past the #include statement and the array into your sketch above void setup(). After doing that, don’t be tempted to “autoformat” the sketch in the Arduino IDE. Now you can use the following function to display the bitmap on the LCD:

Where x and y are the top-left coordinates of the image, width and height are the … width and height of the image, and name is the name of the array. Scale is optional – you can double the size of the image with this parameter. For example a value of two will double the size, three triples it – etc. The function uses simple interpolation to enlarge the image, and can be a clever way of displaying larger images without using extra memory. Finally, you can also display the bitmap on an angle – using:

where angle is the angle of rotation and cx/cy are the coordinates for the rotational centre of the image.

The bitmap functions using the example image have been used in the following sketch – Example 50.5, with the results in the following video:

Unfortunately the camera doesn’t really do the screen justice, it looks much better with the naked eye.

What about the SD card socket and touch screen?

The SD socket didn’t work, and I won’t be working with the touch screen at this time.


So there you have it – an incredibly inexpensive and possibly useful LCD module. Thank you to Henning Karlsen for his useful library, and if you found it useful – send him a donation via his page.


In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The following two tabs change content below.

John Boxall

Person. Founder and original author for tronixstuff.com. VK3FJBX

45 thoughts on “Tutorial – Arduino and ILI9325 colour TFT LCD modules

  1. John

    Hi John,
    that looks really good for its price, I am building a robot controller for outdoor use, and I had planned to use 2 lcd displays ( white on blue backlit background ) but testing it outdoors yesterday you could hardly see the writing.
    This unit looks very bright, but of course its pictured indoors.
    Do you think its brighter than a bog standard LCD?

    Well done with the articles, very informative !

    1. John Boxall

      Thanks. It’s nothing over a normal LCD, so indoor use only I’m afraid.
      OLEDs may be better, but I haven’t seen a component-level one to experiment with yet.

  2. gadjet0

    Thanks for the tutorial, really interesting. I’ve ordered one.
    I noticed that it has an SD card slot and an SPI interface, have you tried these at all?

  3. gastonlagaffe2012

    the UTFT library is absolutely worth a donation. Henning has written a superb peace of code. I use it with several TFT without issues and of course, I have done my donation (I suggest 5 Euro/TFT you use ;^)
    Ciao! Mathias

  4. jayfdee

    Many thanks for the tutorial,I have been meaning to try one of these for a while,so you have prompted me to buy one. Ordered from ebay £7 from Hong Kong..

    John D

  5. Geoff

    Hi John:
    Thanks so much for your article. First of all, a newbie, so please bear with me.
    I am not using Arduino – using a PIC16F877 instead, but the exact display you are using!
    I have not been able to find any documentation re the pinouts for the display except the ILI9325 Data Sheet. Unfortunately this does not give me a clue where the Backlight pin is on the display. I can’t figure out where the touchscreen x, y+ etc are or what PEN_Q, DOUT etc are used for!
    Do you know where I can get some data on the actual display?
    A search for “HY-TFT240_262k HEYAODZ110510” only comes up with your article!

  6. Col

    Do you know if this works with an arduino nano v3. I have connected as per instructions above and downloaded the sketch with utft pins set to 24,23,22,21 but I do not get any text displayed , just backlit.

    1. Ronan

      It works fine with the Nano V3…… There’s not much room for project code though once the library has been compiled.

  7. gadjet0

    The LCD arrived this morning and works fine.

    I tried the Touch library but the resultant code is more then 32K so they won’t work, :-(.

    1. gadjet0

      Hi, I figured out how to make the code smaller by un-commenting the defines for other chipsets , in the memorysaver.h file, now the program to claibrate the touch screen loads but there is no touch working. Does yours?

      1. gadjet0

        OK, can any one else who bought the LCDs comment if their touch screens work?


    2. Gus Smith

      Hi, tried the UTouch library and the examples in there but this but does not work for me. Also tried on Mega 2560 and does not work on that one either.


      1. gadjet0

        Did you connect the 6 way connector to the Arduino before trying the touch function, I didn’t DOH!, I thought it all worked through the data connections, I just realised my error.

        I’ll connect them up and try again.

      2. Gus Smith

        I didn’t RTFM. Forgot to connect the pins for the Utouch functions. “myTouch(6,5,4,3,2);”
        But I’m having mixed results. The calibration example works and recognizes the stylus input. Then I copied the CAL_X, CAL_Y and CAL_S value to UTouchCD.h
        After that the button example did not recognize anything. Also tried LANDSCAPE and PORTRAIT mode. When Serial.print X and Y values it does show values.

        I will play again later today.

  8. Mr. Sharkey


    Very timely post, I was researching new and better LCD displays for my project and just happened to stop by here to see what was new and found your tutorial on the color displays. Ordered two (both worked), and grabbed the UTFT library. Henning was most helpful when I had download difficulties, but it all got sorted out.

    Everyone, if you use this library, please consider sending Henning a donation, the UTFT library is excellent, well written, and well documented with many example sketches. It really does some amazing things.

    Now awaiting the delivery of my new Mega2560, as I got so involved in writing code that my Duemilanove ran out of flash memory. 32k seemed like so much space such a short time ago…

  9. EasyE

    Hey John,
    Thank you for the post! Do you have any advice on moving the data pins? I’m trying to to grab a .bmp file from the Uno Wireless/SD shield but there is a conflict with pin 4 (needed for the SDCS).

  10. Mr. Sharkey

    Did anyone actually ever get the UTFT ibrary to work on a Mega2560? I have had absolutely no success attempting to run either the UTFT examples or the sketches presented here on a Mega. All I get is a white screen, in spite of wiring and re-wiring the LCD to the proper pins on the board.

      1. Julian

        Yes I got UTFT working on Mega2560. Key thing here is to copy the libraries into the core Ardunio so UTFT appears in the list.
        Sketch -> Import Library -> Add Library

  11. gadjet0

    I finally got the screen and the touch working with my UNO, I got the calibration data wrong at first, typos!
    I’m thinking of doing a pcb for the display, which would be better, a shield for the UNO or a pcb containing its own smd 328p (extra IO)?

    1. John Boxall

      Nice work. If you were going to manufacture something, give it the option of being 5V/3.3V compatible so the Due can use it and also people with the little computer… I thinks it’s called a Raspberry Pi?

  12. sharon

    Hi John,
    on the manual of the ili9325 they wrote to use pin DB10-DB17 for 8bit, you are using DB0-DB7.
    is there any difference?

    1. John Boxall

      Just following Henning’s direction for his library. Plus the LCD board used doesn’t have header pins on DB10-DB17 – the holes were soldered full.

  13. Zoszko

    I have tried this with the exact same TFT screen. All I have got is a white screen(backlight). I have checked the wirings, it looks ok for me. Do you have any idea what the problem is?


  14. rafael garcia

    hello, srry, i am using the same lcd from the picture and also i am using an arduino mega, but all that i get is a white screen, the libary only work with arduino uno?

  15. Igor

    Hi, John!
    Two month ago I changed display on my Samsung E1080 mobile phone and I’ve bought 3 spare displays for the mobile.
    Now I have two absolutely new displays and I want to use them with Arduino.
    Displays are marked on the top side as 4535A; on the back side as FPC4535A-V3-F
    Displays dimention – 128х128 px.
    Colors – 65535.
    I asked Samsung for help but I was refused. No datasheet was found over internet. Can you give me advise how to use the displays?
    Thank you!


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.