0% found this document useful (0 votes)
4 views116 pages

Unit 2

This document covers embedded C programming, focusing on memory and I/O device interfacing, the need for real-time operating systems (RTOS), and the structure of embedded C programs. It explains memory-mapped and I/O-mapped I/O schemes, the importance of selecting appropriate programming languages, and the differences between standard C and Embedded C. Additionally, it highlights the basic components of an embedded C program, including keywords, data types, and the necessity of RTOS in time-sensitive applications.

Uploaded by

ramya.s
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)
4 views116 pages

Unit 2

This document covers embedded C programming, focusing on memory and I/O device interfacing, the need for real-time operating systems (RTOS), and the structure of embedded C programs. It explains memory-mapped and I/O-mapped I/O schemes, the importance of selecting appropriate programming languages, and the differences between standard C and Embedded C. Additionally, it highlights the basic components of an embedded C program, including keywords, data types, and the necessity of RTOS in time-sensitive applications.

Uploaded by

ramya.s
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/ 116

UNIT II EMBEDDED C PROGRAMMING

Memory And I/O Devices Interfacing – Programming Embedded Systems in C – Need for
RTOS – Multiple Tasks and Processes – Context Switching – Priority Based Scheduling
Policies.

Memory And I/O Devices Interfacing

Memory mapped I/O scheme:


 In this scheme, there is only one address space
 Address space is defined as the set of all possible addresses that a
microprocessor can generate
 Some addresses are assigned to memories and some addresses to I/O devices
 An I/O device is also treated as memory location and one address is assigned to
it
 The addresses of I/O device are different from the addresses which have been
assigned to memories
 The addresses which have not been assigned to memories can be assigned to I/O
devices
 One address is assigned to each I/O device
 All the data transfer instructions of the microprocessor can be used for both
memory as well as I/O devices
 For Example: MOV A, M will be valid for data transfer from the memory location
or I/O device, whose address in H-L pair
 If the H-L pair contain the address of a memory location, data will be transferred
from the memory location to accumulator
 If the H-L pair contain the address of an I/O device, data will be transferred from
the I/O device to accumulator
 The memory mapped I/O scheme is suitable for a small system.

I/O mapped I/O scheme:


 In this scheme, the address assigned to memory locations can also be assigned to
a I/O devices
 The same address may be assigned to a memory location or to an I/O device
 The microprocessor must issue a signal to distinguish whether the address on
the address bus for a memory location or I/O device
 The Intel 8085 issues IO/͞M signal for this purpose
 Two extra instructions IN and OUT are used to address I/O devices
 The IN instruction is used to read data from an input device
 The OUT instruction is used to send data to an output device
 This scheme is suitable for a large system
Memory & I/O Interfacing:
 Several memory chips and I/O devices are connected to a microprocessor

Memory Chip and I/O Device selection


 An address decoding circuit is employed to select the required I/O device or a
memory chip.
 If IO/͞M is high, the decoder-2 is activated and the required I/O device is selected.
 If IO/͞M is low, the decoder-1 is activated and the required memory chip is
selected.
 A few MSBs of the address lines are applied to the decoder to select a memory
chip or an I/O device.

Interfacing of Memory and I/O Devices


Memory Interfacing
 The address of a memory location or an I/O device is sent out by the
microprocessor.
 The corresponding memory chip or I/O device is selected by a decoding circuit.
 The decoding task can be performed by a decoder, a comparator, a bipolar PROM
or PLA (Programmed Logic Array), PROM (Programmable Read Only Memory)

Application of 74LS138, a 3 to 8 lines decoder


 G1, G2A and G2B are enable signals
 To enable 74LS138, G1 should be high and G2A and G2B should be low
 A, B and C are select lines
 Y0, Y1, ……. Y7 are output lines
 An output lines goes low when it is selected, other output lines remain high

Interfacing of Memory Chips using 74LS138


Truth Table for 74LS138

Interfacing of Memory chips:

 When G1 is low or G2A is high or G2B is high, all output lines become high
 Thus, 74LS138 acts as decoder only when G1 is high, and G2A and G2B are low
 The memory locations for EPROM1lie in the range 0000 to 1FFF
 These are the memory locations for ZONE0 for the memory chip which is
connected to the output line Y0 of the decoder
 Similarly, for ZONE1 is 2000 to 3FFFand for ZONE7 is E000 to FFFF

Interfacing of Memory chips


 The entire memory address has been divided into 8 zones
 Address lines A15, A14 and A13 have been applied to select lines A, B and C of
the 74LS138
 The logic applied to these lines selects a particular memory device, an EPROM or
RAM
 Other address lines A0, A1, ……., A12 go directly to memory chip
 IO/͞M is connected to G2B, when IO/͞M goes low for memory read/write operation
G2B goes low
 G1 is connected to +5Vd.c supply and G2A is grounded
Memory locations for various Zones

I/O Interfacing
 The interfacing of I/O devices through decoder 74LS138
 An address of the I/O device is o 8-bits, only A8–A15 lines of address bus are
used for I/O addressing
 The address lines A8, A9 and A10 have been applied to select lines A, B and C of
the 74LS138
 The address line A11–A15 are applied to G2B through a NAND gate
 G2B becomes low only when all address lines A11–A15 are high, G2A is
grounded
 IO/͞M is connected to G1, when IO/͞M goes high for I/O read/write operation, G1
goes high.

Interfacing of I/O Devices using 74LS138


Address of I/O Devices connected to 74LS138

Programming Embedded Systems in C

Programming Embedded Systems

 Embedded Systems consists of both Hardware and Software.


 If we consider a simple Embedded System, the main Hardware Module is the
Processor.
 The Processor is the heart of the Embedded System and it can be anything like a
Microprocessor, Microcontroller, DSP, CPLD (Complex Programmable Logic
Device) or an FPGA (Field Programmable Gated Array).
 All these devices have one thing in common: they are programmable i.e.; we can
write a program (which is the software part of the Embedded System) to define
how the device actually works.
 Embedded Software or Program allow Hardware to monitor external events
(Inputs / Sensors) and control external devices (Outputs) accordingly.
 During this process, the program for an Embedded System may have to directly
manipulate the internal architecture of the Embedded Hardware (usually the
processor) such as Timers, Serial Communications Interface, Interrupt Handling,
and I/O Ports etc.
 From the above statement, it is clear that the Software part of an Embedded
System is equally important as the Hardware part.
 There is no point in having advanced Hardware Components with poorly written
programs (Software).
 There are many programming languages that are used for Embedded Systems
like Assembly (low-level Programming Language), C, C++, JAVA (high-level
programming languages), Visual Basic, JAVA Script (Application-level
Programming Languages), etc.
 In the process of making a better embedded system, the programming of the
