Why would anyone need an Arduino simulator? You can get a board so easily and in such an affordable price. Well, sometimes you might be missing some parts of your circuit, and running the code on the emulator is always a good idea for debugging before trying it on the actual board!
There are a few simulators available (free or commercial), I have tried some of them. Some have very basic features and might require some extra skills for setting them up and using, some are very easy to use and provide great functionalities. Here is the list:
Has some nice GUI that can load sketches, and simulate the output on an actual Arduino Uno board (pins are highlighted when there is some interaction). You can provide feedback to the analog/digital ports through a dialog window that features sliders for setting the values. A big plus for this simulator is the debugger tool that allows you to watch variables at runtime!
- Simuino (Free, Linux, source code available)
Simuino comes in two versions: as a web tool that can be used directly within your browser, as a standalone-terminal application. I’ve tried the web tool, which seems to be much easier to access than compile the source codes on my macbook.
The interface allows you to load your own sketch, use existing examples, edit sketch and then simulate the execution. The simulation part can be a bit tricky: You need to execute the simulation and then move to a different page that illustrates the board and the simulation. The simulator does not automatically execute you need to drive the execution process by clicking step+, step- buttons (like a debugger).
The most advanced simulator available (used to be free, now commercial) is the Virtual Breadboard. It features Arduino, Netduino and PIC microcontroller simulation. The main hit of this software is that you can simply setup your circuit by dragging components on a virtual breadboard, provide the sketch code and watch running with virtual LEDs blinking, motors running, LCDs showing characters and more. It features all the essential virtual hardware that you will need for simulating the basic Arduino examples and many more.
After evaluating your sketch through simulation you can also upload the sketch to your actual board through the Virtual Breadboard application.
More info about the book in Chapter 4.
Special thanks to Ira Laefsky for providing the first link.