Setting up Cheap Color Display with Arduino (Nokia 1661)

Setting up Cheap Color Display with Arduino (Nokia 1661) Leave a comment

Introduction
Nothing can make our projects look as good as a color graphical display! However, it’s always the price that limits our designs. In this tutorial, we’re going to show you how to set up an inexpensive color display with Arduino.

We’ve previously talked about the Nokia 1661 display on EICUT, but this time our focus will be solely on Arduino — using the popular Adafruit library to run this display. Moreover, we’ll be using a library that supports hardware SPI on the ESP8266, along with a ready‑to‑use board, so you can get this LCD working more easily than ever.

So, stay with Eicut as we dive into this practical tutorial.

Hardware

The display we’re using is originally designed for Nokia mobile phones, and because it’s mass‑produced, it’s very affordable. This display is found in phones like Nokia 1661, Nokia 1616, and etc.To obtain the display itself, you’ll need to visit mobile parts vendors, not typical electronics stores.

In this tutorial, we’re using a ready‑made module of this display, which you can purchase from Store.

1.8-inch TFT LCD Display Module
Ready‑made module Nokia 1661

With this module, you can easily and effortlessly set up the display on your board.

You can review the features of this display below:

  • Supports 65,000 colors
  • 1.8‑inch size
  • 128 × 160 resolution

Setting Up the Adafruit spfd54124b Library

In fact, spfd54124b is the display driver, which directly controls the LCD.

This driver supports the 9‑bit SPI protocol, while — as you know — most microcontrollers only support 8‑bit SPI.

In this library, the SPI interface for AVR microcontrollers has been implemented in software and optimized for performance.

However, the popular ESP8266 module (the NodeMCU board) does support 9‑bit SPI, allowing you to display data on the LCD at high speed.

Next, we’ll review how to use this library.

Now open the Arduino software, and from the menu go to

Sketch → Include Library → Add .ZIP Library,

then select the ZIP file you downloaded earlier.

Screenshot of Arduino IDE menu showing Sketch
Add Adafruit spfd54124b Library

After that, you also need to install the Adafruit GFX library.

To do this, go to

Sketch → Include Library → Manage Libraries,

find and install the Adafruit GFX library.

Installing Adafruit GFX Library in Arduino IDE Library Manager
Install Adafruit GFX library
Arduino IDE Library Dependency Warning
Adafruit GFX library: Select Install all

Now we want to test this library with the NodeMCU board.

To do this, simply open the corresponding example from the library.

Highlighting Arduino Nano selection for board configuration
ready‑made examples of Adafruit GFX library

As you can see, there are several ready‑made examples for working with the library:

  • hw_spi_arduino_uno: Setup using hardware SPI with the Arduino Uno board
  • hw_spi_esp8266: Setup using hardware SPI with the NodeMCU (ESP8266) board
  • sw_spi_arduino_uno: Setup using software SPI with the Arduino Uno board
  • sw_spi_esp32: Setup using software SPI with the ESP32 board
  • sw_spi_esp8266: Setup using software SPI with the NodeMCU (ESP8266) board
NodeMCU ESP8266 wired to TFT LCD on breadboard
NodeMcu: Hardware and Software SPI
Arduino Uno to TFT LCD SPI Connection on Breadboard
Arduino Uno: Hardware and Software SPI

Next, you can see the schematic diagrams corresponding to each example.

To initialize the display in hardware SPI mode, you only need to define the RST and CS pins as follows:

If you’re using software SPI, then all SPI pins must be specified:

🔗Note

When using software SPI on the ESP8266, you cannot use pin 16 (D0 on NodeMCU) for TFT_CLK or TFT_DATA.

Below, you can see the output result of the code above.

Breadboard setup with ESP8266 NodeMCU
Classic “Hello World” test

Color Display Setup

Available Drawing Functions for the Display

You can use all the functions from the Adafruit GFX library with this LCD.

Below are a few examples:

Screen Rotation

This function sets the drawing orientation on the display surface.

You can assign a value from 0 to 3:

Draw a Pixel

This function draws a single pixel at the specified (x, y) coordinates with the chosen color:

Draw a Line

This function draws a line by specifying its starting and ending points, and a color:

Grid diagram illustrating Bresenham's line plot
Draw a Line

Draw a Rectangle

These functions are used to draw outlined or filled rectangles at specified (x, y) coordinates, with the desired width, height, and color:

Grid diagram showing a filled rectangle
Draw a Rectangle

Draw a Circle

These functions are used to draw a circle at a specified (x, y) center point with a chosen radius and color:

Grid diagram showing a filled circle
Draw a Circle

Draw a Rounded Rectangle

These functions are used to draw rectangles with rounded corners, either outlined or filled.

You need to specify the starting (x, y) coordinates, width, height, corner radius, and color:

Grid diagram showing a filled rounded rectangle
Draw a Rounded Rectangle

Draw a Triangle

These functions are used to draw triangles, either outlined or filled, by specifying the three corner coordinates and a color:

Grid diagram showing a filled triangle
Draw a Triangle

Draw a Character

This function displays a single character at specified (x, y) coordinates, with chosen text color, background color, and font size:

Grid diagram showing the letter 'A'
Draw a Character

Text Handling

These functions are used for text rendering and formatting — positioning, coloring, sizing, and wrapping:

To select a specific font, use:

Available Fonts

Here is the list of available fonts you can include:

Image showing "Serif Sans Mono" rendered in four different font
Font types illustrated

Using Fonts in the Adafruit SPFD54124B Library

Before using any font in your code, you must include it at the beginning of your sketch along with the required libraries.

Here’s an example:

FAQ – Setting up Cheap Color Display with Arduino (Nokia 1661)

Why use a color graphical display in Arduino projects?

Color displays significantly improve the visual quality of projects, making interfaces clearer, more informative, and more professional.

What display is used in this tutorial?

The tutorial uses a 1.8-inch color LCD originally designed for Nokia phones such as Nokia 1661 and 1616, chosen for its low cost and wide availability.

What are the main features of this LCD?

It supports 65,000 colors, has a 128×160 resolution, and a compact 1.8-inch form factor, making it ideal for embedded projects.

Which library is used to control the display?

The Adafruit SPFD54124B library is used along with the Adafruit GFX library to handle graphics, text, and shapes.

What is special about the SPFD54124B driver?

It uses a 9-bit SPI protocol. While most microcontrollers use 8-bit SPI, the ESP8266 supports 9-bit hardware SPI for faster performance.

Can this display work with Arduino Uno and ESP8266?

Yes. Arduino Uno can use software or hardware SPI, while ESP8266 (NodeMCU) supports both, including fast 9-bit hardware SPI.

What drawing and graphics functions are available?

You can draw pixels, lines, rectangles, circles, triangles, rounded shapes, and render text using all Adafruit GFX functions.

How do you use custom fonts with this display?

Include the desired font header file at the top of your sketch and select it using display.setFont(&fontName).

Leave a Reply