system plays a vital role and hence, the selection of the Programming Language
is very important.
Factors for Selecting the Programming Language

 The following are few factors that are to be considered while selecting the
Programming Language for the development of Embedded Systems.
 Size: The memory that the program occupies is very important as Embedded
Processors like Microcontrollers have a very limited amount of ROM (Program
Memory).
 Speed: The programs must be very fast i.e., they must run as fast as possible. The
hardware should not be slowed down due to a slow running software.
 Portability: The same program can be compiled for different processors.
 Ease of Implementation
 Ease of Maintenance
 Readability

 Earlier Embedded Systems were developed mainly using Assembly Language.


 Even though Assembly Language is closest to the actual machine code
instructions and produces small size hex files, the lack of portability and high
number of resources (time and man power) spent on developing the code, made
the Assembly Language difficult to work with.
 There are other high-level programming languages that offered the above-
mentioned features but none were close to C Programming Language.
 Some of the benefits of using Embedded C as the main Programming Language:
 Significantly easy to write code in C
 Consumes less time when compared to Assembly
 Maintenance of code (modifications and updates) is very simple
 Make use of library functions to reduce the complexity of the main code
 You can easily port the code to other architecture with very little modifications

Introduction to Embedded C Programming Language

 The C Programming Language, developed by Dennis Ritchie in the late 60’s and
early 70’s, is the most popular and widely used programming language.
 The C Programming Language provided low level memory access using an
uncomplicated compiler (a software that converts programs to machine code)
and achieved efficient mapping to machine instructions.
 The C Programming Language became so popular that it is used in a wide range
of applications ranging from Embedded Systems to Super Computers.
 Embedded C Programming Language, which is widely used in the development
of Embedded Systems, is an extension of C Program Language.
 The Embedded C Programming Language uses the same syntax and semantics of
the C Programming Language like main function, declaration of datatypes,
defining variables, loops, functions, statements, etc.
 The extension in Embedded C from standard C Programming Language include
I/O Hardware Addressing, fixed point arithmetic operations, accessing address
spaces, etc.
Difference between C and Embedded C

 There is not much difference between C and Embedded C apart from few
extensions and the operating environment. Both C and Embedded C are ISO
Standards that have almost same syntax, datatypes, functions, etc.
 Embedded C is basically an extension to the Standard C Programming Language
with additional features like Addressing I/O, multiple memory addressing and
fixed-point arithmetic, etc.
 C Programming Language is generally used for developing desktop applications,
whereas Embedded C is used in the development of Microcontroller based
applications.

Basics of Embedded C Program

We will start with two of the basic features of the Embedded C Program: Keywords and
Datatypes.

Keywords in Embedded C
 A Keyword is a special word with a special meaning to the compiler (a C
Compiler for example, is a software that is used to convert program written in C
to Machine Code).
 For example, if we take the Keil’s Cx51 Compiler (a popular C Compiler for 8051
based Microcontrollers) the following are some of the keywords:

 bit
 sbit
 sfr
 small
 large

Data Types in Embedded C

 Data Types in C Programming Language (or any programming language for that
matter) help us declaring variables in the program.
 There are many data types in C Programming Language like signed int, unsigned
int, signed char, unsigned char, float, double, etc.
 In addition to these there few more data types in Embedded C.
 The following are the extra data types in Embedded C associated with the Keil’s
Cx51 Compiler.

 bit
 sbit
 sfr
 sfr16

 The following table shows some of the data types in Cx51 Compiler along with
their ranges.
Data Type Bits (Bytes) Range

bit 1 0 or 1 (bit addressable part of RAM)

signed int 16 (2) -32768 to +32767

unsigned int 16 (2) 0 to 65535

signed char 8 (1) -128 to +127

unsigned 8 (1) 0 to 255

float 32 (4) ±1.175494E-38 to ±3.402823E+38

double 32 (4) ±1.175494E-38 to ±3.402823E+38

sbit 1 0 or 1 (bit addressable part of RAM)

sfr 8 (1) RAM Addresses (80h to FFh)

sfr16 16 (2) 0 to 65535

Basic Structure of an Embedded C Program (Template for Embedded C


Program)

 The next thing to understand in the Basics of Embedded C Program is the basic
structure or Template of Embedded C Program.
 The following part shows the basic structure of an Embedded C Program.

Multiline Comments . . .. . Denoted using /*……*/


Single Line Comments . . .. . Denoted using //
Preprocessor Directives . . . . . #include<…> or #define
Global Variables . . . . . Accessible anywhere in the program
Function Declarations . . . . . Declaring Function

Main Function . . . . . Main Function, execution begins here


{
Local Variables . . . . . Variables confined to main function
Function Calls . . . . . Calling other Functions
Infinite Loop . . . . . Like while(1) or for(;;)
Statements . . . . .
….
….
}

Function Definitions . . . . . Defining the Functions


{
Local Variables . . . . . Local Variables confined to this Function
Statements . . . . .
….
….
}

Different Components of an Embedded C Program

Preprocessor Directive:
 A Preprocessor Directive in Embedded C is an indication to the compiler that it
must look in to this file for symbols that are not defined in the program.
 In C Programming Language (also in Embedded C), Preprocessor Directives are
usually represented using # symbol like #include… or #define….
 In Embedded C Programming, we usually use the preprocessor directive to
indicate a header file specific to the microcontroller, which contains all the SFRs
and the bits in those SFRs.
 In case of 8051, Keil Compiler has the file “reg51.h”, which must be written at the
beginning of every Embedded C Program.
Global Variables: Global Variables, as the name suggests, are Global to the program
i.e., they can be accessed anywhere in the program.
Local Variables: Local Variables, in contrast to Global Variables, are confined to
their respective function.
Main Function: Every C or Embedded C Program has one main function, from where
the execution of the program begins.

Basic Embedded C Program

 In this example, we will use an 8051 Microcontroller to blink LEDs connected to


PORT1 of the microcontroller.

Example of Embedded C Program

 The following image shows the circuit diagram for the example circuit. It
contains an 8051 based Microcontroller (AT89S52) along with its basic
components (like RESET Circuit, Oscillator Circuit, etc.) and components for
blinking LEDs (LEDs and Resistors).
Need for RTOS

 Real-time operating systems (RTOS) are used in environments where a large


number of events, mostly external to the computer system, must be accepted
and processed in a short time or within certain deadlines. such applications are
industrial control, telephone switching equipment, flight control, and real-time
simulations.
 With an RTOS, the processing time is measured in tenths of seconds.
 This system is time-bound and has a fixed deadline.
 The processing in this type of system must occur within the specified
constraints. Otherwise, this will lead to system failure.
 Examples of the real-time operating systems: Airline traffic control systems,
Command Control Systems, Airlines reservation system, Heart Pacemaker,

