0% found this document useful (0 votes)
34 views34 pages

Iot Simulator

Uploaded by

funnymine04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views34 pages

Iot Simulator

Uploaded by

funnymine04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Outlines

• Anatomy of Arduino Board


• Fritzing Simulator
– Interface
– Starting a New Project
– Arranging the Environment
– Building a Circuit
– Editing Properties

• Tinkercad Simulator
– Create an Account
– Create a New Circuit
– Build a New Circuit
– Program with Arduino
– Simulate the Built Circuit

Le The Dung, Ph.D. Arduino Board and Simulators 1/32


ARDUINO BOARD

Le The Dung, Ph.D. Arduino Board and Simulators 2/32


Arduino Board - Anatomy
• Arduino boards senses the environment by receiving inputs from many
sensors, and affects their surroundings by controlling lights, motors, and
other actuators.
• Arduino boards are the microcontroller development platform that will be
at the heart of your projects.

The anatomy of Arduino Uno.


Le The Dung, Ph.D. Arduino Board and Simulators 3/32
Arduino Board - Anatomy (cont’)

No. Component Function

Use these pins with digitalRead(), digitalWrite(), and


1 Digital pins analogWrite(). analogWrite() works only on the pins with the
PWM symbol.
The only actuator built-in to your board. Besides being a
2 Pin 13 LED handy target for your first blink sketch, this LED is very useful
for debugging.
Indicates that your Arduino is receiving power. Useful for
3 Power LED
debugging.
4 ATmega microcontroller The heart of your board.

5 Analog in Use these pins with analogRead().


Use these pins to provide +5V power and ground to your
6 GND and 5V pins
circuits.
This is how you power your Arduino when it's not plugged
7 Power connector
into a USB port for power. Can accept voltages between 7-12V.

Le The Dung, Ph.D. Arduino Board and Simulators 4/32


Arduino Board – Anatomy (cont.)

No. Component Function

These LEDs indicate communication between your Arduino


and your computer. Expect them to flicker rapidly during
8 TX and RX LEDs
sketch upload as well as during serial communication. Useful
for debugging.
Used for powering your Arduino Uno, uploading your sketches
9 USB port to your Arduino, and for communicating with your Arduino
sketch (via Serial. println() etc.).
10 Reset button Resets the ATmega microcontroller.

Le The Dung, Ph.D. Arduino Board and Simulators 5/32


ARDUINO BOARD SIMULATORS
1. Fritzing

Arduino Board and Simulators 6/32


