0% found this document useful (0 votes)
310 views18 pages

DGFN1131: What Is Tinkercad?

Tinkercad is a free online software that allows users to design and simulate Arduino circuits on their computer without physically having an Arduino board. The document provides instructions on how to use Tinkercad to write simple Arduino programs and simulate them, including blinking an LED. It also explains how to access and set up an account on Tinkercad, add Arduino and electronic components to circuits, write code, and save completed circuit designs.

Uploaded by

Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
310 views18 pages

DGFN1131: What Is Tinkercad?

Tinkercad is a free online software that allows users to design and simulate Arduino circuits on their computer without physically having an Arduino board. The document provides instructions on how to use Tinkercad to write simple Arduino programs and simulate them, including blinking an LED. It also explains how to access and set up an account on Tinkercad, add Arduino and electronic components to circuits, write code, and save completed circuit designs.

Uploaded by

Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 18

Arduino - Notes 4

DGFN1131
Simulating Arduino using Tinkercad

Objective: To simulate and program the Arduino microcontroller board on a computer using a
FREE software called Tinkercad.

What is Tinkercad?

Want to learn how to use the Arduino Uno microcontroller which has taken the maker electronics hobby community by
the storm, in the comfort of your home, without even buying it (even though it’s about $15 to $40) ?

Do not despair. Autodesk, the company that makes the hugely popular computer aided drafting software AutoCAD has
just the solution for you. It’s called Tinkercad Circuits, and it’s absolutely free.

All the Arduino programs you are writing in the labs in DGFN are possible to be simulated using Tinkercad Circuits
including a simulation of input devices like switches and pushbuttons, and output devices like LEDs, seven segment
displays, motors etc.

See Appendix 1 for details on accessing Tinkercad, signing in, and getting started with programming the Arduino using
Tinkercad Circuits.

Arduino program 1 in Tinkercad


Writing an Arduino program in Tinkercad is not difficult at all. Suppose you want to write a Hello World! Greeting, and
have it printed in the Serial Monitor window. Here is how.

1. Open up Tinkercad, select Circuits, select Create new Circuit.

2. Select an Arduino Uno R3 microcontroller board from the Components, and drag it to the main screen.
See Fig. 1.

DGFN1131 Arduino Notes 4 P a g e |1


Fig. 1

DGFN1131 Arduino Notes 4 P a g e |2


DGFN1131 Arduino Notes 4 P a g e |3
3. Select Code Editor from the menu bar at the top on the right. A window will open up below and will display
the code pane on the right, as well as other panes on the left. See Fig. 2.

Fig. 2

DGFN1131 Arduino Notes 4 P a g e |4


4. To close the panes on the left, which are not applicable for our needs, select Block. A note will appear
asking if you want to close the blocks editor. Select OK. See Fig. 3.

The panes on the left will disappear, and you will be left with just the program editor window. See Fig. 4.

Fig. 3

Fig. 4

5. Delete the existing program lines by highlighting them, and press Delete.

6. Type the Hello World! Greeting code exactly as shown, using the Serial.print function, starting with the comment
lines at the top. See Fig. 5.

DGFN1131 Arduino Notes 4 P a g e |5


Fig. 5

7. Once the program is written, select Upload & Run.


Sometimes, you may have an error in your code, which will be flagged. Eg., in our program, we are missing the
semicolon at the end of line 8. See Fig. 6.

8. Fix the error, type the semicolon, and press Upload and Run again.

DGFN1131 Arduino Notes 4 P a g e |6


Fig. 6

9. If there are no other errors, the result of the program, the message Hello World! Will be displayed in the Serial
Monitor window on the right side. See Fig. 7.

Fig. 7

DGFN1131 Arduino Notes 4 P a g e |7


10. To stop the program execution, select Stop Simulation from the bar at the top. See Fig. 8.

DGFN1131 Arduino Notes 4 P a g e |8


Fig. 8

11. To save the program as a Tinkercad circuit file, see Appendix 1.

Arduino program 2 in Tinkercad

1. Write a program using Tinkercad Circuits to turn the LED connected at pin 8 on for 1.5 sec, off for 1.5 sec,
continuously, repeatedly, until power is turned off to the Arduino board.

Fig. 9

2. From the Components list, select a small breadboard, an Arduino Uno, a 220 ohm resistor and an LED.
Place them as shown in Fig. 9 and wire up the resistor and LED as shown in Fig. 9.

