0% found this document useful (0 votes)
40 views77 pages

IOT Unit 3 and 4

This document provides an overview of IoT devices and Arduino programming, detailing the differences between IoT devices and computers, IoT configurations, and the basic components of an IoT system. It introduces Arduino as an open-source platform for electronics projects, highlighting its ease of use and versatility for various applications. Additionally, it outlines the types of Arduino boards available, their features, and their suitability for beginners and advanced users alike.

Uploaded by

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

IOT Unit 3 and 4

This document provides an overview of IoT devices and Arduino programming, detailing the differences between IoT devices and computers, IoT configurations, and the basic components of an IoT system. It introduces Arduino as an open-source platform for electronics projects, highlighting its ease of use and versatility for various applications. Additionally, it outlines the types of Arduino boards available, their features, and their suitability for beginners and advanced users alike.

Uploaded by

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

UNIT III IOT AND ARDUINO PROGRAMMING

Introduction to the Concept of IoT Devices – IoT Devices Versus Computers – IoT
Configurations – Basic Components – Introduction to Arduino Types of Arduino –
Arduino Toolchain – Arduino Programming Structure – Sketches – Pins – Input/Output
From Pins Using Sketches – Introduction to Arduino Shields – Integration of Sensors and
Actuators with Arduino.

Introduction to the Concept of IoT Devices

 Different types of applications require different types of sensors to collect data from
the environment.

 In an Internet of Things (IoT) ecosystem, two things are very important: the Internet
and physical devices like sensors and actuators.

 As shown in Fig. 1, the bottom layer of the IoT system consists of sensor connectivity
and network to collect information.

 This layer is an essential part of the IoT system and has network connectivity to the
next layer, which is the gateway and network layer.

 The main purpose of sensors is to collect data from the surrounding environment.
Sensors, or ‘things’ of the IoT system, form the front end.

 These are connected directly or indirectly to IoT networks after signal conversion and
processing.

 But all sensors are not the same and different IoT applications require different types
of sensors.
 For instance, digital sensors are straightforward and easy to interface with a
microcontroller using Serial Peripheral Interface (SPI) bus.

 But for analogue sensors, either analogue-to-digital converter (ADC) or Sigma- Delta
modulator is used to convert the data into SPI output.

IoT Devices Versus Computers

Difference between IoT devices and Computers:


Computers
IOT Devices

IoT devices are special-purpose


Computers are general-purpose devices.
devices.

IoT devices can do only a particular


Computers can do so many tasks.
task for which it is designed.

The hardware and software built-in in the


The hardware and software built-in in
computers are streamlined to do many
the IoT devices are streamlined for
tasks(such as calculation, gaming, music
that particular task.
player, etc. )

IoT devices can be cheaper and faster


at a particular task than computers, as A computer can be expensive and slower
IoT devices are made to do that at a particular task than an IoT device.
particular task.

Examples: Music Player- iPod, Alexa, Examples: Desktop computers, Laptops,


smart cars, etc. etc.

IOT CONFIGURATIONS

 Configuring an Internet of Things (IoT) system involves setting up and managing


various components to ensure proper communication, data collection, and
control.

 Here's a general outline of the steps involved in configuring an IoT system:

1. Define Use Case and Requirements:


Clearly define the purpose of your IoT system, the data you want to
collect, the devices involved, and the desired outcomes. This will guide the entire
configuration process.

2. Select IoT Platform:

Choose an appropriate IoT platform that suits your needs. Popular


platforms include AWS IoT, Microsoft Azure IoT, Google Cloud IoT, and more.
These platforms provide tools and services to manage devices, data, and
analytics.

3. Device Selection and Configuration:

Choose the IoT devices that will collect and transmit data. These devices
could be sensors, actuators, gateways, or other embedded systems. Configure the
devices to connect to your chosen IoT platform. This involves setting up device
identities, credentials, and communication protocols (MQTT, CoAP, HTTP, etc.).

4. Security Considerations:

Implement security measures to protect your IoT system from


unauthorized access and data breaches. This includes using secure
communication protocols, device authentication, data encryption, and regular
security updates.

5. Data Ingestion and Storage:

Configure your IoT platform to receive, process, and store the data
generated by your devices. Set up data ingestion pipelines and storage solutions,
such as databases, data lakes, or cloud storage.

6. Data Processing and Analytics:

Define data processing pipelines to transform and analyze the incoming


data. This could involve real-time analytics, machine learning models, and
pattern recognition to extract meaningful insights from the data.

7. Remote Monitoring and Control:

If your IoT system involves remote control of devices, configure the


necessary interfaces to enable remote monitoring and control. This might
include building a user interface or integrating with existing dashboards.

8. Scalability and Performance:

Ensure that your IoT system is designed to handle the expected load.
Configure scaling options to accommodate an increasing number of devices and
data volume.
9. Alerts and Notifications:

Set up alerts and notifications to be informed about critical events or


anomalies in your IoT system. This could involve sending emails, text messages,
or triggering automated actions.

10. Data Visualization:

Configure data visualization tools to display the insights and information


extracted from your IoT data. Dashboards and visual representations help you
understand the system's performance and make informed decisions.

11. Testing and Quality Assurance:

Thoroughly test the entire IoT system before deployment. This includes
testing device connectivity, data flow, security measures, and the overall
functionality of the system.

12. Deployment and Monitoring:

Deploy the configured IoT system in the target environment. Monitor its
performance, stability, and security on an ongoing basis. Implement procedures
for updates, patches, and maintenance.

Basic Components

Major Components of IOT:

These are explained as following below.

 Things or Device
 These are fitted with sensors and actuators.
 Sensors collect data from the environment and give to gateway where as
actuators performs the action (as directed after processing of data).
 Gateway

 The sensors give data to Gateway and here some kind of pre-processing of
data is even done.

 It also acts as a level of security for the network and for the transmitted
data.

 Cloud

 The data after being collected is uploaded to cloud.

 Cloud in simple terms is basically a set of servers connected to internet


24*7.
 Analytics

 The data after being received in the cloud processing is done. Various
algorithms are applied here for proper analysis of data (techniques like
Machine Learning etc are even applied).

 User Interface

 User end application where user can monitor or control the data.

INTRODUCTION TO ARDUINO
 Arduino is an open-source electronics platform based on easy-to-use hardware
and software.
 Arduino boards 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.
 You can tell your board what to do by sending a set of instructions to the
microcontroller on the board.
 To do so you use the Arduino programming language (based on Wiring),
and the Arduino Software (IDE), based on Processing.
 Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments.
 A worldwide community of makers - students, hobbyists, artists, programmers,
and professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible
knowledge that can be of great help to novices and experts alike.
 Arduino was born at the Ivrea Interaction Design Institute as an easy tool for
fast prototyping, aimed at students without a background in electronics and
programming.
 As soon as it reached a wider community, the Arduino board started changing
to adapt to new needs and challenges, differentiating its offer from simple 8-bit
boards to products for IoT applications, wearable, 3D printing, and embedded
environments.

Why Arduino?

 Due to its simple and accessible user experience, Arduino has been used in
thousands of different projects and applications.
 The Arduino software is easy-to-use for beginners, yet flexible enough for
advanced users.
 It runs on Mac, Windows, and Linux.
 Teachers and students use it to build low cost scientific instruments, to prove
chemistry and physics principles, or to get started with programming and
robotics.
 Designers and architects build interactive prototypes, musicians and artists use
it for installations and to experiment with new musical instruments.
 Makers, of course, use it to build many of the projects exhibited at the Maker
Faire, for example. Arduino is a key tool to learn new things. Anyone - children,
hobbyists, artists, programmers - can start tinkering just following the step by
step instructions of a kit, or sharing ideas online with other members of the
Arduino community.
 There are many other microcontrollers and microcontroller platforms available
for physical computing.
 Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and
many others offer similar functionality.
 All of these tools take the messy details of microcontroller programming and
wrap it up in an easy-to-use package.
 Arduino also simplifies the process of working with microcontrollers, but it
offers some advantage for teachers, students, and interested amateurs over
other systems:

1. Inexpensive - Arduino boards are relatively inexpensive compared to


other microcontroller platforms. The least expensive version of the
Arduino module can be assembled by hand, and even the pre-assembled
Arduino modules cost less than \$50
2. Cross-platform - The Arduino Software (IDE) runs on Windows,
Macintosh OSX, and Linux operating systems. Most microcontroller
systems are limited to Windows.
3. Simple, clear programming environment - The Arduino Software
(IDE) is easy-to-use for beginners, yet flexible enough for advanced
users to take advantage of as well. For teachers, it's conveniently based
on the Processing programming environment, so students learning to
program in that environment will be familiar with how the Arduino IDE
works.
4. Open source and extensible software - The Arduino software is
published as open-source tools, available for extension by experienced
programmers. The language can be expanded through C++ libraries, and
people wanting to understand the technical details can make the leap
from Arduino to the AVR C programming language on which it's based.
Similarly, you can add AVR-C code directly into your Arduino programs
if you want to.
5. Open source and extensible hardware - The plans of the Arduino
boards are published under a Creative Commons license, so experienced
circuit designers can make their own version of the module, extending it
and improving it. Even relatively inexperienced users can build
the breadboard version of the module in order to understand how it
works and save money.

TYPES OF ARDUINOS

 Arduino board was designed in the Ivrea Interaction Design Institute intended
for students without a background in electronics and programming concepts.
 This board started altering to adapt to new requirements and challenges,
separating its presence from simple 8-bit boards to products for IoT (Internet of
Things) applications, 3D printing, wearable, and embedded surroundings.
 All boards are entirely open-source, allowing users to build them separately and
finally adapt them to their exact needs.
 Over the years the different types of Arduino boards have been used to build
thousands of projects, from daily objects to compound scientific instruments. An
international community of designers, artists, students, programmers, hobbyists,
and experts has gotten together around this open-source stage, their donations
have added up to an unbelievable amount of available knowledge that can be of
immense help to beginners and specialists alike.

What are the Types of Arduino Boards?


 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.
 The platform of an Arduino has become very famous with designers or students
just starting out with electronics, and for an excellent cause.
Types of Arduino Boards
 Unlike earlier programmable circuit boards, the Arduino does not require a
separate part of hardware in order to program a new code onto the board you
can just use a USB cable.
 As well, the Arduino IDE uses a basic version of C++, making it simpler to learn
the program.
 At last, the Arduino board offers a typical form factor that breaks out the
functions of the microcontroller into a more available package.

Why Arduino Boards?

 Arduino board has been used for making different engineering projects and
different applications.
 The Arduino software is very simple to use for beginners, yet flexible adequate
for advanced users.
 It runs Windows, Linux, and Mac.
 Teachers and students in the schools utilize it to design low-cost scientific
instruments to verify the principles of physics and chemistry.
 There are numerous other microcontroller platforms obtainable for physical
computing.
 The Netmedia’s BX-24, Parallax Basic Stamp, MIT’s Handyboard, Phidget, and
many others present related functionality.
 Arduino also makes simpler the working process of microcontroller, but it gives
some advantages over other systems for teachers, students, and beginners.
 Inexpensive
 Cross-platform
 The simple, clear programming environment
 Open source and extensible software
 Open source and extensible hardware

The Function of the Arduino Board

 The flexibility of the Arduino board is enormous so that one can do anything they
imagine.
 This board can be connected very easily to different modules such as obstacle
sensors, presence detectors, fire sensors, GSM Modules GPS modules, etc.
 The main function of the Arduino board is to control electronics through reading
inputs & changing it into outputs because this board works like a tool.
 This board is also used to make different electronics projects in the field of
