---
title: "PROJECT 14: INTERFACING LCD DISPLAY TO THE MICROCONTROLLER"
description: Interfacing an LCD (Liquid Crystal Display) with a microcontroller in an electronics circuit is useful as it provides a visual interface for displaying information to the user. This lets the microcontroller output data like text, numbers, or simple graphics, which…
url: "https://nedu.rw/documentation/project-14-interfacing-lcd-display-to-the-microcontroller/"
updated: "2026-10-13"
category: InnoKit MPK A100 / Experiments you can do with MPK A100
---

# PROJECT 14: INTERFACING LCD DISPLAY TO THE MICROCONTROLLER

Interfacing an LCD (Liquid Crystal Display) with a microcontroller in an electronics circuit is useful as it provides a visual interface for displaying information to the user. This lets the microcontroller output data like text, numbers, or simple graphics, which you can use for a variety of purposes.

## **Objective**

The aim of this experiment is to help the user to:

- Understand the operation of  an LCD display  
- Interfacing an LCD display to the microcontroller
- Displaying a text on LCD display using microcontroller 

## Component knowledge

### **What is an LCD Display in Conjunction with a Microcontroller?**

An LCD display (Liquid Crystal Display) is an electronic component that visually displays information such as text, numbers, or symbols. When used with a microcontroller, an LCD can show outputs or feedback from the microcontroller's program, making it essential in many electronic projects, such as temperature monitoring or digital clocks.

One common type of LCD used with microcontrollers is the 16x2 LCD, which means it can display 2 lines of 16 characters each.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcZwpngkMgrMFxnN7kBgcb3s9OcO8Zc_Y8AKBFFvMfRf2QUpLxvUSGPHOgjRm0DXiEQjSC1woe0TnGFRga08GveiNWrFDUAq7H8CBWuroNubx6LFXwSbzQ96g9b6YI2MqgAx9UJUKYZLBihwE75G5FVd57uZJbLyqXC_T8qzr2HVWPsF-u6kfU?key=EIFaBMwRIuJeDoZo9taXbw)

***Figure: 12X2 LCD Display***

- **Pin Identification of an LCD Display**

A typical 16x2 LCD display has 16 pins, and you need to connect them to a microcontroller. Here's a breakdown of the pin configuration:

1. **VSS (Pin 1)**: Ground (connect to the ground of the circuit).
2. **VDD (Pin 2)**: Power supply (typically 5V).
3. **V0 (Pin 3)**: Contrast adjustment pin (usually connected to a potentiometer).
4. **RS (Pin 4)**: Register Select pin (selects between command or data mode).
5. **RW (Pin 5)**: Read/Write pin (set to write mode when connected to ground).
6. **E (Pin 6)**: Enable pin (activates data writing to the display).
7. **D0 to D7 (Pins 7-14)**: Data pins (used to send data to the display, can be 4 or 8-bit mode).
8. **A (Pin 15):** Anode (positive terminal for backlight, typically 5V).
9. **K (Pin 16):** Cathode (negative terminal for backlight, usually connected to ground).

- **Proper Way to Test an LCD Display**

To test whether the LCD is functioning properly, follow these steps:

- ***Check the Power and Backlight:***

- Connect Pin 1 to ground and Pin 2 to 5V.
- Connect Pin 15 (A) to 5V and Pin 16 (K) to ground.This will turn on the backlight.
- If the LCD backlight turns on, the power is functioning correctly.
- ***Check the Contrast:***

Adjust the contrast by connecting Pin 3 (V0) to a potentiometer. Set the potentiometer between 5V and ground, and adjust it. If the contrast works, you should be able to see faint boxes on the display without any characters.

- ***Test Data Communication:***

- To fully test the data pins (RS, RW, E, D0-D7), you need a microcontroller like an Arduino. Connect the LCD to the microcontroller using the appropriate library (like the LiquidCrystal library for Arduino).
- Upload a simple sketch that sends data or text to the display. If the data shows correctly, the data pins are functioning properly.
- ***Test Using a Multimeter:***

You can check continuity between pins using a multimeter in continuity mode. Ensure you do not short adjacent pins that should remain unconnected. This will help ensure the LCD is working and properly interacting with the microcontroller.

## Materials use

| ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfFm_OV48K1ohaYi8CMA-SJqfZv9W7beyeg9HVpZ3hb2ZDWssMo4B0mYW9glgFiDFwFD7t1Jn4N7gdbkg4KH31X6IGE_ogjfahjYMEaORQMZqmSE4xb3UnIRldCG9bahadzV98wP6KPQZnGCD8dPsDXL0lMzaJ9OkRr2EzMaEhFoo5RkJnWk0o?key=EIFaBMwRIuJeDoZo9taXbw) | ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXexQ8qeYBo4PI0_KtM4Be2yxZEKkCkBjncrFFzvmCrpa3xvvNZLaJk5kpUdZ3QwGn2bzMJlJfoU0ub6E5yhU5Whv3vhpuCxf1dX2MSeOf-hktiZ5PVtsQJwrs7P_BPuc-E0QLkhbAwTdDfrtDQhOPpC-dOD6wtiIo5x5Joq4fHW8YQDt8BkjN8?key=EIFaBMwRIuJeDoZo9taXbw) | ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfAqvZsks-qvRF6-kSwvZWpqWPO6IoTaqv2bapHbizumdw1T1LSHqH2oM2_A249TJNMCRIEeyZgmHO_x5jPEtRYKpmjlEBOQ2JQ8HecwEgmMxfhNQthP0O5ICnZxaWeu09EYuXcLfNEOZEp13KEv_OIC-wF0-P8dfXky5pFoxhtVYSrURRD25Q?key=EIFaBMwRIuJeDoZo9taXbw) |
| --- | --- | --- |
| ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfIF-crGkFuz1kbLsoXkX7b8wb4THJvpS-Cq8Y48FdgiR8m0259HPflWfEtutLy77MsctAAtCVY3XZbDbl82yrx7JcnUKst7TRx1_UdxFzYnx3JLKCF-AirYqmDYgsAotkhW9P4cGygFZ5WmasWlPw-yg6yVPkYCZaXXXMonElRGjGxJD-wWw?key=EIFaBMwRIuJeDoZo9taXbw) |  |  |

**6. Circuit diagram**

Let's now connect the **LCD 1602** to the **MPK A100 Microcontroller** for configuration and display purposes. The schematic diagram shows the potentiometer connected, so you can adjust the brightness.

Here's how to proceed:

- **GND (VSS)** and **VCC (VDD)**: Connect all ground and power pins appropriately.
- **RS**: Connect the **RS** pin to **pin 12** of the microcontroller.
- **Enable (E)**: Connect the **E** pin to **pin 11**.
- **D4 - D7**: Connect data pins **D4 - D7** to **pins 5 to 2** respectively.

This will ensure proper configuration and communication with the microcontroller for displaying text.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfgTCjO55AnfmTqpAcyZ4esJrrglCWu0tn0offkJVSIqpee3qpb8KYykCwhWCp8wFRhNwGxfLM712_Neug6Yv_Lr1S9Z7j8ZeXhsXAYAHvHKGcwEazE3Zuy90gQl9nMd_3U4gRzHrnNm3zRl_gSuwO7LOtGZEhxP4Q-XWknIQ?key=EIFaBMwRIuJeDoZo9taXbw)

***                                                             Figure: Schematic diagram***

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeH2JckjMtNcXjvQ_-C0-5ArnCbFDJlofdk-a5UAXBTo_M2MxjsS1t6Cm2xXrTaxbP2uDfqhSqSQSLFcMB2E8du2HH6491i5OERMPjVae2uGvrTUw0lbNL9Dh5_wyU0r8IcJtM2t09yazbqAuI8Viq3OiHT2V5g2xDkYhUHuuUcMJwitBavU48?key=EIFaBMwRIuJeDoZo9taXbw)

***Figure: Components used to make connection on the board***

## Arduino Code

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15   #include LiquidCrystal.h> // library of liquidcrystal const int rs =12, en=11, d4=5, d5=4, d6=3, d7=2; // lcd pins to be connected to control board LiquidCrystalLcd(rs,en,d4,d5,d6,d7); void setup(){  // put your setup code here, to run once: Lcd.begin(16,2); Lcd.print(" HELLO "); // display " HELLO" Lcd.setCursor(0, 1); Lcd.print(" NYEREKA TECH"); // display " NYEREKA TECH" } void loop(){  // put your main code here, to run repeatedly: Lcd.setCursor(0, 1); }

## Code knowledge

Now let's get the get some explanations about codes of sending some text to the serial monitor.

    1    #include LiquidCrystal.h> // library of liquidcrystal

#include is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made functions), and also libraries written especially for Arduino. For now we are going to use LiquidCrystal to display some text on LCD( Liquid Crystal Display ) screen.

    2 3 4    const int rs =12, en=11, d4=5, d5=4, d6=3, d7=2; // lcd pins to be connected to control board LiquidCrystalLcd(rs,en,d4,d5,d6,d7);

The LCD display has the pins rs, en, d4, d5, d6, and d7, which we connect to the Arduino's digital pins.

    5 6 7    void setup(){  // put your setup code here, to run once: Lcd.begin(16,2);

In this stage, we declare the size of the LCD screen where we will display our text. Lcd.begin(16,2) This means that it have **16 columns**and**2 rows**which allows it to display **32 characters** (16\*2=32).

    8    Lcd.print(" HELLO "); // display " HELLO"

"In this stage, we declare the kind of text to display on the screen. Lcd.print tells Liquid Crystal library to display the word which is inside the brackets. That word is  HELLO .

    9    Lcd.setCursor(0, 1);

The function Lcd.setCursor sets the location of the text on the LCD screen. The parameters (0, 1) mean we want to position our text at column 0 and row 1 of the LCD screen.

## Result

Here's what the provided code does, based on its functionality.

### **Expected Output on the LCD**

1. **Top Row (Row 0)**: Displays " HELLO " (the text "HELLO" with the remaining spaces blank on a 16-character row).
2. **Bottom Row (Row 1)**: Displays " NYEREKA TECH " (the text "NYEREKA TECH" with the remaining spaces blank on a 16-character row).

So, the Final Visible LCD Output will be:

**HELLO       **

**NYEREKA TECH**
