Hello friends, I hope you all are doing great. Today, I am going to share the new Arduino UNO Library for Proteus V4.0. The Arduino UNO is the board most of us learned with, and it is the heart of most of our Proteus simulations. With this Arduino UNO Library for Proteus, the UNO on your Proteus sheet behaves much more like the one on your desk: its LEDs work, the RESET button runs the bootloader, the 5V and 3.3V pins really power your parts, and a serial monitor is built into the board, so you no longer have to wire a Virtual Terminal to see what your sketch prints.
Version 4.0 is the next version of our Arduino library for Proteus, after V1.0 (2015), V2.0 and V3.0 (2023). The UNO shares one library file with five more boards: the Mega 2560, Mega 1280, Nano, Pro Mini and Mini. If you want all six boards, read our Arduino Library for Proteus V4.0 post. The microcontroller inside is still Proteus's own AVR model, the one V3.0 used, so your Arduino UNO Proteus simulations, HEX files and debug windows work as before. Here is the UNO running our demo sketch, with its built-in monitor in the Simple interface:
NOTICE: This library is very special to our team. We drew the UNO again as a detailed top view of the real R3, made its LEDs, its RESET button with the bootloader and its supply pins work, and then put our serial monitor inside the board. It took our team a lot of hard work, many test runs and many design changes. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the Arduino Proteus Library board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the Arduino UNO Library for Proteus V4.0:
What is Arduino UNO?
The Arduino UNO is a microcontroller board built around the ATmega328P, an 8-bit AVR microcontroller (first made by Atmel, now by Microchip), clocked at 16 MHz. The classic version is the UNO R3, and that is the board we drew (the newer UNO R4 uses a different chip). You program it over USB from the Arduino IDE. A second chip on the board, the ATmega16U2, turns the USB connection into a serial port (a UART) on the ATmega328P's pins D0 and D1. That is why the text of Serial.print() appears on your PC.
Everything you need is on the board:
- 14 digital pins, D0 to D13. Six of them (3, 5, 6, 9, 10 and 11, marked with a ~) give PWM with
analogWrite(). - 6 analog inputs, A0 to A5.
analogRead()turns 0 to 5 V into a number from 0 to 1023 (a 10-bit ADC). A4 and A5 are also the I2C pins SDA and SCL. - A serial port on D0 (RX, receive) and D1 (TX, transmit), shared with the USB chip.
- Four LEDs: ON (power), L (pin 13), TX and RX.
- A RESET button, the power pins 5V, 3.3V, IOREF, VIN and GND, a USB-B socket and a DC jack.
The ATmega328P has 32 KB of flash memory for your sketch (0.5 KB of it holds the bootloader), 2 KB of RAM and 1 KB of EEPROM. That is small, but plenty for most beginner projects, and it is one reason the UNO is still where most students start.
The Arduino UNO R3 at a Glance
| Feature | Value |
|---|---|
| Microcontroller | ATmega328P, 8-bit AVR, 16 MHz |
| USB-to-serial chip | ATmega16U2, with a USB-B socket |
| Digital pins | D0 - D13; PWM on 3, 5, 6, 9, 10 and 11 |
| Analog inputs | A0 - A5, 10-bit (0 - 1023) |
| Serial (UART) | D0 = RX, D1 = TX |
| I2C | A4 = SDA, A5 = SCL (also on the SDA / SCL pins next to AREF) |
| Memory | 32 KB flash, 2 KB RAM, 1 KB EEPROM |
| LEDs | ON, L (pin 13), TX, RX |
| Operating voltage | 5 V; a 3.3 V regulator for the 3.3V pin |
| Board size | 68.6 x 53.3 mm (2.7 x 2.1 in) |
Features of Arduino UNO Library for Proteus V4.0
- The real UNO R3, drawn again: our own detailed top view in the real orientation, colour and size (2.7 x 2.1 in), with the real headers, chips, crystal, connectors and silkscreen.
- Proteus's own AVR model inside: the ATmega328P at 16 MHz runs your HEX file; the clock and fuse properties and Proteus's AVR debug windows work as in V3.0.
- Working LEDs: ON lights with power, L follows pin 13 through the R3's op-amp buffer (with its dim glow when pin 13 floats), and TX / RX flash with the serial traffic.
- A working RESET button with the bootloader: hold it and the chip stays in reset; release it and L flashes 3 times before the sketch starts again.
- Real supply pins: 5V, 3.3V and IOREF are voltage sources you can power parts from, and the GND pins are tied to ground.
- 31 pins: the 24 pins of V3.0 in V3.0's order, plus SDA / SCL, IOREF, 3.3V, VIN and two more GND pins.
- A built-in serial monitor (a TEP addition): a copy of our TEP Serial Monitor Advance inside the board, with Board, Monitor and Plotter tabs.
- One library, six boards:
ArduinoV4TEP.LIBholds the UNO, Mega 2560, Mega 1280, Nano, Pro Mini and Mini, and one model file,TEPARDUINO.DLL, runs them all. - A ready demo: one UNO, one sketch, nothing to wire.
- A small download: about 0.91 MB, without the C++ source code.
What's New Since V3.0
If you have used our V3.0 UNO, these are the changes:
| Topic | V4.0 |
|---|---|
| Board drawing | Drawn again as a detailed top view of the UNO R3, in its real orientation, colour and size |
| LEDs | ON, L, TX and RX work like the real ones, with a glow and a short fade |
| RESET | A working reset switch on the board, with the bootloader's 3 flashes and 1 s wait |
| Supply pins | 5V, 3.3V and IOREF are real voltage sources; the GND pins are tied to ground |
| Serial output | A serial monitor built into the board; no Virtual Terminal to wire |
| Pins | 31 instead of 24; the 24 of V3.0 keep V3.0's order |
| Pin direction (bug fix) | AREF, RESET, VCC and GND pointed INTO the board in V3.0; now top pins point up and bottom pins point down |
| Property name (bug fix) | "Clock Frequence" is now "Clock Frequency" |
What did not change: the microcontroller model, the HEX upload and the debug windows. V3.0 and V4.0 can stay installed together, because their file and device names differ. The pin positions did change, though, so a V3.0 design does not swap pin for pin: place the V4.0 board and wire it again.
Download Arduino UNO Library for Proteus V4.0
Click the button below to download Arduino-UNO-Library-for-Proteus-v4.0.zip (about 0.91 MB, without the C++ source code):
Arduino UNO Library for Proteus V4.0- README.txt: the files, the installation, the board, the built-in monitor, the properties, the test status and troubleshooting.
- Proteus Library Files:
ArduinoV4TEP.LIB, one library with all six V4.0 boards. - Proteus Model Files:
TEPARDUINO.DLL, the board model. - Proteus Simulation:
UNO-V4-Board-Demo.pdsprj, its sketchTEP_Board_Demo_UNO.hexand a copy ofTEPARDUINO.DLL, so the demo runs as it is. - Arduino Code:
TEP_Board_Demo\TEP_Board_Demo.ino, the source of the HEX file; it needs no extra Arduino library.
That is 7 files. The library and the model are the same in every V4.0 download; this zip carries only the UNO's demo. TEPARDUINO.DLL loads Proteus's own AVR model (MODELS\AVR2.DLL) and needs no Visual C++ redistributable.
How to Install Arduino UNO Library for Proteus V4.0
- Close Proteus and extract the whole zip file to a normal folder (the Desktop is fine).
- Copy
ArduinoV4TEP.LIBfrom Proteus Library Files into the LIBRARY folder of Proteus, for exampleC:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY(on some PCsC:\ProgramData\Labcenter Electronics\Proteus 8 Professional\LIBRARY: use the folder that already holds Proteus's own .LIB files). - Copy
TEPARDUINO.DLLfrom Proteus Model Files into the MODELS folder (...\Proteus 8 Professional\MODELS). - If an
ArduinoV4TEP.IDXis in the LIBRARY folder, delete it. - Start Proteus, press P (Pick Devices) and search for V4.0 or Arduino. The six boards are in the category Arduino > Arduino Boards; pick ARDUINO UNO V4.0.
Note: Tested in Proteus 8.5; Proteus 7 is not supported. The install takes about two minutes. Your V3.0 library can stay where it is.
How to Run the Arduino UNO Simulation in Proteus
The demo is as simple as it gets: one UNO and nothing else on the sheet, because the board itself shows everything. Try it before you read on:
- Open
UNO-V4-Board-Demo.pdsprjfrom the Proteus Simulation folder. KeepTEP_Board_Demo_UNO.hexandTEPARDUINO.DLLbeside it. - Press Run. The board powers up (ON lights), the monitor window opens with the sketch's start-up text, and L blinks once a second.
- Type READ in the monitor and press Enter. RX flashes while your line arrives, TX while the sketch answers with every analog pin.
- Hold the board's RESET button: the sketch stops. Release it: L flashes 3 times and the sketch starts again 1 s later.
- Type PLOT ON and open the Plotter tab. Type PLOT OFF to stop.
The rest of this article explains each of these steps: the board, its LEDs, RESET, the supply pins, the built-in monitor, the sketch and how to run your own code.
The Arduino UNO V4.0 Board in Proteus
We drew the board ourselves, as a detailed top view of the real UNO R3 in its real size (2.7 x 2.1 inches, 68.6 x 53.3 mm) and layout, lying the way you usually see it: the USB socket on the left and the digital header along the top. Here it is, running the demo:
Take a tour from left to right:
- Left edge: the silver USB-B socket (click it while the simulation runs to open the monitor) and the black DC jack.
- Top-left corner: the RESET button, the ATmega16U2's 2 x 3 ICSP header and a mounting hole.
- The USB side: the ATmega16U2 (marked MEGA16U2) with its 16.000 MHz crystal, the regulator, the capacitors and the op-amp that drives L.
- The LEDs: L, TX and RX in a column next to the 16U2, and ON on the right, next to the Arduino logo with ARDUINO and "UNO" in its white border.
- The main chip: the ATmega328P-PU in its 28-pin DIP package, with the second ICSP header on the right edge.
- Headers: DIGITAL (PWM~) along the top, POWER and ANALOG IN along the bottom, with the pin names printed next to them as on the real board.
In the picture, Proteus draws its small logic-state squares on the pins while the simulation runs: red for HIGH, blue for LOW and grey for a pin that floats. Pin 13 is red, so L is lit. TX>1 and RX<0 are red too, because a serial line rests HIGH between characters.
Pinout
The board has 31 pins. Top pins point up and bottom pins point down, at the real header positions:
| Pin(s) | Where | What it does |
|---|---|---|
| RX<0 (D0), TX>1 (D1) | Top header, right end | The serial port; the built-in monitor sits on these two |
| 2 - 13 | Top header | Digital I/O; ~3, ~5, ~6, ~9, ~10 and ~11 give PWM; 13 also drives L |
| GND, AREF | Top header, left of 13 | Ground; the ADC's reference input |
| SDA, SCL | Top header, left end | I2C: the same nets as A4 and A5 |
| A0 - A5 | ANALOG IN header (bottom right) | Analog inputs (they work as digital pins too) |
| IOREF | POWER header | A 5 V source: tells a shield the board's I/O voltage |
| RESET | POWER header | The board's RESET pin, kept from V3.0 |
| 3.3V | POWER header | A 3.3 V source |
| 5V | POWER header | A 5 V source |
| GND, GND | POWER header | Ground |
| Vin | POWER header | The board's input supply on a real UNO; a load only here |
The first 24 pins are the pins of V3.0 (D0 - D13, A0 - A5, AREF, RESET, 5V and GND), in V3.0's order. The new ones are SDA and SCL on the top header, a GND next to AREF, and IOREF, 3.3V, VIN and a second GND on the power header. This fixes an old V3.0 bug as well: its AREF, RESET, VCC and GND pins pointed into the board.
Component Properties
| Property | Meaning | Default |
|---|---|---|
| Upload Hex File | Your sketch: a HEX, ELF or COFF file | TEP_Board_Demo_UNO.hex in the demo |
| Clock Frequency | The AVR model's clock (V3.0 spelled it "Clock Frequence") | 16MHz |
| BOOTLOADER | YES: after RESET, L flashes 3 times and the sketch starts 1 s later, as on a real board; NO: the sketch starts at once | YES |
| MONITOR | YES: the built-in serial monitor on D0 / D1; NO: D0 / D1 are free for your own terminal | YES |
| BAUD | The monitor's baud rate: 300 to 2000000, or AUTO (it measures the sketch's bits) | 9600 |
| AUTOOPEN | YES: the monitor window opens at Run; NO: click the USB port to open it | YES |
The AVR fuses, the EEPROM file and the trace switches are Proteus's own, hidden as in V3.0.
The Working LEDs of the Arduino UNO
A real UNO has four LEDs, and on the V4.0 board all four do what the real ones do:
| LED | Colour | What lights it |
|---|---|---|
| ON | Red | Power: lit while the simulation runs |
| L | Green | Pin 13, through the R3's op-amp buffer: lit while D13 is HIGH (also with INPUT_PULLUP), dark while it is LOW, a dim glow while it floats |
| TX | Orange | Traffic on D1, so the sketch sending; held 40 ms after the last edge |
| RX | Blue | Traffic on D0, so the sketch receiving; held 40 ms after the last edge |
L and the Op-Amp Buffer
On the UNO R3, pin 13 does not drive the L LED directly. An op-amp (half of an LMV358) wired as a buffer copies the pin's voltage to the LED, so the LED takes no current from pin 13. This has two effects you can see on a real board, and on ours:
- INPUT_PULLUP lights L fully. The weak internal pull-up is enough for the buffer's input, so L shines as if the pin were an output driving HIGH.
- A floating pin 13 gives a dim glow. When pin 13 is an INPUT with nothing wired to it, or while the chip is held in reset, the buffer's input floats and the real L LED often glows faintly. Our model shows that as a dim glow. You will see it in the RESET picture below.
In your own sketch, with nothing wired to pin 13, pinMode(13, INPUT) gives you the dim glow and pinMode(13, INPUT_PULLUP) lights L. In the demo, L blinks once a second: on for half a second, off for half a second.
TX and RX: Held 40 ms So You Can See Them
TX flashes when the sketch sends on D1, and RX when something arrives on D0. At 9600 baud, one character takes 10 bits / 9600 = about 1 ms, so a single character would be far too short to see. That is why each LED stays lit for 40 ms after the last edge. When the sketch prints a long text, TX stays on for the whole text.
There is one difference from the real board. On a real UNO, the TX and RX LEDs belong to the USB chip and flash only for USB traffic. Here they flash for any traffic on D0 / D1, also when you wire a GPS or Bluetooth module to these pins. For learning, that is handy: you see the data move.
The Glow and the Fade
A real LED does not jump from dark to bright on a screen's frame. So our LEDs glow in steps and fade out over a few frames, and TX / RX shimmer while they are busy. These are drawing choices that make the LEDs easy to read, not physics: the pins themselves switch at once.
The RESET Button and the Bootloader
The RESET button in the top-left corner is a tactile switch drawn as one, and it works like the real one. Click and hold it:
- While you hold it: the chip is held in reset. The cap looks pressed: darker and without its shine. Every pin floats, so Proteus draws grey squares, and L shows the dim glow of the floating buffer.
- When you release it: the bootloader runs. L flashes 3 times (pin 13 really toggles, in 62.5 ms steps), and the sketch starts again 1 s after the release.
- At power-on (when you press Run), the sketch starts at once, as on a real board.
- BOOTLOADER=NO skips the wait: after RESET, the sketch starts at once.
- The red RESET key on the monitor's Board tab does the same as a 20 ms press of the button, bootloader included.
Why does a real UNO wait after a reset? Its bootloader (optiboot) listens for about a second for a new sketch from the Arduino IDE before it starts yours, and it flashes L 3 times while it does. After a power-on it skips that wait. Our model copies this, so a RESET in Proteus looks like a RESET on your desk. After every RESET, the demo prints its start-up text again, and the Board tab counts the resets.
Supply Pins: 5V, 3.3V, IOREF, VIN and GND
On the V4.0 board, the supply pins are real. You can wire a sensor's VCC straight to the UNO's 5V pin and its GND to a GND pin, exactly as you would on a real board:
| Pin | In the simulation | On a real UNO R3 |
|---|---|---|
| 5V | A 5 V source (0.1 ohm) | 5 V from the USB or the regulator |
| 3.3V | A 3.3 V source (0.5 ohm, no current limit) | A 3.3 V regulator, about 50 - 150 mA |
| IOREF | A 5 V source | Tells a shield the board's I/O voltage (5 V) |
| VIN | A load only (1 Mohm); the board runs as if USB-powered | An input, through the regulator |
| GND (3 pins) | Tied to ground | Ground |
The Board tab of the built-in monitor shows these pins live. In our run it showed 5V 5.00 V, 3.3V 3.30 V, IOREF 5.00 V and VIN 0.00 V: nothing feeds VIN, because the simulated board is powered as if from USB.
The Built-In Serial Monitor (a TEP Addition)
A real UNO has no screen. To read what a sketch prints, you open the Serial Monitor of the Arduino IDE on your PC, and in Proteus you would normally wire a Virtual Terminal to D0 and D1. In V4.0, the board has its own copy of our TEP Serial Monitor Advance, wired inside the board to its serial port. This monitor is a TEP addition: no real UNO has it. Read all about the monitor itself in our TEP Serial Monitor Advance for Proteus post.
- Where it is connected: it listens to D1 (the sketch's TX) and drives D0 (the sketch's RX) through a weak driver, the way the real USB chip sits behind its 1 k resistors. So a module you wire to D0 still wins.
- How it opens: at Run (AUTOOPEN=YES), or when you click the board's USB port. Proteus's Debug menu lists it too.
- Its baud rate: the BAUD property, 9600 by default. AUTO measures the sketch's bits.
- Turning it off: MONITOR=NO frees D0 and D1 for a Virtual Terminal or another TEP Serial Monitor.
The window has three tabs, Board, Monitor and Plotter, and a compact Simple interface. We start with the Simple interface, because that is what the featured image shows.
The Simple Interface
Press Ctrl+Shift+U (or use the monitor's ... menu) and the window shrinks to the text and the line to send. One slim toolbar row stays: the baud rate (9,600 baud), follow, pause, search and clear, the part's name and format (ARD1 · 9600 8N1), and the buttons to expand, minimise and close. Esc goes back to the full interface. Here is the demo right after Run:
=== TEP Arduino UNO V4.0 - board demo (9600 baud) ===
Commands:
HELP this list
LED ON pin 13's LED on (stops the blink)
LED OFF pin 13's LED off
BLINK blink it again (1 s)
READ the analog pins (volts)
PLOT ON stream sin / cos / ramp for the Plotter tab
PLOT OFF stop the stream
STATUS LED, plot and uptime
Ready - L blinks; type a command and press Enter.
After that the sketch prints nothing on its own: L keeps blinking, and the monitor waits for you. Type READ in the send box and press Enter (the line ending is Newline):
READ
You typed: READ
A0: 0 (0.00 V)
A1: 0 (0.00 V)
A2: 0 (0.00 V)
A3: 0 (0.00 V)
A4: 0 (0.00 V)
A5: 0 (0.00 V)
Notice the small tags in this picture. The monitor marks each line with the direction it saw: RX for text it received from the sketch, TX for the line you sent (READ, in blue). On the board it is the other way round, because the board's LEDs take the sketch's point of view: the sketch's answer lights the board's TX LED, and your READ lights its RX LED.
The Monitor Tab
The Monitor tab is the full serial terminal: the text in both directions, a line to send (Enter sends it, and the arrow keys bring back the history), the line ending, the baud rate and format, ASCII or HEX view, time stamps, search, and saving the log to a file. It is the same terminal as in our standalone TEP Serial Monitor Advance.
The Board Tab
The Board tab is the first tab, and it is something no real board can give you: a live view of the whole UNO.
- ARDUINO UNO R3: the four LEDs as they glow on the sheet (here ON and TX are lit, and L is dark between two blinks) and the state pill: RUNNING, IN RESET or BOOTLOADER.
- The RESET key: a red key with a switch icon; one click is a 20 ms press, bootloader included.
- Options: "Bootloader after RESET (L flashes 3x)" and "Open this window at Run", the BOOTLOADER and AUTOOPEN properties as check boxes.
- Chip, Sketch, Resets, Speed: ATmega328P @ 16 MHz, TEP_Board_Demo_UNO.hex, 1 reset so far, and 70 % of real time.
- DIGITAL PINS: a tile for every pin, D0 to D13, with its state: HIGH, LOW, pull-up or input. Here D1 is HIGH (the serial line at rest), D0 shows pull-up, D2 - D12 are inputs and D13 is LOW.
- ANALOG PINS (volts · analogRead): the voltage and the count of every analog pin. Here all six say "open": nothing is wired to them, so Proteus has no node to read, and the sketch reads 0.
- SUPPLY PINS: 5V, 3.3V, IOREF and VIN, live.
The status bar at the bottom counts the traffic from the monitor's side: RX 14,892 (received from the sketch) and TX 21 (sent by you), no errors, 464 lines, at t = 187.162 s of simulated time. The speed shows how hard the PC works: about 70 % of real time on our PC with the monitor open and the plot stream running. Proteus's AVR model sets the pace, as it did with V3.0.
The Plotter Tab
Type PLOT ON. The sketch then prints a line like sin:0.000,cos:1.000,ramp:-1.00 (the first one) every 200 ms. The Plotter turns every "name:value" pair into a live trace:
The toolbar picks the window (Last 500 samples) and the scale (Auto scale), and has pause and clear buttons. Below the chart, each trace shows its last, minimum and maximum value. The ramp tops out at 0.95, not 1: the sketch counts 0 to 39 and prints (count / 20) - 1, so the highest value is 39 / 20 - 1 = 0.95. Your own sketch can use the same format for any values, for example temp:24.5,hum:61.
Help and Support
The ? icon in the header opens Help & Support. The gear opens Settings, the palette icon switches the theme, and the - / + buttons change the zoom (100 % here).
There are eight cards: Report a bug and Suggest a feature (our forum board for the Arduino libraries), Read the article and User guide (both open this post), Check for updates ("This is v4.0"), Support / donate, Visit our website and Community forum. Every card shows its link. Each board in the library opens its own post here. Copy diagnostics copies a short report for a bug post, and a links.ini next to the DLL can change the links.
The Demo Sketch: TEP_Board_Demo
The demo sketch, TEP_Board_Demo.ino, is one sketch for all six boards. It uses only the hardware Serial at 9600 baud and no extra library, and it needs nothing wired: the board's own LEDs and the built-in monitor show everything. First, it picks the board's name from the board you select in the Arduino IDE:
#if defined(ARDUINO_AVR_MEGA2560)
const char BOARD[] = "Arduino Mega 2560";
#elif defined(ARDUINO_AVR_MEGA)
const char BOARD[] = "Arduino Mega 1280";
#elif defined(ARDUINO_AVR_NANO)
const char BOARD[] = "Arduino Nano";
#elif defined(ARDUINO_AVR_PRO)
const char BOARD[] = "Arduino Pro Mini";
#elif defined(ARDUINO_AVR_MINI)
const char BOARD[] = "Arduino Mini";
#else
const char BOARD[] = "Arduino UNO";
#endif
With the board "Arduino Uno" selected, none of the names before #else is defined, so the UNO's HEX file says "Arduino UNO". Then the timing: L changes every 500 ms (one blink a second), the plot runs every 200 ms, and a pause of 100 ms ends a typed line:
const int LED_PIN = 13;
const unsigned long BLINK_MS = 500, PLOT_PERIOD_MS = 200, LINE_TIMEOUT_MS = 100;
setup() prints the start-up text you saw in the monitor:
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
Serial.println();
Serial.print(F("=== TEP "));
Serial.print(BOARD);
Serial.println(F(" V4.0 - board demo (9600 baud) ==="));
printHelp();
Serial.println(F("Ready - L blinks; type a command and press Enter."));
nextBlinkAt = millis();
}
The F() around each text keeps it in flash memory instead of the UNO's small 2 KB of RAM. The loop never calls delay(), so a typed command is answered at once. It collects the characters of a line; Enter ends the line, and so does a pause, for the "No line ending" setting:
while (Serial.available() > 0) {
char c = Serial.read();
lastCharAt = millis();
if (c == '\r' || c == '\n') handleLine();
else if (lineLength < sizeof(line) - 1) line[lineLength++] = c;
}
if (lineLength > 0 && millis() - lastCharAt >= LINE_TIMEOUT_MS) handleLine(); // "No line ending": a pause ends it
The heartbeat on L is a millis() timer, not a delay:
if (blinking && (long)(millis() - nextBlinkAt) >= 0) {
nextBlinkAt += BLINK_MS;
setLed(!ledOn);
}
handleLine() first cleans the line up: it turns it into upper case and removes extra spaces, so "led on", "LED ON" and " Led On " all work:
for (byte i = 0; i < lineLength; i++) {
char c = line[i];
if (c >= 'a' && c <= 'z') c -= 32;
if (c == ' ' && (n == 0 || cmd[n - 1] == ' ')) continue;
cmd[n++] = c;
}
Then it compares the command. LED ON and LED OFF stop the blink and set pin 13:
} else if (strcmp(cmd, "LED ON") == 0) {
blinking = false; setLed(true);
Serial.println(F("L (pin 13) is ON"));
} else if (strcmp(cmd, "LED OFF") == 0) {
blinking = false; setLed(false);
Serial.println(F("L (pin 13) is OFF"));
READ goes through every analog pin. NUM_ANALOG_INPUTS comes from the Arduino core: 6 on the UNO, so the loop prints A0 to A5 (on a Mega, the same code prints 16 pins):
void readAnalog() {
for (byte i = 0; i < NUM_ANALOG_INPUTS; i++) {
int v = analogRead(A0 + i);
Serial.print('A');
Serial.print(i);
Serial.print(F(": "));
Serial.print(v);
Serial.print(F(" ("));
Serial.print(v * 5.0 / 1023.0, 2);
Serial.println(F(" V)"));
}
}
STATUS answers in one line: the LED (blinking, ON or OFF), the plot stream and the time since the last start, with one decimal. After a RESET the uptime starts again from zero, because millis() does:
} else if (strcmp(cmd, "STATUS") == 0) {
Serial.print(F("LED "));
Serial.print(blinking ? F("blinking") : ledOn ? F("ON") : F("OFF"));
Serial.print(F(", plot "));
Serial.print(plotOn ? F("ON") : F("OFF"));
Serial.print(F(", uptime "));
Serial.print(millis() / 1000.0, 1);
Serial.println(F(" s"));
And the plot stream, in the "name:value" format the Plotter understands:
if (plotOn && (long)(millis() - nextPlotAt) >= 0) {
nextPlotAt += PLOT_PERIOD_MS;
float a = sample * 0.15;
Serial.print(F("sin:"));
Serial.print(sin(a), 3);
Serial.print(F(",cos:"));
Serial.print(cos(a * 0.7), 3);
Serial.print(F(",ramp:"));
Serial.println((sample % 40) / 20.0 - 1.0, 2);
sample++;
}
Demo Commands
| Command | What it does | The answer |
|---|---|---|
| HELP | Prints the command list | The list from the start-up text |
| LED ON | Pin 13 HIGH, L on (stops the blink) | L (pin 13) is ON |
| LED OFF | Pin 13 LOW, L off (stops the blink) | L (pin 13) is OFF |
| BLINK | L blinks once a second again | L (pin 13) blinks again |
| READ | Every analog pin: the count and the volts | A0: 0 (0.00 V) ... A5 |
| PLOT ON | sin / cos / ramp every 200 ms for the Plotter tab | Plot stream ON - open the Plotter tab |
| PLOT OFF | Stops the stream | Plot stream OFF |
| STATUS | The LED, the plot and the uptime | LED blinking / ON / OFF, plot ON / OFF and the uptime in s |
A command the sketch does not know gets "Unknown command - type HELP". Try LED ON and watch L light up fully, then BLINK; try STATUS before and after PLOT ON.
Your Own Sketch on the Arduino UNO V4.0
Running your own code works as with V3.0:
- In the Arduino IDE, select the board Arduino Uno (Tools > Board).
- Write or open your sketch and use Sketch > Export Compiled Binary. Sketch > Show Sketch Folder shows you where the HEX files went.
- Take the .hex file without "with_bootloader" in its name.
- In Proteus, double-click the UNO and set Upload Hex File to that file.
- If your sketch uses another baud rate than 9600, set BAUD to the same rate, or to AUTO.
- Press Run.
A few tips for sketches in Proteus:
- Power your parts from the board. The 5V, 3.3V and GND pins are real now, so wire a module's VCC and GND to them.
- D0 and D1 belong to the monitor. The monitor only listens to D1 and drives D0 weakly, so a module wired to D0 still wins. If you want a Virtual Terminal or your own monitor on these pins, set MONITOR=NO.
- Use INT0 / INT1 for interrupts. Proteus 8.5's AVR model did not run pin-change interrupts in our tests. Use
attachInterrupt()on D2 (INT0) or D3 (INT1), ordigitalRead(). - Moving a V3.0 design? The pin positions changed: place the V4.0 board and wire it again. Both libraries can stay installed side by side.
Things to Know Before Using a Real Arduino UNO
The demo sketch uses only the Arduino core, so it runs on a real UNO as well. Keep these differences in mind:
- TX and RX LEDs: on a real board, the USB chip drives them for the USB traffic only. Here they flash for any traffic on D0 / D1, also from a module.
- The bootloader: after a RESET, a real UNO waits about a second for an upload before the sketch starts, and optiboot flashes L 3 times; a power-on starts the sketch at once. The model does the same (BOOTLOADER=NO: no wait).
- The 3.3V pin of a real board gives only about 50 - 150 mA. In the simulation it is a 3.3 V source with 0.5 ohm and no current limit, so check the current of your parts against the real limit.
- VIN is an input on a real board: about 7 - 12 V that the regulator turns into 5 V. Here it is a load only, and the board runs as if powered from USB.
- Pin current: an ATmega328P pin can give about 20 mA safely (40 mA is the absolute maximum), so always use a resistor with an LED.
- No serial monitor on the board: on real hardware, open the Serial Monitor of the Arduino IDE at the same baud rate (9600 for the demo, line ending Newline).
Troubleshooting
- The board does not simulate, no LEDs light:
TEPARDUINO.DLLis missing from the MODELS folder and from the project folder. - No monitor window: click the board's USB port, or check that MONITOR=YES. Proteus's Debug menu also lists the monitor.
- The monitor shows nothing, or strange characters: the sketch's
Serial.begin()and the BAUD property differ. Set BAUD to the sketch's rate, or to AUTO. - A Virtual Terminal on D0 / D1 shows the text twice or fights the monitor: set MONITOR=NO on the board.
- An analog tile on the Board tab says "open": nothing is wired to that pin, so Proteus has no node to read (the sketch reads 0).
- The board cannot be found in Pick Devices: check that
ArduinoV4TEP.LIBis in the LIBRARY folder that holds Proteus's own .LIB files, delete an oldArduinoV4TEP.IDXand search for "V4.0". - Your sketch waits for a pin-change interrupt and nothing happens: Proteus 8.5's AVR model did not run pin-change interrupts in our tests. Use
attachInterrupt()on INT0 / INT1 ordigitalRead().
Found a bug? Please post it in our forum with a screenshot, the monitor text, the simulation log and the monitor's Copy diagnostics text.
Limitations of the Simulation
- What is Proteus's and what is ours: the ATmega328P is Proteus's own AVR model (Labcenter's
AVR2.DLL). OurTEPARDUINO.DLLadds the board around it: the drawing, the LEDs, RESET with the bootloader, the supply pins and the built-in monitor. - Not simulated: the ATmega16U2 and the USB (the built-in monitor stands in for them), the regulator and VIN, and the current limits of the real supply pins. The glow, the fade and the shimmer of the LEDs, and the Board tab, are TEP additions, not features of the real board.
- Speed: about 70 % of real time on our PC with the monitor open and the plot stream running. Proteus's AVR model sets the pace, as with V3.0, so a slower PC runs slower.
- Tested: verified in Proteus 8.5 on 9 October 2026 with the demo project as shipped and the built-in monitor. ON was lit, L blinked, and TX / RX flashed with the serial traffic. With RESET held, the chip stayed in reset (the pins floated, L dimmed); after the release, the bootloader flashed L and the sketch restarted 1 s later. The supply pins read 5.00 V / 3.30 V / 5.00 V, READ answered A0 - A5 and the plot stream drew sin / cos / ramp.
- Checked when the library is built: no two parts or texts overlap, every text sits on the board, every LED and RESET region the model redraws is clear, the pin positions and V3.0's pin order are right, and the demo project is read back after it is written.
- Licences: the board model, the symbols, the artwork and the built-in monitor are made by The Engineering Projects (the C++ source code is not included). The HEX file is built from the demo sketch and the Arduino AVR core 1.8.6, which includes LGPL-licensed code; you can find its source code on GitHub. Proteus is a product of Labcenter Electronics and is not included. Arduino is a trademark of Arduino SA: the board is our own drawing, not an official Arduino product.
So, that was all about the Arduino UNO Library for Proteus V4.0. I hope the working LEDs, the RESET button with its bootloader, the real supply pins and the built-in monitor make your UNO simulations feel much closer to the real board, so your code works the first time you upload it to a real UNO. If you use the Arduino UNO Library for Proteus in a project, please share your feedback in the comments or in our forum, and if you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!