electronics, electrical, robotics, etc.

Features of Different Types of Arduino Boards

 The features of different types of Arduino boards are listed in the tabular form.
Arduino Board Processor Memory Digital I/O Analogue I/O

16Mhz 2KB SRAM, 32KB


Arduino Uno 14 6 input, 0 output
ATmega328 flash

84MHz 96KB SRAM,


Arduino Due 54 12 input, 2 output
AT91SAM3X8E 512KB flash

16MHz 8KB SRAM, 256KB


Arduino Mega 54 16 input, 0 output
ATmega2560 flash

16MHz 2.5KB SRAM, 32KB


Arduino Leonardo 20 12 input, 0 output
ATmega32u4 flash

Different Types of Arduino Boards

 The list of Arduino boards includes the following such as


 Arduino Uno (R3)
 Arduino Nano
 Arduino Micro
 Arduino Due
 LilyPad Arduino Board
 Arduino Bluetooth
 Arduino Diecimila
 RedBoard Arduino Board
 Arduino Mega (R3) Board
 Arduino Leonardo Board
 Arduino Robot
 Arduino Esplora
 Arduino Pro Mic
 Arduino Ethernet
 Arduino Zero
 Fastest Arduino Board

Arduino Uno (R3)

 The Uno is a huge option for your initial Arduino.


 This Arduino board depends on an ATmega328P based microcontroller.
 As compared with other types of arduino boards, it is very simple to use like the
Arduino Mega type board.
 It consists of 14-digital I/O pins, where 6-pins can be used as PWM (pulse width
modulation outputs), 6-analog inputs, a reset button, a power jack, a USB
connection, an In-Circuit Serial Programming header (ICSP), etc.
 It includes everything required to hold up the microcontroller; simply attach it to
a PC with the help of a USB cable and give the supply to get started with an AC-
to-DC adapter or battery.

Arduino Uno (R3)


 Arduino Uno is the most frequently used board and it is the standard form apart
from all the existing Arduino Boards.
 This board is very useful for beginners.

Arduino Nano

 This is a small board based on the microcontrollers like ATmega328P otherwise


ATmega628 but the connection of this board is the same as to the Arduino UNO
board.
 This kind of microcontroller board is very small in size, sustainable, flexible, and
reliable.

Arduino Nano
 As compared with the Arduino Uno board, it is small in size.
 The devices like mini-USB and Arduino IDE are necessary to build the projects.
 This board mainly includes analog pins-8, digital pins-14 with the set of an I/O
pin, power pins-6 & RST (reset) pins-2.

Arduino Micro

 The Arduino Micro board mainly depends on the ATmega32U4 based


Microcontroller that includes 20-sets of pins where the 7-pins are PWM pins, 12-
analog input pins.
 This board includes different components like an ICSP header, RST button, small
USB connection, crystal oscillator-16MHz.
 The USB connection is inbuilt and this board is the shrunk version of the
Leonardo board.

Arduino Micro

Arduino Due

 This Arduino board depends on the ARM Cortex-M3 and it is the first Arduino
microcontroller board.
 This board includes digital I/O pins-54 where 12-pins are PWM o/p pins, analog
pins -12, UARTs-4, a CLK with 84 MHz, an USB OTG, DAC-2, a power jack, TWI-2,
a JTAG header, an SPI header, two buttons for reset & erase.

Arduino Due
 This board works with 3.3V where the highest voltage that the pins of
input/output can stand is 3.3V because providing a high voltage to any I/O pin
can lead to damage the board.
 This board is simply connected to a computer through a small USB cable
otherwise it can be powered through an AC to DC adapter.
 This Arduino Due board is suitable with all shields of Arduino at 3.3V.

LilyPad Arduino Board

 The Lily Pad Arduino board is a wearable e-textile technology expanded by Leah
“ Buechley” and considerately designed by “Leah and SparkFun”.
 Each board was imaginatively designed with huge connecting pads & a smooth
back to let them to be sewn into clothing using conductive thread.
 This Arduino also comprises of I/O, power, and also sensor boards which are
built especially for e-textiles. These are even washable!

LilyPad Arduino Boards


Arduino Bluetooth

 This Bluetooth mainly depends on the microcontroller like ATmega168 and this
board is also called Arduino BT.
 This kind of board includes different components like digital pins-16, analog
pins-6, crystal oscillator-16MHz, reset button, screw terminals, ICSP header.
 In this board, the screw terminals are mainly used for power.
 The programming of this Bluetooth microcontroller can be done with Bluetooth
like a wireless connection.

Arduino Diecimila

 The microcontroller board like Arduino Diecimila mainly depends on the


ATmega168.
 This board includes digital I/O pins -14 where 6-pins can be used like PWM
outputs & analog inputs-6, a USB connection, a crystal oscillator-16 MHz, an ICSP
header, a reset button & a power jack.
 This board can be connected to a computer through a USB cable and it can be
activated using a battery and an AC-DC adapter.
Arduino Diecimila
 As the name suggests, the meaning of Diecimila in Italian is 10,000 which means
that marks the truth that above 10k Arduino boards have been designed.
 In a set of USB Arduino boards, it is the latest one as compared with other
versions.

RedBoard Arduino Board

 The RedBoard Arduino board can be programmed using a Mini-B USB cable
using the Arduino IDE.
 It will work on Windows 8 without having to modify your security settings.
 It is more constant due to the USB or FTDI chip we used and also it is entirely flat
on the back.
 Creating it is very simple to utilize in the project design. Just plug the board,
select the menu option to choose an Arduino UNO and you are ready to upload
the program.
 You can control the RedBoard over a USB cable using the barrel jack.

RedBoard Arduino Boards


Arduino Mega (R3) Board

 The Arduino Mega is similar to the UNO’s big brother.


 It includes lots of digital I/O pins (from that, 14-pins can be used as PWM o/ps),
6-analog inputs, a reset button, a power jack, a USB connection, and a reset
button.
 It includes everything required to hold up the microcontroller; simply attach it to
a PC with the help of a USB cable and give the supply to get started with an AC-
to-DC adapter or battery.
 The huge number of pins make this Arduino board very helpful for designing
projects that need a bunch of digital i/ps or o/ps like lots of buttons.

Arduino Mega (R3) Board

Arduino Leonardo Board

 The first development board of an Arduino is the Leonardo board.


 This board uses one microcontroller along with the USB.
 That means, it can be very simple and cheap also.
 Because this board handles USB directly, program libraries are obtainable which
let the Arduino board to follow a keyboard of the computer, mouse, etc.

Arduino Leonardo Board


Arduino Robot

 This kind of board is the first Arduino over wheels.


 This Arduino robot includes two processors on each of its boards.
 The two boards are the motor board and control board where the motor board
controls the motors & the control board is used to read the sensors for operating.
 Every board is a complete Arduino board and its programming can be done
through the Arduino IDE.
 These are microcontroller boards that depend on the ATmega32u4.
 The pins of this Robot are mapped to actuators and sensors onboard.
 The process of programming the robot is the same as the Arduino Leonardo
board.
 It is also named a small computer and it is extensively used in robotics.
 This board includes the speaker, color screen, buttons-5, motors-2, a digital
compass, an SD card reader, potentiometers-2 & floor sensors-5.
 The library of this robot can be used for controlling the sensors as well as the
actuators.

Arduino Esplora

 The Arduino Esplora includes a small computer known as a microcontroller


including a number of inputs & outputs.
 The inputs of this board are a light sensor, four buttons, a microphone, an
accelerometer, joystick, a slider, a temperature sensor, etc whereas the outputs
are a 3 color LED, a buzzer.
 This kind of Arduino board looks like a videogame controller.

Arduino Esplora
 The programming of this board can be done using Arduino Software like IDE
which takes the data from the inputs and controls the output like a keyboard or a
mouse.
 As compared with all other types of Arduino boards, this esplora is totally
different because the inputs, as well as outputs, are connected to the board
already.
 So connecting the components like actuators or sensors is very simple.
 Thus, programming is somewhat different as compared with other types of
Arduino boards.
 This esplora board includes its own library so that the data from the sensors &
actuators are very easy to read and write.

Arduino Pro Mic

 The Arduino Pro Micro board is the same as the Arduino Mini board apart from
the ATmega32U4 Microcontroller.
 This pro mic board includes digital I/O pins-12, pulse width modulation (PWM)
pins-5, serial connections of Tx & Rx &10-bit ADC.

Arduino Ethernet

 The Arduino Ethernet board depends on the microcontroller like ATmega328.


 This kind of microcontroller board includes analog pins-5, digital I/O pins-14,
RST button, an RJ45 connection, crystal oscillator, a power jack, ICSP header, etc.
 The connection of the Arduino board can be done through the Ethernet shield to
the internet.

Arduino Zero

 This is a powerful as well as simple 32-bit board and it provides the best
platform for innovative projects like wearable technology, smart IoT devices,
crazy robotics, high-tech automation, etc.
 This board expands by providing improved performance, permitting a range of
project opportunities & performs like a great educational tool.

Arduino Zero
 This board includes analog input pins-6, digital I/O pins-14, a power jack, AREF
button, UART port pins, a USB connector & an In-Circuit Serial Programming
(ICSP) header, a power header, etc.
 This board is power-driven through the SAMD21 microcontroller based on
Atmel.
 The main feature of this is EDBG (Embedded Debugger) based on Atmel and it
provides a complete debug interface without using extra hardware.

Fastest Arduino Board

 Designing one of the best Arduino development boards that are familiar with
Arduino MEGA & UNO is the hifive1 board that includes a 320 MHz RISC-V
microcontroller unit.
 This kind of fastest board has Cortex M-7 with a 400 MHz microcontroller unit.
 Flash memory – upto 2Mbytes
 RAM – 1 Mbyte
 DMA controllers -4
 Communication peripherals- Up to 35
 16-bit Max Resolution with 3× ADCs
 D/A converters with 2× 12-bit
 Hardware with JPEG Codec
 Timers -22 & Watchdogs – 200Mhz
 HW Calendar & RTC with Sub-second Accuracy
 Cryptographic Acceleration

Hifive1 Board Features


 The features of the Hifive1 board include the following.
 Mega Form Factor or Arduino Uno
 Charger for Battery
 SD Card including Detection of Card Feature
 Ethernet*
 Optional QSPI Flash – 133Mhz
 Interfaces – CAN, SWD, Camera
 USB- OTG

The Arduino Shields

 Additionally, Arduino shields are pre-built circuit boards used to connect to a


number of Arduino boards.
 These shields fit on the top of the Arduino compatible boards to provide
additional capabilities like connecting to the internet, motor controlling,
providing wireless communication, LCD screen controlling, etc.
 The different types of Arduino shields are
Shields for Arduino Boards
 Wireless Shields
 The GSM Shield
 The Ethernet Shield
 The Proto Shields

Arduino Boards Comparison

The comparison between different Arduino boards includes the following.

Arduino Voltage CLK Digital Analog Interface of


PWM UART
Board of System Speed I/O Inputs Programming

Arduino Uno – 5V 1 USB through


16MHz 14 14 6
R3 ATMega16U2
Arduino Uno 5V 1 USB through
16MHz 14 14 6
R3 SMD ATMega16U2

