0% found this document useful (0 votes)
41 views

ITELEC3207 - Module1 - Virtual Arduino

The document provides an instructional module for a course on the Internet of Things. It contains 4 projects for students to complete using the TinkerCad virtual circuit design tool. The projects include making an LED blink, controlling an LED with a pushbutton, controlling an LED with a potentiometer, and displaying numbers from 0-9 on a 7-segment display. The module provides the objectives, descriptions of the TinkerCad tool, circuit diagrams, code, and references for each project.

Uploaded by

Patricia Ann
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

ITELEC3207 - Module1 - Virtual Arduino

The document provides an instructional module for a course on the Internet of Things. It contains 4 projects for students to complete using the TinkerCad virtual circuit design tool. The projects include making an LED blink, controlling an LED with a pushbutton, controlling an LED with a potentiometer, and displaying numbers from 0-9 on a 7-segment display. The module provides the objectives, descriptions of the TinkerCad tool, circuit diagrams, code, and references for each project.

Uploaded by

Patricia Ann
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Instructional Module for the Course

ITELEC 3207 Laboratory (INTERNET OF THINGS I)

Module 1: Virtual Arduino (TinkerCad)


Objectives:

Upon completion of this topic, you are expected to:

1. Explore the parts and use of the TinkerCad circuit interface window; and
2. Practice breadboarding and coding using TinkerCad.

What is TinkerCad?
• TinkerCad is a free online application for 3D design, electronic circuit, and coding.
Introduce by Autodesk, a global leader in design and make technology.

TinkerCad Circuit
• It is a component of the TinkerCad application, which enables educators, learners,
hobbyists, and designers to build and evaluate concepts electronically.
• Students may explore, connect, and code virtual designs using interactive circuit
editor and an endless toolkit of simulated components.
• It allows users to build and simulate Arduino projects without the requirement for
actual hardware.

Getting Started with TinkerCad


1. Create an account. Go to the TinkerCad website at www.tinkercad.com. On the
website, click the Sign Up button at the upper right corner of the screen.
2. Next, create a personal account. To do that, click the “Create a personal account”
button. You can sign up using your existing google or apple account. For this lesson,
use your personal email.

3. On the first page, select your country and date of birth.


4. On the second page, input your email address, password, and select the agree check
box.
5. Click the “Create” button to move to the next page.
6. Click the check box and the “Done” button. After selecting the button, you will
automatically be logged-in to your TinkerCad account.

Exploring TinkerCad
1. On the left side of the screen is your menu.

2|Page
2. On the upper left corner of the screen, click the “+ New” button then select “Circuit”.

3. Congratulations! You may now create your first TinkerCad circuit project.

3|Page
TinkerCad Project 1: Blinking LED

Components: 1 Arduino Uno R3


1 Breadboard small
1 LED
1 resistor
Circuit: Connect the LED anode (the longer positive leg) to digital output pin 13 on the
board through a 220Ω (ohm) resistor.
Connect the LED cathode (the shorter negative leg) directly to the ground.

Code: On the upper left part of the screen, click the Code editor. Choose Text as edit
mode. Write the codes as shown below.
Note: Each line is ended with a semicolon (;).
pinMode (pin, <INPUT/OUTPUT >)
sets the pin to either INPUT or OUTPUT mode
digitalWrite (pin, <HIGH/LOW>)
switches ON (HIGH) or OFF (LOW) the LED on the pin
delay (time interval)
takes time interval in milliseconds (ex. delay (1000) – 1 second wait
Once done with the code, click the Start Simulation button beside the Code
editor button.

4|Page
Project 2: Pushbutton to control LED

Components: 1 Arduino Uno R3


1 Breadboard small
1 LED
2 resistors
1 pushbutton
Circuit: Connect the LED anode (the longer
positive leg) to digital pin 9 on the
board through a 220Ω (ohm) resistor.
Connect the LED cathode (the
shorter negative leg) directly to the
ground.
Pushbuttons connect two points in a
circuit when you press them.
Add the push button to the
breadboard. Connect one leg of the
button to the ground, and put a 10kΩ
resistor in between. This resistor will
act as a “pull down” resistor, which
means that the default button’s state
will be LOW. Also, connect the
same leg as the pull-down resistor)
directly to digital pin 9.
Finally, connect the other leg of the
button to 5V supply.

