IoT_PPT04_Intro_Arduino_Board_and_IDE
IoT_PPT04_Intro_Arduino_Board_and_IDE
Introduction to Arduino
Arduino UNO Board & IDE
• It has the capability to act as an interface for electrical and electronic systems
09-08-2023 2
Types of Arduino Boards
• Entry Level - easy to use and ready to power your first
creative projects.
– Arduino UNO
– Arduino Nano
– Arduino Micro
Arduino UNO
• Enhanced Features - boards with advanced
functionalities, or faster performances
– Arduino Zero
– Arduino Mega 2560
– Arduino Motor Shield
Source: https://docs.arduino.cc/hardware/uno-rev3
09-08-2023 5
Detailed Pin Diagram
09-08-2023 6
Pin Description
Pin category Pin Name Details
Power Pins Vin, 3.3V, 5V, Vin : Input voltage to Arduino when using an external power
GND, source.
RESET
5V : Regulated power supply used to power microcontroller
and other components on the board.
ICSP: In-Circuit ICSP pins: Used to code and boot an Arduino from an external source.
Serial MISO, VCC, Allow inter workings of two or more Arduino boards.
Programming SCK, MOSI, Allow you to upload your firmware.
RESET, GND
09-08-2023 7
Cont…
Pin category Pin No / name Details
Analog pin A0 - A5 Used to provide analog input in the range 0-5V.
Digital Input/output pin Digital Pins 2 - 13 Can be used as input or output pins.
Serial Communication 0(Rx),1(Tx) Used to receive and transmit TTL serial data.
I2C: Inter-IC, or A4 (SDA: Serial Data), Used for TWI / I2C communication.
TWI: Two Wire Interface A5 (SCL: Serial Clock)
AREF AREF : Analog Reference To provide reference voltage from an external
Voltage power supply for analog-to-digital conversion of
inputs to the analog pins.
E.g. if AREF is 4V – the analogRead() range of
0~1023 will relate to 0~4V and not 0~5V.
09-08-2023 8
Arduino in IoT
• Arduinos are used to create IoT projects.
09-08-2023 9
Configure Arduino IDE
• Download and Install Arduino IDE https://www.arduino.cc/en/Main/Software
• The Arduino Software (IDE) allows you to write programs and upload them to your board.
• When the Arduino IDE first opens, this is what you should see:
09-08-2023 10
Built-in Examples
09-08-2023 11
Set Arduino Board
09-08-2023 12
Set Serial Port
09-08-2023 13
Code Compilation
• Compilation
successful
message at the
bottom left
corner.
09-08-2023 14
Code Uploading
09-08-2023 15
Serial Monitor
• The serial monitor is the 'tether' between the computer and your Arduino - it lets you
send and receive text messages.
• First select the port (go to Tools -> Port: ) to which the board is connected then click
the icon of Serial Monitor on the top right side of the Arduino IDE
Serial Monitor
output
09-08-2023 16
Serial Plotter
• Can use Serial Plotter to
plot the output signal
09-08-2023 17
How to Install Sensor Libraries
• Let we will use DHT11 sensor for which we need DHT.h header file
• So, this header file needs to be installed first.
09-08-2023 18
Cont…
• After installing the DHT library from Adafruit, install “Adafruit Unified Sensor” libraries.
09-08-2023 19
Demo: LED Blink
09-08-2023 20
Blink In-built LED Continuously
• First upload the bare
minimum example:
Files -> Examples -> Basics ->
BareMinimum
• Output:
In-built LED will glow
continuously
09-08-2023 21
Blink In-built LED Periodically
• First upload the bare
minimum example:
Files -> Examples -> Basics ->
BareMinimum
• Output:
In-built LED will glow
continuously
• Output:
In-built LED will glow
periodically
09-08-2023 22
Blink External LED
09-08-2023 23
Demo on LED Blink
09-08-2023 24
Lessons Learned
What is Arduino
Arduino in IoT
Arduino IDE
09-08-2023 25
09-08-2023 26
Which is better? ATmega328P vs STM32 vs MSP430