Guides · 9 min read

Proteus Arduino Simulation: Library, .hex File, LCD and Motors

Proteus Arduino simulation: add the Arduino library, export the .hex from the IDE, set a 16 MHz clock; LCD, LM35, servo and virtual terminal examples.

A Proteus Arduino simulation is one of the most detailed ways to run Arduino code on your computer without building the circuit or buying a single part. Proteus is Labcenter Electronics' software for schematic capture, circuit simulation and PCB design. You load the .hex file compiled in the Arduino IDE into the Arduino or ATmega328P model in Proteus; the program runs instruction by instruction just like on a real board, the LED lights up, the LCD shows text, the motor turns and you see the serial output in the virtual terminal.

In this guide you will learn step by step how to add an Arduino library to Proteus, how to get the .hex file with Export Compiled Binary in the Arduino IDE, and how to set the clock frequency, the place where simulations break most often. Then we will run three ready-made sketches that simulate a 16x2 LCD with an LM35 temperature sensor, the virtual terminal, a servo and a DC motor. The last section compares Proteus, Tinkercad and Wokwi in a table and lists fixes for common errors such as hex file not found.

What is Proteus and how does Arduino simulation work?

The schematic part of Proteus (formerly called ISIS) is where you draw the circuit, and the simulator called VSM (Virtual System Modelling) models the inside of the microcontroller and runs the machine code you load. In other words, Proteus does not compile your Arduino code; the Arduino IDE compiles it and Proteus executes the resulting .hex file. Resistors, transistors and op-amps around the microcontroller are calculated by a SPICE-based analog engine, so Proteus gives more realistic voltages and currents than Tinkercad and Wokwi. The program runs only on Windows and is paid; Labcenter's demo version is limited when it comes to saving and simulating. It is widely used in schools and university electronics courses, so it is often required for assignments and project submissions.

Proteus conceptWhat it does
Schematic CaptureThe sheet where you draw the circuit and run the simulation
Pick Devices (P key)The window where you search the library and add parts
Terminals ModeThe tool for adding POWER (5 V) and GROUND symbols
Virtual Instruments ModeInstruments such as the virtual terminal, oscilloscope and voltmeter
Program FilePath to the .hex file loaded into the microcontroller
Play, Pause, StopSimulation buttons at the bottom left of the screen
PCB LayoutSwitch from the same schematic to designing a printed circuit board

Adding an Arduino library to Proteus

There are three ways to use an Arduino in Proteus. Newer versions of Proteus 8 ship with an Arduino Uno model; if it shows up when you type ARDUINO in the Pick Devices window, you need no extra library. If it does not, or if you want other boards such as the Nano or Mega, you install a third-party Arduino library: these usually consist of a .LIB and an .IDX file that you copy into Proteus' LIBRARY folder. Where that folder is depends on the version: in older Proteus 8 releases it is Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY, in newer releases it is the hidden ProgramData\Labcenter Electronics\Proteus 8 Professional\LIBRARY folder. The third way is the most robust: use the bare ATMEGA328P model from the library. It is the heart of the Uno anyway; its pins are labelled with port names such as PB5 and PD2, so you only need to know that D13 = PB5 and A0 = PC0.

  1. Close Proteus.
  2. Open the archive you downloaded and take out only the files with the .LIB and .IDX extensions.
  3. Copy them into Proteus' LIBRARY folder; if you cannot find the folder, turn on show hidden items in Windows Explorer.
  4. Restart Proteus and open a new schematic.
  5. Press P and type ARDUINO in the search box; you should see the Uno, Nano or Mega models in the list.
  6. Place the model on the sheet, double-click it and check that the properties window has a Program File field.
Only download third-party libraries from sources you trust, and copy only the .LIB and .IDX files from the archive; no executable is needed. Most of these libraries wrap an ATmega328P model in an Arduino-shaped graphic; the clock frequency field may come empty or wrong, so check the settings in every new project.

Getting the .hex file from the Arduino IDE (Export Compiled Binary)

The file Proteus runs is the Intel HEX file that the Arduino IDE produces at the end of compilation. With Arduino Uno selected as the board, click Sketch > Export Compiled Binary. In Arduino IDE 2 the files are written to the build\arduino.avr.uno folder inside your sketch folder; in Arduino IDE 1.8 they go straight into the sketch folder. Two files are created: one holds only your program, the other, with with_bootloader in its name, also includes the bootloader. For Proteus choose the one without the bootloader. The same folder also contains an .elf file; some versions of Proteus let you debug step by step in the source code with it. When you change the code, just run the menu command again; Proteus reloads the file from disk every time the simulation starts.

