100% found this document useful (1 vote)
327 views54 pages

Internet of Things (Iot)

The Internet of Things (IoT) refers to the billions of physical devices around the world that are connected to the internet, collecting and sharing data. These devices range from traditional things like home appliances and vehicles to more novel devices like wearables and smart city infrastructure. IoT devices are enabling new forms of automation and data collection that are transforming industries and society. The growth of IoT is expected to accelerate as more everyday objects become embedded with sensors, processing ability, and connectivity. Security and privacy issues also need to be addressed as more private data is collected and shared through IoT networks and devices.

Uploaded by

nitinsomanathan
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
100% found this document useful (1 vote)
327 views54 pages

Internet of Things (Iot)

The Internet of Things (IoT) refers to the billions of physical devices around the world that are connected to the internet, collecting and sharing data. These devices range from traditional things like home appliances and vehicles to more novel devices like wearables and smart city infrastructure. IoT devices are enabling new forms of automation and data collection that are transforming industries and society. The growth of IoT is expected to accelerate as more everyday objects become embedded with sensors, processing ability, and connectivity. Security and privacy issues also need to be addressed as more private data is collected and shared through IoT networks and devices.

Uploaded by

nitinsomanathan
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/ 54

Internet of Things (IoT)

Arun Mani Tripathi


Deputy Director ( T)
National Institute of Electronics and Information
Technology, Lucknow
Ph. 7706009307
Pins Description and Hardware Components -
Arduino Uno
What Is Arduino
Platform ?
• Arduino is open source Embedded system hardware so that
hobbyists as well as professionals can assemble the simplest
Arduino modules themselves by hand. Arduino consists of both a
physical programmable circuit board (often referred to as a
microcontroller) and a piece of software, or IDE (Integrated
Development Environment) that runs on your computer, used to
write and upload computer code to the physical board. Atmega328
is sub-category of AVR series of microcontrollers developed by
Atmel Company.
The Uno is one of the more popular boards in the Arduino family
and a great choice for beginners. Programming on Arduino IDE
follows C & C++ Language concepts. ATmega328p is an AVR
series of microcontroller used in Arduino Boards.
ABOUT ARDUINO BOARD
 Arduino board is an open-source platform used to
make electronics projects.
 It consists of both a microcontroller and a part of the
software or Integrated Development Environment
(IDE) that runs on your PC, used to write & upload
computer code to the physical board.
 Arduino board has been used for making different
engineering projects and different applications. There
are many varieties of Arduino boards like Aduino Uno,
Due, Nano,Mega,Leonardo,Lilipad,Yun,fio,Tie etc. that
can be used for different purposes.
Difference between Microprocessor and Microcontroller
 Microprocessor is an IC which has only the CPU inside them i.e. only the
processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo, i3, i5 etc.
These microprocessors don’t have RAM, ROM, and other peripheral on
the chip. A system designer has to add them externally to make them
functional. Application of microprocessor includes Desktop PC’s,
Laptops, notepads etc.

 Microcontroller has a CPU, in addition with a fixed amount of RAM,


ROM and other peripherals all embedded on a single chip. At times it is
also termed as a mini computer or a computer on a single chip. Today
different manufacturers produce microcontrollers with a wide range of
features available in different versions. Some manufacturers are ATMEL,
Microchip, TI, Freescale, Philips, Motorola etc.

 Microprocessor cannot be used stand alone. They need other peripherals


like RAM, ROM, buffer, I/O ports etc and hence a system designed
around a microprocessor is quite costly.
 Microcontrollers are designed to perform specific tasks. Specific means
applications where the relationship of input and output is defined.
Depending on the input, some processing needs to be done and output is
delivered. For example, keyboards, mouse, washing machine, digicam,
pendrive, remote, microwave, cars, bikes, telephone, mobiles, watches,
etc. Since the applications are very specific, they need small resources like
RAM, ROM, I/O ports etc and hence can be embedded on a single chip.
This in turn reduces the size and the cost.

 The clock speed of the Microprocessor is quite high as compared to the


microcontroller. Whereas the microcontrollers operate from a few MHz
to 30 to 50 MHz, today’s microprocessor operate above 1GHz as they
perform complex tasks.

 A microcontroller is far cheaper than a microprocessor


ANATOMY OF ARDUINO BOARD
PIN & PORT SPECIFICATIONS:-
Power USB(1)
Arduino board can be powered by using the USB cable from your computer. All you need
to do is connect the USB cable to the USB connection
Power (Barrel Jack)(2) (7 - 12v DC) (2.1mm x 5.5mm)
Arduino can be powered straightforwardly from the DC power supply by associating it to
the Barrel Jack
Voltage Regulator(3)
The function of the voltage regulator is to control the voltage given to the Arduino board
and stabilize the DC voltages used by the processor and other elements.
The capacity of the voltage controller is to control the voltage given to the Arduino board
and settle the DC voltages to 5V or 3.3V utilized by the Microcontroller and different
components.
Crystal Oscillator(4)
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on top of
the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or 16
MHz.
Arduino Reset(5,17)
You can reset your Arduino board, i.e., start your program from the beginning. You can
reset the UNO board in two ways. First, by using the reset button (17) on the board. Second,
you can connect an external reset button to the Arduino pin labelled RESET (5).
Pins(6,7,8,9) (3.3V, 5V, GND, Vin)

 3.3V (6) − Supply 3.3 output volt


 5V (7) − Supply 5 output volt
 Most of the components used with Arduino board works fine with 3.3 volt and 5 volt.
 GND (8)(Ground) − There are several GND pins on the Arduino, any of which can be