3. Type the program using Code Editor. See Fig. 10.

DGFN1131 Arduino Notes 4 P a g e |9


Fig. 10

4. Upload and Run the program. If there are no errors, the LED should blink continuously every 1.5 sec.

5. Save the Kindercad circuit program. See Appendix 1 if you are not sure how to.

Appendix 1

Tinkercad is an Autodesk software product, the same company that also makes AutoCAD.

DGFN1131 Arduino Notes 4 P a g e | 10


1. In Google, search for Tinkercad, or Tinkercad circuits.

2. Sign up for an account with Tinkercad using your email, and create a password. You will be needing both
for verification to sign in and use Tinkercad circuits.

3. Once you are on the main page of Tinkercad, also called the ‘dashboard’, from the column on the left,
select
Circuits. From the right side, under Circuits, select Create new Circuit. See Fig. 11.

Fig. 11

4. You will see Select a component below to get started! See Fig. 12.

Fig. 12

DGFN1131 Arduino Notes 4 P a g e | 11


5. Go down the Basic Components, and find a component, eg. ‘Breadboard Small’. Click on it and drag it
to the space above. See Fig. 13.

6. Repeat for Arduino Uno R3. Drag it and place it above the breadboard. See Fig. 13.

Fig. 13

7. Use the mouse scroll wheel to zoom in and out. And from the top left side in the menu selection, select
the icon for ‘Zoom To Fit’. See Fig. 14.

Fig. 14

8. Other icons on the same line are Rotate, Delete, Undo, Redo.

9. If you want to select a resistor of a certain value, eg. 220 ohms, select + Components from the top right
selection bar. Find the resistor symbol under Components list. place the resistor first on the breadboard,
and from the selection under Resistor, change Resistance from the default value of 1 kΩ to 220Ω. See
Fig. 15.

Fig. 15

DGFN1131 Arduino Notes 4 P a g e | 12


10. If necessary, use the ‘Rotate’ icon to turn the resistor position by 90 degrees. See Fig. 16.

Fig. 16

11. Wiring is easy in Tinkercad Electrical. Simply hover the mouse cursor over a hole in the breadboard or on
the Arduino board. Click and drag. You can create curves in the wires by clicking in a middle position, then
drag again.
See Fig. 17.

Fig. 17

12. You can change the colour of the wire by simply clicking on the wire, and from the selection under
Breadboardwire, change from the default colour of green to red, or black, whatever your choice is. See
Fig. 18.

DGFN1131 Arduino Notes 4 P a g e | 13


Fig. 18

13. You can test this circuit by selecting Start Simulation from the bar at the top right. The LED will light up. A

Simulator time will indicate the amount of time taken during the simulation of the circuit. To make a
change, eg.
add a component, or end the simulation, select Stop Simulation from the bar at the top. See Fig. 19.

Fig.
19

DGFN1131 Arduino Notes 4 P a g e | 14


Saving the circuit as a Tinkercad file

1. Once the circuit is tested, you can save it with a new name and description as follows. Tinkercad initially
assigns an unusual name to the circuit, such as ‘Dazzling Kasi’. Click on the logo Tinkercad at the upper
left side of the page.

2. Move cursor over the Properties symbol on the upper right side of the circuit file to see the label Options
appear. Click on it. See Fig. 20.

Fig. 20

3. In the Design Properties page, type a new Design name, eg. LED and RESISTOR. See Fig. 21. Give a
Design
description, eg. LED turns on when circuit is simulated. Give a Tags description, eg. LED on. Select if
you want
the circuit to be viewed privately or publicly. From the bottom of the page, select Save changes.

Fig. 21

DGFN1131 Arduino Notes 4 P a g e | 15


Transfer Arduino code from Tinkercad to Arduino IDE Editor Window

You can always copy the program code from Tinkercad and paste it in the Arduino software editor window. Then
you can verify, upload and run the program with the actual Arduino hardware board.

DGFN1131 Arduino Notes 4 P a g e | 16


Citations

https://www.tinkercad.com/#/

https://www.tinkercad.com/circuits

https://www.tinkercad.com/things/jLGrMFxhuAE-spectacular-bigery/editel?tenant=circuits

https://programmingelectronics.com/home/

DGFN1131 Arduino Notes 4 P a g e | 17


NOTES

DGFN1131 Arduino Notes 4 P a g e | 18

You might also like