Arduino IDE versionFile locationFile to give ProteusVersion with bootloader
Arduino IDE 2.xSketchFolder\build\arduino.avr.uno\sketch.ino.hexsketch.ino.with_bootloader.hex
Arduino IDE 1.8.xSketchFolder\sketch.ino.standard.hexsketch.ino.with_bootloader.standard.hex
arduino-cliThe folder you pass with --output-dirsketch.ino.hexsketch.ino.with_bootloader.hex

Step by step: your first Proteus Arduino simulation with an LED and a clock test

  1. In Proteus create a new project with New Project and continue with the schematic-only option.
  2. Press P and add the Arduino Uno model or the ATMEGA328P, then the LED-RED and RES parts.
  3. Double-click the resistor and set it to 220R; connect pin D13 (PB5) to the resistor, the resistor to the LED's anode and the LED's cathode to a GROUND symbol.
  4. Open the test sketch below in the Arduino IDE and create the .hex file with Export Compiled Binary.
  5. Double-click the Arduino model, select the .hex file in the Program File field with the folder icon and check that the clock frequency is 16MHz.
  6. Press the Play button at the bottom left; the LED should blink once a second.
C++ (Arduino IDE)
1// Proteus saat testi: LED 1 sn yanık, 1 sn sönük olmalı
2// Proteus clock test: the LED should be on for 1 s, off for 1 s
3const int LED_PIN = 13;   // D13 + 220 ohm + LED-RED
4
5void setup() {
6  pinMode(LED_PIN, OUTPUT);
7  Serial.begin(9600);     // Sanal terminal 9600 baud / virtual terminal 9600 baud
8  Serial.println("Proteus Arduino testi basladi / test started");
9}
10
11void loop() {
12  digitalWrite(LED_PIN, HIGH);
13  Serial.println("LED ON");
14  delay(1000);            // 16 MHz değilse süre yanlış olur / wrong timing if the clock is not 16 MHz
15  digitalWrite(LED_PIN, LOW);
16  Serial.println("LED OFF");
17  delay(1000);
18}

This small sketch is really a clock test. If the LED is on for one second and off for one second, Proteus is running the processor at the right frequency. If it changes only every 16 seconds, the model is running at 1 MHz; every 2 seconds means 8 MHz, and you need to fix the settings in the next section. The status bar at the bottom shows simulation time and CPU load; when the simulation runs in real time, the time advances at the same speed as a clock.

Clock frequency and fuse settings

The ATMEGA328P model in Proteus comes with factory fuses, just like the real chip: the internal RC oscillator runs at 8 MHz and the divider (CKDIV8) is on, so the processor runs at 1 MHz. Arduino code, however, is compiled for 16 MHz; as a result delay(1000) lasts 16 seconds, millis() counts slowly and serial communication runs at the wrong speed and produces garbage in the virtual terminal. The fix is to double-click the part and correct three fields in the properties window: set the CKDIV8 divider to off (Unprogrammed), choose an external crystal or external clock for CKSEL Fuses, and type 16MHz in the Clock Frequency field. Field names may differ slightly between Proteus versions. In Arduino library models these values are often preset, but check them anyway. In the simulation you do not have to draw the crystal and 22 pF capacitors; the clock comes from the properties window.

SettingCorrect valueWhat happens if it is wrong?
Program File.hex without bootloader (or .elf)The simulation does not start or reports hex file not found
Clock Frequency16MHzdelay() and millis() give wrong timing
CKDIV8Unprogrammed (no division)The clock is divided by 8 and the code runs 8 times slower
CKSEL FusesExternal crystal or external clockThe internal 8 MHz RC is used or you get a no clock frequency warning
Virtual terminal baudSame as Serial.begin in the code (e.g. 9600)Garbage characters appear in the terminal

Wiring table: LCD, sensor, motors and virtual terminal

ComponentProteus part nameArduino Uno pinATmega328P pin
Red LED + 220 ΩLED-RED, RESD13PB5
16x2 LCD RS, ELM016LD12, D11PB4, PB3
16x2 LCD D4, D5, D6, D7LM016LD5, D4, D3, D2PD5, PD4, PD3, PD2
LCD RW and VSSLM016LGNDGND
LM35 temperature sensor VOUTLM35A0PC0
Potentiometer wiperPOT-HGA1PC1
Servo signalMOTOR-PWMSERVOD9PB1
DC motor driver EN1, IN1, IN2L293D + MOTOR-DCD10, D7, D8PB2, PD7, PB0
Virtual terminal RXD / TXDVIRTUAL TERMINALD1 (TX) / D0 (RX)PD1 / PD0