Network Multi
1. Hard Real-Time operating system:
These operating systems guarantee that critical tasks be completed within a
range of time. For example, a robot is hired to weld a car body. If the robot
welds too early or too late, the car cannot be sold, so it is a hard real-time
system that requires complete car welding by robot hardly on the time.,
scientific experiments, medical imaging systems, industrial control systems,
weapon systems, robots, air traffic control systems, etc.

2. Soft real-time operating system:


This operating system provides some relaxation in the time limit. For example
– Multimedia systems, digital audio systems etc. Explicit, programmer-defined
and controlled processes are encountered in real-time systems. A separate
process is changed with handling a single external event. The process is
activated upon occurrence of the related event signalled by an
interrupt. Multitasking operation is accomplished by scheduling processes for
execution independently of each other. Each process is assigned a certain level
of priority that corresponds to the relative importance of the event that it
services. The processor is allocated to the highest priority processes. This type
of schedule, called, priority-based preemptive scheduling is used by real-time
systems.

3. Firm Real-time Operating System:


RTOS of this type have to follow deadlines as well. In spite of its small impact,
missing a deadline can have unintended consequences, including a reduction in
the quality of the product. Example: Multimedia applications.

Advantages:
The advantages of real-time operating systems are as follows-
1. Maximum consumption –
Maximum utilization of devices and systems. Thus, more output from all the
resources.

2. Task Shifting –
Time assigned for shifting tasks in these systems is very less. For example, in
older systems, it takes about 10 microseconds. Shifting one task to another and
in the latest systems, it takes 3 microseconds.

3. Focus On Application –
Focus on running applications and less importance to applications that are in
the queue.

4. Real-Time Operating System In Embedded System –


Since the size of programs is small, RTOS can also be embedded systems like in
transport and others.
5. Error Free –
These types of systems are error-free.

6. Memory Allocation –
Memory allocation is best managed in these types of systems.

Disadvantages:
The disadvantages of real-time operating systems are as follows-

1. Limited Tasks –
Very few tasks run simultaneously, and their concentration is very less on few
applications to avoid errors.

2. Use Heavy System Resources –


Sometimes the system resources are not so good and they are expensive as
well.

3. Complex Algorithms –
The algorithms are very complex and difficult for the designer to write on.

4. Device Driver And Interrupt signals –


It needs specific device drivers and interrupts signals to respond earliest to
interrupts.

5. Thread Priority –
It is not good to set thread priority as these systems are very less prone to
switching tasks.

6. Minimum Switching – RTOS performs minimal task switching.

Comparison of Regular and Real-Time operating systems:


Regular OS Real-Time OS (RTOS)

Complex Simple

Best effort Guaranteed response

Fairness Strict Timing constraints

Average Bandwidth Minimum and maximum limits

Unknown components Components are known

Unpredictable behavior Predictable behavior


Regular OS Real-Time OS (RTOS)

Plug and play RTOS is upgradeable

Multiple Tasks and Multiple Processes

 Tasks are units of sequential code implementing the system actions and executed
concurrently by an OS.
 Real time systems require that tasks be performed within a particular time
frame. Task is related to the performance of the real time systems.
 A task, also called a thread, is a simple program that thinks it has the CPU all to
itself. The design process for a real-time application involves splitting the work
to be done into tasks responsible for a portion of the problem.
 Each task is assigned a priority, its own set of CPU registers and its own stack
area.
 In the specified time constraint, system must produce its correct output. If
system fail to meet the specified output, then the system is fail or quality
decreases.
 Real time systems are used for space flights, air traffic control, high speed
aircraft, telephone switching, electricity distribution, industrial processes etc.
 Real time system must be 100 % responsive 100 % of the time. Response time is
measured in fractions of second, but this is an ideal not often achieved in the
field.
 Real time database is updated continuously. In aircraft example, flight data is
continuously changing so it is necessary to update. It includes speed, direction,
location, height etc.
 A process is a sequential program in execution. Terms like job and task are also
used to denote a process.
 A process is a dynamic entity that executes a program on a particular set of data.
Multiple processes may be associated with one program.
 Task is a single instance of an executable program.
 In a multiprogramming environment, usually more programs to be executed
than could possibly be rim at one time. In CPU scheduling, it switches from one
process to another process. CPU resource management is commonly known as
scheduling.
 Objective of the multiprogramming is to increases the CPU utilization. CPU
scheduling is one kind of fundamental operating system functions.
 Each process has an execution state which indicates what process is currently
doing.
 The process descriptor is the basic data structure used to represent the specific
state for each process.
 A state diagram is composed of a set of states and transitions between states.
 Input and output of the compressor box is serial ports.
 It takes uncompressed data and processes it.
 Output of the box is compressed data.
 Given data is compressed using predefined compression table. Modem is used
such type of box.
 The program's need to receive and send data at different rates. It is an example
of rate control problems. It uses asynchronous input. You can provide a button
for compressed mode and uncompressed mode.
 When user press uncompressed mode, the input data is passed through
unchanged.
 The button will be depressed at a much lower rate than characters will be
received, since it is not physically possible for a person to repeatedly depress a
button at even slow serial line rates.
 Keeping up with the input and output data while checking on the button can
introduce some very complex control code into the program.
 Sampling the button's state too slowly can cause the machine to miss a button
depression entirely, but sampling it too frequently and duplicating a data value
can cause the machine to incorrectly compress data.
 This problem is solved by maintaining counter.

Context Switching

 The Context switching is a technique or method used by the operating system to


switch a process from one state to another to execute its function using CPUs in
the system.

 When switching perform in the system, it stores the old running process's status
in the form of registers and assigns the CPU to a new process to execute its tasks.

 While a new process is running in the system, the previous process must wait in
a ready queue.

 The execution of the old process starts at that point where another process
stopped it.

 It defines the characteristics of a multitasking operating system in which


multiple processes shared the same CPU to perform multiple tasks without the
need for additional processors in the system.
The need for Context switching

 A context switching helps to share a single CPU across all processes to complete
its execution and store the system's tasks status.

 When the process reloads in the system, the execution of the process starts at the
same point where there is conflicting.

 Following are the reasons that describe the need for context switching in the
Operating system.

1. The switching of one process to another process is not directly in the system. A
context switching helps the operating system that switches between the multiple
processes to use the CPU's resource to accomplish its tasks and store its context.
We can resume the service of the process at the same point later. If we do not
store the currently running process's data or context, the stored data may be lost
while switching between processes.
2. If a high priority process falls into the ready queue, the currently running process
will be shut down or stopped by a high priority process to complete its tasks in
the system.
3. If any running process requires I/O resources in the system, the current process
will be switched by another process to use the CPUs. And when the I/O
requirement is met, the old process goes into a ready state to wait for its
execution in the CPU. Context switching stores the state of the process to resume
its tasks in an operating system. Otherwise, the process needs to restart its
execution from the initials level.
4. If any interrupts occur while running a process in the operating system, the
process status is saved as registers using context switching. After resolving the
interrupts, the process switches from a wait state to a ready state to resume its
execution at the same point later, where the operating system interrupted occurs.
5. A context switching allows a single CPU to handle multiple process requests
simultaneously without the need for any additional processors.