5V 1 USB through
RedBoard 16MHz 14 14 6
FTDI
FTDI-
Arduino Pro 3.3V 1
8MHz 14 14 6 Compatible
3.3V/8MHz
Header
FTDI-
Arduino Pro 5V 1
16MHz 14 14 6 Compatible
5V/16MHz
Header
FTDI-
Arduino Mini 5V 1
16MHz 14 14 8 Compatible
05
Header
Arduino Pro FTDI-
Mini 3.3V 8MHz 14 14 6 1 Compatible
3.3V/8MHz Header
Arduino Pro FTDI-
Mini 5V 16MHz 14 8 6 1 Compatible
5V/16MHz Header
FTDI-
Arduino 5V 1
16MHz 14 6 6 Compatible
Ethernet
Header
FTDI-
Compatible
Arduino Fio 3.3V 8MHz 14 8 6 1 Header or
Wirelessly via
XBee†
LilyPad FTDI-
Arduino 328 3.3V 8MHz 14 6 6 1 Compatible
Main Board Header
LilyPad FTDI-
Arduino 3.3V 8MHz 9 4 5 0 Compatible
Simple Board Header

ARDUINO TOOLCHAIN

Arduino Hardware/Software Interface


 When programming the Arduino (or anything else), it is possible to write some
pretty complex instructions and get the Arduino to do some really cool things.
 The problem is that a microcontroller (like the ATmega328 on the Uno) can only
execute simple, low-level instructions.
 These simple instructions include things like add variable a to variable b or take
variable b and put it in register x.
 And, to complicate matters, microcontrollers only speak in binary.
 For those who don’t know, binary numbers are long strings of 1s and 0s.
Arduino and other microcontrollers only understand binary.

 The statement here may make total sense to you if you’ve been working with
Arduino for a while.
 Or, if not, it may not make any sense at all.
 Either way, just go with me here for a minute.
 This is just an illustration which does not require complete understanding of the
code.
Int Temp = analogRead(sensorPin);
If (Temp > 500)

{
//more complex instructions go here
}
 How does a complex statement like this one actually run on a microcontroller
that only knows basic arithmetic, logic, moving and shifting?
 How do these statements translate into the ones and zeros that the
microcontroller can actually understand?
 Microcontrollers are electronic devices, so to speak to one you need to send
electronic signals.
 That’s where binary numbers come into play.
 A zero represents low or off, usually 0 V or close to it, while a one represents
high or on, usually either about 5 V or 3.3 V, depending on the processor.
 A good way to think of binary numbers and digital signals is like a single pole
light switch.
 The light is either on or its off, there is nothing in between.
 Zero is off and one is on.
A good way to think about digital signals.

 Going from complex instructions to simple ones the microcontroller understands


requires several layers of software that translate the high-level operations into
simpler instructions.

How the Arduino Compiler Works


 Enter the compiler. Compiling a program in Arduino is referred to as verifying.
 The terms mean the same thing, so throughout these tutorials we’ll use them
interchangeably.
 The compiler first transforms the code you write into assembly language.
 The name of the compiler we’ll be using on our Uno is AVR-GCC.
 If you’re new to this, that may sound kind of weird but try not to obsess over it.
It’s just a name.
 The assembler, which come with the IDE with the compiler, then translates the
assembly language program into machine language.
 It then creates object files, which combine machine language, data, and
information it needs to place instructions properly in memory.
 Often, the assembler creates multiple files which will eventually be put together.
 This is where the linker — another part of the compiler software package —
shines.
 The linker will take all the independently assembled machine language programs
and object files and put them together.
 This produces a .hex file that the microprocessor can understand and run.
 The two figures below, though they apply to C/C++ programming in general, are
a good illustration of this process.
Arduino code compilation process. The figure below is another way to view it.

Another way to visualize the Arduino code compilation process.

 Another piece of software, called AVR Dude (for Downloader UploaDEr) starts
when we press the upload button.
 This software sends the .hex file to the ATMega328 on the Arduino board.
 On the chip resides the bootloader.
 This bootloader was put there on purpose by the folks at Arduino and works
with AVR Dude to get the. hex into the flash memory on the chip.
 All of this happens very quickly and seamlessly behind the scenes of the Arduino
IDE.

How the compiled code transfers to the Arduino board.

ARDUINO PROGRAMMING STRUCTURE

 Here, we will study in depth, the Arduino program structure and we will learn more
new terminologies used in the Arduino world.
 The Arduino software is open-source.
 The source code for the Java environment is released under the GPL and the
C/C++ microcontroller libraries are under the LGPL.
Sketch − The first new terminology is the Arduino program called “sketch”.
Structure
 Arduino programs can be divided in three main parts: Structure,
Values (variables and constants), and Functions.
 In this tutorial, we will learn about the Arduino software program, step by step,
and how we can write the program without any syntax or compilation error.
 Let us start with the Structure. Software structure consist of two main functions

 Setup( ) function
 Loop( ) function
Void setup ( ) {

}
PURPOSE − The setup() function is called when a sketch starts. Use it to

initialize the variables, pin modes, start using libraries, etc. The setup
function will only run once, after each power up or reset of the Arduino
board.
 INPUT − -
 OUTPUT − -
 RETURN − -
Void Loop ( ) {

}
 PURPOSE − After creating a setup() function, which initializes and sets
the initial values, the loop() function does precisely what its name
suggests, and loops consecutively, allowing your program to change and
respond. Use it to actively control the Arduino board.
 INPUT − -
 OUTPUT − -
 RETURN − -
SKETCHES

 The Internet of Things is hard to track. As I point out in Pax Technica, what
makes it hard to estimate the size of the Internet of Things (IoT) is the fact that
the addressing system for devices is changing.

 The Carna Bot found 1.3 billion devices with an IPv4 address in 2012.

 Engineers expect so many of these connected devices that they have


reconfigured the addressing system to allow for 2 to the 128th power addresses–
enough for each atom on the face of the earth to have 100 Internet addresses.

 The IoT is developing now because we’ve figured out how to give everything we
produce an address, we have enough bandwidth to allow device-to-device
communications, and we have the capacity to store all the data those exchanges
create.

 There are over 30 different sources—from full on commissioned research


reports to vague press releases—about how the Internet of Things is growing.

 It is hard to get a consistent punchline from all the different ways of counting the
Internet of Things, but the figure below puts all the estimates together so we can
at least see what the trend line might be.

 In the absence of good consistent census data, evaluating, and reconciling


estimates is the next best way to think about the most plausible trend lines.

 The figure includes two trend lines, one for the count of the human population
on the planet and one of the count of the population of connected devices.

 The projections go through to the year 2025 and the counts are in billions.
Human population data is from the “medium scenario” of the latest UN
Population revision.

 The figure includes two milestones.

 The first is the year the “Internet of Things” was coined as a term—1998.

 The figure also reveals the crossover point between the two trend lines.

 This second milestone is around 2014, and it marks the point at which the
number of devices communicating with each other surpassed the number of
people communicating with each other.
 Knowing a bit about how analysts generate these numbers, I have shaded the
data points that represent projections for the years ahead.

 Many of the data points from 1995 to 2015 are best guesses, are unreproducible,
are taken from another source, or are poorly explained.

 But as a set, at least these past values are internally consistent so we may have
some confidence in them.

 The research that went into the values from 2015 forward are only guesses or
projections laden with assumptions.

 They are often poorly explained and unreproducible because the notes on how
they were created are hidden behind paywalls.

 Some are industry sales projections, which are often aspirational.

 So I colored all the values up to and including Gartner’s 2015 estimate.

 We should have less confidence in all estimates after that point.

 Numbers from chip designers and makers, such as Intel and Cisco, are probably
among the most credible.

 These numbers vary greatly. Gartner always speaks of the “installed base” to
distinguish between the number of chips that get made and the number that are
actually embedded into objects and shipped out to consumers.

 Some numbers are specific to consumer electronics or smart meters. Some


reports simply refer to human made objects embedded with chips.

 The number 50 billion connections by 2020 have been parroted across multiple
industry documents.

 For some researchers this means the number is being repeated without
verification.

 But at this point it also appears to be credible enough that the technology
industry is sticking to it.

Pins – Input/Output from Pins Using Sketches


Arduino Input and Output Pins

 Arduino input and output pins for beginners in electronics.

 What is an input pin, output pin, and PWM pin on an Arduino Uno or Arduino
MEGA 2560?

 This final part of the Arduino tutorial for beginners looks at the most basic
Arduino concepts.

 That is, how to use Arduino digital pins as inputs and outputs.

 In addition PWM pins are covered.

 Basically, Arduino digital pins are configurable between three different functions
as follows.

 Firstly, input pins for reading the state of a pin, or attached switch for example.

 Secondly as an output to switch or drive an electric load such as an LED.

 Thirdly some pins have special functions such as serial communications and
PWM (Pulse Width Modulation).

 Digital Arduino input and output pins are briefly covered in part 8 of this tutorial
on how to use a push button switch with Arduino.

 This part of the tutorial includes more details on digital input and output pins. In
addition the basics of PWM pins are explained.

Arduino Digital Pins and PWM Pins

 The following subsections highlight the main Arduino Uno and Arduino MEGA
2560 pins.

 That is, the digital pins and PWM pins.

 Digital pins that are configurable as either inputs or outputs are called
input/output pins.

 Input/output is often written I/O for short.


Arduino Uno Digital Input Pins, Output Pins, and PWM Pins

 The following image marks the Arduino Uno digital pins.

 Some of the digital pins have PWM capabilities.

 Digital pins are configurable as input pins or output pins.

 In addition, the two pins at the top right of the below image are for serial
communications.

Arduino Uno Digital Input Output Pins, PWM Pins and Communication Pins

 In addition to the marked pins, there are actually other communication pins.

 These are known as TWI or I2C, and SPI pins.

 Analog pins at the bottom right of the Arduino Uno are also configurable as
digital pins.

 Whereas this Arduino tutorial for beginners covers some parts of the Arduino
Uno hardware, the Ultimate Arduino Uno Hardware Manual covers a lot more.

 For example, board handling precautions, details on the microcontroller, what


the programming headers are for, as well as a pin reference, interfacing
examples and fault-finding techniques, to name only some of the book contents.

Arduino MEGA 2560 Digital Input Pins, Output Pins and PWM Pins

 The following image marks Arduino MEGA 2560 digital input and output pins
that are also PWM pins on the top left.

 To the right of these are digital input and output pins that are also
communication pins.

 That is, pins used for serial communications.

 In other words, these pins are configurable as either communication pins, or


digital input pins, or digital output pins.

 At the right end of the Arduino MEGA 2560 is a double row of digital pins.
 All digital pins are configurable as input pins or output pins.

Arduino MEGA 2560 Digital Pins with PWM and Communications Pins

 There are actually some communication pins and PWM pins on the double
connector at the end of the Arduino MEGA 2560.

 In addition, this manual contains a lot of valuable information on all aspects of


the Arduino MEGA 2560 hardware.

Arduino Digital Input Pins

 Configure Arduino digital pins as input pins to read the state of a switch for
example.

 Digital input pins enable the state of a pin to be read in Arduino sketch code.

 That is, an input is either HIGH (also called logic 1), or LOW (also called logic
low).

Arduino Digital Output Pins

 Configure Arduino digital pins as outputs to drive or switch a load.

 For example, a LED and series resistor are an electrical load.

 Another example of an electrical load is a 5V buzzer.

 A TDB05LFPN is the part number for a 5V buzzer.

 There are many other examples of 5V buzzers, but the TDB05LFPN draws less
than 30mA of current.

 This means that this buzzer can be directly connected to and driven by an
Arduino Uno or Arduino MEGA 2560 pin.

Arduino Uno and MEGA 2560 Pin Current Limits


 Arduino give the maximum current draw of a digital output pin as 20mA.

 In fact it is possible to draw more than 20mA from a pin.

 As a result, it is possible to directly drive or switch a buzzer that draws up to