LCD and sensor simulation: LM016L and LM35

In Proteus the HD44780-compatible 16x2 LCD is called LM016L. The contrast potentiometer of a real circuit is not needed in the simulation; you can leave the VEE pin open or connect it to GND. Always connect the RW pin to GND, otherwise the LCD switches to read mode and the screen stays blank. With the small arrow buttons on the LM35 model you can change the temperature while the simulation is running; the sensor outputs 10 mV per degree, so at 25 °C the output is 250 mV and the Uno's 10-bit ADC reads about 51. The sketch below shows the temperature on the LCD, writes it to the virtual terminal once a second and switches to Fahrenheit if you send the letter f from the terminal. You can see how the LCD is wired on a real board in the 16x2 LCD parallel wiring guide and the LM35 formula in the LM35 guide.

C++ (Arduino IDE)
1// Proteus: LM016L LCD + LM35 sıcaklık sensörü + sanal terminal
2// Proteus: LM016L LCD + LM35 temperature sensor + virtual terminal
3#include <LiquidCrystal.h>
4
5LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // RS, E, D4, D5, D6, D7
6const int LM35_PIN = A0;               // LM35 VOUT
7unsigned long lastPrint = 0;
8
9void setup() {
10  lcd.begin(16, 2);
11  lcd.print("BlueGrays");
12  lcd.setCursor(0, 1);
13  lcd.print("Proteus LCD");
14  Serial.begin(9600);
15  Serial.println("Komut / command: 'c' = derece / Celsius, 'f' = Fahrenheit");
16  delay(1000);
17  lcd.clear();
18}
19
20bool useFahrenheit = false;
21
22void loop() {
23  if (Serial.available()) {            // Sanal terminalden gelen tuş / key typed in the virtual terminal
24    char k = Serial.read();
25    if (k == 'f') useFahrenheit = true;
26    if (k == 'c') useFahrenheit = false;
27  }
28  int raw = analogRead(LM35_PIN);
29  float celsius = raw * (5.0 / 1023.0) * 100.0;   // LM35: 10 mV / °C
30  float shown = useFahrenheit ? celsius * 9.0 / 5.0 + 32.0 : celsius;
31
32  lcd.setCursor(0, 0);
33  lcd.print("Sicaklik/Temp:  ");
34  lcd.setCursor(0, 1);
35  lcd.print(shown, 1);
36  lcd.print(useFahrenheit ? " F        " : " C        ");
37
38  if (millis() - lastPrint >= 1000) {  // Saniyede bir terminale yaz / print once a second
39    lastPrint = millis();
40    Serial.print("ADC: ");
41    Serial.print(raw);
42    Serial.print("  T: ");
43    Serial.println(shown, 1);
44  }
45  delay(100);
46}

The virtual terminal as a Serial Monitor

Proteus has no Serial Monitor like the Arduino IDE; you use the VIRTUAL TERMINAL instead. Pick the terminal from the Virtual Instruments Mode icon, place it on the sheet and wire it crossed over: the Arduino's TX pin (D1) goes to the terminal's RXD input and the RX pin (D0) to the terminal's TXD output. Double-click the terminal and set Baud Rate to the same value as Serial.begin in your code; the default is 9600 baud, 8 data bits, no parity and 1 stop bit. When the simulation starts, the terminal window opens; if you close it, you can reopen it from the Debug menu. Characters you type after clicking in the window are sent to the Arduino; to see what you type, right-click and enable Echo Typed Characters. If you want to talk to a real COM port, the COMPIM model connects the simulated serial line to your computer's port. For serial basics see the Arduino Serial Monitor guide.

Motor simulation: servo and DC motor

Proteus has MOTOR-PWMSERVO for servos, MOTOR-DC for DC motors and MOTOR-STEPPER for stepper motors. The servo model's properties window lists the minimum and maximum pulse widths; these are usually 1 ms and 2 ms. Arduino's Servo library uses 544–2400 µs by default, so angles look off in Proteus. Writing servo.attach(9, 1000, 2000) in the code makes both sides match. Do not connect the DC motor directly to an Arduino pin; use an L293D driver as you would in a real circuit: connect VSS to the 5 V logic supply, VS to the motor supply (for example 12 V) and feed PWM to EN1. In the simulation the motor shows its speed and direction live. Read about real motor driving techniques in the DC motor and L298N guide and how a servo works in the what is a servo motor article.