Example of Context Switching

 Suppose that multiple processes are stored in a Process Control Block (PCB). One
process is running state to execute its task with the use of CPUs.

 As the process is running, another process arrives in the ready queue, which has
a high priority of completing its task using CPU.

 Here we used context switching that switches the current process with the new
process requiring the CPU to finish its tasks.

 While switching the process, a context switch saves the status of the old process
in registers.
 When the process reloads into the CPU, it starts the execution of the process
when the new process stops the old process.

 If we do not save the state of the process, we have to start its execution at the
initial level.

 In this way, context switching helps the operating system to switch between the
processes, store or reload the process when it requires executing its tasks.

Context switching triggers


Following are the three types of context switching triggers as follows.
1. Interrupts
2. Multitasking
3. Kernel/User switch

Interrupts: A CPU requests for the data to read from a disk, and if there are any
interrupts, the context switching automatic switches a part of the hardware that
requires less time to handle the interrupts.

Multitasking: A context switching is the characteristic of multitasking that allows the


process to be switched from the CPU so that another process can be run. When
switching the process, the old state is saved to resume the process's execution at the
same point in the system.

Kernel/User Switch: It is used in the operating systems when switching between the
user mode, and the kernel/user mode is performed.

What is the PCB?

 A PCB (Process Control Block) is a data structure used in the operating system to
store all data related information to the process.

 For example, when a process is created in the operating system, updated


information of the process, switching information of the process, terminated
process in the PCB.

Steps for Context Switching

 There are several steps involves in context switching of the processes.

 The following diagram represents the context switching of two processes, P1 to


P2, when an interrupt, I/O needs, or priority-based process occurs in the ready
queue of PCB.
 As we can see in the diagram, initially, the P1 process is running on the CPU to
execute its task, and at the same time, another process, P2, is in the ready state.

 If an error or interruption has occurred or the process requires input/output, the


P1 process switches its state from running to the waiting state.

 Before changing the state of the process P1, context switching saves the context
of the process P1 in the form of registers and the program counter to the PCB1.

 After that, it loads the state of the P2 process from the ready state of the PCB2 to
the running state.

The following steps are taken when switching Process P1 to Process 2:


1. First, thes context switching needs to save the state of process P1 in the form of
the program counter and the registers to the PCB (Program Counter Block),
which is in the running state.
2. Now update PCB1 to process P1 and moves the process to the appropriate queue,
such as the ready queue, I/O queue and waiting queue.
3. After that, another process gets into the running state, or we can select a new
process from the ready state, which is to be executed, or the process has a high
priority to execute its task.
4. Now, we have to update the PCB (Process Control Block) for the selected process
P2. It includes switching the process state from ready to running state or from
another state like blocked, exit, or suspend.
5. If the CPU already executes process P2, we need to get the status of process P2 to
resume its execution at the same time point where the system interrupt occurs.

 Similarly, process P2 is switched off from the CPU so that the process P1 can
resume execution.
 P1 process is reloaded from PCB1 to the running state to resume its task at the
same point.

 Otherwise, the information is lost, and when the process is executed again, it
starts execution at the initial level.

Priority Based Scheduling Policies


 Priority Scheduling is a process scheduling algorithm based on priority where
the scheduler selects tasks according to priority.
 Thus, processes with higher priority execute first followed by processes with
lower priorities.
 If two jobs have the same priorities then the process that should execute first is
chosen on the basis of round-robin or FCFS.
 Which process should have what priority depends on a process’ memory
requirements, time requirements, the ratio of I/O burst to CPU burst, etc.

Types of Priority Scheduling


Following are the two main types of priority scheduling:

1. Preemptive Scheduling:
 Tasks execute according to their priorities.
 In case a lower priority task is running and a higher priority task arrives in the
waiting state then the lower priority task is put on hold.
 The higher priority task replaces it and once done executing the lower priority
task resumes execution from when it was paused.
 This process requires special hardware like a timer.
2. Non-Preemptive Scheduling:
 The OS allocates the CPU to a specific process that releases the CPU either
through context switching or after termination.
 We can use this method on various hardware platforms because unlike
preemptive scheduling it doesn’t require any special hardware.

Characteristics of Priority Scheduling


 Schedules processes on the basis of priority.
 Used to perform batch processes.
 In the case of two processes with similar priorities, we use FCFS and Round-
Robin to choose between them.
 A number is given to each process to indicate its priority level.
 Lower is the number assigned, higher is the priority level of a process.
 If a higher priority task arrives when a lower priority task is executing, the higher
priority task replaces the one with lower priority and the latter is put on hold
until it completes execution.

Example of Priority Scheduling


Following five processes have a unique priority, burst time, and arrival time.

Step 0: At time = 0, two processes P1 and P2 arrive. Since P1(with a burst time 4) has
higher priority it executes before P2.
Step 1: At time = 1, no new process arrives and execution of P1 continues.
Step 2: At time = 2, no new process arrives, P2 is in the waiting queue, and execution of
P1 continues.
Step 3: At time = 3, no new process arrives, P2 is in the waiting queue, and execution of
P1 continues.
Step 4: At time = 4, P1 finishes execution, and P2 starts execution.
Step 5: At time = 5, P2 continues execution as no new process arrives.
Step 6: At time = 6, P3 arrives and since it has a higher priority of 1 the OS preempts P2.
P3 starts executing.

Step 7: At time = 7, P3 continues executing as no new process arrives and P2 is on hold


in the waiting queue.
Step 8: At time = 8, we continue with P3 as no new process arrives.
Step 9: At time = 9, we continue with P3 as no new process arrives.
Step 10: At time = 10, we continue with P3 as no new process arrives.
Step 11: At time = 11, P4 arrives but P3 continues executing as it has a higher priority
than P4.
Step 12: At time = 12, P5 arrives but P3 continues executing as it has a higher priority.
Step 13: At time = 13, P3 is done executing. Now there are three processes P2, P4, and
P5 in the ready queue. Among these two processes have higher and similar priorities.
These are P2 and P5. Since the arrival time of P2 is less than that of P5, P2 starts
execution.

