ARDUINO ,UART AND LCD SIMULATION IN PROTEUS (DISPLAYING UART DATA IN LCD USING ARDUINO AND PROTEUS)

Photo of author

By Jackson Taylor

Home » Electronics Topics » Arduino » ARDUINO ,UART AND LCD SIMULATION IN PROTEUS (DISPLAYING UART DATA IN LCD USING ARDUINO AND PROTEUS)

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

Proteus simulation of Arduino Uno showing a UART character on a 16x2 LCD with Virtual Terminal

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:

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video
  1. You type a character in the Virtual Terminal.
  2. The character arrives on the Arduino RX pin at 9600 baud.
  3. The sketch reads it with Serial.read().
  4. 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.

See also
9 Level Cascaded Multilevel Inverter Simulation (Simulink) -MATLAB

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

  1. Build the circuit in Proteus using the connections above.
  2. Compile the sketch in the Arduino IDE and locate the compiled HEX file (enabling verbose output during compilation shows its path).
  3. Double-click the Arduino in Proteus and set the HEX file as its program file.
  4. Double-click the Virtual Terminal and set the baud rate to 9600, with 8 data bits, no parity and 1 stop bit.
  5. Start the simulation, click inside the terminal window and type. The characters appear on the LCD.
See also
DIY Arduino Projects for Beginners: Start Your Journey into Electronics

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.

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works