Interface Nokia 5110 Graphic LCD with STM32 Blue Pill Board

This post shows how to interface the STM32 Blue Pill board with Nokia 5110 monochrome graphical LCD display module that has a resolution of 84×48 pixel.
The example shows how to print texts and draw some shapes (circles, rectangular…) on the Nokia 5110 display.

The STM32 Blue Pill development board is based on STMicroelectronics ARM Cortex-M3 microcontroller STM32F103C8T6 running at maximum clock frequency of 72MHz. This particular development board gained popularity due to its low cost and compact size, making it a popular choice for hobbyists, students, and developers.

To use the STM32 Blue Pill, a hardware programmer, such as ST-Link, is required to upload project code to the board. A USB-to-Serial converter module can also be used to upload the code to the board, an example of this converter is the popular one from FTDI which is FT232RL module.

Nokia 5110 with STM32 Blue Pill board hardware circuit

Nokia 5110 Graphical LCD Display Module:
The Nokia 5110 LCD is a popular monochrome graphical LCD display that was originally used in the Nokia 5110 and Nokia 3110 mobile phones. It has since become a popular choice for hobbyists and developers due to its simplicity, low cost, and ease of interfacing with microcontroller based systems like Arduino, Raspberry Pi, STM32 development boards…

The Nokia 5110 display uses PCD8544 low power CMOS LCD driver with controller chip which is designed to drive graphical displays of 48 rows and 84 columns, or simply 84×48 pixels. The PCD8544 chip is responsible for managing the display’s pixels, handling communication with the microcontroller, and controlling the display’s contrast and power modes.

Specifications:
These are some specifications of the Nokia 5110 LCD.

  • Display Type: Monochrome graphical Liquid Crystal Display (LCD).
  • Controller: PCD8544 controller/driver.
  • Resolution: 84×48 Pixels.
  • Operating Voltage: Typically operates at 3.3V, including power and logic signals.
  • Interface: Serial Peripheral Interface (SPI) communication protocol.
  • Backlight: Built-in LED backlight that can be controlled separately.

The image below shows the Nokia 5110 LCD module used in this project:

Nokia 5110 LCD screen monochrome graphical display

Nokia 5110 LCD Module Pinout:
The display module typically has 8 pins which are listed as below.

  • GND: Ground pin, connected to circuit common ground.
  • BL: Backlight LED control pin, connected to VCC, or control through PWM source.
  • VCC: Power supply pin, typically 3.3V.
  • CLK: Serial clock input pin for the SPI bus. Connected to the SPI clock pin (SCK) of the microcontroller.
  • DIN: Serial data input pin for the SPI bus. Connected to the SPI data-out pin (MOSI) of the microcontroller.
  • DC: Data/Command selection pin. Connected to a digital output pin on the microcontroller. It determines whether the data on the bus is a command or actual pixel data, with high logic level for Data and low level for Command.
  • CE: Chip enable pin (active low). Connected to a digital pin on the microcontroller. Used to enable or disable the communication with the display.
  • RST: Reset pin. Used to reset the display. If used, it is connected to any general purpose output pin of the microcontroller.

Interfacing STM32 Blue Pill Board with Nokia 5110 LCD:
The circuit schematic below shows the wiring diagram of the Nokia 5110 LCD display with the STM32 Blue Pill board.
In this example the display is interfaced with the microcontroller STM32F103C8T6 using bit-banging mode meaning that hardware SPI of the microcontroller is not used.

Hardware Required:
This is a summary of the parts required to build this project.

STM32F103C8T6 STM32 Blue Pill with Nokia 5110 LCD circuit schematic

The Nokia 5110 LCD module is connected to the STM32 Blue Pill board as follows:
GND —> STM32 Blue Pill GND pin.
CLK —> STM32 Blue Pill pin PA0.
DIN —> STM32 Blue Pill pin PA1.
DC  —> STM32 Blue Pill pin PA2.
CE  —> STM32 Blue Pill pin PA3.
RST —> STM32 Blue Pill pin PA4.

GND Pin of the Nokia 5110 LCD module is connected to GND pin of the STM32 Blue Pill board.
BL and VCC are connected to 3.3V pin of the Blue Pill board.

Interfacing STM32 Blue Pill Board with Nokia 5110 LCD Code:
Arduino IDE (Integrated Development Environment) is used to write project code, the STM32 Blue Pill board has to be added to the IDE before compiling the code.
The STM32 Blue Pill board can be installed using Arduino IDE Boards Manager.

The FT232RL USB to serial UART converter is used to program the STM32F103C8T6 microcontroller, the ST-LINK V2 programmer also can be used and it is supported by Arduino IDE.

To be able to compile project Arduino code, two libraries are required from Adafruit Industries:
The first library is a driver for the Nokia 5110 LCD display (PCD8544 driver) and it can be installed from Arduino IDE library manager (Sketch —> Include Library —> Manage Libraries…, in the search box write “pcd8544” and install the one from Adafruit).
The second library is Adafruit graphics library which can be installed also from Arduino IDE library manager.
During installation of the Adafruit PCD8544 library, Arduino IDE may ask for installing some other libraries form Adafruit Industries (dependencies).

Project code was tested with the following library versions:
Adafruit GFX Library: Version 1.12.0.
Adafruit PCD8544 Nokia 5110 LCD Library: Version 2.0.3.
Adafruit BusIO: Version 1.17.0.

Programming Hints:
The used libraries are included in the Arduino code as shown below:

The connection between STM32 Blue Pill board and Nokia 5110 LCD is defined as below where bit-banging mode is used (communication is handled via software instead of hardware):

Note that the Arduino code for STM32 given below is originally comes as an example with the Adafruit PCD8544 library with some modification.

Full Arduino code:

Interfacing STM32 Blue Pill Board with Nokia 5110 LCD Video:
The video below shows a hardware test circuit for the STM32 Blue Pill board and Nokia 5110 LCD.

Proteus Simulation:
The interfacing of STM32 Blue Pill board with Nokia 5110 LCD can be simulated with Proteus simulation software, the following video shows simulation results.

Proteus simulation file download link is below, use version 8.15 or higher to open it:
STM32 Blue Pill with Nokia 5110 LCD – Proteus simulation


Discover more from Simple Circuit

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

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

Scroll to Top