APC Australia

Make a virtual Arduino

Want to try out Arduino for free? Autodesk’s free 123D Circuits simulator lets you build Arduino circuits with your web browser. Darren Yates explains how.

-

When I was a kid, I was given one of those 150-in-one electronic kits and loved it. The manual came with 150 different circuits to build by just following the wiring numbers, pulling the springs to one side and poking the supplied pre-cut tinned wires into place.

Today, the kits are (almost) gone, but if you’re interested in trying out Arduino yet not too confident with hardware, there’s an interestin­g ‘soft’ option, using a free Arduino simulator from computer-aided design (CAD) software maker Autodesk.

HOW IT WORKS

Autodesk’s 123D Circuits is a browserbas­ed electronic­s circuit simulator with a focus on Arduino. Just head to https://123d.circuits.io, sign up for a free account and you can begin creating your own virtual Arduino projects.

To start building a new project, click the ‘+ New’ button at the top-right of screen to reveal the pop-out command menu down the right-hand side and select ‘New Electronic­s Lab’ from the menu list. It’ll take a few seconds, but you’ll soon be presented with a blank breadboard, ready for you to start building.

ADDING COMPONENTS

You’ll find components by clicking the ‘+ Components’ button on the new menu row at top right of the page, which opens up a grid of available components at the bottom of the screen. Just scroll through and click on the box containing the component you want, move your mouse up to the breadboard and the component will follow the cursor. Locate the breadboard position you want and left-click to drop the component into place. Need to rotate a component? Click on it to highlight it and click the rotate button on the top-left command row until the component is in the position you need.

Among the components, you’ll find a number of Arduino options, including the Uno R3 we’ve used extensivel­y in this masterclas­s series, along with the breadboard-favourite Arduino Micro.

There’s even some basic-function test equipment available including a digital multimeter plus a simple oscillosco­pe that you can add to your circuit for diagnostic­s. These are great as introducto­ry tools – the multimeter can measure voltage and current, while the oscillosco­pe, or ‘CRO’ (cathode-ray oscillosco­pe) as old-hands will know it, allows you to ‘see’ the voltage waveforms at the point you connect up the CRO to your circuit.

“As with building real circuits, you do need to be careful with component choices – for example, select a current-limiting resistor too low in value connected to an LED and you’ll ‘virtually’ blow up the LED.”

These are very basic components however, with the CRO offering only a single trace and a single time-base control, which sets the length of time covered by each grid square on the screen. Actual multimeter­s and oscillosco­pes have many more controls and options.

One quick tip - when adding components such as resistors and capacitors, you add the basic component and set the value you desire in the blue edit window on the topright.

ADDING WIRES

To join components together, you need to add connecting wires. This is quite easy – just move your cursor to the start point until you get a red square under your cursor. Left-click, move your cursor to the wire finish point you want and left-click again. Use the blue item box at the top-right to change the colour from the default green if you wish (using multiple wire colours can make identifica­tion easier, particular­ly if you have lots of wires in a small space).

WRITING CODE

Just like the real thing, the virtual Arduino devices require you to write genuine Arduino code and you do this by firing up the Code Editor, available by tapping the command button on the top-right of the window. You must select and drop an Arduino device into your project before you can begin programmin­g it, but the code editor isn’t too dissimilar from the basic Arduino IDE.

To begin with, bring the Arduino Uno R3 onto the breadboard, launch the code editor and it will automatica­lly load the example ‘blink’ code. All you need to do is click the ‘Upload & Run’ button and the simulator does the rest – the LED next to the Arduino infinity logo will begin flashing once per second.

When coding your project, remember the Arduino code basics – the ‘setup()’ method runs once at the start and the ‘loop()’ method loops continuous­ly thereafter until you either reset the device or stop the simulation. You can also include your own methods.

TRY IT YOURSELF

To test it out, I made a simple sevensegme­nt display project called ‘Counting up’. You’ll find it at https://123d.circuits.io/ circuits/2111247-counting-up. It uses a standard seven-segment display wired to an Arduino Uno R3 and counts up digits ‘0’ through ‘9’ on a continuous loop. The Arduino code replicator seems quite decent – at least good enough to support multi-dimension arrays that were used in this project.

As with building real circuits, you do need to be careful with component choices – for example, select a currentlim­iting resistor too low in value connected to an LED and you’ll ‘virtually’ blow up the LED. Unlike in real-life, there’s no ‘give’ in the nominal maximum current tolerances – go beyond the set limit and you get instant destructio­n. But at least it doesn’t cost you a real component – just change the values and run the code again.

What’s also good about 123D Circuits is it’s not just for Arduino – it has a reasonable list of 74HC High-Speed CMOS logic chips and other components for building ‘discrete’ electronic circuits. You can also interact these chips with an Arduino to build whatever your imaginatio­n dreams up.

IMPROVEMEN­TS

For what it does and the fact you can do it in a web browser, 123D Circuits is a great learning tool for genuine newbies who’d be otherwise dangerous with a soldering iron in-hand. For students who’ve never seen electronic components before, it’s a solid introducti­on, but one, we think, you might eventually outgrow. The list of component options isn’t exhaustive by any means and little things like labelling whether the seven-segment display is commonanod­e or –cathode (its common-anode) would help.

BUILDING ALWAYS BETTER

Ultimately, entry-level circuit simulators have their place, for sure, but they can’t replicate the learning you gain when you build with actual real electronic components. The practical aspects of electronic design, particular­ly analog electronic­s, are difficult to simulate with perfect accuracy, but overall, 123D Circuits does a passable job.

Plugging wires into a 150-in1electro­nics kit might seem antiquated, but the lessons I began learning as a kid building real circuits are just as important today.

 ??  ?? Drag in an Arduino Uno R3 board, select Code Editor and run the Blink code.
Drag in an Arduino Uno R3 board, select Code Editor and run the Blink code.
 ??  ?? Autodesk’s new 123D Circuits lets you build virtual Arduino projects.
Autodesk’s new 123D Circuits lets you build virtual Arduino projects.
 ??  ?? Your project begins with a clean- slate 840-point breadboard.
Your project begins with a clean- slate 840-point breadboard.
 ??  ?? My first virtual project loops from 0 to 9 on a seven-segment display.
My first virtual project loops from 0 to 9 on a seven-segment display.
 ??  ?? Log in, press the New button and ‘New Electronic­s Lab’ from the menu.
Log in, press the New button and ‘New Electronic­s Lab’ from the menu.
 ??  ?? 123D Circuits comes with a decent selection of components to use.
123D Circuits comes with a decent selection of components to use.

Newspapers in English

Newspapers from Australia