- [Instructor] Are you looking
for an Arduino simulator?
We get tons of requests
over at PEA asking,
hey is there a good Arduino
simulator out there?
And in short, yeah, there is.
In this video we'll explain
what an Arduino simulator is,
why you should be checking them out,
even if you already have
all your Arduino hardware,
and we'll do a step by step walkthrough
using a popular and oh, by the way, free
online Arduino simulator
called Tinkercad, stay tuned.
(funky music)
Okay, so what is an Arduino simulator?
It's a virtual representation
of a real world Arduino circuit.
What does that actually mean?
Let's look at an example.
Here you see, we've created the famous
Hello World blinking LED
circuit with actual hardware.
We've programmed the
code in the Arduino IDE,
we've uploaded it, and bam, we have a
real world physical circuit.
I timed myself making
this from start to finish
and it took me six
minutes, or thereabouts.
Here, using the free online
Arduino simulator software
at Tinkercad, we've created
exactly the same circuit,
we've used the same exact code,
and after we hit the
start simulation button,
we have a virtual version
of exactly the same circuit.
This guy only took me a
minute and 50 seconds,
that is some serious efficiency.
Okay, so we'll show you
at the end of the video
exactly how to make that demo,
we will recreate it in Tinkercad.
So, why are simulators so cool?
Well you already saw, it could be
much quicker to build stuff online
so we won't belabor that point,
but here are a few other quick
reasons why simulators rock.
First off, you can learn how to code
as well as learn how to build circuits
from anywhere you have a
computer and internet access.
That's right, no longer are you tethered
to your hardware in your workshop.
You can do it from literally anywhere.
Number two, it's much easier
to track down hardware
and wiring errors in the simulator.
It can be very difficult to visualize
where wires are connected
to and which pins
on a busy breadboard, but if you
get it right in the
simulator, then recreating it
in the real world goes much much smoother.
And lastly, you can share
your design with peers
for feedback and get help with solutions.
So, instead of posting
your code to a forum
and hoping that someone knows
what your circuit looks like,
or they ask you a bunch
of questions about it,
you can do both at the same time.
Just share your link to your
project and everybody can see
exactly what your code is
and what your circuit is,
it is much more efficient this way.
Okay, so how do you actually
build stuff in a simulator?
Well, thankfully it's super easy.
We're gonna use Tinkercad
and we'll show you
exactly how to build
the Hello World circuit
that we made before.
Okay, so here we are at Tinkercad.
We'll assume you've already
signed up for an account,
if you haven't you just go to the
join now button right here
but we'll go to sign in.
And now we're at the dashboard.
So, this dashboard's blank
because it's 3D designs,
we'll go to the circuits
one and here you will see
previous designs that we've created,
but for us right now we'll
go to create new circuit.
And this is it, and this is kinda
where all the magic happens.
You're gonna drag and drop components over
from the right hand side over
to the workspace right here,
and then you'll be able to click code
and write code for your design.
So, let's just quickly go through it.
And one thing to note
is, here's the components
but there's also these starter
assemblies you can click.
So, if you went to Arduino
right here and clicked blink,
that is actually the
exact, I'll just do it.
So, click on that and then
you move your mouse over
and then click one more time and there
we've dropped the actual circuit.
It looks a little bit
different one that I made,
but that's a functioning
circuit right there.
And we can just show you, start simulation
and yup, it works as advertised.
Okay, so let's create it from scratch.
So, the first thing
we're gonna wanna do is
make sure we have
components selected here,
we'll type in Arduino and
then you see that unor3.
Again, click it once, move over to
where you want it in the workspace,
click again, and there you have it.
To pan the view around, you just wanna
click and hold and then move around.
Next let's drop a breadboard.
So, we'll drop this one right here.
Click once, again I can move it around,
click one more time and it's placed.
Next we'll do the LED.
Just click there and here you can see
you can put the cathode or anode
on specific pins, we'll put it over here.
One cool thing is, when you click it
it allows you to change the
color of the actual LED.
Next, resistor, oops, okay.
Okay, and we'll drop it right here.
Set the resistance value.
You can see the colors
correspond with that.
And next, we just have to wire it up.
So, here's how straight forward it is.
I'm gonna wanna join this
right here to pin 13,
and I literally just
click once on that pin,
drag it down, and I'm
into pin 13 right there.
And I can move the Arduino board
and make that as straight
as possible if I wanted to.
Now, one other cool thing
is, we'll click once
and we're gonna take this one to ground.
I could just go straight line to ground,
but just to demonstrate
this, every time you
click once you put a node in the wire.
So, I can make it basically S
turn as much as I want it to,
and that really allows you
to keep things organized.
Another thing that'll allow
you to stay very organized
is changing the colors of the wire.
So you can see how much faster that is
than trying to use
actual physical hardware.
You're able to create things so quickly.
So, that's the actual circuit built.
And going into the code, you can see
it's already preloaded with a sketch.
It's in block view.
You can see that it's going to
basically blink or send, it's gonna
digitally write pin 13 high,
it's gonna wait for one second,
then it's gonna write it low
and then all go back through the loop.
So, the code is already written.
Soon as you hit start simulation it will
automatically upload it to
the board so let's do that.
And there you go, that's our functioning
Hello World blinking circuit.
One thing to note here, which
can be very frustrating,
is sometimes you'll
click that and you'll be
looking at the code and
okay, this all makes sense,
oh actually I wanna change something.
Well, if you don't hit stop simulation
and you try to move something,
nothing will happen.
You won't actually be able to do anything,
and it's very frustrating until you
figure out what's actually going on.
It's easy to tell with this
blinking LED right now,
but if you don't have a LED that
indicates that the program is running,
the only way you'll know
is this one box right here.
And the same thing, if you try to code,
if you try to type stuff
in there, you can't.
So, that's how you build a very very basic
Hello World circuit in Tinkercad.
So, there's lots of really
cool things about Tinkercad,
and let's take a look at a little bit
more of the educational side.
This is the main view you'll see,
and all your designs
will be loaded in here.
Let's go to learn and then, just make sure
you click over here back to circuits,
and then they have lots
of starter lessons,
lots of projects that'll really
help you understand different aspects to
both using Arduino as well as just
basic electronic
circuitry, but my favorite
one out of all of these
is you go to projects,
and then click show all Arduino,
and then if you purchase the starter kit
from arduino.cc, which
I did a long time ago,
each one of these lessons is actually,
corresponds to a project
out of the starter kit book.
So, there's like 15 lessons
and each one of these
corresponds to an actual
project out of that book.
So, you can follow along either
in the real world or here
on Tinkercad virtually
which makes it super convenient.
Now, if you're just trying
to get some inspiration
or learn new skills and
check out new stuff,
go to gallery, click
there and that'll load up,
and make sure, again, you go to circuits
and you can see a variety of
projects here for inspiration.
Now, you can actually search
for more specific things.
So, if you're struggling
with a particular project
and you wanna see if there's
other projects out there
that are similar, it's
pretty straightforward.
All you have to do is just
click this search button
and let's say we were looking
for an Arduino alarm clock.
We'll click circuits here and then search.
Okay cool, so a NewPixel clock
pops up right here, let's click on that.
And here you can see everything
to do with the project.
A lot of comments and the
coolest part though is
you can just, okay I like that,
I wanna explore it now so
I click copy and tinker
and here we go, I can, no kidding,
mess around with the actual design,
the components, and I
can even look at the code
and see how this guy programmed
this particular project.
So, you can see how there's tons
of really useful stuff on Tinkercad,
not only just for you to
design your own circuits
but also to learn from the community,
learn from others, and
also get inspiration.
So, there you have it, we
know what a simulator is,
why it's cool, and how to use one.
We really hope you've enjoyed this video.
So, how do you use the simulator?
Do you like creating
projects online first,
or do you like to tinker
in the physical world?
Let us know in the comments below,
we'd really appreciate it.