Fritzing - Introduction
• Fritzing (https://fritzing.org) is an open-source hardware initiative that
makes electronics accessible as a creative material for anyone.

• It lets you develop a virtual test board, utilize an auto-router in automatic


mode or manual mode, and create a circuit diagram.
• You can add notes which are sharable with other users
• There is an online project gallery which is accessible to see the work.

Le The Dung, Ph.D. Arduino Board and Simulators 7/32


Fritzing – Interface (cont.)
• The interface of the tool has three accessible views available for starting a
new project. They are as follows:
– Protoboard View – Gives the test board view, so you can sketch the way you want the
components to connect on the real board.

Le The Dung, Ph.D. Arduino Board and Simulators 8/32


Fritzing – Interface (cont.)
– Schematic View – Uses symbols to represent the connections and components.

Le The Dung, Ph.D. Arduino Board and Simulators 9/32


Fritzing – Interface (cont.)
– Printed Circuit Board – Lets you preview the way components get distributed on a PCB.
Here you select the positioning and connections which are best for the components.

Le The Dung, Ph.D. Arduino Board and Simulators 10/32


Fritzing – Starting a New Project
• Create a new sketch:
sketch: File > New
• Open a Fritzing sketch:
sketch: File > Open
• Open an example:
example: File > Open Example > … > …

Le The Dung, Ph.D. Arduino Board and Simulators 11/32


Fritzing – Arranging the Environment
• Show the Parts window:
window: Window > Parts
• Show the Inspector window:
window: Window > Inspector
• Show the Layers window:
window: Window > Layers

Le The Dung, Ph.D. Arduino Board and Simulators 12/32


Fritzing – Building a Circuit
• Drag and drop an Arduino from the Parts window. Do the same with the
breadboard and all other parts of your circuit.
• Arrange parts by selecting, dragging and dropping, or by using the
functions in the menu bar.
• To delete a part, simply select and press DELETE.

Le The Dung, Ph.D. Arduino Board and Simulators 13/32


Fritzing – Building a Circuit (cont.)
• Click & drag the Arduino +5V connector. This should create a wire. Drop
the wire on one of the breadboard's connectors. The connection is
confirmed by a small green circle or square.
• Connect all parts until the circuit looks exactly like your circuit in the real
world. Notice that connectors that are not properly connected are painted
red.

Le The Dung, Ph.D. Arduino Board and Simulators 14/32


Fritzing – Building a Circuit (cont.)
• If you click and hold on a connector, Fritzing will highlight all equipotential
connectors. This can really be useful if you want to see the whole set of
connections attached to this particular connection.
• You can bend wires by adding bend-points. Just drag them out of a wire.
• Select the schematic and PCB tabs to watch or edit your circuit in these
views.

Le The Dung, Ph.D. Arduino Board and Simulators 15/32


Fritzing – Editing Properties
• Select any of your circuit's parts and have a look at the Part Inspector
palette window.
• Click on the part's name and rename it. This is useful when you want to
distinguish between similar parts.
• You can also change properties of parts in the PCB View.

Le The Dung, Ph.D. Arduino Board and Simulators 16/32


Fritzing – Exporting a Circuit
• Select the desired Project View to be exported (breadboard, schematic or
pcb).
• From the Fritzing menu bar, select File > Export > and the desired format.

Le The Dung, Ph.D. Arduino Board and Simulators 17/32


ARDUINO BOARD SIMULATORS
2. Tinkercad

Arduino Board and Simulators 18/32


Tinkercad - Introduction
• Tinkercad (https://www.tinkercad.com) is a free and easy-to-use
application for 3D design, electronics, and coding.

• No need to buy any physical components, sensors, Arduino boards or


modules.
• No destruction of any physical components if circuit is incorrect.
• Make your presentation clean and professional.

Le The Dung, Ph.D. Arduino Board and Simulators 19/32


Tinkercad – Create an Account
• Access to https://www.tinkercad.com.
• Select Login > Student accounts.
accounts

• If given a Class Code from teacher, select Student with Class Code.
Code

Le The Dung, Ph.D. Arduino Board and Simulators 20/32


Tinkercad – Create a New Circuit
• Select Design > New > Circuit

Le The Dung, Ph.D. Arduino Board and Simulators 21/32


Tinkercad – Create a New Circuit (cont.)
• Select Design > New > Circuit

• 3D Design:
Design: Tinkercad is similar to a CAD software where you can design 3D models
for 3d printing. The CAD software is based on constructive solid geometry (CSG),
which allows users to create complex models by combining simpler objects
together.
• Circuits:
Circuits: This option helps create a virtual circuit, program it, and test it in real time.
• Codeblocks:
Codeblocks: This new feature helps you create a block programming tree, where
the 3D models are formed step by step following the tree instructions.

Le The Dung, Ph.D. Arduino Board and Simulators 22/32


Tinkercad – Create a New Circuit (cont.)

 

•  This space is where we will place all the components. The components can be
moved around, edited, and wired together.
•  This section holds all the components. Scroll down to access component types.

Le The Dung, Ph.D. Arduino Board and Simulators 23/32


Tinkercad – Create a New Circuit (cont.)

 

•  Use this tab to rotate, delete, undo or redo. It also helps users to create and
name labels for components.
•  This option helps you program Arduino, use serial monitor, start real time
simulation, export code, and share your projects.

Le The Dung, Ph.D. Arduino Board and Simulators 24/32


Tinkercad – Create a New Circuit (cont.)
• Tinkercad has many components and modules which can be used with
Arduino UNO.
• To get access to more components select All option in .

Le The Dung, Ph.D. Arduino Board and Simulators 25/32


Tinkercad – Build a New Circuit
• Place all the components as image below by selecting them from the
components section on right side. Click on the component to select and
click again anywhere on workspace to place.

• 1 Arduino Uno R3; 3 resistors; 3 LEDs.

Le The Dung, Ph.D. Arduino Board and Simulators 26/32


Tinkercad – Build a New Circuit (cont.)
• For rotating the component s direction, click the Rotate icon.
• For changing the component s value, select the component and change its
value.

Le The Dung, Ph.D. Arduino Board and Simulators 27/32


Tinkercad – Build a New Circuit (cont.)
• Move the components to the right positions by dragging, dropping, and
rotating.
• Hover over the points of the components to know the terminal name and
click it to start wiring the components.

Le The Dung, Ph.D. Arduino Board and Simulators 28/32


Tinkercad – Build a New Circuit (cont.)
• Click on wire to select the wire color. This helps in differentiating between
wire use.
• Wire all the components as shown in the image below.

Le The Dung, Ph.D. Arduino Board and Simulators 29/32


Tinkercad – Program with Arduino
• Once wiring is complete, select the code option to start coding.
• Use the Text option to write the code for this tutorial. This is where all code
can be written. Copy and paste the code shown on next page.

Le The Dung, Ph.D. Arduino Board and Simulators 30/32


Tinkercad – Program with Arduino (cont.)
int led_red = 0; // the red LED is connected to Pin 0 of the Arduino
int led_yellow = 1; // the yellow LED is connected to Pin 1 of the Arduino
int led_green = 2; // the green LED is connected to Pin 2 of the Arduino

void setup() {
// set up all the LEDs as OUTPUT
pinMode(led_red, OUTPUT);
pinMode(led_yellow, OUTPUT);
pinMode(led_green, OUTPUT);
}

void loop() {
// turn the green LED on and the other LEDs off
digitalWrite(led_red, LOW);
digitalWrite(led_yellow, LOW);
digitalWrite(led_green, HIGH);
delay(2000); // wait 2 seconds

// turn the yellow LED on and the other LEDs off


digitalWrite(led_red, LOW);
digitalWrite(led_yellow, HIGH);
digitalWrite(led_green, LOW);
delay(1000); // wait 1 second

// turn the red LED on and the other LEDs off


digitalWrite(led_red, HIGH);
digitalWrite(led_yellow, LOW);
digitalWrite(led_green, LOW);
delay(3000); // wait 3 seconds
}

Le The Dung, Ph.D. Arduino Board and Simulators 31/32


Tinkercad – Simulate the Built Circuit
• Click Start Simulation after writing the code.

Le The Dung, Ph.D. Arduino Board and Simulators 32/32


THANK YOU ALL FOR LISTENING

Arduino Board and Simulators


QUESTIONS AND ANSWERS

Arduino Board and Simulators

You might also like