used to ground your circuit.
 Vin (9) − This pin also can be used to power the Arduino board from an external power
source, like AC mains power supply.

Analog pins(10)

 The Arduino UNO board has six analog input pins A0 through A5. These pins can read
the signal from an analog sensor like the humidity sensor or temperature sensor and
convert it into a digital value that can be read by the microprocessor
Microcontroller Atmega328p(11)
 Each Arduino board has its own microcontroller (11). You can assume it as the
brain of your board. The main IC (integrated circuit) on the Arduino is slightly
different from board to board. The microcontrollers are usually of the ATMEL
Company. You must know what IC your board has before loading up a new
program from the Arduino IDE. This information is available on the top of the IC.

 The Atmel 8-bit AVR RISC-based microcontroller combines


32 KB ISP flash memory with read-while-write capabilities, 1 KB EEPROM,
2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers,
three flexible timer/counters with compare modes, internal and
external interrupts, serial programmable USART, a byte-oriented 2-wire serial
interface, SPI serial port, 10-bit A/D converter ,programmable watchdog
timer with internal oscillator, and five software selectable power saving modes.
The device operates between 1.8-5.5 volts. The device achieves throughput
approaching 1 MIPS per MHz

 For more details about the IC construction and functions, you can refer to the data sheet.
AVR Family
 A common alternative to the ATmega328 is the
"picoPower" ATmega328P. A comprehensive list of all
other members of the megaAVR series can be found
on the Atmel website.[3]
 ATmega328
 ATmega328P and ATmega328P-AUTOMOTIVE
 ATmega328PB and ATmega328PB-AUTOMOTIVE
(superset of ATmega328P) - has more UART, I2C, and
SPI peripherals than ATmega328P
Power LED indicator(13)
 This LED should light up when you plug your Arduino into a power
source to indicate that your board is powered up correctly. If this light
does not turn on, then there is something wrong with the connection.
TX and RX LEDs(14)
 On your board, you will find two labels: TX (transmit) and RX (receive).
They appear in two places on the Arduino UNO board. First, at the
digital pins 0 and 1, to indicate the pins responsible for serial
communication. Second, the TX and RX led (13). The TX led flashes with
different speed while sending the serial data. The speed of flashing
depends on the baud rate used by the board. RX flashes during the
receiving process.
Digital I/O Pins(15)
 The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM
(Pulse Width Modulation) output. These pins can be configured to work as
input digital pins to read logic values (0 or 1) or as digital output pins to drive
different modules like LEDs, relays, etc. The pins labelled “~” can be used to
generate PWM.
AREF Analogue Reference (16)
 It allows us to feed the Arduino a reference (analog inputs) voltage from an
external power supply. For example, if we want to measure voltages with a
maximum range of 3.3V, we would feed a nice smooth 3.3V into the AREF pin –
perhaps from a voltage regulator IC. Then the each step of the ADC would
represent 3.22 millivolts.
Pulse Width Modulation (PWM) Signal
 PWM is a method for generating an analog signal using a digital source. Here
PWM is used for supplying electrical power to a load that has a relatively slow
response. The supply signal consists of a train of voltages pulses such that the
width of individual pulses controls the effective voltage level to the load. Both
AC and DC signals can be simulated with PWM
How to Download and Install the Arduino IDE Software
The Arduino Integrated Development Environment
(Arduino IDE) is the free software required to interact
with your Arduino controller board, without the Arduino
IDE you can‟t program your Arduino microcontroller to
do electronic projects

Choose a device to install the Arduino IDE software on


Download the Arduino IDE Software
Go to the Arduino.cc official website & download the
relevant version for your device.

The Arduino IDE software is available for Windows, Mac


and Linux operating systems.
Since I‟m installing on a Desktop PC running Windows
7. I downloaded the Windows Installer, for Windows 7
and up with filename: arduino-1.8.12(latest version)-
windows.exe.
Install the Arduino IDE Software
 Install the Arduino IDE software by running the downloaded file and
follow the instructions. Installing the IDE software is like installing
any software on a PC

Read the Arduino License agreement and click the “I


Agree” button.
 Unless you have a reason to change them, keep all the Arduino
IDE software components ticked and click the “Next” button.
 On the next window you can choose to change the folder where
the Arduino IDE software is installed, or keep the default
location and click the “Install” button.

 The Arduino software will start to install.


 This can take sometime and you‟ll be presented with various drivers