30mA.

 This applies to Arduino Uno and Arduino MEGA 2560 boards.

 Arduino output pin current limits are actually more complex than just stating a
maximum current draw such as 20mA per pin.

 Arduino pins are divided into groups or banks of pins.

 These groups or banks of pins have limits to how much current can be drawn
from them.

 As a result, 30mA can be drawn from some pins, but not too many in a pin group
or bank.

How to Connect a Buzzer to an Arduino Output Pin

 Connect a buzzer directly to an Arduino Uno or Arduino MEGA 2560 output pin if
the buzzer is low power.

 In addition, the buzzer must also be able to work from 5V.

 Connect a buzzer to an Arduino Uno or MEGA 2450 using a transistor if the


buzzer draws more current than about 30mA.

 Also use a transistor when the buzzer operates from a voltage that is higher than
12V.

Directly Connect a Buzzer to an Arduino Digital Output Pin

 Connect a TDB05LFPN or similar 5V buzzer to an Arduino Uno or Arduino MEGA


2560.

 Make the connection as shown in the article on how to connect a buzzer to an


Arduino Uno.
 As a matter of fact, this very simple article connects the buzzer to Arduino digital
pin 13.

Connect a Buzzer to an Arduino Output Pin using a Transistor

 Connect a buzzer using a transistor as the Arduino buzzer circuit.

 This method reduces the amount of current drawn from an Arduino Pin.

 In addition, a buzzer that operates from more that 5V must be connected using a
transistor and external power supply.

Arduino PWM Output Pins

 PWM stands for Pulse Width Modulation.

 Some Arduino Uno and Arduino MEGA 2560 digital pins have PWM capabilities,
as is mentioned above.

 Control the brightness of an LED using PWM and the Arduino fade example
sketch.Control an LED attached to pin 9 of an Arduino Uno or MEGA 2560 using
the fade example sketch.

 The links to the Arduino tutorial page from the above tutorial page show a 220
ohm resistor in the circuit.

 Use a 470 ohm resistor if you do not have a 220 ohm resistor.

Build a Circuit without Arduino

 This final part of the Arduino tutorial for beginners shows a simple circuit built
without an Arduino.

 Build the dual LED flasher circuit on a breadboard and power it from Arduino 5V.

 This circuit demonstrates a cheap alternative to Arduino that flashes two LEDs
alternately.

 The circuit consists of resistors, capacitors, LEDs and transistors.


INTRODUCTION TO ARDUINO SHIELDS

What is Arduino Shields?

 Arduino shields are the boards, which are plugged over the Arduino board to
expand its functionalities.

 There are different varieties of shields used for various tasks, such as Arduino
motor shields, Arduino communication shields, etc.

 Shield is defined as the hardware device that can be mounted over the board to
increase the capabilities of the projects.

 It also makes our work easy.

 For example, Ethernet shields are used to connect the Arduino board to the
Internet.

 The pin position of the shields is similar to the Arduino boards.

 We can also connect the modules and sensors to the shields with the help of the
connection cable.

 Arduino motor shields help us to control the motors with the Arduino board.

Why do we need Shields?

 The advantages of using Arduino shields are listed below:

 It adds new functionalities to the Arduino projects.


 The shields can be attached and detached easily from the Arduino board. It
does not require any complex wiring.
 It is easy to connect the shields by mounting them over the Arduino board.
 The hardware components on the shields can be easily implemented.

Types of Shields

 The popular Arduino shields are listed below:


 Ethernet shield
 Xbee Shield
 Proto shield
 Relay shield
 Motor shield
 LCD shield
 Bluetooth shield
 Capacitive Touchpad Shield

Ethernet shield

 The Ethernet shields are used to connect the Arduino board to the Internet.

 We need to mount the shield on the top of the specified Arduino board.

 The USB port will play the usual role to upload sketches on the board.

 The latest version of Ethernet shields consists of a micro SD card slot.

 The micro SD card slot can be interfaced with the help of the SD card library.

 The Ethernet shield is shown below:

Xbee Shield

 We can communicate wirelessly with the Arduino board by using the Xbee Shield
with Zigbee.

 It reduces the hassle of the cable, which makes Xbee a wireless communication
model.

 The Xbee wireless module allows us to communicate outdoor upto 300 feet and
indoor upto 100 feet.

 The Xbee shield is shown below:


Proto shield

 Proto shields are designed for custom circuits.

 We can solder electronic circuits directly on the shield.

 The shield consists of two LED pads, two power lines, and SPI signal pads.

 The IOREF (Input Output voltage REFerence) and GND (Ground) are the two
power lines on the board.

 We can also solder the SMD (Surface Mount Device) ICs on the prototyping area.
A maximum of 24 pins can be integrated onto the SMD area

 The proto shield is shown below:

.
Relay shield

 The Arduino digital I/O pins cannot bear the high current due to its voltage and
current limits.

 The relay shield is used to overcome such situation.

 It provides a solution for controlling the devices carrying high current and
voltage.

 The shield consists of four relays and four LED indicators.

 It also provides NO/NC interfaces and a shield form factor for the simple
connection to the Arduino board.

 The LED indicators depicts the ON/OFF condition of each relay.

 The relay used in the structure is of high quality.

 The NO (Normally Open), NC (Normally Closed), and COM pins are present on
each relay.

 The applications of the Relay shield include remote control, etc.

 The relay shield is shown below:

Motor shield

 The motor shield helps us to control the motor using the Arduino board.

 It controls the direction and working speed of the motor.


 We can power the motor shield either by the external power supply through the
input terminal or directly by the Arduino.

 We can also measure the absorption current of each motor with the help of the
motor shield.

 The motor shield is based on the L298 chip that can drive a step motor or two DC
motors.

 L298 chip is a full bridge IC.

 It also consists of the heat sinker, which increases the performance of the motor
shield.

 It can drive inductive loads, such as solenoids, etc.

 The operating voltage is from 5V to 12V.

 The applications of the motor shield are intelligent vehicles, micro-robots, etc.

 The Motor shield is shown below:

LCD shield

 The keypad of LCD (Liquid Crystal Display) shield includes five buttons called as
up, down, left, right, and select.

 There are 6 push buttons present on the shield that can be used as a custom
menu control panel.

 It consists of the 1602 white characters, which are displayed on the blue
backlight LCD.
 The LED present on the board indicates the power ON.

 The five keys present on the board helps us to make the selection on menus and
from board to our project.

 The LCD shield is popularly designed for the classic boards such as Duemilanove,
UNO, etc.

 The LCD shield is shown below:

Bluetooth shield

 The Bluetooth shield can be used as a wireless module for transparent serial
communication.

 It includes a serial Bluetooth module. D0 and D1 are the serial hardware ports in
the Bluetooth shield, which can be used to communicate with the two serial
ports (from D0 to D7) of the Arduino board.

 We can install Groves through the two serial ports of the Bluetooth shield called
a Grove connector.

 One Grove connector is digital, while the other is analog.

 The communication distance of the Bluetooth shield is upto 10m at home


without any obstacle in between.

 The Bluetooth shield is shown below:


Capacitive Touchpad shield

 It has a touchpad interface that allows to integrate the Arduino board with the
touch shield.

 The Capacitive touchpad shield consists of 12 sensitive touch buttons, which


includes 3 electrode connections and 9 capacitive touch pads.

 The board can work with the logic level of 3.3V or 5V.

 The capacitive shield is shown below:

Integrating sensors and actuators with an Arduino

 Integrating sensors and actuators with an Arduino board is a fundamental step


in creating IoT and embedded systems projects.
 Here's a general guide on how to do it:

1. Select Sensors and Actuators:


Choose the sensors and actuators that are appropriate for your
project. Common sensors include temperature, humidity, motion, light,
and distance sensors. Actuators can include motors, servos, LEDs, and
relays.

2. Gather Components:
Ensure you have all the necessary components, including the
Arduino board, sensors, actuators, breadboard, jumper wires, and any
additional modules required (e.g., motor drivers or relay modules).

3. Wiring:
Connect the sensors and actuators to the Arduino using jumper
wires and a breadboard if needed. Most sensors and actuators require
power (VCC), ground (GND), and data pins. Consult the datasheets or
documentation for specific wiring details.

4. Install Libraries:
Many sensors and actuators require Arduino libraries to simplify
communication. Install the required libraries using the Arduino IDE's
Library Manager. This will give you access to pre-written functions that
interact with the sensors and actuators.

5. Code:
Write the Arduino code to read data from sensors and control
actuators. Use the functions provided by the installed libraries to
interface with the components. You'll need to understand the datasheets
and library documentation to properly configure and use the sensors and
actuators.

6. Test and Debug:


Upload the code to your Arduino board and test the setup. Monitor
the Serial Monitor in the Arduino IDE to see sensor readings or debug
messages. Make sure everything is functioning as expected.

7. Iterate and Refine:


It's common to encounter issues during the testing phase. Debug
your code and wiring if needed. Adjust sensor settings and calibration as
required to ensure accurate readings.

8. Integrate with IoT Platforms (Optional):


If your goal is to create an IoT project, you can integrate your
Arduino with IoT platforms like Blynk, ThingSpeak, or Adafruit IO. These
platforms allow you to remotely monitor and control your Arduino-based
system using the internet.
9. Enclosure and Mounting (Optional):

Depending on your project, you might want to enclose your


Arduino board, sensors, and actuators in a protective case. This is
especially important if your project will be deployed in real-world
environments.

10.Documentation:
Document your wiring, code, and any setup instructions. This will
be helpful if you need to revisit the project in the future or if you want to
share your project with others.

UNIT IV IOT COMMUNICATION AND OPEN PLATFORMS

IoT Communication Models and APIs – IoT Communication Protocols –


Bluetooth – WiFi – ZigBee – GPS – GSM modules – Open Platform (like
Raspberry Pi) – Architecture – Programming – Interfacing – Accessing GPIO
Pins – Sending and Receiving Signals Using GPIO Pins –
Connecting to the Cloud

IoT Communication Models and APIs

 IoT devices are found everywhere and will enable circulatory intelligence in the
future.

 For operational perception, it is important and useful to understand how various


IoT devices communicate with each other.

 Communication models used in IoT have great value.

 The IoTs allow people and things to be connected any time, any space, with
anything and anyone, using any network and any service.

Types of Communication Model:

1. Request & Response Model –

 This model follows a client-server architecture.

 The client, when required, requests the information from the server.
This request is usually in the encoded format.

 This model is stateless since the data between the requests is not
retained and each request is independently handled.
 The server Categories the request, and fetches the data from the
database and its resource representation.

 This data is converted to response and is transferred in an encoded


format to the client.

 The client, in turn, receives the response.

 On the other hand — In Request-Response communication model


client sends a request to the server and the server responds to the
request. When the server receives the request it decides how to
respond, fetches the data retrieves resources, and prepares the
response, and sends it to the client.

2. Publisher-Subscriber Model –

 This model comprises three entities: Publishers, Brokers, and Consumers.

 Publishers are the source of data.

 It sends the data to the topic which are managed by the broker.

 They are not aware of consumers.

 Consumers subscribe to the topics which are managed by the broker.

 Hence, Brokers responsibility is to accept data from publishers and send it to the
appropriate consumers.

 The broker only has the information regarding the consumer to which a
particular topic belongs to which the publisher is unaware of.
3. Push-Pull Model –

 The push-pull model constitutes data publishers, data consumers, and data