C++ (Arduino IDE)
1// Proteus: potansiyometre ile servo açısı ve L293D üzerinden DC motor hızı
2// Proteus: servo angle and DC motor speed (via L293D) from a potentiometer
3#include <Servo.h>
4
5const int POT_PIN = A1;     // POT-HG orta ucu / wiper
6const int SERVO_PIN = 9;    // MOTOR-PWMSERVO sinyal / signal
7const int EN_PIN = 10;      // L293D EN1 (PWM)
8const int IN1_PIN = 7;      // L293D IN1
9const int IN2_PIN = 8;      // L293D IN2
10
11Servo servo;
12
13void setup() {
14  servo.attach(SERVO_PIN, 1000, 2000); // Proteus modelinin 1-2 ms aralığı / the model's 1-2 ms range
15  pinMode(EN_PIN, OUTPUT);
16  pinMode(IN1_PIN, OUTPUT);
17  pinMode(IN2_PIN, OUTPUT);
18  Serial.begin(9600);
19}
20
21void loop() {
22  int pot = analogRead(POT_PIN);             // 0-1023
23  int angle = map(pot, 0, 1023, 0, 180);     // Servo açısı / servo angle
24  servo.write(angle);
25
26  int speed = map(pot, 0, 1023, -255, 255);  // Ortada dur, iki yöne dön / stop in the middle, both directions
27  if (abs(speed) < 30) speed = 0;            // Ölü bölge / dead band
28  digitalWrite(IN1_PIN, speed > 0);
29  digitalWrite(IN2_PIN, speed < 0);
30  analogWrite(EN_PIN, abs(speed));
31
32  Serial.print("Aci / angle: ");
33  Serial.print(angle);
34  Serial.print("  PWM: ");
35  Serial.println(speed);
36  delay(200);
37}
If the status bar shows Simulation is not running in real time due to excessive CPU load, your computer cannot keep up with the simulation. Remove unnecessary instruments, print over Serial less often and avoid very short delay() loops; LCD and motor models are the parts that add the most load.

Proteus vs Tinkercad vs Wokwi

FeatureProteusTinkercad CircuitsWokwi
PricePaid, limited demo versionFreeFree basic use, paid plans
Where it runsInstalled on WindowsBrowserBrowser and VS Code extension
Arduino codeCompiled in the IDE, .hex loadedWritten and compiled in the browserWritten and compiled in the browser
BoardsArduino models, AVR, PIC, 8051, some ARM chipsArduino Uno, ATtiny, micro:bitUno, Mega, Nano, ESP32, Raspberry Pi Pico, STM32
Analog accuracyHigh, SPICE-basedMedium, with multimeter and oscilloscopeLimited, has a logic analyzer
InstrumentsOscilloscope, logic analyzer, virtual terminal, voltmeterMultimeter, oscilloscopeLogic analyzer, serial monitor
Wi-Fi and ESP32NoNoYes, with virtual Wi-Fi
PCB designYes, in the same programNoNo
Best forSchool assignments, analog circuits, moving to PCBFirst steps, block coding, classroomsESP32 and IoT projects, quick sharing

Which one should you choose? If you want analog circuit behaviour, oscilloscope signals and a design that will later become a PCB all in one place, Proteus is the strongest option. If you are just starting and want nothing to install, Tinkercad Arduino simulation with its block coding is the easiest start. For projects that need an ESP32, a Raspberry Pi Pico or Wi-Fi, Wokwi simulation has no rival, because Proteus does not simulate the ESP32.

Common errors and how to fix them

Error or symptomLikely causeFix
Hex file not found (Could not open / Cannot find file)Wrong Program File path, file moved or the path contains non-English charactersRun Export Compiled Binary again and put the file in a simple folder such as C:\Proteus\hex
LED changes only every 16 secondsClock at 1 MHz, CKDIV8 onSet Clock Frequency to 16MHz and CKDIV8 to Unprogrammed
CKSEL fuse bits specify external oscillator but no clock frequency is specifiedExternal clock selected but frequency emptyType 16MHz in the Clock Frequency field
Garbage characters in the virtual terminalBaud rate mismatch or wrong clock frequencyMatch the terminal baud to Serial.begin and check the clock
Black boxes or a blank LCDRW not tied to GND, pin order differs from the codeConnect RW to GND and compare RS, E and D4–D7 with the table
No model specified for ...The part has no simulation model, only a PCB footprintPick a part with a simulation model in Pick Devices
Servo angle is offPulse ranges do not matchUse servo.attach(9, 1000, 2000)
Code changed but the simulation is oldHex was not exported againRun Export Compiled Binary again, stop and restart the simulation