Step 14: At time = 14, P2 completes execution. In the waiting state between P4 and P5,
P5 has a higher priority so it starts executing.
Step 15: At time = 15, P5 continues executing.
Step 16: At time = 16, P5 completes execution and since P4 is the only process present
in the waiting state it starts executing.
Step 17: At time = 20, no process is left for execution as P5 completes execution.
Step 18: Following is the average waiting time: Waiting Time (Wt) = Start Time (St) –
Arrival Time (At) + Waiting Time for next burst
P1 = 0 – 0 = 0
P2 = 4 – 0 + 7 = 11
P3 = 6 – 6 = 0
P4 = 16 – 11 = 5
Thus, the average waiting time is: (0+11+0+5+2)/5 = 18/5 = 3.6
Advantages of priority scheduling
Following are the benefits of priority scheduling method:
 Easy to use.
 Processes with higher priority execute first which saves time.
 The importance of each process is precisely defined.
 A good algorithm for applications with fluctuating time and resource
requirements.

Disadvantages of priority scheduling


Following are the disadvantages of priority scheduling:
 We can lose all the low-priority processes if the system crashes.
 This process can cause starvation if high-priority processes take too much
CPU time. The lower priority process can also be postponed for an indefinite
time.
 There is a chance that a process can’t run even when it is ready as some
other process is running currently.

Aging Technique
 Aging technique can help prevent starvation of a process.
 In this, we can increase the priority of the low-priority processes based on their
waiting time.
 This ensures that no process waits for an indefinite time to get CPU time.

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.

UNIT V APPLICATIONS DEVELOPMENT

Complete Design of Embedded Systems – Development of IoT Applications


– Home Automation –Smart Agriculture – Smart Cities – Smart Healthcare.
Complete Design of Embedded Systems

 An Embedded system is a controller, which controls many other electronic


devices. It is a combination of embedded hardware and software.
 There are two types of embedded systems microprocessors and micro-
controller. Micro-processor is based on von Neumann model/architecture
(where program + data resides in the same memory location), it is an important
part of the computer system, where external processors and peripherals are
interfaced to it.
 It occupies more area and has more power consumption.
 The application of the microprocessor is personal computers.

What is an Embedded System Design?


Definition: A system designed with the embedding of hardware and software together
for a specific function with a larger area is embedded system design. In embedded
system design, a microcontroller plays a vital role. Micro-controller is based on Harvard
architecture, it is an important component of an embedded system. External processor,
internal memory and i/o components are interfaced with the microcontroller. It
occupies less area, less power consumption. The application of microcontrollers is MP3,
washing machines.

Embedded Design
Types of Embedded Systems
 Stand-Alone Embedded System
 Real-Time Embedded System
 Networked Appliances
 Mobile devices

Elements of Embedded Systems


 Processor
 Microprocessor
 Microcontroller
 Digital signal processor.
Steps in the Embedded System Design Process
 The different steps in the embedded system design flow/flow diagram include
the following.

Embedded design – process – steps


Abstraction
In this stage the problem related to the system is abstracted.

Hardware – Software Architecture


Proper knowledge of hardware and software to be known before starting any design
process.

Extra Functional Properties


Extra functions to be implemented are to be understood completely from the main
design.

System Related Family of Design


When designing a system, one should refer to a previous system-related family of
design.

Modular Design
Separate module designs must be made so that they can be used later on when required.

Mapping
Based on software mapping is done. For example, data flow and program flow are
mapped into one.

User Interface Design


In user interface design it depends on user requirements, environment analysis and
function of the system. For example, on a mobile phone if we want to reduce the power
consumption of mobile phones we take care of other parameters, so that power
consumption can be reduced.

Refinement
 Every component and module must be refined appropriately so that the software
team can understand.
 Architectural description language is used to describe the software design.
 Control Hierarchy
 Partition of structure
 Data structure and hierarchy
 Software Procedure.

Embedded System Design Software Development Process Activities


There are various design metric required to design any system to function properly,
they are

Design Metrics / Design Parameters of an Embedded


System

Function
Power Dissipation
Always maintained low
Performance
Should be high
The process/task should be completed w
Process Deadlines
time.
Manufacturing Cost
Should be maintained.
Engineering Cost
It is the cost for the edit-test-debug of ha
Size is defined in terms of memory RAM/
Size
Memory/Physical Memory.
Prototype
It is the total time taken for developing a
System safety should be taken like phone
Safety
like engine break down safety measure m
Proper maintenance of the system must
Maintenance
avoid system failure.
It is the time taken for the product/syste
Time to market
launched into the market.
Embedded software development process activities mainly include the following.

Specifications

Proper specifications are to be made so that the customer who uses the product can go
through the specification of the product and use it without any confusion. Designers
mainly focus on specifications like hardware, design constraints, life cycle period,
resultant system behavior.

Architecture

Hardware and Software architecture layers are specified.

Components

In this layer, components design is done. Components like single process processor,
memories- RAM/ROM, peripheral devices, buses..etc.

System Integration

In this layer, all the components are integrated into the system and tested whether its
meeting designers, expectations.

Challenges in Embedded System Design


While designing any embedded system, designers face lots of challenges like as follows,
 Environment adaptability
 Power consumption
 Area occupied
 Packaging and integration
 Updating in hardware and software
 Security
 There are various challenges the designers face while testing the design like
Embedded hardware testing, Verification stage, Validation Maintainability.

Embedded System Design Examples


 Automatic chocolate vending machine (ACVM)
 Digital camera
 Smart card
 Mobile phone
 Mobile computer. etc.

Development of IoT Applications


Home Automation

Overview:
 Home automation is constructing automation for a domestic, mentioned as a
sensible home or smart house. In the IoT home automation ecosystem, you
can control your devices like light, fan, TV, etc.
 A domestic automation system can monitor and/or manage home attributes
adore lighting, climate, enjoyment systems, and appliances. It is very helpful
to control your home devices.
 It’s going to in addition incorporates domestic security such as access
management and alarm systems. Once it coupled with the internet, domestic
gadgets are a very important constituent of the Internet of Things.
 A domestic automation system usually connects controlled devices to a
central hub or gateway.
 The program for control of the system makes use of both wall-mounted
terminals, tablet or desktop computers, a smartphone application, or an
online interface that may even be approachable off-site through the Internet.
 Smart Home automation refers to the use of technology to control and
automate various functions in a home, such as lighting, heating, air
conditioning, and security. In the context of IoT (Internet
of Things) and M2M (Machine-to-Machine) communications, home
automation systems can be controlled and monitored remotely through a
network connection.
 One of the key benefits of IoT-enabled home automation is the ability to
control and monitor a wide range of devices and systems from a single,
centralized location, such as a smartphone or tablet. This can include
everything from lighting and temperature control to security cameras and
alarm systems.
 Another advantage of IoT-enabled home automation is the ability to remotely
monitor and control devices, even when away from home. This can be useful
for controlling energy consumption and ensuring the safety and security of
the home.
 IoT-enabled home automation systems typically involve the use of smart