queues.

 Publishers and Consumers are not aware of each other.

 Publishers publish the message/data and push it into the queue.

 The consumers, present on the other side, pull the data out of the queue.

 Thus, the queue acts as the buffer for the message when the difference occurs in
the rate of push or pull of data on the side of a publisher and consumer.

 Queues help in decoupling the messaging between the producer and consumer.

 Queues also act as a buffer which helps in situations where there is a mismatch
between the rate at which the producers push the data and consumers pull the
data.
4. Exclusive Pair –

 Exclusive Pair is the bi-directional model, including full-duplex communication


among client and server.

 The connection is constant and remains open till the client sends a request to
close the connection.

 The Server has the record of all the connections which has been opened.

 This is a state-full connection model and the server is aware of all open
connections.

 WebSocket based communication API is fully based on this model.


IoT Communication Protocols
 The prime focus of the internet of things is to offer communication between
various objects that are not traditional computers.
 IoT allows these objects to send and receive data over a network. There are
various protocols in IOT established to offer this communication.
 The most popular communication protocols offered by IOT are described in
detail below.

IoT Communication Protocols

1. Bluetooth

 Standard communication protocols help in unleashing the full potential of the


internet of things.
 More than one third of Iot devices contain bluetooth connectivity.
 Bluetooth is a form of wireless technology used for device communication and to
make personal area networks (PANs).
 The latest version is the bluetooth5 and it has features such as high range, speed
and data broadcasting.
 Bluetooth connects to devices with smaller distances and changes the device
interaction.
 It has some empowering features that support IoT devices.
 Bluetooth low energy (BLE) supports devices that require less power and ideal
for IoT enabled projects.

2. Zigbee

 Zigbee is a WLAN and a wireless technology that aims to support extremely low
power devices.
 It supports these kinds of devices and makes it possible to connect them to the
internet.
 It is an open global standard and works on IEEE 802.15.4 physical radio
standards.
 IoT devices do not require extra functionality and Zigbee is an ideal protocol for
transferring data from one communication point to another.
 Zigbee makes data flow easy.
 It is used to send small amounts of data using very less power which is why it is
used in machine-to-machine communication(M2M) and IoT.

3. Bluetooth Low Energy

 BLE is a bluetooth that uses less power.


 It is designed to support the internet of things.
 BLE is energy efficient and offers better connectivity compared to other forms of
technology such as Zigbee or LoRa.
 BLE fits the need of data transfers as they are the only function that takes place
in Iot sensors.
 BLE is used in the making of smartwatches, medical devices, fitness trackers,
beacons and home automation devices.
 BLE consumes less power and has less bandwidth.

4. Wifi

 Wifi is a form of local area network for wireless communication.


 It is a better option for data transfers as it easily fits into a variety of standards.
 It plays an important role in IoT communication and intercommunication with
other cellular networks such as bluetooth.
 Wifi supports high bandwidth and low latency.

5. Z-Wave

 Z-wave is a wireless messaging protocol to communicate between various IoT


devices.
 It is useful especially in home automation to connect appliances in smart homes.
 Z-wave offers a two-way mode of communication empowered with mesh
networking and message received acknowledgment.
 Z-wave is a low-cost technology that eliminates issues caused by Wifi and
Bluetooth.
 The network of Z-wave includes the internet of things devices and control called
the primary hub.
 When z-hub receives a message via a smartphone or tablet it sends this message
to the relevant smart home appliance.
RFID (radio frequency identification)
 Radio frequency identification system is a technology that supports the
identification of objects via radio waves.
 By connecting the RFID reader to the terminal of the internet, users can identify,
monitor and track the object with tags. It was first used in World War 2.
 RFID is fast, dependent and does not require physical interaction between the
user and the tagged item.
 It identifies IoT objects by tagging and labelling them.
 The tag or label replaces the object. RFID is useful to identify, track and monitor
remote IoT objects with time and location.

6. Cellular

 Cellular connects the devices to anything and everything without the need for
smartphones or gateway.
 This means it connects devices directly to the base station without any
intermediaries.
 These connections are always present even in remote areas.
 Cellular IoT makes it possible to construct less power-consuming devices that
connect to the internet which was not possible before.
 You can easily send small packs of data through a cellular network.
 5G is the latest cellular technology that is taking over IoT devices with rapid
speed.

7. Sigfox

 Sigfox was the first to introduce LPWAN technologies in the development of IoT
projects.
 It uses a low-power wide area network to intercommunicate between IoT
devices via the internet.
 It supports long-distance communication for sending and receiving small
messages.

8. Ethernet

 Ethernet is a communication standard that was developed in the early 80s to


network between local devices and computers.
 The local environment is labelled as a local area network (LAN).
 LAN creates a common environment for devices to receive and share information
among one another.
 Ethernet however offers a wired form of communication.
 Since it does not offer wireless communication, the set becomes a bit costly and
is not the ideal option for IoT communication.

9. NFC

 NFC stands for near-field communication.


 It is a wireless technology for short-distance communication.
 However, the NFC-enabled devices must be in close proximity to each other so
that they can communicate via radio waves.
 One of the devices should be an active device such as a smartphone or tablet and
the other device can be passive such as an NFC tag.
 The active devices require an external power supply while the passive devices do
not.
10. LPWAN

 LPWAN stands for low power wide area network.


 It offers wireless communication between devices that consume less amounts of
power.
 It connects these devices to the internet to send and receive messages from
devices within the same network.
 Some examples of LPWAN are sigfox and LoRa.

11. LoRaWAN

 Low range wide area network or LoRaWAN is a wide area network protocol.
 It was constructed to connect objects to the internet and to act as a mode of
communication between these objects.
 These objects could be home automation devices, smart cars, thermostats and so
on.
BLUETOOTH

 Bluetooth is universal for short-range wireless voice and data communication.


 It is a Wireless Personal Area Network (WPAN) technology and is used for
exchanging data over smaller distances.
 This technology was invented by Ericson in 1994.
 It operates in the unlicensed, industrial, scientific, and medical (ISM) band from
2.4 GHz to 2.485 GHz.
 Maximum devices that can be connected at the same time are 7.
 Bluetooth ranges up to 10 meters.
 It provides data rates up to 1 Mbps or 3 Mbps depending upon the version.
 The spreading technique that it uses is FHSS (Frequency-hopping spread
spectrum).
 A Bluetooth network is called a piconet and a collection of interconnected
piconets is called scatternet.

What is Bluetooth?
 Bluetooth simply follows the principle of transmitting and receiving data using
radio waves.
 It can be paired with the other device which has also Bluetooth but it should be
within the estimated communication range to connect.
 When two devices start to share data, they form a network called piconet which
can further accommodate more than five devices.

Points to remember for Bluetooth:


 Bluetooth Transmission capacity 720 kbps.
 Bluetooth is Wireless.
 Bluetooth is a Low-cost short-distance radio communications standard.
 Bluetooth is robust and flexible.
 Bluetooth is cable replacement technology that can be used to connect almost
any device to any other device.
 The basic architecture unit of Bluetooth is a piconet.

Bluetooth Architecture:
 The architecture of Bluetooth defines two types of networks:
1. Piconet
2. Scatternet
Piconet:
 Piconet is a type of Bluetooth network that contains one primary node called
the master node and seven active secondary nodes called slave nodes.
 Thus, we can say that there is a total of 8 active nodes which are present at a
distance of 10 meters.
 The communication between the primary and secondary nodes can be one-to-
one or one-to-many.
 Possible communication is only between the master and slave; Slave-slave
communication is not possible.
 It also has 255 parked nodes, these are secondary nodes and cannot take
participation in communication unless it gets converted to the active state.

Scatternet:
 It is formed by using various piconets.
 A slave that is present in one piconet can act as master or we can say primary in
another piconet.
 This kind of node can receive a message from a master in one piconet and deliver
the message to its slave in the other piconet where it is acting as a master.
 This type of node is referred to as a bridge node.
 A station cannot be mastered in two piconets.

Bluetooth protocol stack:


1. Radio (RF) layer: It specifies the details of the air interface, including
frequency, the use of frequency hopping and transmit power. It performs
modulation/demodulation of the data into RF signals. It defines the physical
characteristics of Bluetooth transceivers. It defines two types of physical
links: connection-less and connection-oriented.
2. Baseband Link layer: The baseband is the digital engine of a Bluetooth
system and is equivalent to the MAC sublayer in LANs. It performs the
connection establishment within a piconet, addressing, packet format, timing
and power control.
3. Link Manager protocol layer: It performs the management of the already
established links which includes authentication and encryption processes. It
is responsible for creating the links, monitoring their health, and terminating
them gracefully upon command or failure.
4. Logical Link Control and Adaption (L2CAP) Protocol layer: It is also
known as the heart of the Bluetooth protocol stack. It allows the
communication between upper and lower layers of the Bluetooth protocol
stack. It packages the data packets received from upper layers into the form
expected by lower layers. It also performs segmentation and multiplexing.
5. Service Discovery Protocol (SDP) layer: It is short for Service Discovery
Protocol. It allows discovering the services available on another Bluetooth-
enabled device.
6. RF comm layer: It is a cabal replacement protocol. It is short for Radio
Frontend Component. It provides a serial interface with WAP and OBEX. It
also provides emulation of serial ports over the logical link control and
adaption protocol(L2CAP). The protocol is based on the ETSI standard TS
07.10.
7. OBEX: It is short for Object Exchange. It is a communication protocol to
exchange objects between 2 devices.
8. WAP: It is short for Wireless Access Protocol. It is used for internet access.
9. TCS: It is short for Telephony Control Protocol. It provides telephony
service. The basic function of this layer is calling control (setup & release) and
group management for the gateway serving multiple devices.
10. Application layer: It enables the user to interact with the application.

Types of Bluetooth
 Various types of Bluetooth are available in the market nowadays.
 In-Car Headset: One can make calls from the car speaker system without the
use of mobile phones.
 Stereo Headset: To listen to music in car or in music players at home.
 Webcam: One can link the camera with the help of Bluetooth with their laptop
or phone.
 Bluetooth-equipped Printer: The printer can be used when connected via
Bluetooth with mobile phone or laptop.
 Bluetooth Global Positioning System (GPS): To use GPS in cars, one can
connect their phone with car system via Bluetooth to fetch the directions of
the address.

Advantage:
 It is a low-cost and easy-to-use device.
 It can also penetrate through walls.
 It creates an Ad-hoc connection immediately without any wires.
 It is used for voice and data transfer.

Disadvantages:
 It can be hacked and hence, less secure.
 It has a slow data transfer rate: of 3 Mbps.
 It has a small range: 10 meters.
 Bluetooth communication does not support routing.
 The issues of handoffs have not been addressed.

Applications:
 It can be used in laptops, and in wireless PCs, printers.
 It can be used in wireless headsets, wireless PANs, and LANs.
 It can connect a digital camera wirelessly to a mobile phone.
 It can transfer data in terms of videos, songs, photographs, or files from one
cell phone to another cell phone or computer.
 It is used in the sectors of medical health care, sports and fitness, Military.

WIFI

 Wi-Fi stands for Wireless Fidelity.


 It is a technology for wireless local area networking with devices based on IEEE
802.11 standards.
 Wi-Fi compatible devices can connect to the internet via WLAN network and a
wireless access point abbreviated as AP.
 Every WLAN has an access point which is responsible for receiving and
transmitting data from/to users.
 IEEE has defined certain specifications for wireless LAN, called IEEE
802.11 which covers physical and data link layers.
 Access Point(AP) is a wireless LAN base station that can connect one or many
wireless devices simultaneously to internet.
 The architecture of this standard has 2 kinds of services:
