Launched in 2005, the Arduino open hardware and software platform has grown to be very popular among hobbyists, educators, and professionals alike, gaining momentum especially in the robotics field. Backed by a massive online community, and with most development boards and hardware accessories available at very low prices, this platform is perhaps the best place to start in working with embedded devices. But what if you want to learn programming and do not own an Arduino board, or are overwhelmed by the selection of hardware out there? This is where simulation software comes in.
These products generally create a virtual environment in which not only can you write code but you can also create electronic circuits to test the behavior of your code. In the selection of software presented below you will notice that very different sets of features are offered by each application. Some offer vast libraries of hardware to select from, while others allow you to develop in visual environments and show results in graphical form, while others plot graphs and display data sets.
Some even accurately render your project in 3D and allow data export for professional fabrication of electronic circuits or elements. You will also find MCU emulators, as we will discus later in the article, that execute program instructions in the exact same way real hardware would. Some of these products are completely free and open source, while others cost several times more than hardware.
Speaking of cost, why would you bother with such software when boards and accessories come so cheap? Well, there are a number of features and advantages that simulation software offers, compared to a standard IDE and hardware combos. For instance debugging features are very extensive in some simulators, and you can also observe and correct functional errors of your programming, while IDE software debuggers address only non-functional or technical mistakes in code, such as improper declarations, invalid objects or syntax errors. In visual simulation environment you can actually see what your program does, so you can alter it on-the-fly if necessary, or build new functionality in a very creative way. You can also log and plot output data, to check how hardware responds in a given situation.
Software simulators are useful even if you own a development board but want to perform certain experiments, without losing time uploading your program to the board for every little change you make. This is also good for the board’s Flash memory, as it will not get rewritten that often. You can also test functionality of new peripherals for the board before actually buying them, or create and share blueprints for new electronic circuits that could become very helpful and popular.
Simulator for Arduino
Created by Australian company Virtronics, Simulator for Arduino is a pretty powerful software for PCs running Windows. It supports most Arduino hardware, such as Uno, Mega, Nano and other common boards. It comes with a range of features that aid rapid sketch prototyping and debugging as well.
A number of peripherals can be simulated such as serial, Ethernet or SPI interfaces, servo control, SD card and so forth. The simulator has some limitations — custom hardware components and libraries, pointers, classes and structs are not properly supported.
The software is available either as a free download, with some limitations after the 30 day trial period expires, or as a Pro version priced at approximately 13 US Dollars (14.99 Australian Dollars).
123D Circuits is an online electronics simulator and collaborative design platform, born from the partnership between Autodesk and Circuits.io, since in Fall 2013. It is an excellent tool for beginners who want to quickly get a grip of creating with Arduino, Raspberry Pi or other platforms right from their browser window.
Virtual circuits can be created by using the intuitive breadboard editor, or the more advanced electronic schematics or PCB editors, and ready made components and designs are also available for you to implement. Programming of the newly created circuits is possible with the code editor and operation is displayed in real time. You can also fabricate and order the electronics based on your own design.
123D Circuits is a free service, however upgraded memberships starting at US$ 12 per month will bring you discounts on orders as well as the ability to make your designs private.
Virtual Breadboard is perhaps the most advanced Arduino simulator available. It was created by James Caska back in 1999 and nowadays it has evolved into a very mature software with a long list of features. Not only does it simulate Arduino devices but also Netduino and PIC microcontrollers. It features a visual development environment and it also allows you to program a real Arduino boards.
It is compatible with Fritzing and J.A.R.V.I.S and also doubles as a powerful AVR emulator. The core software, for Windows, is free to download, however functionality expansion modules are licensed individually.
[yellow_box]Read more about Fritzing in Useful tools for drawing electrical circuits[/yellow_box]
Apart from its obvious Arduino sketch debugging abilities, ArduinoDebugger is also a simulator. The software is created by Paul Richards (Paulware) and supports a number of components such as segment and LCD displays, 4051 MUX, LED functions, to mention some of them. The open source software is written in C++ and runs under Windows.
Discussion about this software on Arduino forums.
CodeBlocks Arduino IDE (API-level Arduino simulator)
This software is an Arduino customized version of the well known CodeBlocks IDE, with a recently added API based Arduino simulation feature, which is however in a very early development stage. Stay tuned for updates on this matter.
Simuino is an Arduino Uno and Mega pin simulator for Linux (Ubuntu). It runs in a terminal and displays pin results based on your sketches. It also had a web based version, the Webuino, but unfortunately it has been offline since last year. Files available on Google Code.
AVR Microcontroller Emulators
Well, what is the difference between a simulator and an emulator, and when to use one or another? Emulators generally execute code instructions in exactly the same way an embedded device would do it, down to hardware level.
For instance if we look at an ATMega328 MCU, specific to the Arduino Uno board, we see specs like RISC 8-bit CPU, 20 MHz frequency, up to 4 instructions per cycle, and so on. These are completely different from specifications of the desktop-class CPUs which power your PC or Mac, which are generally x86 64-bit multiple core and thread processing units, running at over 2 GHz frequencies.
Not only will execution timing the program be completely off when testing in simulation software, but data throughput and resource handling will also be completely different, leading to discrepancies in expected and actual behavior your code. MCU emulators address this basically by creating an environment where the exact amount of resources as in real life is made available, by means of a virtualization mechanism (i.e. virtual machine). This comes in handy when debugging at levels more closer to hardware is required, like observing how resources are allocated and freed up during program runtime, possible errors or limitations for certain code.
Proteus VSM for AVR and Arduino AVR
Proteus VSM for Arduino is a professional product developed by Labcenter Electronics from the UK, part of the Proteus EDA software lineup launched in the early 1990s.designed to aid rapid prototyping of applications AVR MCUs. Proteus VSM comes in two flavors — for Arduino specific AVR MCUs, priced at approximately US$ 240, and for all AVRs at US$ 314. An extension package with advanced simulation features is available for US$ 475.
Emulino is a very early open source emulator for Arduino-specific MCUs. It runs under Linux and allows you to test execution of your sketch as if it were run o a real board.
Atmel Studio 6
Built for Windows, Studio 6 is a free software that supports all Atmel AVR and ARM MCUs and allows you to program using C/C++ or assembly language and test the actual behavior of hardware during runtime. Source code libraries and examples are available.
This open source software for Windows is an emulator oriented on ATMega MCUs. It allows you to create virtual electronic circuits and simulate their operation. It supports the complete AVR instruction set.
SimAVR an open source software for Linux emulating most ATMega and ATTiny MCUS, and also supports adding new hardware to emulate. It is based on the AVR GCC toolchain.