lOMoARcPSD|63475549
Arduino - fiot
Fundamentals of Internet of Things (Jawaharlal Nehru Technological University,
Hyderabad)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Arduino
Yarelis D. Acevedo
Arianna H. Colón
Tiahra N. Avilés
1
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
AGENDA 2
What is Arduino?
1 What is an Arduino? Why Arduino? How can I
use it and implement it on the lab?
Arduino Software
2 How Arduinos are programmed
How to get started?
3
Hands On
4 Using Tinkercad simulator
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
What is a
microcontroller
To answer this enter to [Link]
Code: 5829 2707
3
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
What is a microcontroller? 4
A microcontroller (MCU for microcontroller unit) is a
small computer on a single
metal-oxide-semiconductor (MOS) integrated circuit
(IC) chip. A microcontroller contains one or more
CPUs (processor cores) along with memory and
programmable input/output peripherals.
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Big computers vs small computers 5
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
01
What is Arduino?
What is an Arduino? What is the purpose? How
can I use it and implement it on the lab?
6
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
A brief story. The Arduino project began in
Arduino 2005 as a tool for students at the
Interaction Design Institute Ivrea in Ivrea,
Italy, aiming to provide a low-cost and easy
microcontroller way for novices and professionals to create
devices that interact with their
environment using sensors and actuators.
7
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Arduino Microcontroller 8
● Open-source electronics platform
based on easy-to-use hardware
and software.
● Are able to read inputs - light on a
sensor, a finger on a button, or a
Twitter message - and turn it into
an output - activating a motor,
turning on an LED, publishing
something online.
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
What is it used
for?
● Physical Computing projects /
research
● Interactive Installations
● Rapid Prototyping
9
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
What can I do? 10
Sensors Actuators
● Push buttons, touchpads, ● Lights, LED’s
tilt switches ● Motors
● Variable resistors (Sliders, ● Speakers
Volume knobs) ● Displays (LCD’s)
● Photoresistors (sensing
light)
● Thermistors (temperature)
● Ultrasound (proximity
range finder)
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Types of Arduinos 11
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
What is the
difference
between them?
12
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Types of Arduino 13
Arduino Board Processor Memory Digital I/O Analogue I/O
Arduino Uno 16Mhz ATmega328 2KB SRAM, 32KB flash 14 6 input, 0 output
96KB SRAM, 512KB
Arduino Due 84MHz AT91SAM3X8E 54 12 input, 2 output
flash
8KB SRAM, 256KB
Arduino Mega 16MHz ATmega2560 54 16 input, 0 output
flash
2.5KB SRAM, 32KB
Arduino Leonardo 16MHz ATmega32u4 20 12 input, 0 output
flash
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Arduino Uno Digital output
0, 1 Serial Port
14
USB port
In circuit serial
programming
ATMEL
Microcontroller
Power
input
Power supply Analog input
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Analog and digital pins 15
The Arduino can input and output analog signals as well as digital signals.
An analog signal is one that can take on any number of values, unlike a digital
signal which has only two values: HIGH and LOW.
We will talk
about this later!
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
How Arduino is programmed? 16
Using a software
called Arduino IDE
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
02
Arduino Software
How Arduinos are programmed
17
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Arduino Software (IDE) 18
The Arduino Integrated Development Environment - or Arduino Software (IDE)
- contains a text editor for writing code, a message area, a text console, a
toolbar with buttons for common functions and a series of menus. It connects
to the Arduino hardware to upload programs and communicate with them.
[Link]
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Arduino Language 19
● Simplified C/C++
● Based on the wiring project
○ [Link]
● Peripheral libraries
○ LCD, sensors, 12C, ect.
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Useful functions 20
pinMode() set pin as input or output
digitalWrite() set a digital pin high/low
digitalRead() read a digital pin’s state
analogRead() read an analog pin
analogWrite() write an “analog” PWM value
delay() wait an amount of time
millis() get the current time
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Sketch 21
Global Declare variables at the top
variables
setup()
Initialize
setup() - run once at the
beginning
set pins
loop() loop() - run repeatedly
after setup()
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Let’s see how a
sketch for
turning an LED
light runs in an
Arduino
22
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Blinking LED 23
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Global variables 24
int ledPin = 13;
Global variables - LED connected to
the control pin 13
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Setup() 25
setup() pinMode(ledPin, OUTPUT);
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
loop() 26
digitalWrite(ledPin, HIGH);
delay(5000);
loop() digitalWrite(ledPin, LOW);
delay(5000);
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
27
Verify Search
Upload
Opens
Save
New
sketch
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
03
How to get
started?
28
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
If you have the
board
29
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
How to get started? 30
● Arduino board
○ USB cable
○ DC power supplies
● Download the Arduino’s software (Arduino
IDE)
○ Read carefully
■ Instruccions to install and setup the
Arduino board with the computer and
software
○ Download the Arduino IDE software
■ [Link]
● Plug it in!
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Plug in it into the computer 31
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Online
32
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
33
Tinkercad is a free, online 3D
modeling program that runs in a
web browser, known for its
simplicity and ease of use. Since it
became available in 2011 it has
become a popular platform for
creating models for 3D printing as
well as an entry-level introduction
to constructive solid geometry in
schools.
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Tinkercad 34
Make an
account in It’s free!
tinkercad
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
35
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
36
Scroll down
until you find
the Arduino
Uno
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
37
Find the resistor
and the LED
Connect the
resistor to the
GND (Ground)
Connect the LED:
Shorter leg with
the resistor and
longer leg to pin
12
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
38
Write the code After writing the
code, start the
simulation here
to see the
circuit work with
the Arduino!
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
39
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
40
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Button 41
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Moving a stepper motor 42
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Moving a stepper motor using a potentiometer 43
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Using a load cell 44
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
More projects 45
You can find more
projects at:
[Link]
[Link]/projecthub
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
46
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
04
Hands On
47
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Challenge!! 48
LED Control Using a button
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Challenge!! 49
LED Brightness Control Using a Potentiometer
Downloaded by Farheen Farhin (farheenfarhin2@[Link])
lOMoARcPSD|63475549
Challenge!! 50
Scrolling LED
Downloaded by Farheen Farhin (farheenfarhin2@[Link])