1. BSS (Basic Service Set)
2. ESS (Extended Service Set)
 BSS is the basic building block of WLAN.
 It is made of wireless mobile stations and an optional central base station called
Access Point.
 Stations can form a network without an AP and can agree to be a part of a BSS.
 A BSS without an AP cannot send data to other BSSs and defines a standalone
network.
 It is called Ad-hoc network or Independent BSS (IBSS). i.e., A BSS without AP is
an ad-hoc network.
 A BSS with AP is infrastructure network.
 The figure below depicts an IBSS, BSS with the green coloured box depicting an
AP.

E
 SS is made up of 2 or more BSSs with APs.
 BSSs are connected to the distribution system via their APs.
 The distribution system can be any IEEE LAN such as Ethernet.
 ESS has 2 kinds of stations:
1. Mobile – stations inside the BSS
2. Stationary – AP stations that are part of wired LAN.
 The topmost green box represents the distribution system and the other 2 green
boxes represent the APs of 2 BSSs.

Features of Wi-Fi include:


1. Wireless Connectivity: Wi-Fi allows devices to connect to a network without
the use of physical cables, providing greater mobility and flexibility.
2. High Speed: Wi-Fi networks can provide high-speed internet access, allowing
users to download and upload data quickly.
3. Easy Setup: Wi-Fi networks are easy to set up and configure, requiring minimal
technical knowledge. Most modern devices come with Wi-Fi connectivity built-in.
4. Multiple Device Connectivity: Wi-Fi networks can support multiple devices at
the same time, allowing multiple users to connect to the same network and
access the internet simultaneously.
5. Security: Wi-Fi networks can be secured using encryption and other security
measures, which protect against unauthorized access and hacking.
6. Range: Wi-Fi networks can cover a wide range of distances, depending on the
type of router and the environment in which it is used.
7. Compatibility: Wi-Fi is a widely adopted technology and is compatible with a
wide range of devices, including smartphones, laptops, tablets, and smart home
devices.
8. Interference: Wi-Fi signals can be subject to interference from other wireless
devices and physical barriers, such as walls and buildings, which can impact
network performance.
9. Reliability: Wi-Fi networks can sometimes suffer from dropouts or signal loss,
particularly in areas with high network congestion or interference.

ZIGBEE

 ZigBee is a Personal Area Network task group with low rate task group 4.
 It is a technology of home networking. ZigBee is a technological standard created
for controlling and sensing the network.
 As we know that ZigBee is the Personal Area Network of task group 4 so it is
based on IEEE 802.15.4 and is created by Zigbee Alliance.
 ZigBee is an open, global, packet-based protocol designed to provide an easy-to-
use architecture for secure, reliable, low power wireless networks.
 Flow or process control equipment can be place anywhere and still communicate
with the rest of the system.
 It can also be moved, since the network doesn’t care about the physical location
of a sensor, pump or valve.
 IEEE802.15.4 developed the PHY and MAC layer whereas, the ZigBee takes care of
upper higher layers.
 ZigBee is a standard that addresses the need for very low-cost implementation of
Low power devices with Low data rates for short-range wireless
communications.
 IEEE 802.15.4 supports star and peer-to-peer topologies.
 The ZigBee specification supports star and two kinds of peer-to-peer topologies,
mesh and cluster tree.
 ZigBee-compliant devices are sometimes specified as supporting point-to-point
and point-to-multipoint topologies.

Why another short-range communication standard??

Types of ZigBee Devices:


 Zigbee Coordinator Device: It communicates with routers. This device is
used for connecting the devices.
 Zigbee Router: It is used for passing the data between devices.
 Zigbee End Device: It is the device that is going to be controlled.

General Characteristics of Zigbee Standard:


 Low Power Consumption
 Low Data Rate (20- 250 kbps)
 Short-Range (75-100 meters)
 Network Join Time (~ 30 msec)
 Support Small and Large Networks (up to 65000 devices (Theory); 240
devices (Practically))
 Low Cost of Products and Cheap Implementation (Open Source Protocol)
 Extremely low-duty cycle.
 3 frequency bands with 27 channels.

Operating Frequency Bands (Only one channel will be selected for use in a network):
1. Channel 0: 868 MHz (Europe)
2. Channel 1-10: 915 MHz (the US and Australia)
3. Channel 11-26: 2.4 GHz (Across the World)

Features of Zigbee:
1. Stochastic addressing: A device is assigned a random address and announced.
Mechanism for address conflict resolution. Parents node don’t need to maintain
assigned address table.
2. Link Management: Each node maintains quality of links to neighbors. Link quality is
used as link cost in routing.
3. Frequency Agility: Nodes experience interference report to channel manager, which
then selects another channel
4. Asymmetric Link: Each node has different transmit power and sensitivity. Paths
may be asymmetric.
5. Power Management: Routers and Coordinators use main power. End Devices use
batteries.

Advantages of Zigbee:
1. Designed for low power consumption.
2. Provides network security and application support services operating on the
top of IEEE.
3. Zigbee makes possible completely networks homes where all devices are able
to communicate and be
4. Use in smart home
5. Easy implementation
6. Adequate security features.
7. Low cost: Zigbee chips and modules are relatively inexpensive, which makes
it a cost-effective solution for IoT applications.
8. Mesh networking: Zigbee uses a mesh network topology, which allows for
devices to communicate with each other without the need for a central hub or
router. This makes it ideal for use in smart home applications where devices
need to communicate with each other and with a central control hub.
9. Reliability: Zigbee protocol is designed to be highly reliable, with robust
mechanisms in place to ensure that data is delivered reliably even in adverse
conditions.

Disadvantages of Zigbee:
1. Limited range: Zigbee has a relatively short range compared to other
wireless communications protocols, which can make it less suitable for
certain types of applications or for use in large buildings.
2. Limited data rate: Zigbee is designed for low-data-rate applications, which
can make it less suitable for applications that require high-speed data
transfer.
3. Interoperability: Zigbee is not as widely adopted as other IoT protocols,
which can make it difficult to find devices that are compatible with each
other.
4. Security: Zigbee’s security features are not as robust as other IoT protocols,
making it more vulnerable to hacking and other security threats.

Zigbee Network Topologies:


 Star Topology (ZigBee Smart Energy): Consists of a coordinator and several
end devices, end devices communicate only with the coordinator.
 Mesh Topology (Self-Healing Process): Mesh topology consists of one
coordinator, several routers, and end devices.
 Tree Topology: In this topology, the network consists of a central node which
is a coordinator, several routers, and end devices. the function of the router is
to extend the network coverage.

Architecture of Zigbee:
 Zigbee architecture is a combination of 6 layers.
1. Application Layer
2. Application Interface Layer
3. Security Layer
4. Network Layer
5. Medium Access Control Layer
6. Physical Layer

 Physical layer: The lowest two layers i.e the physical and the MAC (Medium
Access Control) Layer are defined by the IEEE 802.15.4 specifications. The
Physical layer is closest to the hardware and directly controls and
communicates with the Zigbee radio. The physical layer translates the data
packets in the over-the-air bits for transmission and vice-versa during the
reception.
 Medium Access Control layer (MAC layer): The layer is responsible for the
interface between the physical and network layer. The MAC layer is also
responsible for providing PAN ID and also network discovery through beacon
requests.
 Network layer: This layer acts as an interface between the MAC layer and the
application layer. It is responsible for mesh networking.
 Application layer: The application layer in the Zigbee stack is the highest
protocol layer and it consists of the application support sub-layer and Zigbee
device object. It contains manufacturer-defined applications.

Channel Access:
1. Contention Based Method (Carrier-Sense Multiple Access with Collision
Avoidance Mechanism)
2. Contention Free Method (Coordinator dedicates a specific time slot to each
device (Guaranteed Time Slot (GTS)))

Zigbee Applications:
1. Home Automation
2. Medical Data Collection
3. Industrial Control Systems
4. meter reading system
5. light control system
6. Commercial
7. Government Markets Worldwide
8. Home Networking

GPS
 GPS stands for Global Positioning System.
 GPS is a satellite-based navigation system that allows ground users to provide
their exact location, velocity, and time 24 hours a day, in all weather conditions,
all over the world.
 GPS developed by the U.S. Department of Défense.
 It was basically designed to assist soldiers and military vehicles but after some
years it’s available to anyone having a GPS receiver.
 GPS is a common system that most of us are using to reach from one location to
Another location.
 The GPS systems are a Combination of a network of satellites that are constantly
sending coded information in the form of radio signals.
 After that receiver received the signals and interprets the transmitted
information from the satellites to locate the position on earth accurately.
 This satellite system is congestive of 29 satellites situated at almost 20,000
kilometers above the Earth’s surface.
 The GPS satellites are located at 6 earth-centered orbital planes and travel at a
speed of 14,000 km/hr.
 The GPS was first time used in combat during the Gulf wars.
Global Positioning System

Functionality of GPS:
 The GPS device will first establish a connection with 3 to 4 satellites.
 After that GPS satellite broadcasts a message including the location of the
receiver.
 If the GPS receiver receives a Group of messages from different satellites to
calculate the exact position using the process called triangulation.
 GPS satellites need an unobstructed line of sight for the broadcast.
 Hence, this technology is not only for indoor but also for use in a wide area.
 There some devices use nearby cell towers and open-source Wi-Fi signals.
 Then technology is called LPS (Local Positioning System) and is a substitute for
GPS.

Architecture of GPS:
GPS Architecture is basically divided into three segments.
1. Space segment: The GPS satellites fly in circular orbits at an altitude of
20000 km and with a period of 12 hours. It’s powered by Solar cells. The GPS
satellite Continuously orients themselves to point their solar panels toward
the sun and their antenna. Towards the earth. Orbital planes are centered on
the earth. Orbits are designed so that, at least, Six satellites are always within
a line of sight from any location on the Planet. The GPS System Consist of 24
satellites (in present 32) Established in near-circular orbits arranged in 6
orbitals Placed at 55 Degree Inclination to the Equator at 20200 km height
and 26600 km orbital Radius. The Period of Revolution is 12 Hours. So that at
least 4 Satellites are available for observations at any time throughout the
year anywhere in the World.
2. Control Segment: The second component of GPS is the Control segment. It’s
further divided into three sub-components.
 Master Control System
 Monitor Station: The monitor station checks the exact latitude,
Position, Speed, and overall health of the orbiting satellites. The
control segment ensures that the GPS and Clocks remain within
acceptable limits. A station can track up to 11 satellites at a time.
This “check-up” is performed twice a day, By each station.
 Ground Antennas: The ground Antennas monitor and track the
satellites from horizon to horizon. They also transmit correction
information to individual satellites. Communication with the GPS
satellites for command-and-control purposes.
3. User Segment: The Master Control Station is located at Falcon Air Force base
in Colorado Springs. Responsible for the overall management of remote
monitoring and transmission sites. Check-up is performed twice a day, by
each of the 6 stations as satellites Complete their journey around the earth.
Master Control can reposition satellites to maintain an optimal GPS
Constellation. It also includes a display for showing location and speed
information to the user. A receiver is often described by its number of
channels (this signifies how many satellites it can monitor simultaneously).
As of recent, receivers usually have between twelve and twenty channels.
There are five stations for satellites signal Receivers:
 Colorado (Main Station)
 Hawaii
 Ascension
 Diego Garcia
 Kwajalein
 Cape Canaveral

GPS receiver basically consists of three components:


 An Antenna (tuned to the frequencies transmitted by the satellites).
 Receiver processor.
 Highly Stable Clock (Commonly a Crystal oscillator).