Proteus is a powerful tool for trying Arduino code before moving to a real circuit, especially for seeing how analog parts and motor drivers behave; with the right .hex file and a 16 MHz clock setting, most simulations work on the first try. When you want to build the LED, LCD, LM35 and servo circuits you simulated with real parts, the BlueGrays app gives you step-by-step circuit diagrams and commented code for these projects.

Frequently asked questions

How do you simulate an Arduino in Proteus?

You write the code in the Arduino IDE and create a .hex file with Sketch > Export Compiled Binary. In Proteus you double-click the Arduino or ATmega328P model, select this file in the Program File field, set the clock frequency to 16MHz and press Play.

Where do I copy the Proteus Arduino library?

The .LIB and .IDX files go into Proteus' LIBRARY folder. In older Proteus 8 versions this folder is under Program Files (x86), in newer ones it is in the hidden ProgramData folder; restart Proteus after copying.

Where is the hex file in the Arduino IDE?

In Arduino IDE 2, Export Compiled Binary writes the files to the build\arduino.avr.uno folder inside your sketch folder; IDE 1.8 saves them straight into the sketch folder. For Proteus use the file without with_bootloader in its name.

Why does my Arduino run slowly in Proteus?

The most common reason is the clock setting: the ATMEGA328P model runs at 1 MHz by default, so the code looks 16 times slower. Set Clock Frequency to 16MHz and CKDIV8 to Unprogrammed; if the status bar shows a CPU load warning, also remove unnecessary instruments.

How do I open the Serial Monitor in Proteus?

Proteus uses the VIRTUAL TERMINAL instead of a Serial Monitor. Connect the Arduino's TX pin to the terminal's RXD input and the RX pin to its TXD output, and set the terminal's baud rate to the same value as Serial.begin in your code.

Can Proteus simulate the ESP32?

No, Proteus does not simulate the ESP32 or Wi-Fi; some third-party ESP32 libraries only provide a schematic symbol. For ESP32 and IoT projects, the browser-based Wokwi is a better choice.

See all projects
LED Blink
AR-1Beginner

LED Blink

The very first hello of electronics: switching a single LED on and off. The Arduino keeps the LED on for one second and off for one second, so you can easily follow every blink.

4.6(203)
1382
Traffic Light
AR-3Beginner

Traffic Light

A tiny copy of the traffic light you see on the road every day. Red stays on for two seconds, yellow flashes for a moment, green stays on for two seconds, then it goes back to red through yellow…

4.8(139)
490
Print Message on 2x16 LCD Screen
AR-29Advanced
Premium

Print Message on 2x16 LCD Screen

Your first step to writing text on a screen. The two-line LCD screen first shows a waiting message, then writes a greeting on the top line and types a word letter by letter on the bottom line like a…

4.6(37)
51
Using LCD Screen with I2C
AR-32Beginner
Premium

Using LCD Screen with I2C

Give your Arduino its own screen and make it write its first message. The two-line LCD screen hooks up with just a few wires; a greeting appears on the top line, then a second message on the bottom…

4.8(53)
71
Using a Servo Motor
AR-35Beginner
Premium

Using a Servo Motor

The arm of a small servo motor turns to three positions in turn: all the way to the start, right to the middle and all the way to the end, waiting two seconds at each stop.

4.7(49)
69
Servo Motor Operation with Potentiometer
AR-36Beginner
Premium

Servo Motor Operation with Potentiometer

As you turn the potentiometer knob, the servo motor's arm turns right along with it: one end of the knob means zero degrees, the other end means half a turn.

4.6(37)
54
Temperature Measurement with NTC and 2x16 Lcd Display
AR-44Beginner
Premium

Temperature Measurement with NTC and 2x16 Lcd Display

Measure the temperature around you with a sensor that looks like a tiny bead. This part, called an NTC, lets electricity through more easily as it warms up; the Arduino reads that change, turns it…

4.5(33)
44
HC-SR04 Distance Measurement (Serial Display)
AR-27Beginner

HC-SR04 Distance Measurement (Serial Display)

The HC-SR04 sensor works just like a bat finding its way in the dark: it sends out a sound you cannot hear, listens for the echo and measures how far away the object in front of it is.

4.6(52)
94