devices, such as thermostats, light bulbs, and security cameras, that can be
controlled and monitored through a centralized hub or app. These smart
devices can communicate with each other and with the centralized hub using
wireless protocols such as Zigbee, Z-Wave, and Bluetooth.
 In addition, IoT-enabled home automation systems can integrate with other
smart home technologies, such as voice assistants like Alexa and Google
Home, to provide additional functionality and convenience.
 Overall, IoT-enabled home automation can provide many benefits to
homeowners, including increased convenience, energy efficiency, and
security. However, it is important to ensure the security of these systems, as
they may be vulnerable to hacking and other cyber threats.

Components:
Here, you will see the smart home components like smart lighting, smart appliances,
intrusion detection, smoke/gas detector, etc. So, let’s discuss it.
Component-1:
Smart Lighting –
 Smart lighting for home helps in saving energy by adapting the life to the
ambient condition and switching on/off or dimming the light when needed.
 Smart lighting solutions for homes achieve energy saving by sensing the
human movements and their environments and controlling the lights
accordingly.
Component-2:
Smart Appliances –
 Smart appliances with the management are here and also provide status
information to the users remotely.
 Smart washer/dryer can be controlled remotely and notify when the washing
and drying are complete.
 Smart refrigerators can keep track of the item store and send updates to the
users when an item is low on stock.
Component-:
Intrusion Detection –
 Home intrusion detection systems use security cameras and sensors to detect
intrusion and raise alerts.
 Alert can we inform of an SMS or an email sent to the user.
 Advanced systems can even send detailed alerts such as an image shoot or
short video clips.
Component-4:
Smoke/gas detectors –
 Smoke detectors are installed in homes and buildings to detect smoke that is
typically an early sign of Fire.
 It uses optical detection, ionization for Air sampling techniques to detect
smoke.
 Gas detectors can detect the presence of harmful gases such as CO, LPG, etc.
 It can raise alerts in the human voice describing where the problem is.

Smart Agriculture
 Smart Agriculture is a topic that covers the many applications of Internet of
Things (IoT) technology in farming, agrotech and agriculture.
 The use of sensors, data collection, wireless networks, cloud platforms and
data analysis is already revolutionising the farming and agricultural

sectors.
 The primary benefits include:
 Increased production.
 Lower production costs.
 Operational efficiencies.
 Real-time and intelligent cost management.
 These items will either increase revenues, reduce costs – maximising your
profits while also having the potential to reduce environmental impact.
 There is real momentum behind IoT technology in agriculture and farming –
with many analysts predicting both the market and the adoption of Smart
 Agriculture technology to sky-rocket as more firms recognise the benefits.

IOT Use Cases: Smart Agriculture


 Traditional farming would be focused on acres of land, making general
decisions based on historical data, experience and ‘feel’.
 These decisions could determine the use of fertiliser, irrigation, pesticides
and harvesting.
 With the advent of IoT; Smart Agriculture and precision farming utilise
sensors, GPS, mapping and data analytics to provide accurate, real-time
insights that you can use to tailor your activity and investment for maximum
return.
 Systems can recommend calibrated doses of fertiliser, targeted irrigation and
early identification of diseases or substandard conditions.
 Intelligent software can make recommendations, trigger alarms and allow
you to visualise the data.
 You can access the reports and insights using a web browser, mobile or tablet
device.

Precision farming and Smart Agriculture enhances the visibility, control and
insight that you have concerning your farm. These factors translate into better time
management, improved decision making and the more practical application of
resources (i.e. Fertiliser, Irrigation) – producing healthier crops, higher yields and
allows you to conserve resources. All of these factors translate to less work, higher
revenues and reduced cost.
Libelium Smart Agriculture Xtreme
 Sensors are installed in the fields to monitor the temperature, pH and
moisture levels of the soil, precipitation, leaf water potential, fertiliser
presence and soil morphology.
 This data is transmitted back to the cloud for further analysis.
 The Libelium Plug&Sense Smart Agriculture unit can monitor all of these
parameters.
 The unit is mounted and the probes installed into the earth or adjacent to the
plants – and the software continually monitors different parameters.
 The system would take measurements before transmitting the data to the
cloud so that you can control it remotely.
 California produces 80% of the world’s Almonds. A study found that a
single Almond can consume 3.8L of water to grow. With Smart farming,
soil moisture levels are monitored continuously, dramatically reducing
unnecessary irrigation and watering.
 A 1969 Potato research study found to obtain the highest yields of
Potatoes, soil moisture should never drop below 50%, the first foot
should be 20%, and a sudden onset of moisture can introduce growth
cracks, second growth and knobby tubers. Precision monitoring of soil
moisture can optimise these parameters.
 These are just two examples of what is possible. Specific applications and
opportunities will vary by crop.
 Some applications of Internet of Things Smart Farming Technologies:
 Soil moisture monitoring (including conductivity and pH).
 IoT irrigation control. Activate irrigation valves when the soil moisture
drops below a certain level.
 Soil nutrient analysis. There are a range of emerging sensors that can
monitor NPK levels in soil.
 Solar radiation. Monitor levels of solar radiation to use in digital models
that predict plant growth, health and risk of disease.
 Weather stations. The ability to monitor wind, rain, temperature and
humidity are important factors in both arable and livestock farming.
 Livestock tracking. GPS-enabled asset tracking can be attached to a
collar, allowing the farmer to determine the location of their livestock.
 Autonomous farm vehicles – reduce the human labour associated with
driving and operating vehicles.
 Agricultural drones allow farmers to survey their fields with ease; using
imaging technology to recognise disease, pests or other issues relating to
growth.

Smart Cities

 The Internet of Things (IoT) in smart cities has witnessed wide adoption. It helps
improve efficiency, reduce costs, and enhance residents’ quality of life.
 It uses IoT-powered devices, such as connected Bluetooth sensors, RFID tags and
meters, to collect real-time data for future analysis.
 Using this data, the municipalities can improve infrastructure, services, public
utilities, and more.
 Here are some real-world IoT smart city examples:

Smart Traffic Management


 IoT sensors can be installed on traffic lights, roadways, and vehicles to collect
data on traffic patterns, congestion, and accidents.
 This data can be used to optimize traffic flow, reduce congestion, and improve
road safety.
 These solutions utilize sensors and GPS data from the rider’s smartphone to
report the location and speed of a vehicle.
 Further, historical data enables the prediction of preferred routes and prevent
potential congestion problems.

Real-life application:
 New York: Piloting a project of connected vehicles (CTV) to eliminate traffic-
related accidents, injuries, and damage to life and property.
 Los Angeles: Has implemented CCTV and road-surface sensors to control traffic
flow with real-time updates. The city has also deployed smart controllers that
auto-adjust traffic lights based on changing traffic conditions.