to install including Arduino USB drivers and COM/LPT port drivers,
I suggest you install them all.

 When complete the Arduino IDE Software is ready to run.


Running the Arduino IDE
Software
Arduino UNO Attached to a PC
via USB Cable
 Attach your Arduino Microcontroller board (I‟m working with an
Arduino UNO clone) to your device with a USB cable.
Select your Arduino board
 To avoid any error while uploading your program to the board,
you must select the correct Arduino board name, which
matches with the board connected to your computer.

 Go to Tools → Board and select your board.


 After connecting the Arduino UNO via USB to a Desktop PC, the
power light on the Arduino UNO will light up (the USB cable
powers the UNO board, no need for a power supply) and you should
get a “Found New Hardware” message from Windows.
Select the Correct COM Port

 Although Windows has successfully installed the Arduino on COM4


(could be COM3 or another port) the Arduino IDE Software doesn‟t
automatically select the relevant serial port.

 To select the correct port click “Tools”, hover over „Port:”COM4


Arduino Genuino UNO”„ and click “COM4 Arduino Genuino
UNO”.

 Serial COM port can be other also


That’s it, you’ve successfully installed the Arduino
IDE Software.
Introduction to Arduino IDE
 Arduino IDE is an open source software that is mainly used for
writing and compiling the code into the Arduino Module.
 It is an official Arduino software, making code compilation too easy
that even a common person with no prior technical knowledge can
get their feet wet with the learning process.
 It is easily available for operating systems like MAC, Windows,
Linux and runs on the Java Platform that comes with inbuilt
functions and commands that play a vital role for debugging, editing
and compiling the code in the environment.
 Each of them contains a microcontroller on the board that is
actually programmed and accepts the information in the form of code.

 The main code, also known as a sketch, created on the IDE platform will
ultimately generate a Hex File which is then transferred and uploaded in the
controller on the board.

 The IDE environment mainly contains two basic parts: Editor and Compiler
where former is used for writing the required code and later is used for
compiling and uploading the code into the given Arduino Module.

 This environment supports both C and C++ languages.


The IDE environment is mainly
distributed into three sections

 Menu Bar

 Text Editor

 Output Pane

As you download and open the IDE


software, it will appear like an
image below.
The bar appearing on the top is called Menu Bar that
comes with different options as following

1. File Menu - You can open a new window for writing


the code or open an existing one. Following table
shows the number of further subdivisions the file
option is categorized into.
As you go to the preference section and check the compilation section, the
Output Pane will show the code compilation as you click the upload button.
How to load an example code in
Arduino IDE?
 Open the Arduino IDE software.
 Go to the File menu and click on Examples option than to Basics.
 You can see the example programs. Now, Select the example program you
want.
 Click on the upload option. Now your board should perform according to
the program that is uploaded.
2. Edit Menu
3. Sketch Menu
What are Libraries?

 Libraries are simply a collection of code that helps you to


interface the hardware with any peripheral devices such as
sensors, modules, shields, etc. easily. You can use built-in
functions of the libraries to make a coding project much more
comfortable.
How to install a library in the
Arduino IDE?

 There are a couple of ways to install a library for the Arduino


IDE. You will need to do this whenever you are using a unique
device or a shield from one of the various of Arduino
shields available.
How to install the library from the library
manager in the Arduino IDE?
 Open the Arduino IDE software.

 Go to the sketch menu and click on Include Library option.

 Click on Manage Libraries.

 You will see the list of already installed libraries, click on the
needed library.

 Select the latest version of the library you needed.


How to import the library from a zip
file?

 Open the Arduino IDE software.

 Go to the sketch menu and click on Include Library option.

 Click on Add .zip Library options.

 Then, select the correct .zip library by navigating the location.

 Open the .zip library file. Now you can find it that library in
Include Library option.
4. Tools Menu
5. Help Menu
Below the dropdown menus, you can
see a bar that has five basic and
important options. They are
How to compile code in Arduino
IDE?
 Open the Arduino IDE software.
 You can compile the code by clicking in the verify option in the drop-down
menus.

 When you click on the upload option, it will automatically compile your
sketch.
How to execute code in Arduino IDE?

 Open the Arduino IDE software.


 Click on the File menu and select the
New sketch option.
 Write the code that you need to
perform.
 Click on the Verify option to compile
the sketch.
 Click on the Upload option and upload
the sketch into the board. Now, the
board will start functioning according
to the code.
Sketch
Upload program
to Arduino
About Serial Monitor in Arduino
Serial Monitor is one of the tools in Arduino IDE. It is used
for two purposes:

 Arduino → PC: Receives data from Arduino and display


data on screen. This is usually used for debugging and
monitoring

 PC → Arduino: Sends data (command) from PC to


Arduino.
Data is exchanged between Serial Monitor and Arduino via USB cable, which
is also used to upload the code to Arduino. Therefore, To use Serial Monitor,
we MUST connect Arduino and PC via this cable.
How to open Serial monitor in
Arduino

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy