As an Amazon Associate we earn from qualifying purchases.
This project shows how to receive data over UART on an Arduino and display it on a 16×2 character LCD, all inside Proteus. You type a character in a virtual terminal, the Arduino reads it from its serial port, and the LCD shows it. Because it runs entirely in simulation, you can test the wiring and the code before touching real hardware.
SIMULATION VIDEO
SIMULATION SCREENSHOT
How the project works
UART is a simple serial link that sends data one byte at a time over two lines: TX (transmit) and RX (receive). On an Arduino Uno, the hardware UART uses digital pin 0 (RX) and pin 1 (TX). In Proteus, a Virtual Terminal stands in for the PC serial monitor, so you can send characters to the Arduino and watch the result.
The flow is straightforward:
- You type a character in the Virtual Terminal.
- The character arrives on the Arduino RX pin at 9600 baud.
- The sketch reads it with
Serial.read(). - The sketch writes it to the LCD with the LiquidCrystal library.
Components needed in Proteus
- An Arduino Uno board (this needs the Arduino library for Proteus to be installed)
- A 16×2 character LCD (LM016L in the Proteus library)
- A Virtual Terminal from the instruments list
Circuit connections
The LCD runs in 4-bit mode, which needs only six Arduino pins. The pin numbers below match the sketch in this article.
- LCD RS to Arduino pin 3
- LCD EN (Enable) to Arduino pin 4
- LCD D4 to pin 5, D5 to pin 6, D6 to pin 7, D7 to pin 8
- LCD RW to ground, since the sketch only writes to the display
- Virtual Terminal TXD to Arduino RX (pin 0)
- Virtual Terminal RXD to Arduino TX (pin 1)
The LCD also needs its power and ground pins connected. In Proteus these are often implied, but on a real board you would also wire VEE (contrast) through a potentiometer. If you want a step-by-step look at the display wiring alone, see this tutorial on how to interface a 16×2 LCD with Arduino in Proteus.
PROGRAM
The sketch below starts the LCD with a short welcome message, then waits for serial data. Each time a byte arrives, it clears the screen and shows that character in the top-left position.
#include <LiquidCrystal.h>
LiquidCrystal lcd(3, 4, 5, 6, 7, 8);//LCD RS-3,En-4,D4-5,D5- 6,D6-7,D7-8
char uart_data;
void setup()
{
Serial.begin(9600);
lcdstart();
lcd.clear();
}
void loop()
{
if(Serial.available()>0)
{
lcd.clear();
uart_data=Serial.read();
lcd.setCursor(0,0);
lcd.write(uart_data);// Print a message to the LCD.
}
}
void lcdstart(void)
{
lcd.begin(16, 2);// set up the LCD's number of columns and rows:
lcd.setCursor(0, 0);
lcd.print("EMERGING TECHS");// Print a message to the LCD.
lcd.setCursor(0,1);
lcd.print("LCD WORKING");// Print a message to the LCD.
delay(500);
}
Code explanation
- LiquidCrystal lcd(3, 4, 5, 6, 7, 8) tells the library which pins connect to RS, EN, D4, D5, D6 and D7.
- Serial.begin(9600) opens the UART at 9600 baud. The Virtual Terminal must use the same rate.
- lcdstart() sets the display to 16 columns and 2 rows and prints the startup text. The half-second delay keeps it visible briefly before
lcd.clear()wipes it. - Serial.available() returns the number of bytes waiting. The sketch only reads when it is greater than zero.
- lcd.write(uart_data) sends a single character to the display.
Note that this version shows only the most recent character, because the screen is cleared on every byte. That is fine for a basic test, but the next section shows how to keep the whole message.
Optional: show a full message instead of one character
If you want typed text to build up across the display, track the cursor position yourself. This version fills the first row, moves to the second, then clears and starts again. It also ignores line-end characters.
#include <LiquidCrystal.h>
LiquidCrystal lcd(3, 4, 5, 6, 7, 8);
int column = 0;
int row = 0;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("UART TO LCD");
delay(1000);
lcd.clear();
}
void loop()
{
if (Serial.available() > 0)
{
char c = Serial.read();
if (c == '\n' || c == '\r') return;
if (column == 16)
{
column = 0;
row = 1 - row;
if (row == 0) lcd.clear();
lcd.setCursor(column, row);
}
lcd.write(c);
column++;
}
}
How to run the simulation
- Build the circuit in Proteus using the connections above.
- Compile the sketch in the Arduino IDE and locate the compiled HEX file (enabling verbose output during compilation shows its path).
- Double-click the Arduino in Proteus and set the HEX file as its program file.
- Double-click the Virtual Terminal and set the baud rate to 9600, with 8 data bits, no parity and 1 stop bit.
- Start the simulation, click inside the terminal window and type. The characters appear on the LCD.
Troubleshooting
- LCD stays blank: check that the pin numbers in
LiquidCrystal lcd(...)match your wiring, and that RW is grounded. - Garbled characters: the baud rate in the terminal does not match
Serial.begin(). - Nothing happens when you type: make sure the terminal TXD goes to the Arduino RX pin, not TX, and that the terminal window has focus.
- Old behavior after editing code: recompile and reload the HEX file in Proteus, because it does not pick up sketch changes automatically.
Related simulations
The same idea of reading serial data and showing it on a display works on other microcontrollers. If you use that family, try UART simulation with the 8051 or the guide on LCD interfacing with the 8051. For a project that combines serial communication with a real-time clock, look at the PIC18F4550 with a DS1307 clock and UART example.
FAQ
Why does the LCD show only one character?
The original sketch calls lcd.clear() before every new byte and always writes at column 0, row 0. Use the cursor-tracking version above to keep a longer message on screen.
What baud rate should I use?
Any standard rate works as long as the sketch and the Virtual Terminal match. This project uses 9600 baud.
Can I use different pins for the LCD?
Yes. Change the numbers in LiquidCrystal lcd(...) and the wiring to match. Avoid pins 0 and 1, since the UART uses them.
Will the same sketch work on a real Arduino?
Generally yes. Wire the LCD the same way, add a contrast potentiometer on VEE, and send data from the Arduino Serial Monitor at 9600 baud.