Usage of GPS:
 There are five most uses of the GPS.
 Location: - with the help of GPS we can find the exact position of the object.
 Navigation: – we can navigate one location to another with the help of
GPS.GPS technology is also useful for Transportation Management and
breathing of Ship at docks.
 Tracking: -with the help of GPS we can Monitor object movement like speed,
distance, position.
 Mapping: – GPS also helps in creating maps of the World.
 Timing: - GPS also provides the estimated time for reaching destination
measurement it depends on speed and object movement.
 For Example, GPS technology is also useful for Monitoring Vehicles and Persons.
 Tracking is useful in the following services:
 Mass Tracking
 Ship Tracking
 Vehicle Tracking
 GPS tracking is Mostly used by Police, Ambulance, Fire Department Service, and
Mass delivery man.
 A GPS tracking device is a portable device.
 GPS device allows users to monitor and track the exact location of an object.
 These devices are most commonly used in Ambulance, train airplane tracking
systems.
 While tracking devices are used in-car navigation systems, then GPS navigation
systems show the drivers their location on a digital map and also provide driving
instructions and direction for a destination.
 Advanced feature GPS trackers use GPS technology to track a vehicle’s current
location and trip history.
 We can broadcast GPS data to a computer, smartphone, or tablet.

GSM
 GSM stands for Global System for Mobile Communication.
 GSM is an open and digital cellular technology used for mobile communication.
 It uses 4 different frequency bands of 850 MHz, 900 MHz, 1800 MHz and 1900
MHz.
 It uses the combination of FDMA and TDMA.

GSM is having 4 different sizes of cells are used in GSM :


1. Macro: In this size of cell, Base Station antenna is installed.
2. Micro: In this size of cell, antenna height is less than the average roof level.
3. Pico: Small cells’ diameter of few meters.
4. Umbrella: It covers the shadowed (Fill the gaps between cells) regions.

Features of GSM are:


1. Supports international roaming
2. Clear voice clarity
3. Ability to support multiple handheld devices.
4. Spectral / frequency efficiency
5. Low powered handheld devices.
6. Ease of accessing network
7. International ISDN compatibility.
8. Low service cost.
9. New features and services.

GSM is nothing but a larger system which is divided into further 3 subsystems.
1. BSS: BSS stands for Base Station Subsystem. BSS handles traffic and signalling
between a mobile phone and the network switching subsystem. BSS having
two components BTS and BSC.
2. NSS: NSS stands for Network and Switching Subsystem. NSS is the core
network of GSM. That carried out call and mobility management functions for
mobile phone present in network. NSS have different components like VLR,
HLR and EIR.
3. OSS: OSS stands for Operating Subsystem. OSS is a functional entity which the
network operator monitors and control the system. OMC is the part of OSS.
Purpose of OSS is to offer the customer cost-effective support for all GSM
related maintenance services.

 Suppose there are 3 Mobile stations which are connected with the tower and that
tower is connected to BTS through TRX, then further connected to BSC and MSC.
 Let’s understand the functionality of different components.
1. MS: MS stands for Mobile System. MS comprises user equipment and software
needed for communication with a mobile network. Mobile Station (MS) = Mobile
Equipment (ME) + Subscriber Identity Module (SIM). Now, these mobile stations are
connected to tower and that tower connected with BTS through TRX. TRX is a
transceiver which comprises transmitter and receiver. Transceiver has two
performances of sending and receiving.
2. BTS: BTS stands for Base Transceiver Station which facilitates wireless
communication between user equipment and a network. Every tower has BTS.
3. BSC: BSC stands for Base Station Controller. BSC has multiple BTS. You can consider
the BSC as a local exchange of your area which has multiple towers and multiple towers
have BTS.
4. MSC: MSC stands for Mobile Switching Centre. MSC is associated with communication
switching functions such as call setup, call release and routing. Call tracing, call
forwarding all functions are performed at the MSC level. MSC is having further
components like VLR, HLR, AUC, EIR and PSTN.
 VLR: VLR stands for Visitor Location Register. VLR is a database which
contains the exact location of all mobile subscribers currently present in the
service area of MSC. If you are going from one state to another state then your
entry is marked into the database of VLR.
 HLR: HLR stands for Home Location Register. HLR is a database containing
pertinent data regarding subscribers authorized to use a GSM network. If you
purchase SIM card from in the HLR. HLR is like a home which contains all
data like your ID proof, which plan you are taking, which caller tune you are
using etc.
 AUC: AUC stands for Authentication Centre. AUC authenticates the mobile
subscriber that wants to connect in the network.
 EIR: EIR stands for Equipment Identity Register. EIR is a database that keeps
the record of all allowed or banned in the network. If you are banned in the
network then you can’t enter the network, and you can’t make the calls.
 PSTN: PSTN stands for Public Switched Telephone Network. PSTN connects
with MSC. PSTN originally a network of fixed line analog telephone systems.
Now almost entirely digital in its core network and includes mobile and other
networks as well as fixed telephones. The earlier landline phones which
places at our home is nothing but PSTN.
5.OMC: OMC stands for Operation Maintenance Centre. OMC monitor and maintain the
performance of each MS, BSC and MSC within a GSM system.
Three subsystem BSS, NSS and OSS are connected with each other via some interfaces.
Total three interfaces are there:
1. Air Interface: Air interface is also known as UM interface. Interface between
MS and BTS is called as UM interface because it is mobile analog to the U
interface of ISDN.
2. Abis Interface: It is a BSS internal interface linking with BTS and BSC.
3. An interface: It provides communication between BSS and MSC.

Services of GSM:
1. Bearer services/ data services:
 GSM specifies different mechanism for data transmission, The original GSM
allowing for data rates of up to 9600 bits/s.
 Bearer services permit transparent or non-transparent data transmission.
 Transparent bearer services:
Transparent bearer services only use the physical layer to transmit data. Data
transmission has a constant delay at throughput if no transmission error
occurs.
 Non-transparent bearer services:
Non-transparent bearer services use protocols of layer two and three two
three to implement error correction and flow control. (data link layer and
network layer).
2.Tele services:
Tele services are nothing but we use now as at also.
 Video calls.
 Video text and face emoji.
 short text message (SMS).
3.Supplementary services:
Supplementary services it means advanced services.
 Conference calls.
 Call waiting.
 Call forwarding.

GSM security:
 GSM offers several security using confidential information stored in the AUC
and in the individual SIM.
 The SIM stores personal secret data and is protected with a pin against
unauthorized use.
Advantages:
Compatibility: GSM is widely used around the world, so it is compatible with many
different networks and devices.
Security: GSM offers enhanced security features such as authentication, encryption and
confidentiality, which helps to protect the user’s privacy and data.
Efficient use of bandwidth: GSM uses a time-division multiplexing (TDM) technique
which enables many users to share the same frequency channel at different times,
making it an efficient use of the available bandwidth.
Roaming: GSM allows users to roam internationally and use their mobile phones in
other countries that use the same GSM standard.
Wide range of features: GSM supports a wide range of features, including call
forwarding, call waiting, voicemail, conference calling, and more.

Disadvantages:
Limited coverage: GSM networks may have limited coverage in some remote areas,
which can make it difficult for users to make calls or access the internet.
Network congestion: GSM networks may become congested during peak hours, which
can lead to dropped calls or poor call quality.
Security vulnerabilities: Although GSM offers enhanced security features, it is still
vulnerable to certain types of attacks, such as eavesdropping and spoofing.
Data transfer speed: GSM networks offer relatively slow data transfer speeds
compared to newer technologies such as 3G and 4G.
Limited capacity: GSM networks have a limited capacity for handling large volumes of
data, which can be a disadvantage for users who require high-speed internet access or
other data-intensive applications.

Open Platform (like Raspberry Pi)

Architecture
What is a Raspberry Pi?
 Raspberry pi is the name of the “credit card-sized computer board” developed by
the Raspberry pi foundation, based in the U.K.
 It gets plugged in a TV or monitor and provides a fully functional computer
capability.
 It is aimed at imparting knowledge about computing to even younger students at
the cheapest possible price.
 Although it is aimed at teaching computing to kids, but can be used by everyone
willing to learn programming, the basics of computing, and building different
projects by utilizing its versatility.
 Raspberry Pi is developed by Raspberry Pi Foundation in the United Kingdom.
 The Raspberry Pi is a series of powerful, small single-board computers.
 Raspberry Pi is launched in 2012 and there have been several iterations and
variations released since then.
 Various versions of Raspberry Pi have been out till date.
 All versions consist of a Broadcom system on a chip (SoC) with an integrated
ARM-compatible CPU and on-chip graphics processing unit (GPU).
 The original device had a single-core Processor speed of device ranges from 700
MHz to 1.2 GHz and a memory range from 256 MB to 1 GB RAM.
 To store the operating system and program memory Secure Digital (SD) cards
are used.
 Raspbian OS which is a Linux operating system is recommended OS by
Raspberry Pi Foundation.
 Some other third-party operating systems like RISC OS Pi. Diet Pi, Kali, Linux can
also be run on Raspberry Pi.

Used:
It also provides a set of general-purpose input/output pins allowing you to control
electronic components for physical computing and explore the Internet of Things (IOT).

Raspberry pi Diagram:

Raspberry Pi model –
 There have been many generations of raspberry Pi from Pi 1 to Pi 4.
 There is generally a model A and model B.
 Model A is a less expensive variant and it trends to have reduce RAM and dual
cores such as USB and Ethernet.

List of Raspberry pi models and releases year:

1. pi 1 model B – 2012
2. pi 1 model A – 2013
3. pi 1 model B+ -2014
4. pi 1 model A+ – 2014
5. Pi 2 Model B – 2015
6. Pi 3 Model B- 2016
7. Pi 3 Model B+ -2018
8. Pi 3 Model A+ -2019
9. Pi 4 Model A – 2019
10. Pi Model B – 2020
11. Pi 400 – 2021

Specs of the Computer: – The computer has a quad-core ARM processor that doesn’t
support the same instruction as an X86 desktop CPU. It has 1GB of RAM, One HDMI port,
four USB ports, one Ethernet connection, Micro SD slot for storage, one combined
3.5mm audio/video port, and a Bluetooth connection. It has got a series of input and
output pins that are used for making projects like – home security cameras, Encrypted
Door lock, etc.
Versatility of Raspberry Pi: – It is indeed a versatile computer and can be utilized by
people from all age groups, it can be used for watching videos on YouTube, watching
movies, and programming in languages like Python, Scratch, and many more. As
mentioned above it has a series of I/O pins that give this board the ability to interact
with its environment and hence can be utilized to build really cool and interactive
projects.

Programming

 The Raspberry Pi is a fully-fledged minicomputer, capable of doing whatever you


might do with a computer. It comes with 4x USB, HDMI, LAN, built-in
Bluetooth/WiFi support, 1GB RAM, 1.2GHz quad-core ARM CPU, 40 GPIO
(General Purpose Input Output) pins, audio and composite video output, and
more. Rather than not having many choices, instead, your options are
staggeringly large!
 A typical Raspberry Pi shopping list, assuming you have a mouse, keyboard, and
HDMI monitor that you can use temporarily while setting up is:

1. Raspberry Pi - $37
2. 1000mA+ mini usb power supply - $10
3. 16 GB micro-SD card - $10

 Additionally, if you plan to join us on the initial GPIO (General Purpose Input
Output pins) tutorials, you will also want to pick up:

