In this tutorial we are discussing on how to use arduino with Proteus simulation software. We assume that you have installed Arduino Library in your Proteus software. for installing arduino library in Proteus visit “How to add library in Proteus?” We will learn it by taking led blink example.
LED blinking with Arduino in Proteus
Step 1: Introduction to Proteus Simulation Screen
Open Proteus Software. When you open Proteus you will see a blank page with grid. Grid can be changed from View>>Grid menu (Short cut just press G on Key board). On the left side you have various tools. To change tool bars go to View >>Tool bars..
Step 2: Add components to Proteus
To add components simply right click on work space then move mouse Place >> Components >> From Libraries and click on From Libraries.
You will see Pick Devices window.
- To search components type “arduino” in Keywords.
- Select appropriate Category. In our case Emulator.
- Then select “ARDUINO UNO R3″ in Results.
- Double click “ARDUINO UNO R3″. It will appear in Devices (See left side near tool bar) it is on main window.
- Then add Red LED. Similarly search “LED” in Keywords. Then select Category Optoelectronics and Finally double click on “RED-LED” Animated Model in Results.
- As shown below. This way you can add components to Devices list.
Step 3: Adding Components to worksheet
- Close Pick Devices Window.
- Click on ARDUINO UNO in Device list as shown below.
- Then Click on work sheet. as soon as you click on worksheet you will see the outline of arduino board.
- Similarly Place LED at proper location.
- To rotate LED right click on it.
Step 4: Making connections (Draw Wires) in Proteus
- Connect LED to Pin 13 of Arduino.
- With Selection Mode (Arrow) tool.
- Move the mouse over the end of LED Pin. You will see dotted square.
- Click on the LED end connection when you see dotted square.
- And move mouse towards Pin 13 of Arduino and click on pin end. This way you can draw wires.
- Click on Terminal Mode Tool and select GROUND connect LED second terminal to ground.
- Similarly you can get POWER i.e. +5V if needed.
Step 5: Uploading Code to Arduino
Now you have learned that how to draw circuits in the Proteus. Let’s program the arduino. To program arduino you need to write code in your Arduino IDE. Then get the hex file from your code. for more on getting hex file from arduino see this tutorial How to get HEX file in Arduino IDE?
Assuming that you have got the hex file for blink example. In my case file path is “C:\DOCUME~1\ADMIN~1\LOCALS~1\Temp\build11603454873395663.tmp\Blink.cpp.hex”
- Double click on ARDUINO UNO Board which you see in Workspace.
- You will see Edit Component window.
- Then you see the screen as shown below
- Put file path or browse it in Program File.
- Then click OK. See other options to learn more.
Step 6: Simulating the our LED Blink Example in Proteus
At the bottom of screen you will find Play, Stop, Pause buttons. By pressing Play button your simulation will start. Remember that Arduino IDE will not compile code if Simulation is running and it will not show any error.
Observe the LED blinking, If you see “Error: AVR Program property is not set” It means that you have not loaded your code in Arduino Step 5.
Most Commonly used tools are
- Virtual Instrument Mode
- Here you can find serial Terminal, DSO, Logic Analyser, Voltmeter, Ammeter, etc. all the instruments that you need.
- Voltage Probe Mode
- It is used to measure voltage of any wire with reference to Ground.
- Generator Mode
- In this you get various voltage sources such as Function generator, Pulse generator, Clock generator
In this tutorial we have covered How to use arduino with Proteus simulation software ? by taking led blink example. Now you can enjoy many circuits in Proteus simulation. To learn more understand the Proteus tool bar. Most of the things are in Tool Bar.