Smart Parking
 IoT sensors can be installed in parking spaces to detect when a spot is occupied
and transmit that information to a central server.
 This data can guide drivers to available parking spots, reducing congestion and
search time.
 The sensors embedded in the ground transmit the data to the cloud, immediately
notifying the driver whenever a nearby parking spot is vacant.

Real-life application:
 London (UK): The Smart Park project deployed in Westminster allows drivers to
locate parking spaces on-the-go. It eliminates the hassles of time-consuming
searches for a vacant spot and alleviates congestion.
Public Safety
 IoT-enabled cameras and sensors can be installed in public spaces to monitor
potential security threats, such as suspicious activity or unattended bags.
 IoT-enabled solutions come integrated with analytics, real-time tracking, and
decision-making capabilities.
 Analyzing the data generated from CCTV cameras & acoustic sensors embedded
throughout the city and the data generated from social media feeds helps predict
potential crime incidents.
 This can help law enforcement agencies respond quickly and effectively to
potential threats.

Real-life example:
 New York (USA): NYC fire department uses predictive modeling and data
analytics to identify crime hot spots.
 The city has also deployed a gunshot detection solution that uses connected
microphones to transmit data to a cloud platform.
 This platform records the time taken by the sound of a gunshot to reach the
microscope and estimates the gun’s location to alert the police on a mobile app

Waste Management
 Waste collection operators use IoT-powered solutions to optimize collection
schedules & routes with real-time tracking of waste levels, fuel consumption, and
use of waste containers.
 IoT sensors can be installed in garbage cans and recycling bins to monitor the fill
level and optimize waste collection routes, reducing costs and environmental
impact.
 Every container is embedded with a sensor that records waste levels. Once a
container nears the threshold level, the truck driver receives an instant
notification on a mobile app to empty a full container and avoid emptying it
when it’s half-full.

Real-life example:
 New Jersey (USA): The municipality of East Brunswick has rolled out a recycling
app enabled with IoT capabilities.
 It helps improve their communication with residents to create a positive
environmental impact.
 The app connects all the residents to improve recycling rates and reduce waste.

Utility Management
 IoT-equipped smart solutions enable citizens to save their money on home
utilities with:
 Energy management: IoT sensors can be installed in buildings and homes to
monitor energy usage and optimize energy consumption, reducing costs and
carbon emissions.
 Smart lighting: IoT sensors can be installed in streetlights to adjust the lighting
level based on ambient light, reducing energy consumption and pollution.
 Water management: IoT sensors can be installed in water distribution systems
to monitor water quality, detect leaks, and optimize water usage, reducing costs
and conserving resources.
Remote Monitoring
 IoT-based smart city solutions also enable efficient utility management for
citizens.
 They allow residents to use their meters to track and control resource
consumption.
 For instance, a homeowner can turn off their HVAC system using a smartphone
app.
 And in case of issues like leakages or potential failures, utility companies can
notify households and send specialists for timely repairs and maintenance.

Real-life example:
 New York (USA): MyNYCHA is a web application used for creating & managing
public housing services online for 300+ public developments.
 This free service allows residents to submit, schedule and track their repair and
maintenance tickets online.
 Residents can also subscribe to notifications in case of outages, shortages, and
upcoming rent payments.

Environmental Well-being
 IoT-powered solutions help municipalities remotely monitor environmental
conditions.
 For instance, sensors are attached to water grids to inspect their quality and
trigger notifications in case of leakages or changes in the chemical composition
of water.
 The same technology is also used for measuring air quality in areas prone to
pollutants and is critical to recommending solutions that improve air quality.

Real-life example:
 Copenhagen (Denmark): Has set the green standard high by deploying smart
grids to reduce carbon emissions from heating systems.
 This project includes new energy infrastructures that integrate all energy forms,
including electric transport, energy-efficient buildings, and HVAC systems at full
scale.

Public Transport
 Traffic operators can use the data from sensors embedded in multiple sources to
analyze and identify patterns of using public transport.
 This data helps achieve a standardized level of safety & timeliness while cutting
wait times and enhancing the traveling experience for citizens.
 A smart city can also embed BLE beacons on roads and bridges to monitor wear
and tear and repair them immediately in case of impending damage.

Real-life example:
 London: Train operators use IoT technology to accurately forecast the payload of
train passenger cars on their journey in and out of the city.
 They unify the data from CCTV cameras, sensors, and ticket sales to predict the
number of passengers every car will load.
 When a train comes to the station, operators can encourage passengers to
disperse across the train for uniform loading and optimal use of capacity.
 Overall, IoT technology is a valuable tool for improving the efficiency and
sustainability of smart cities, making them more liveable and enjoyable for
residents.

Benefits of IoT in Smart Cities


 IoT-based smart cities leverage the combined use of apps, connected systems,
buildings, devices, and more to create efficient living & working environments.
Here are just a few of its many benefits:
 Improved infrastructure management: IoT technology can be used to monitor
and manage the city’s infrastructure, including bridges, roads, and buildings. This
can help identify maintenance needs, reduce downtime, and improve overall
safety.
 Enhanced public safety: IoT-enabled sensors and cameras can help improve
public safety by detecting potential security threats, tracking criminal activity,
and monitoring emergency response times.
 Efficient transportation: IoT helps optimize public transportation routes,
reduce congestion, and improve traffic flow. Connected vehicles can also
communicate with each other and with traffic systems, enabling safer and more
efficient travel.
 Energy efficiency: IoT technology enables monitoring and managing energy use
in buildings and public spaces, reducing energy waste and saving costs.
 Improved waste management: IoT sensors can help optimize waste collection
routes, reducing the environmental impact of garbage collection and lowering
costs.
 Enhance citizen engagement: IoT-enabled platforms can enable citizens to
participate in city planning, and provide feedback on urban services, and report
issues in real time.
 Health and wellness: IoT can be used to monitor air quality, detect
environmental hazards, and track health trends, providing valuable data for
public health officials to develop policies that improve citizen’s health. Overall, IoT
in smart cities can help improve the quality of life for citizens, drive innovation and
economic growth, and create a more sustainable and resilient future.

Smart City Implementation Model


 Whether municipalities want to implement sustainable development practices,
improve traffic management, or automate waste collection – they need to have a
basic smart city platform in place.
 With the help of an IoT application development company the architecture of
this platform can be easily updated with new technologies if the municipality
wishes to expand its range of services
Here’s a six-step implementation plan to build a secure, scalable, and stable IoT
architecture for rolling out smart city initiatives:

Critical Components of an IoT-Based Platform


 Sensors collect data and transmit it to a centralized cloud platform.
 Actuators to enable devices to act – restrict water flow, modify the lighting,
notify about impending repairs, etc.
 Field Gateways to enable data collection, compression, and secure transmission