Code: On the upper left part of the screen, click the Code editor. Choose Text as edit
mode. Write the codes as shown below.

Note: Each line is ended with a


semicolon (;).

digitalRead (pin)
This function is used to read the
value from a specified digital pin,
either HIGH or LOW.

Once done with the code, click the


Start Simulation button beside the
Code editor button.

5|Page
Project 3: Potentiometer to control LED

Components: 1 Arduino Uno R3


1 Breadboard small
1 LED
1 resistor
1 potentiometer
Circuit: Connect the LED anode (the longer positive leg) to digital pin 9 on the board
through a 220Ω (ohm) resistor.
Connect the LED cathode (the shorter negative leg) directly to the ground.
A potentiometer is a straightforward mechanical device whose shaft may be
twisted to vary the resistance it offers. The amount of resistance a
potentiometer (also known as a pot) produces can be measured as an analog
value by applying voltage through the potentiometer and onto an analog input
on your board. Potentiometer set values from 0 to 1023 ohms.
Plug the 3 legs of the potentiometer to 3 different lines on the breadboard.
Connect the extreme left leg to GND. Connect the other extreme right leg to
5V on the Arduino. Connect the middle leg to an analog pin A0.

Code: On the upper left part of the screen, click the Code editor. Choose Text as edit
mode. Write the codes as shown below.

Note: Each line is ended with a semicolon (;).

6|Page
map (value, fromLow, fromHigh, toLow, toHigh)
Re-maps a number from one range to another. That is, a value
of fromLow would get mapped to toLow, a value of fromHigh to toHigh,
values in-between to values in-between, etc. It uses integer math so will not
generate fractions, when the math might indicate that it should do so.
Fractional remainders are truncated, and are not rounded or averaged.
analogWrite (pin, value)
Writes an analog value to a pin. Can be used to light a LED at varying
brightness’s or drive a motor at various speeds.
Once done with the code, click the Start Simulation button beside the Code
editor button.

Project 4: Counting from 0 to 9 using 7-Segment Display

Components: 1 Arduino Uno R3


1 Breadboard small
1 7-segment display (set as common cathode)
7 resistors
Circuit: In an 8-shaped component known as a 7-segment display, 7 LEDs are
integrated. Each LED is referred to as a segment, and each segment, when
activated, contributes to the decimal or hexadecimal portion of the numeral
that will be shown. The display's LEDs are each given a positional section that
extends from the rectangular plastic package with one of its connection pins.
The letters "a" through "g" on these LED pins stand for each distinct LED. A
common pin is created by joining the additional LED pins.
The display's common pin often identifies its type. A pin of connected
cathodes and a pin of connected anodes, denoting Common Cathode (CC) and
Common Anode, respectively, are the two types of pin connections (CA). A
CA display has all the anodes of the 7 segments connected, but a CC display
has all the cathodes of the 7 LEDs connected, as the name suggests.

7|Page
Code: On the upper left part of the screen, click the Code editor. Choose Text as edit
mode. Write the codes as shown below.

Note: Each line is ended with a semicolon (;).

References
• Lady A. Breadboards for Beginners. Adafruit. Retrieved last January 18, 2023 from
https://learn.adafruit.com/breadboards-for-beginners/
• Science Buddies. How to Use a Breadboard for Electronics and Circuits. Science
Buddies Org. Retrieved last January 18, 2023 from
https://www.sciencebuddies.org/science-fair-projects/references/how-to-use-a-
breadboard
• Atlearner. How to use breadboard? Beginner’s Guide. Atlearner. Retrieved last
January 18, 2023 from https://www.atlearner.com/2019/08/How-to-use-a-
breadboard.html
• Arduino. Language References. Retrieved last January 19, 2023 from
https://www.arduino.cc/reference/en/
• Arduino. How to Wire and Program a Button. Retrieved last January 19, 2023 from
https://docs.arduino.cc/built-in-examples/digital/Button
• Arduino. Basics of Potentiometers with Arduino. Retrieved last January 19, 2023
from https://docs.arduino.cc/learn/electronics/potentiometer-basics
• Primerobotics in Circuits. 7-segment Display Using Arduino Uno R3. Autodesk
Instructables. Retrieved last January 19, 2023 from https://www.instructables.com/7-
segment-Display-Using-Arduino-Uno-R3/

8|Page

You might also like