Model and simulate your circuit projects
He’s no fake, but Mats Tage Axelsson shows you around the intricacies of simulating your Arduino-based projects for better, error-free results.
Mats Tage Axelsson
OUR EXPERT
Mats Tage Axelsson is keen to show you how using the Linux operating system can benefit your work and home life.
You may have considered creating a project using either the Arduino controller range of boards or any of its compatible systems. If you have, but were put off by having to buy new hardware just to try it out, then why not simulate your idea before splashing out the cash? All the software you need is on Linux and you can see what the different boards are capable of beforehand.
In this tutorial we’re going to learn what you can do with virtual boards and the right software. You can create all the components and connect them to your board, program the controller and see how it handles it. You have several CLI options including simavr, simulavr and a few others, too.
There are many different packages available for designing the circuit. The main software for writing the sketches (what the code is referred to as) is the Arduino IDE. A graphical front-end is Simulide, which also can simulate ordinary circuits. Adding components is straightforward. You can measure voltages and display waves on an oscilloscope in the application.
We’ll be looking at how to set up the software in this tutorial, step by step. To choose the correct board you’ll need to have a vision for what your project needs to do. You’ll use an Arduino type board for your projects, and there are many copies available. The Arduino platform is open source.
Start small
The Arduino Uno board is small and cheap. It makes sense to start learning with this model until you’ve become more experienced. We recommend choosing that one first and move on to larger projects later.
The standard way to compile for the Arduino is to write a sketch in the Arduino IDE, which is a Java application. It enables you to handle all the tasks necessary for getting your project to a board. However, you may want to do this using other solutions. You can also rely on the compiler extensions from that package. The extensions are for the gcc suite of programs. You can do this by installing arduino-mk, which depends on arduino-core. These packages are there for people who use the command line for everything.
For successful simulation you’ll need a few more packages. Here, too, you have options. A good one is Simulide, a package that’s easy to set up and start creating your design. Compiling and upload to the simulator involves just a couple of clicks. You’re also able to use the Arduino core package for compiling.
When you’re planning a new project, it’s good to test your ideas many times. You could either run cables and power your Arduino, or you can simulate your circuit. If you’re uncertain about which components to use, you can buy one of each, or stick to a simulation.