between network nodes and the cloud part.
 Data Lake to store information in its raw, unstructured format until it is needed
for extracting meaningful insights.
 Data Warehouse to contain all the structured and defined data about connected
devices and control apps.
Tracking & Analytics
Smart cities can monitor the device environment and predefine rules to control
pipelines, electronic valves, and distribution systems based on a set criterion. The
collected data can be visualized on a centralized dashboard to stay on top of every
public utility service.
Predictive Models
Deep analytics leverages machine learning algorithms and statistical analysis to reveal
patterns and correlations in historical data. This information is then used to create
predictive models employed in control applications to command the actuators
embedded in connected devices and vehicles.
Automated Controls
Control applications enable the automation of connected objects by sending commands
to complete a specific task. These apps can be rule-based or ML-based, depending on the
application.
User Applications
A desktop user app for traffic control centers to alter signals, re-route part of the traffic,
and relieve congestion. A mobile app that uses GPS data detects a jam and notifies the
driver to take a different route.
Integrations
A smart city can integrate its traffic management solution with intelligent air quality
monitoring software. This cross-solution integration helps control both traffic and air
quality dynamically.

hat can IoT do for

Smart Healthcare
 Before Internet of Things, patients’ interactions with doctors were limited to
visits, and tele and text communications.
 There was no way doctors or hospitals could monitor patients’ health
continuously and make recommendations accordingly.
 Internet of Things (IoT)-enabled devices have made remote monitoring in the
healthcare sector possible, unleashing the potential to keep patients safe and
healthy, and empowering physicians to deliver superlative care.
 It has also increased patient engagement and satisfaction as interactions with
doctors have become easier and more efficient. Furthermore, remote monitoring
of patient’s health helps in reducing the length of hospital stay and prevents re-
admissions. IoT also has a major impact on reducing healthcare costs
significantly and improving treatment outcomes.
 IoT is undoubtedly transforming the healthcare industry by redefining the space
of devices and people interaction in delivering healthcare solutions. IoT has
applications in healthcare that benefit patients, families, physicians, hospitals
and insurance companies.

IoT for Patients


 Devices in the form of wearables like fitness bands and other wirelessly
connected devices like blood pressure and heart rate monitoring cuffs,
glucometer etc. give patients access to personalized attention.
 These devices can be tuned to remind calorie count, exercise check,
appointments, blood pressure variations and much more.
 IoT has changed people’s lives, especially elderly patients, by enabling constant
tracking of health conditions. This has a major impact on people living alone and
their families.
 On any disturbance or changes in the routine activities of a person, alert
mechanism sends signals to family members and concerned health providers.

IoT for Physicians


 By using wearables and other home monitoring equipment embedded with IoT,
physicians can keep track of patients’ health more effectively.
 They can track patients’ adherence to treatment plans or any need for immediate
medical attention.
 IoT enables healthcare professionals to be more watchful and connect with the
patients proactively.
 Data collected from IoT devices can help physicians identify the best treatment
process for patients and reach the expected outcomes.

IoT for Hospitals


 Apart from monitoring patients’ health, there are many other areas where IoT
devices are very useful in hospitals.
 IoT devices tagged with sensors are used for tracking real time location of
medical equipment like wheelchairs, defibrillators, nebulizers, oxygen pumps
and other monitoring equipment.
 Deployment of medical staff at different locations can also be analysed real time.
 The spread of infections is a major concern for patients in hospitals. IoT-enabled
hygiene monitoring devices help in preventing patients from getting infected.
 IoT devices also help in asset management like pharmacy inventory control, and
environmental monitoring, for instance, checking refrigerator temperature, and
humidity and temperature control.

IoT for Health Insurance Companies


 There are numerous opportunities for health insurers with IoT-connected
intelligent devices.
 Insurance companies can leverage data captured through health monitoring
devices for their underwriting and claims operations.
 This data will enable them to detect fraud claims and identify prospects for
underwriting.
 IoT devices bring transparency between insurers and customers in the
underwriting, pricing, claims handling, and risk assessment processes.
 In the light of IoT-captured data-driven decisions in all operation processes,
customers will have adequate visibility into underlying thought behind every
decision made and process outcomes.
 Insurers may offer incentives to their customers for using and sharing health
data generated by IoT devices.
 They can reward customers for using IoT devices to keep track of their routine
activities and adherence to treatment plans and precautionary health measures.
 This will help insurers to reduce claims significantly.
 IoT devices can also enable insurance companies to validate claims through the
data captured by these devices.
 IoT has a four-step architecture that are basically stages in a process (See
Figure ).
 All four stages are connected in a manner that data is captured or processed at
one stage and yields the value to the next stage.
 Integrated values in the process brings intuitions and deliver dynamic business
prospects.

Step 1: First step consists of deployment of interconnected devices that includes


sensors, actuators, monitors, detectors, camera systems etc. These devices collect the
data.
Step 2: Usually, data received from sensors and other devices are in analog form, which
need to be aggregated and converted to the digital form for further data processing.
Step 3: Once the data is digitized and aggregated, this is pre-processed, standardized
and moved to the data centre or Cloud.
Step 4: Final data is managed and analysed at the required level. Advanced Analytics,
applied to this data, brings actionable business insights for effective decision-making.
 IoT is redefining healthcare by ensuring better care, improved treatment
outcomes and reduced costs for patients, and better processes and workflows,
improved performance and patient experience for healthcare providers.

The four stages of IoT solutions

The major advantages of IoT in healthcare include:

 Cost Reduction: IoT enables patient monitoring in real time, thus significantly
cutting down unnecessary visits to doctors, hospital stays and re-admissions
 Improved Treatment: It enables physicians to make evidence-based informed
decisions and brings absolute transparency
 Faster Disease Diagnosis: Continuous patient monitoring and real time data
helps in diagnosing diseases at an early stage or even before the disease develops
based on symptoms
 Proactive Treatment: Continuous health monitoring opens the doors for
providing proactive medical treatment
 Drugs and Equipment Management: Management of drugs and medical
equipment is a major challenge in a healthcare industry. Through connected
devices, these are managed and utilized efficiently with reduced costs
 Error Reduction: Data generated through IoT devices not only help in effective
decision making but also ensure smooth healthcare operations with reduced
errors, waste and system costs

 Healthcare IoT is not without challenges. IoT-enabled connected devices capture


huge amounts of data, including sensitive information, giving rise to concerns
about data security.
 Implementing apt security measures is crucial.
 IoT explores new dimensions of patient care through real-time health
monitoring and access to patients’ health data.
 This data is a goldmine for healthcare stakeholders to improve patient’s health
and experiences while making revenue opportunities and improving healthcare
operations.
 Being prepared to harness this digital power would prove to be the differentiator
in the increasingly connected world.

You might also like