1. 10 x Male-to-Female jumper wires (you should consider just buying a bunch of


these so you have plenty in the future).
2. 1 x Breadboard (You may also want multiples of these)
3. 3 x LED light (...more wouldn't hurt)
4. ~6 x Resistors (between 300 and 1K Ohm). You will need at least 1K and 2K
ohms for the distance sensor, then ~300-1K resistance per LED bulb. You
probably should just buy a kit, they're super cheap.
5. 1 x HC-SR04 Ultrasonic Distance Sensor (...you know what I'm going to say...think
about maybe a few.)
6. 1 x Raspberry Pi camera module. You only need one of these!

 For the jumpers, breadboard, and leds, you could also just buy a kit, something like: this
GPIO starter kit.

 First, we must format the SD card.


 If you are on Windows, you can use SD Formatter.
 Mac users can also use SD Formatter, but they have a built in formatter, and
Linux users can use GParted.
 Whatever the case, you need to format the SD card, do not do a "quick format"
and do make sure you have the "resize" option on. Using SDFormatter on
Windows, and chosing options:
 This should go without saying, but do make sure you're formatting the right
drive. This will format any flash drive, in alphabetical order.
 If you had something plugged in already, like your favorite USB drive, and forgot
about it, that'd likely be the default choice to format, and then you'd spend all
afternoon trying to recover your data rather than enjoying playing with your
Raspberry Pi.
 Once you're done, great.
 Now, assuming you've downloaded the NOOBS package, let's go ahead and
extract that. Now, we want to copy all these NOOBS contents to our SD Card.
 Do not drag the directory, but rather the contents:

 While that's transferring, let's talk about a few things on the actual Raspberry Pi
board:
 The GPIO (General Purpose Input/Output) pins are underlined in blue.
 We can use these to control peripheral devices like motors, servos, and more.
 Circled in red is the micro usb power input for the board. In orange, the HDMI
output port.
 The yellow is where you can plug in the Raspberry Pi camera module.
 The grey circle has the USB ports. This is obviously not everything, but these are
the main things to note.
 Once everything is transferred to the micro-SD card, you can put it in the
Raspberry Pi.
 The slot is on the bottom side of the board, circled in yellow here:

 Once you've got the SD card plugged in, go ahead and plug in your keyboard,
mouse, and HDMI cable to your monitor.
 Finally, plug in the power, and this will start up the Raspberry Pi.
 Once fully loaded, you should land on the following screen:
 Now you can choose the operating system. In my case, the only option is
Raspbian, so I will check that box, then click "install."

 Let the process go, this will take a while, something like 20-30 minutes or so.
 Once that's done, hit okay and the device should reboot to desktop.
 While on the desktop, wait for a moment for wifi to start up and find available
connections. Connect to your wifi network if possible.
 You can also plug directly in with an ethernet cable if you don't have wifi.
 You can also just continue interacting directly with the Raspberry Pi with the
mouse and keyboard connected to it if you like, but I prefer to access it remotely.

INTERFACING

 Raspberry Pi is most popular SBC (Single Board Computer).


 We can used Raspberry Pi as an IoT device and IoT Gateway.

What is Raspberry pi?


 The Raspberry Pi is a low cost, credit-card sized computer that plugs into a
computer monitor or TV, and uses a standard keyboard and mouse.
 It is a capable little device that enables people of all ages to explore computing,
and to learn how to program in languages like Scratch and Python.
 It’s capable of doing everything you’d expect a desktop computer to do, from
browsing the internet and playing high-definition video, to making spreadsheets,
word-processing, and playing games.”
 Raspberry pi has Serial, SPI and I2C interfaces for data transfer.
Serial: The Serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins for
communication with serial peripherals.
SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communicating with one or more peripheral devices. in an SPI connection, there are five
pins on Raspberry Pi for SPI interface:
 MISO (Master in slave out) – Master line for sending data to the peripherals.
 MOSI (Master out slave in) – Slave line for sending data to the master.
 SCK (Serial Clock) – Clock generated by master to synchronize data
transmission
 CE0 (Chip Enable 0) – To enable or disable devices
 CE0 (Chip Enable 1) – To enable or disable devices
I2C:
The I2C interface pins on Raspberry Pi allow you to connect hardware modules. I2C
interface allows synchronous data transfer with just two pins – SDA (data line) an SCL
(Clock Line).

Accessing GPIO Pins – Sending and Receiving Signals Using GPIO Pins

 Act as both digital output and digital input.

 Output: turn a GPIO pin high or low.

 Input: detect a GPIO pin high or low

Installing GPIO library:


 Open terminal
 Enter the command “sudoapt-get install python-dev” to install python
development
 Enter the command “sudoapt-get install python-rpi. gpio” to install GPIO library.

Basic python coding:

 Open terminal enters the command


 sudo nano filename.py
 This will open the nano editor where you can write your code
 Ctrl+O: Writes the code to the file
 Ctrl+X: Exits the editor
Blinking LED Code:
 import RPi. GPIO as GPIO #GPIO library import time
 GPIO.setmode(GPIO.BOARD) # Set the type of board for pin numbering
 GPIO.setup(11, GPIO.OUT) # Set GPIO pin 11as output pin
 for i in range (0,5): GPIO.output(11, True) # Turn on GPIO pin 11
 time. sleep (1)
 GPIO.output(11, False)
 time. sleep (2)
 GPIO.output(11, True)
 GPIO.cleanup()

GPIO PINS

Power Pins:
 The header provides 5V on Pin 2 and 3.3V on Pin 1. The 3.3V supply is limited to
50mA. The
 5V supply draws current directly from your micro-USB supply so can use
whatever is left over
 after the board has taken its share. A 1A power supply could supply up to 300mA
once the
 Board has drawn 700mA.

Basic GPIO:
 The header provides 17 Pins that can be configured as inputs and outputs. By
default, they are all configured as inputs except GPIO 14& 15.
 In order to use these pins, you must tell the system whether they are inputs or
outputs.
 This can be achieved a number of ways and it depends on how you intend to
control them. I intend on using Python.

SDA & SCL:


 The ’DA’ in SDA stands for data, the ‘CL’ in SCL stands for clock; the S stands for
serial.
 You can do more reading about the significance of the clock line for various types
of computer bus, you will probably find I 2 C devices that come with their own
userspace drivers and the linux kernel includes some as well.
 Most computers have an I 2 C bus, presumably for some of the purposes listed by
Wikipedia, such as interfacing with the RTC (real time clock) and configuring
memory.
 However, it is not exposed, meaning you can’t attach anything else to it, and
there are a lot of interesting things that could be attached -- pretty much any kind
of common sensor (barometers, accelerometers, gyroscopes, luminometers, etc.)
as well as output devices and displays.
 You can buy a USB to I 2 C adapter for a normal computer, but they cost a few
hundred dollars.
 You can attach multiple devices to the exposed bus on the pi.

UART, TXD RXD:


 This is a traditional serial line; for decades most computers have had a
port for this and a port for parallel.
 Some pi-oriented OS distros such as Raspbian by default boot with this serial line
active as a console, and you can plug the other end into another computer and
use some appropriate software to communicate with it.
 Note this interface does not have a clock line; the two pins may be used for full
duplex communication (simultaneous transmit and receive).

PCM, CLK/DIN/DOUT/FS:
 PCM is how uncompressed digital audio is encoded.
 The data stream is serial, but interpreting this correctly is best done with a
separate clock line (more lowest level stuff).
SPI, MOSI/MISO/CE0/CE1:
 SPI is a serial bus protocol serving many of the same purposes as I 2 C, but
because there are more wires, it can operate in full duplex which makes it faster
and more flexible.
Raspberry Pi Terminal Commands:
 [sudo apt-get update] - Update Package Lists
 [sudo apt-get upgrade] - Download and Install Updated Packages
 [sudo raspi-config] - The Raspberry Pi Configuration Tool
 [sudo apt-get clean] - Clean Old Package Files
 [sudo reboot] - Restart your Raspberry Pi
 [sudo halt] - Shut Down your Raspberry Pi

Connecting to the Cloud

 A Raspberry Pi 2 or Raspberry Pi 3 board.


 An Azure subscription. If you don't have an Azure subscription, create
a free account before you begin.
 A monitor, a USB keyboard, and mouse that connects to Pi.
 A Mac or PC that is running Windows or Linux.
 An internet connection.
 A 16 GB or above microSD card.
 A USB-SD adapter or microSD card to burn the operating system image
onto the microSD card.
 A 5-volt 2-amp power supply with the 6-foot micro-USB cable.

The following items are optional:


 An assembled Adafruit BME280 temperature, pressure, and humidity
sensor.
 A breadboard.
 6 F/M jumper wires.
 A diffused 10-mm LED.

Create an IoT hub


This section describes how to create an IoT hub using the Azure portal.
1. Sign in to the Azure portal.
2. On the Azure homepage, select the + Create a resource button.
3. From the Categories menu, select Internet of Things, and then select IoT
Hub.
4. On the Basics tab, complete the fields as follows:

Important

Because the IoT hub will be publicly discoverable as a DNS endpoint, be


sure to avoid entering any sensitive or personally identifiable information
when you name it.

Property Value

Subscription Select the subscription to use for your hub.

Resource Select a resource group or create a new one. To create a new one,
group select Create new and fill in the name you want to use.

IoT hub name Enter a name for your hub. This name must be globally unique,
with a length between 3 and 50 alphanumeric characters. The
name can also include the dash ('-') character.

Region Select the region, closest to you, where you want your hub to be
located. Some features, such as IoT Hub device streams, are only
available in specific regions. For these limited features, you must
select one of the supported regions.
Property Value

Tier Select the tier that you want to use for your hub. Tier selection
depends on how many features you want and how many messages
you send through your solution per day.

The free tier is intended for testing and evaluation. The free tier
allows 500 devices to be connected to the hub and up to 8,000
messages per day. Each Azure subscription can create one IoT hub
in the free tier.

To compare the features available to each tier, select Compare


tiers. For more information, see Choose the right IoT Hub tier for
your solution.

Daily Select the maximum daily quota of messages for your hub. The
message limit available options depend on the tier you've selected for your hub.
To see the available messaging and pricing options, select See all
options and select the option that best matches the needs of your
hub. For more information, see IoT Hub quotas and throttling.
Note

Prices shown are for example purposes only.

5. Select Next: Networking to continue creating your hub.


6. On the Networking tab, complete the fields as follows:

Property Value

Connectivity Choose the endpoints that devices can use to connect to


configuration your IoT hub. Accept the default setting, Public access,
for this example. You can change this setting after the
IoT hub is created. For more information, see Managing
public network access for your IoT hub.

Minimum TLS Select the minimum TLS version to be supported by


Property Value

Version your IoT hub. Once the IoT hub is created, this value
can't be changed. Accept the default setting, 1.0, for this
example.

7. Select Next: Management to continue creating your hub.


8. On the Management tab, accept the default settings. If desired,
you can modify any of the following fields:

Property Value

Permissio Part of role-based access control, this property decides how


n model you manage access to your IoT hub. Allow shared access
policies or choose only role-based access control. For more
information, see Control access to IoT Hub by using Azure
Active Directory.

Assign me You may need access to IoT Hub data APIs to manage elements
within an instance. If you have access to role assignments,
select IoT Hub Data Contributor role to grant yourself full
access to the data APIs.

To assign Azure roles, you must


Property Value

have Microsoft.Authorization/roleAssignments/write permissi


ons, such as User Access Administrator or Owner.

Device-to- This property relates the device-to-cloud messages to the


cloud number of simultaneous readers of the messages. Most IoT
partitions hubs need only four partitions.

You might also like