0% found this document useful (0 votes)
77 views39 pages

Unit - 3 Iot

The document discusses sensors, actuators, and input/output interfaces for IoT application development. It defines different types of sensors like position, motion, force, pressure sensors and describes how they are classified. It also defines different types of actuators like linear, rotary, hydraulic, pneumatic, electric actuators and their sources of energy. Finally, it discusses common I/O interfaces like USB, GPIO, I2C, SPI, UART used to connect devices.

Uploaded by

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

Unit - 3 Iot

The document discusses sensors, actuators, and input/output interfaces for IoT application development. It defines different types of sensors like position, motion, force, pressure sensors and describes how they are classified. It also defines different types of actuators like linear, rotary, hydraulic, pneumatic, electric actuators and their sources of energy. Finally, it discusses common I/O interfaces like USB, GPIO, I2C, SPI, UART used to connect devices.

Uploaded by

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

UNIT- 3

IOT APPLICATION DEVELOPMENT


1. SENSORS:
A sensor is a device that produces an output signal for the purpose of sensing of a physical
environment. i.e a sensor measures some physical quantity & convert that measurement reading
into a digital representation.

Classification of Sensors

There are several types of sensors available to measure virtually everything in the physical world.
In the first classification of the sensors, they are divided in to Active and Passive. Active Sensors are those
which require an external excitation signal or a power signal to produce an energy output. Passive Sensors,
do not require any external power signal and directly generates output response.
Contact or non-contact: whether they require physical contact with what they are measuring (contact) or not
(no- contact)
Absolute or relative: whether they measure on an absolute scale or based on a difference with a fixed or
variable reference value (relative).
The final classification of the sensors are Analog and Digital Sensors. Analog Sensors produce an analog
output i.e., a continuous output signal (usually voltage but sometimes other quantities like Resistance etc.)
with respect to the quantity being measured.
Digital Sensors, in contrast to Analog Sensors, work with discrete or digital data. The data in digital sensors,
which is used for conversion and transmission, is digital in nature.

Different Types of Sensors

The following is a list of different types of sensors that are commonly used in various
applications. All these sensors are used for measuring one of the physical properties like
Temperature, Resistance, Capacitance, Conduction, Heat Transfer etc.

Position Sensor: A position sensor is a sensor that measures the position of an object.. A
position sensor may indicate absolute position (location) or relative position (displacement). Ex:
potentiometer
Occupancy & motion: occupancy sensor detect the presence of people & animals in a
surveillance area, while motion sensors detect movement of people & objects. Ex: electric eye

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Velocity & acceleration: velocity (speed of motion) sensors may be linear or angular , indicating
how fast an object moves along a straight line or how fast it rotates. Acceleration sensor measure
change in velocity. Ex: accelerometer, gyroscope.
Force sensor: it detect whether a physical force is applied & whether the magnitude of force is
beyond a threshold. Ex: force gauge, touch sensor.
Pressure sensor: it is used to measure force applied by liquids or gases. Ex: barometer,
piezometer
Flow sensor: it detects the rate of fluid flow. Ex: water meter
Humidity sensor: it detects humidity (amount of water vapor) in the air or a mass. Ex: soil
moisture sensor
Light sensor: it detects the presence of light . ex:photodetector
Temperature Sensor; senses the temperature i.e., it measures the changes in the temperature.ex:
thermometer
Ultrasonic Sensor: An Ultrasonic Sensor is a non-contact type device that can be used to measure
distance as well as velocity of an object. An Ultrasonic Sensor works based on the properties of
the sound waves with frequency greater than that of the human audible range. Using the time of
flight of the sound wave, an Ultrasonic Sensor can measure the distance of the object
2. ACTUATOR: An actuator is a device that receives some type of control signal (electrical
signal or digital command) that triggers a physical effect, usually some type of motion, force &
so on. some examples of actuators are.
Grocery Store Door
When we go to the grocery store, the door opens automatically for us. An actuator makes the
door open.
Car Seat
We can move the car seat forward or backward before we drive away in our car. An actuator
makes the seat move.
Types of Actuators
Motion
Actuators can create two main types of motion: linear and rotary.
Linear Actuators
linear actuators are devices that produce movement within a straight path.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Rotary Actuators
An actuator can make something move in a circular motion, also referred to as rotary. From the
term “rotary,” most machines use these rotating parts to complete a turning movement.
Source of Energy
Actuators can also be classified according to the power source
Hydraulic Actuators
Hydraulic actuators use a variety of liquids as a source of energy. These actuators are widely
seen in exercise equipment such as steppers or car transport carriers.
Pneumatic Actuators
Pneumatic actuators are operated by compressed air. They use pressurized gases to create
mechanical movement.
Examples of equipment that uses pneumatic actuators include:
Bus brakes
Exercise machines
Vane motors
Electric Actuators
Which requires electricity to work. examples include electric cars, manufacturing machinery,
thyristor, bipolar transistors, diodes and robotics equipment.
The different types of electrical actuators include:
Electromechanical actuators: These actuators convert electric signals into rotary or linear
movements and may even be capable of a combination of both.ex: AC motor, DC motor, step
motor
Electrohydraulic actuators: This type of actuator is also powered electrically but gives
movement to a hydraulic accumulator. The accumulator then provides the force for
movement, usually seen in heavy industrial equipments
Thermal and Magnetic Actuators

Thermal and magnetic actuators usually consist of shape memory alloys that can be heated to produce
movement. Ex: linear solenoid

3. I/O INTERFACE:

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


The process of connecting devices together with processor so that they can exchange the
information is called interfacing. In order for these devices to swap their information, they must
share a common communication protocol.
Generally, communication protocol can be separated two categories: parallel or serial.
A parallel interface refers to a multi line channel with each line capable of transmitting several
bits of data simultaneously. They usually require buses of data — transmitting across eight,
sixteen, or more wires. Data is transferred in huge, crashing waves of 1’s and 0’s.
Serial interfaces stream their data, one single bit at a time. These interfaces can operate on as little
as one wire, usually never more than four.
Serial interfaces have certain advantages over parallel interfaces. The most significant advantage
is simpler wiring. In addition, serial interface cables can be longer than parallel interface cables,
because there is much less interaction (crosstalk) among the conductors in the cable.
Most hardware interfaces are serial interfaces sacrificing potential speed in parallel. Serial
interfaces generally use multiple wires to control the flow and timing of binary information along
the primary data wire. Each type of hardware interface defines a method of communicating
between a peripheral and the central processor.
IoT hardware platforms use a number of common interfaces. Sensor and actuator modules can
support one or more of these interfaces:
USB. Universal Serial Bus is a technology that allows a person to connect an electronic
device to a microcontroller. It is a fast serial bus.
GPIO. General-purpose input/output pins area generic pin on an integrated circuit or
computer board whose behavior — including whether it is an input or output pin — is
controllable by the user at run time. GPIO pins have no predefined purpose, and go unused
by default. GPIO pins can be designed to carry digital or analog signals, and digital pins have
only two states: HIGH or LOW.

Digital GPIO can support Pulse Width Modulation (PWM). PWM lets you very quickly
switch a power source on and off, with each “on” phase being a pulse of a particular duration,
or width. The effect in the device can be a lower or higher power level. For example, you can
use PWM to change the brightness of an LED; the wider the “on” pulses, the brighter the
LED glows.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Analog pins might have access to an on-board analog-to-digital conversion (ADC) circuit.
An ADC periodically samples a continuous, analog waveform, such as an analog audio
signal, giving each sample a digital value between zero and one, relative to the system
voltage.
When you read the value of a digital I/O pin in code, the value can must be either HIGH or
LOW, where an analog input pin at any given moment could be any value in a range. The
range depends on the resolution of the ADC. For example an 8-bit ADC can produce digital
values from 0 to 255, while a 10-bit ADC can yield a wider range of values, from 0 to 1024.
More values means higher resolution and thus a more faithful digital representation of any
given analog signal.
The ADC sampling rate determines the frequency range that an ADC can reproduce. A
higher sampling rate results in a higher maximum frequency in the digital data. For example,
an audio signal sampled at 44,100 Hz produces a digital audio file with a frequency response
up to 22.5 kHz, ignoring typical filtering and other processing. The bit precision dictates the
resolution of the amplitude of the signal.
I2C. Inter-Integrated Circuit serial bus uses a protocol that enables multiple modules to be
assigned a discrete address on the bus. I2C is sometimes pronounced “I two C”, “I-I-C”, or “I
squared C”. I has two wires, a clock and data wire.
SPI. Serial Peripheral Interface/Interchange Bus devices employ a master-slave architecture,
with a single master and full-duplex communication.
UART. Universal Asynchronous Receiver/Transmitter devices translate data between serial
and parallel forms at the point where the data is acted on by the processor. UART is required
when serial data must be laid out in memory in a parallel fashion.
RS 232 Recommended Standard 232 is used for obtaining communication between the
computer and circuit such to transfer data between circuit and computer.
4. API (application programming interface):
An application programming interface (API) defines the rules that you must follow to communicate with
other software systems. Developers expose or create APIs so that other applications can communicate with
their applications programmatically. A good API makes it easier to develop a program by providing all the
building blocks.
Examples of APIs are REST API, Web SOCket.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Representational State Transfer (REST) is an architectural style that defines a set of
constraints to be used for creating web services. REST API is a way of accessing web services
in a simple and flexible way without having any processing. Which follows Request response
communication model. Each request involves setting a new TCP connection
Working: A request is sent from client to server in the form of a web URL as HTTP GET or
POST or PUT or DELETE request. After that, a response comes back from the server in the
form of a resource which can be anything like HTML, XML, Image, or JSON. But now JSON
is the most popular format being used in Web Services.

in HTTP there are five methods that are commonly used in a REST-based Architecture i.e.,
POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete
(or CRUD) operations respectively.
GET: The HTTP GET method is used to read (or retrieve) a representation of a resource.
POST: The POST verb is most often utilized to create new resources. In particular, it’s used to
create subordinate resources.
PUT: It is used for updating the capabilities.
DELETE: It is used to delete a resource identified by a URI. On successful deletion, return
HTTP status 200 (OK) along with a response body.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Websocket APIs:
Websocket APIs allow bi-directional, full duplex communication between clients and servers.
Websocket APIs follow the exclusive pair communication model. Unlike request-response
model such as REST, the WebSocket APIs allow full duplex communication and do not
require new coonection to be setup for each message to be sent. Websocket communication
begins with a connection setup request sent by the client to the server. The request (called
websocket handshake) is sent over HTTP and the server interprets it is an upgrade request. If the
server supports websocket protocol, the server responds to the websocket handshake response.
After the connection setup client and server can send data/mesages to each other in full duplex
mode. Websocket API reduce the network traffic and letency as there is no overhead for
connection setup and termination requests for each message. Websocket suitable for IoT
applications that have low latency or high throughput requirements. So Web socket is most
suitable IoT Communication APIs for IoT System.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


4. Communication Protocols in IoT:

The IoT based devices are more susceptible to threats. So these security loopholes can be reduced by using
the correct protocols. Communication protocols in IoT are types of communication that ensure the finest
security toward the data being exchanged among the IoT connected devices.
The connection of these devices can be done through an IP network otherwise a non IP network but, there is
a disparity within their power, range & memory used. The connection throughout IP networks is difficult &
takes huge memory as well as power from these devices as the range is not a trouble.
Alternatively, Bluetooth which is known as non-IP networks needs low power and memory however they
have a limitation in the range.
The main benefits of IoT communication protocols are high quality, credibility, interoperability, innovation
flexibility & global scalability. IoT protocols are available in two types mainly IoT network protocols and IoT
data protocols.
The list of Top 10 IoT Communication Protocols includes the following.

WiFi
SigFox
Bluetooth
LoRaWAN

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


NFC (Near Field Communication)
Z wave
Zigbee
OPC- UA
Cellular
MQTT

5. MQTT protocol
MQTT stands for Message Queuing Telemetry Transport. MQTT is a machine to machine internet of things
connectivity protocol. It is an extremely lightweight and publish-subscribe messaging transport protocol
running on the top of TCP/IP. This protocol is useful for the connection with the remote location where the
bandwidth is a premium. These characteristics make it useful in various situations, including constant
environment such as for communication machine to machine and internet of things contexts. It is a publish
and subscribe system where we can publish and receive the messages as a client. It makes it easy for
communication between multiple devices. It is a simple messaging protocol designed for the constrained
devices and with low bandwidth, so it's a perfect solution for the internet of things applications.
Characteristics of MQTT
The MQTT has some unique features which are hardly found in other protocols. Some of the features of an
MQTT are given below:

It is a machine to machine protocol, i.e., it provides communication between the devices.

It is designed as a simple and lightweight messaging protocol that uses a publish/subscribe


system to exchange the information between the client and the server.

It does not require that both the client and the server establish a connection at the same time.

It provides faster data transmission, like how WhatsApp/messenger provides a faster delivery.
It's a real-time messaging protocol.

It allows the clients to subscribe to the narrow selection of topics so that they can receive the
information they are looking for.

The publishe-subscribe model of MQTT is based on the Client-Server model, but the server running MQTT is
more like a broker or gateway [2]. The MQTT client can publish a message on a topic or subscribe to a topic,

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


and the MQTT server/broker will handle the messages that clients publish and forward them to the
corresponding subscriber clients (see Fig. 2.4). The broker will store the list of topics and process the
subscribe/unsubscribe requests from clients. Each topic will have a topic name as its label, and clients will
send the subscription with a topic filter that include one or more topics.
Client
In MQTT, the subscriber and publisher are the two roles of a client. The clients subscribe to the topics to
publish and receive messages. In simple words, we can say that if any program or device uses an MQTT, then
that device is referred to as a client. A device is a client if it opens the network connection to the server,
publishes messages that other clients want to see, subscribes to the messages that it is interested in receiving,
unsubscribes to the messages that it is not interested in receiving, and closes the network connection to the
server.
In MQTT, the client performs two operations:
Publish: When the client sends the data to the server, then we call this operation as a publish.
Subscribe: When the client receives the data from the server, then we call this operation a subscription.
Server
The device or a program that allows the client to publish the messages and subscribe to the messages. A
server accepts the network connection from the client, accepts the messages from the client, processes the
subscribe and unsubscribe requests, forwards the application messages to the client, and closes the network
connection from the client.
TOPIC

The label provided to the message is checked against the subscription known by the server is known as TOPIC.
Architecture of MQTT

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Now we will look at the architecture of MQTT. To understand it more clearly, we will look at
the example. Suppose a device has a temperature sensor and wants to send the rating to the
server or the broker. If the phone or desktop application wishes to receive this temperature value
on the other side, then there will be two things that happened. The publisher first defines the
topic; for example, the temperature then publishes the message, i.e., the temperature's value.
After publishing the message, the phone or the desktop application on the other side will
subscribe to the topic, i.e., temperature and then receive the published message, i.e., the value of
the temperature. The server or the broker's role is to deliver the published message to the phone
or the desktop application.
6. Constrained Application Protocol (CoAP):
CoAP is an internet utility protocol for constrained gadgets. It is designed to enable simple,
constrained devices to join IoT through constrained networks having low bandwidth availability.
This protocol is primarily used for machine-to-machine (M2M) communication and is
particularly designed for IoT systems that are based on HTTP protocols. COAP protocol was
developed by IETF (Internet Engineering Task Force).

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


CoAP is also a RESTful protocol, which reduces the complexity of the implementation and the communication
overhead as compared to HTTP.
Constrained Application Protocol is specifically designed for constrained (limited)
Hardware. The hardware that doesn’t support HTTP or TCP/IP can use CoAP Protocol. the
CoAP protocol using UDP and IP protocol. It is a lightweight protocol that needs low power IOT
application like for communication between battery powered IOT devices. Like HTTP, it also
follows client-server model. The clients can GET, PUT, DELETE or POST informational
resources over the network.
CoAP makes use of two message types – requests and responses. The messages contain
a base header followed by message body whose length is specified by the datagram. The
messages or data packets are small in size, so that they can be communicated among constraint
devices without data losses.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Message Model :The CoAP messaging model consists of four types of messages : Confirmable
(CON), NonConfirmable (NON), Acknowledgement (ACK) and Reset (RST).
The Confirmable message provides reliability; the message will keep being retransmitted until
the sender receive a corresponding Acknowledgement message. If the message does not need
reliability, the Non-Confirmable message can be used. Both CON and NON message provide
duplication detection by adding a message ID in the header; when the recipient is unable to
process the message, it can reply with a Reset message. The request with four basic methods
(GET, PUT, POST, DELETE) can be carried by a CON or a NON message.

CoAP provides three different types of responses. If the request is in a CON message and
the resource is immediately available, then a Piggybacked response will be used, which means
the response is carried by the ACK message. But when the server need a longer time to obtain
the representation of the resource, and in order to avoid the situation that client keep sending the
same request, the server may use the Separate response. The server can reply with the ACK as a
empty message to inform the client that the request is received.
When the response is available, response will be sent back to the client in a CON
message. Furthermore, if the request is in NON, response will be a Non-Confirmable response, a
NON message will carry the response back to the client. Caching for requests and responses may
be enabled by the CoAP endpoints. In some cases, the request/response pair can be reused by
using the prior request/response payload (supposing the client is checking the state of the same
resource and its state has not changed); this feature increases performance by reducing response
time and reducing network bandwidth consumption.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


7. Introduction to bluetooth:
The first consumer Bluetooth device was launched in 1999.Bluetooth is a short-
range wireless technology standard that is used for exchanging data between fixed and mobile
devices over short distances using UHF radio waves in the ISM bands, from 2.402 to 2.48 GHz,
and building personal area networks (PANs). It is mainly used as an alternative to wire
connections, to exchange files between nearby portable devices and connect cell phones and
music players with wireless headphones. In the most widely used mode, transmission power is
limited to 2.5 milliwatts, giving it a very short range of up to 10 metres (33 ft).
.You can use Bluetooth on your mobile device to share documents or to connect with other
Bluetooth-enabled devices. For security reasons, Bluetooth devices must be paired before they
can begin transferring information. The process of pairing your devices will vary depending on
the device you are connecting to. It is designed for low power consumption with a short
range.(10 cm – 100m) .
Bluetooth products are available in one of three power classes. Range is power-class-dependent,
but effective ranges vary in practice. See the table "Ranges of Bluetooth devices by class".

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Officially Class 3 radios have a range of up to 1 metre (3 ft), Class 2, most commonly found in mobile devices,
10 metres (33 ft), and Class 1, primarily for industrial use cases, 100 metres (300 ft). The effective range
varies depending on propagation conditions, material coverage, production sample variations, antenna
configurations and battery conditions.

8. Bluetooth Architecture/Protocol Stack


Bluetooth is both a hardware-based radio system and a software stack that specifies the linkages
between the architecture layers of the two. The heart of this specification is the protocol stack,
which is used to define how Bluetooth works. The Bluetooth protocol stack is a set of layered
programs. Each layer in a protocol stack talks to the layer above it and to the layer below it.

Think of Bluetooth as having two well-defined layers of functionality in the stack. These layers
range from the lower level hardware-based radio system, to an upper level software stack that
specifies the linkages between the layers (Figure 1).

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Lower Stack Layers
The lower layers are the basic core specifications that describe how Bluetooth works. The base of the
Bluetooth protocol stack is the radio layer, or module. The radio layer describes the physical characteristics
of the transceiver. It is responsible for modulation/demodulation of data for transmitting or receiving over
radio frequencies in the 2.4 GHz band. This is the physical wireless connection. It splits the transmission
band into 79 channels and performs fast frequency hopping (1600 hops/sec) for security.
Above the radio layer is the baseband and link controller/link manager protocol (LMP). Perhaps the best
way to think of these layers is that the baseband is responsible for properly formatting data for transmission
to and from the radio. It defines the timing, framing, packets, and flow control on the link. The link
manager controller translates the host controller interface (HCI) commands from the upper stack, and
establishes and maintains the link. It is responsible for managing the connection, enforcing fairness among
slaves in the piconet, and provides for power management.

Upper Stack Layers

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


The upper stack layers consist of profile specifications that focus on how to build devices that will
communicate with each other, using the core technology.
The host controller interface (HCI) serves as the interface between the software part of the system and the
hardware (i.e., the device driver).
The L2CAP (logical link control and adaptation protocol) layer is above the HCI in the upper stack. Among
other functions, it plays a central role in communication between the upper and lower layers of the
Bluetooth stack. It keeps track of where data packets come from and where they should go. It is a required
part of every Bluetooth system.
Above the L2CAP layer, the protocol stack is not as linearly ordered. Still, the service
discovery protocol (SDP) is important to mention because it exists independently of other higher-level
protocol layers. It provides the interface to the link controller and allows for interoperability between
Bluetooth devices.
Logical Link, Control Adaptation Protocol Layer (L2CAP)
The various function of L2CAP is:
Segmentation and reassembly
L2CAP receives the packets of upto 64 KB from upper layers and divides them into frames for
transmission.
It adds extra information to define the location of frame in the original packet.
The L2CAP reassembles the frame into packets again at the destination.
Multiplexing
L2CAP performs multiplexing at sender side and demultiplexing at receiver side.
At the sender site, it accepts data from one of the upper layer protocols frames them and deliver
them to the Baseband layer.
At the receiver site, it accepts a frame from the baseband layer, extracts the data, and delivers
them to the appropriate protocol1ayer.
Quality of Service (QOS)
L2CAP handles quality of service requirements, both when links are established and during
normal operation.
It also enables the devices to negotiate the maximum payload size during connection
establishment

Service Discovery Protocol (SDP)− SDP takes care of service-related queries like device
information so as to establish a connection between contending Bluetooth devices.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


9. ZIGBEE:
Zigbee communication is specially built for control and sensor networks on IEEE
802.15.4 standard for wireless personal area networks (WPANs), and it is the product from
Zigbee alliance. This communication standard defines physical and Media Access Control (MAC)
layers to handle many devices at low-data rates. These Zigbee’s WPANs operate at 868 MHz,
902-928MHz, and 2.4 GHz frequencies. The data rate of 250 kbps is best suited for periodic as
well as intermediate two-way transmission of data between sensors and controllers.

Zigbee is a low-cost and low-powered mesh network widely deployed for controlling and
monitoring applications where it covers 10-100 meters within the range. Zigbee devices can
transmit data over long distances by passing data through a mesh network of intermediate
devices to reach more distant ones. This communication system is less expensive and simpler
than the other proprietary short-range wireless sensor networks as Bluetooth and Wi-Fi.

ZigBee Architecture
The ZigBee Network Protocol follows IEEE 802.15.4 standards for Physical and MAC layers, along with its own
Network and Application layers.

Physical Layer: This is the lowest protocol layer, and is responsible for controlling and
activating the radio transceiver, and also for selecting the channel frequency and monitoring
the channel. It is also responsible for communication with the radio devices. Communication
of data or commands is done using Packets. Each PHY Packet consists of a Synchronization

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Header (SHR)(responsible for receiver synchronization), Physical Header (PHR)(contains
information about Frame length) and PHY payload (provided by upper layers as a frame and
includes data or command).
Medium Access Control or MAC Layer: It acts as an interface between the Physical layer and
the Network layers. It is responsible for generation of Beacons and synchronization of devices
in the Beacon enabled network. A MAC frame can be a Beacon Frame (used by Coordinator
to transmit Beacons), Data Frame, Acknowledge Frame or a Command Frame. It consists of a
MAC Header (contains information about security and addressing), Variable length size
MAC Payload (contains data or command) and a MAC Footer (contains 16 bit Frame check
sequence for data verification).
Network Layer: This layer connects the Application layer with the MAC layer. It manages the
network formation and routing. It establishes a new network and selects the network topology.
The NWK frame consists of the NWK Header and NWK Payload. The Header contains
information regarding network level addressing and control. The NWK Payload contains the
Application sublayer frame.
Application Support Sub Layer: It provides a set of services through two entities –
Application SupportData Entity and Application Support Management Entity, to the
application and network layers. These entities are accessed through their respective Service
Access Points (SAP)
Application Layer: This is the highest layer in the network and is responsible for hosting the
application objects which holds user applications and ZigBee Device Objects (ZDOs). A
single ZigBee device can contain up to 240 application objects which control and manage the
protocol layers. Each application object can consist of one application profile or program,
developed by the user or the ZigBee alliance. The application profile is responsible for
transmission and reception of data in the network. The type of devices and function of each
device is defined in an application profile. The ZigBee Device Objects act as a interface
between application objects, device profiles and the Application sub layer.

10. BLUETOOTH KEY VERSIONS:

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


All versions of the Bluetooth standards support downward compatibility. That lets the latest
standard cover all older versions.

Bluetooth 1.0 and 1.0B:


Version 1.0 & 1.0B had many problems.
Manufactures had difficulty making their Products interoperable.
Bluetooth 1.1:
Ratified as IEEE Standard 802.15.1–2002.

Many errors found in the v1.0B specifications were fixed.

Added support for non-encrypted channels.

Received Signal Strength Indicator (RSSI).

Bluetooth 1.2
Major enhancements include:
Faster Connection and Discovery

Adaptive frequency-hopping spread spectrum (AFH), which improves resistance to radio


frequency interference by avoiding the use of crowded frequencies in the hopping sequence.

Higher transmission speeds in practice than in v1.1, up to 721 kbit/s.

Extended Synchronous Connections (eSCO), which improve voice quality of audio links by
allowing retransmissions of corrupted packets, and may optionally increase audio latency to
provide better concurrent data transfer.

Host Controller Interface (HCI) operation with three-wire UART.

Ratified as IEEE Standard 802.15.1–2005

Introduced Flow Control and Retransmission Modes for L2CAP.

Bluetooth 2.0 + EDR

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


This version of the Bluetooth Core Specification was released before 2005. The main difference is the
introduction of an Enhanced Data Rate (EDR) for faster data transfer. The bit rate of EDR is 3 Mbit/s, although
the maximum data transfer rate (allowing for inter-packet time and acknowledgements) is 2.1 Mbit/s. EDR
uses a combination of GFSK and phase-shift keying modulation (PSK) with two variants, π/4-DQPSK and 8-
DPSK.[77] EDR can provide a lower power consumption through a reduced duty cycle.

The specification is published as Bluetooth v2.0 + EDR, which implies that EDR is an optional feature. Aside
from EDR, the v2.0 specification contains other minor improvements, and products may claim compliance to
"Bluetooth v2.0" without supporting the higher data rate. At least one commercial device states "Bluetooth
v2.0 without EDR" on its data sheet.

Bluetooth 2.1 + EDR

Bluetooth Core Specification Version 2.1 + EDR was adopted by the Bluetooth SIG on 26 July 2007.

The headline feature of v2.1 is secure simple pairing (SSP): this improves the pairing experience for Bluetooth
devices, while increasing the use and strength of security.

Version 2.1 allows various other improvements, including extended inquiry response (EIR), which provides
more information during the inquiry procedure to allow better filtering of devices before connection; and
sniff subrating, which reduces the power consumption in low-power mode.

Bluetooth 3.0 + HS

Version 3.0 + HS of the Bluetooth Core Specification[77] was adopted by the Bluetooth SIG on 21 April 2009.
Bluetooth v3.0 + HS provides theoretical data transfer speeds of up to 24 Mbit/s, though not over the
Bluetooth link itself. Instead, the Bluetooth link is used for negotiation and establishment, and the high data
rate traffic is carried over a colocated 802.11 link.

The main new feature is AMP (Alternative MAC/PHY), the addition of 802.11 as a high-speed transport. The
high-speed part of the specification is not mandatory, and hence only devices that display the "+HS" logo
actually support Bluetooth over 802.11 high-speed data transfer. A Bluetooth v3.0 device without the "+HS"
suffix is only required to support features introduced in Core Specification Version 3.0[80] or earlier Core
Specification Addendum 1

Bluetooth 4.0

The Bluetooth SIG completed the Bluetooth Core Specification version 4.0 (called Bluetooth
Smart) and has been adopted as of 30 June 2010. It includes Classic Bluetooth, Bluetooth high

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


speed and Bluetooth Low Energy (BLE) protocols. Bluetooth high speed is based on Wi-Fi, and
Classic Bluetooth consists of legacy Bluetooth protocols.

As an alternative to the Bluetooth standard protocols that were introduced in Bluetooth v1.0 to
v3.0, it is aimed at very low power applications powered by a coin cell. Chip designs allow for
two types of implementation, dual-mode, single-mode and enhanced past versions.

Bluetooth 4.1
The Bluetooth SIG announced formal adoption of the Bluetooth v4.1 specification on 4
December 2013. This specification is an incremental software update to Bluetooth Specification
v4.0, and not a hardware update.

New features of this specification include:

Mobile Wireless Service Coexistence Signaling

Train Nudging and Generalized Interlaced Scanning

Low Duty Cycle Directed Advertising

L2CAP Connection Oriented and Dedicated Channels with Credit-Based Flow Control

Dual Mode and Topology

LE Link Layer Topology

802.11n PAL

Audio Architecture Updates for Wide Band Speech

Fast Data Advertising Interval

Limited Discovery Time[103]

Bluetooth 4.2

Released on 2 December 2014, it introduces features for the Internet of Things.

The major areas of improvement are:

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Low Energy Secure Connection with Data Packet Length Extension

Link Layer Privacy with Extended Scanner Filter Policies

Internet Protocol Support Profile (IPSP) version 6 ready for Bluetooth Smart things to
support connected home

Bluetooth 5

The Bluetooth SIG released Bluetooth 5 on 6 December 2016. Its new features are mainly focused on
new Internet of Things technology.

Bluetooth 5 provides, for BLE, options that can double the speed (2 Mbit/s burst) at the expense
of range, or provide up to four times the range at the expense of data rate. The increase in
transmissions could be important for Internet of Things devices, where many nodes connect
throughout a whole house. Bluetooth 5 increases capacity of connectionless services such as
location-relevant navigation of low-energy Bluetooth connections

The major areas of improvement are:

Slot Availability Mask (SAM)

2 Mbit/s PHY for LE

LE Long Range

High Duty Cycle Non-Connectable Advertising

LE Advertising Extensions

LE Channel Selection Algorithm #2


Features Added in CSA5 – Integrated in v5.0:

Higher Output Power


11. User Datagram Protocol(UDP):
The TCP/IP protocol despite being most common protocol stack on internet is not much
suitable for IoT applications due to large overhead. It is more suitable for applications where
reliable delivery of data with high bandwidth in hand is required. The IoT applications generally

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


have limited bandwidth and need swift transfer of small data packets. In such case, the UDP/IP
stack is far better than TCP/IP.
The User Datagram Protocol (UDP) is the simplest transportation layer protocol used
primarily for establishing low-latency and loss tolerating connections between applications on
the communication network. Both TCP and UDP run on the top of Internet Protocol (IP) that is
why they are referred as TCP/IP and UDP/IP.
UDP is a connectionless protocol which means the sender just transmits the data without waiting
for the connection with the receiver. It is an unreliable protocol when compared with TCP. There
is no error checking mechanism or correcting mechanism involved in data transmission which
results in using less bandwidth. UDP protocol just sends the packets (or datagram). There is no
acknowledgement guarantee of packet received by the other end. It allows for less data overhead
and delays.
To achieve higher performance, the protocol allows individual packets to be dropped
(with no retries) and UDP packets to be received in a different order than they were sent, as
dictated by the application.
Features of UDP –
The UDP protocol stack has the following features –
1) UDP can be used when acknowledgement of data does not hold any significance.
2) It is great for data flowing in one direction.
3) It is connectionless protocol.
4) It does not provide any congestion control mechanism.
5) It is a suitable protocol for streaming applications such as video conference applications,
computer games etc.
UDP Datagrams –
UDP traffic works through packets called datagram, with every datagram consisting of a
single message unit. The header details are stored in the first eight bytes, but the rest is what
holds onto the actual message. The UDP datagram header can be divided into four parts each of
which is two bytes long. These parts are as follow –
1) Source Port – This 16 bits (2 bytes) information is used to identify the sender port which will
send the data. A valid UDP port number ranges from 0 to 65535.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


2) Destination Port – This 16 bits information is used to identify the receiver’s port on which the
data will be received. A valid UDP port number ranges from 0 to 65535. This field identifies the
receiver’s port and is required.
3) Length – The length field specifies the entire length of the UDP packet (UDP header and UDP
data). This individual field is 16-bits field. The minimum length of the Length field is 8 bytes in
case of no UDP data.
4) Checksum – This field stores the checksum value generated by the sender before sending the
data to the receiver. UDP checksums protect message data from being corrupted. The checksum
value represents an encoding of the datagram data calculated first by the sender and later by the
receiver. In UDP, checksum is optional, as opposed to TCP where checksum is mandatory.
Advantages of UDP –
The UDP/IP has the following advantages over TCP/IP stack –
1) It is better than TCP for applications that require constant data flow, bulk data and which
require more swiftness than reliability.
2) For multicast and broadcast purposes, UDP is best suited because it supports point to
multipoint transmission method. The sender does not need to keep track of retransmission of data
for multiple receivers in contrast with the TCP/IP where sender needs to take care of each packet.
3) There is small packet header overhead in UDP (only 8 bytes) whereas TCP has 20 bytes of
header.
12. Transmission Control Protocol:
The transmission Control Protocol (TCP) is one of the most important protocols of Internet
Protocols suite. It is most widely used protocol for data transmission in communication network
such as internet.
For example, When a user requests a web page on the internet, somewhere in the world, the server
processes that request and sends back an HTML Page to that user. The server makes use of a protocol
called the HTTP Protocol. The HTTP then requests the TCP layer to set the required connection and send
the HTML file.
Now, the TCP breaks the data into small packets and forwards it towards the Internet Protocol (IP) layer.
The packets are then sent to the destination through different routes.

The TCP layer in the user’s system waits for the transmission to get finished and acknowledges once all
packets have been received.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Features

TCP is reliable protocol. That is, the receiver always sends either positive or negative
acknowledgement about the data packet to the sender, so that the sender always has
bright clue about whether the data packet is reached the destination or it needs to resend
it.

TCP ensures that the data reaches intended destination in the same order it was sent.

TCP is connection oriented. TCP requires that connection between two remote points be
established before sending actual data.

TCP provides error-checking and recovery mechanism.

TCP provides end-to-end communication.

TCP provides flow control and quality of service.

TCP operates in Client/Server point-to-point mode.

TCP provides full duplex server, i.e. it can perform roles of both receiver and sender.

Header

The length of TCP header is minimum 20 bytes long and maximum 60 bytes.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Source port

It is a 16-bit field that indicates the port number of the source sending the data.
Destination port

It is a 16-bit field. The destination port is the numerical value indicating the destination port..
Sequence number

It is a 32-bit field that is used to put the data back in the correct order and also used to re-transmit
missing or damaged data segments.
Acknowledgment number

It is a 32-bit field that is used by the receiving host to acknowledge the successful delivery of
segments based on which the next stream of data segments is sent by the source. When the ACK
bit is set, this field contains the next sequence number that the sender of the segment is expecting
to receive. This value is always sent.
Header Length(HLEN)
It is a 4-bit field . This field indicates the length of the TCP header so that we know where the
actual data begins.
Reserved

It is a 3 bits field with value always set to 0.


Window

It is a 16-bit field that is used to negotiate the window size b/w sending and receiving hosts. This
file specifies the number of bytes the receiver is willing to receive. It is used so the receiver can
tell the sender that it would like to receive more data than what it is currently receiving. Window
size is negotiated based on sender and receiver buffers and is negotiated to the lowest value.
Checksum

It is a 16 bits field that is used for integrity checks TCP segment. It is like CRC because TCP
doesn’t trust the lower layers and checks everything. The Cyclic Redundancy Check (CRC)
checks the header and data fields.
Urgent Pointer

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


It is a 16 bits field that indicates the end of urgent data. This field is used when the URG bit is set
in Code bits(flags).
Options

Sets the maximum TCP segment size to either 0 or 32 bits, if any.


Code Bits(Flags)

There are 6 bits in this filed with each have a specific purpose. These Bits are used to establish a
connection between source and destination hosts before sending the data. Some of the fields are
used while sending data and while the connection is terminated with the destination host. Each
bit of the code bits is 1 bit long. Below are the details:
URG Bit
URG bit indicates that the Urgent pointer field is significant. When this bit is set, the data should
be treated as a priority over other data.
ACK Bit

ACK bit used for the acknowledgment of successful delivery of the previous segment.
PSH Bit

PSH Bit is used for Push function. Updates the receiving host to push the buffered data to the
receiving application.
RST Bit

RST bit is used to reset the connection, when the TCP host receives the segment with RST bit set
the connection is reset immediately. This bit is used when there are unrecoverable errors and it’s
not a normal way to finish the TCP connection.
SYN Bit

SYN bit is used during TCP 3 Way handshake process


FIN Bit

FIN bit is used to finish end the TCP connection in a normal way by both sending and receiving
hosts. This bit also specifies end of data.
Disadvantages

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


TCP is made for Wide Area Networks, thus its size can become an issue for small networks
with low resources
TCP runs several layers so it can slow down the speed of the network
It is not generic in nature. Meaning, it cannot represent any protocol stack other than the
TCP/IP suite. E.g., it cannot work with a Bluetooth connection.
No modifications since their development around 30 years ago.

13. Architecture of Bluetooth Low Energy:


BLE (Bluetooth Low Energy) is an open low energy, short range radio technology
designed and maintained by Bluetooth Special Interest Group (SIG). it is a wireless PAN
technology like Bluetooth protocol. BLE operates in the 2.4 GHz ISM (Industrial, Scientific, and
Medical) band, and is targeted towards applications that need to consume less power and may
need to run on batteries for longer periods of time—months, and even years .There are various
versions of bluetooth. The version 4.2 and above is referred as BLE. The latest in the series are
v5.0 and v5.1. BLE specifications are intended to reduce power consumption and cost of devices
while maintaining coverage range. BLE is known as "Bluetooth Smart" where as previous
version is known as "Bluetooth classic".
Major applications focus in healthcare, entertainment, fitness, proximity (car lock, children in
mall). It supported by most of the operating systems which makes it more special, i.e supported
by android, Ios, blackberry.
The architecture of Bluetooth Low Energy is divided into three important layers:

Application
Host
Controller

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


physical layer :
The physical layer is the part that actually contains the analog communications circuitry, capable of modulating
and demodulating analog signals and transforming them into digital symbols. The radio uses the 2.4
GHz ISM (Industrial, Scientific, and Medical) band to communicate and divides this band into 40 channels
from 2.4000 GHz to 2.4835 GHz. • The transmitter uses GFSK modulation.
• Using this PHY layer, BLE offers data rates of 1 Mbps (Bluetooth v4.2)/2 Mbps (Bluetooth v5.0).
• It uses frequency hopping transceiver.

The Link Layer:

This layer sits above the Physical layer. It is responsible for advertising, scanning, and creating/maintaining
connections. The Link Layer is the part that directly interfaces with the physical layer and it is usually
implemented as a combination of custom hardware and software and it defines the main role of the device. it
defines the packet structure and control.

Host Controller Interface (HCI): HCI : It provides communication between controller and host through
standard interface types. This HCI layer can be implemented either using API or by interfaces such as
UART/SPI/USB.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


L2CAP :
The most important layer in the bluetooth stack is Logical Link Control and Adaptation Protocol. this layer
provides two pieces of functionality First, it serves as a protocol multiplexer that takes multiple protocols from
the upper layers and encapsulates them into the standard BLE packet format .
It also performs fragmentation and recombination, a process by which it takes large packets from the upper
layers and breaks them up into chunks o draw a simple comparison.
For Bluetooth Low Energy, the L2CAP layer is in charge or routing two main protocols: the Attribute Protocol
(ATT) and the Security Manager Protocol (SMP)
Attribute Protocol (ATT):
The Attribute Protocol (ATT) is a simple client/server stateless protocol based on attributes presented
by a device. This protocol is used to access the data. In BLE, each device is a client, a server, or both,
irrespective of whether it’s a master or slave. A client requests data from a server, and a server sends data to
clients.

Security Manager (SMP): This security Manager layer provides methods for device pairing and key

distributions. It offers services to other protocol stack layers in order to securely connect and exchange data

between BLE devices.

Generic Access Profile (GAP): This layer directly interfaces with application layer and/or profiles on it. It
handles device discovery and connection related services for BLE device. It also takes care of initiation of
security features. and to allow data exchange to take place between devices from different vendors.
GATT : This layer is service framework which specifies sub-procedures to use ATT. Data communications
between two BLE devices are handled through these sub-procedures.This defines how data or attributes are
formatted, packaged, and sent across connected devices according to its described rules. Similar to GAP,
there are certain roles that interacting devices can adopt:
Client: This typically sends a request to the GATT server. The client can read and/or write
attributes/data found on the server.
Server: One of the main roles of the server is to store attributes/data. Once the client makes a
request, the server must make the attributes/data available.
The Application, is the highest layer and the one responsible for containing the
application logic, user interface, and data handling of everything related to the actual use-case
that the application implements i.e user application sits here, interacts directly with the Bluetooth
stack.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


14. PSOC 4 BLE ARCHITECTURE:

PSoC 4 is a programmable embedded system controller with an ARM Cortex-M0 CPU.


It combines programmable analog, programmable interconnect, user-programmable digital logic,
and commonly used fixed-function peripherals with a highperformance ARM Cortex-M0
subsystem. The PSoC 4xxx-BL family is based on the PSoC 4 architecture which supports
Bluetooth. This is upward-compatible with larger members of PSoC 4.
PSoC 4 devices have these characteristics:
High-performance, 32-bit single-cycle Cortex-M0 CPU core
BLE radio and subsystem
On-chip BLE transceiver
Link layer controller compliant with Bluetooth 4.2

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


Fixed-function and configurable digital blocks
Programmable digital logic
High-performance analog system
Flexible and programmable interconnect
Capacitive touch sensing (CapSense)
Low-power operating modes – Sleep, Deep-Sleep, Hibernate, and Stop modes
Direct memory access (DMA)
The PSoC 4xxx-BL family has these major components:
BLE radio and subsystem
32-bit Cortex-M0 CPU with single-cycle multiply, delivering up to 43 DMIPS at 48 MHz
Up to 256 KB flash and 32 KB SRAM
Direct memory access (DMA)
Four independent center-aligned pulse-width modulators (PWMs) with complementary, dead-
band programmable outputs
Twelve-bit SAR ADC (with a sampling rate of 1 Msps in PSoC 42xx-BL and 806 ksps in PSoC
41xx-BL) with hardware sequencing for multiple channels
Up to four opamps that can be used for analog signal conditioning and as a comparator
Two low-power comparators
Two serial communication blocks (SCB) that can work as SPI, UART, I2C, and local
interconnect network (LIN) slave serial communication channels
Up to four programmable logic blocks, known as universal digital blocks (UDBs)
CapSense.
Segment LCD direct drive
Low-power operating modes: Sleep, Deep-Sleep, Hibernate, and Stop
Programming and debugging system through serial wire debug (SWD)
Fully supported by PSoC Creator IDE tool
COMPONENT DESCRIPTION OF PSOC 4 BLE:
1.CPU System
Processor:
The heart of the PSoC 4 is a 32-bit Cortex-M0 CPU core running up to 48 MHz for PSoC 42xx-
BL and 24 MHz for PSoC 41xx-BL. It is optimized for low-power operation with extensive

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


clock gating. It uses 16-bit instructions and executes a subset of the Thumb-2 instruction set.
This instruction set enables fully compatible binary upward migration of the code to higher
performance processors such as Cortex M3 and M4. The CPU has a hardware multiplier that
provides a 32-bit result in one cycle.
Interrupt Controller:
The CPU subsystem includes a nested vectored interrupt controller (NVIC) with 32 interrupt
inputs and a wakeup interrupt controller (WIC), which can wake the processor from Deep-Sleep
mode. The Cortex-M0 CPU of PSoC 4 implements a non-maskable interrupt (NMI) input, which
can be tied to digital routing for general-purpose use
Direct Memory Access:
The DMA engine is capable of independent data transfers anywhere within the memory map
(peripheral-to-peripheral and peripheral-to/from-memory) with a programmable descriptor chain.
Note: DMA is available only in PSoC 41x8-BL5xx and PSoC 42x8-BL5xx families.
Memory:
The PSoC 4 memory subsystem consists of flash and SRAM. A supervisory ROM, containing
boot and configuration routines, is also present.
Flash :
The PSoC 4 has a flash module, with a flash accelerator tightly coupled to the CPU, to improve
average access times from the flash block. The flash accelerator delivers 85 percent of single-
cycle SRAM access performance on an average.
SRAM: The PSoC 4 provides SRAM, which is retained during Hibernate mode.
System Resources :
Clocking System :
The clocking system for the PSoC 4 device consists of the internal main oscillator (IMO) and
internal low-speed oscillator (ILO) as internal clocks and has provision for an external clock,
external crystal oscillator (ECO), and watch crystal oscillator (WCO). The IMO with an
accuracy of ±2 percent is the primary source of internal clocking in the device. Multiple clock
derivatives are generated from the main clock frequency to meet various application needs. The
ILO is a low-power, less accurate oscillator and is used as a source for LFCLK, to generate
clocks for peripheral operation in Deep-Sleep mode. Its clock frequency is 32 kHz with ±60
percent accuracy.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


An external clock source ranging from 0 MHz to 48 MHz can be used to generate the clock
derivatives for the functional blocks instead of the IMO. The ECO is used to generate a highly
accurate 24-MHz clock without any external components. It is primarily used to clock the BLE
subsystem,
3.Power System :
The PSoC 4 operates with a single external supply in the range 1.71 V to 5.5 V. PSoC 4 has four
low-power modes – Sleep, Deep-Sleep, Hibernate, and Stop – in addition to the default Active
mode. In Active mode, the CPU runs with all the logic powered. In Sleep mode, the CPU is
powered off with all other peripherals functional. In Deep-Sleep mode, the CPU, SRAM, and
high-speed logic are in retention; the main system clock is OFF while the low-frequency clock is
ON and the low-frequency peripherals are in operation. In Hibernate mode, even the low-
frequency clock is OFF and low-frequency peripherals stop operating. Multiple internal
regulators are available in the system to support power supply schemes in different power modes.
GPIO :
Every GPIO in PSoC 4 has the following characteristics:
Eight drive strength modes
Individual control of input and output disables
Hold mode for latching previous state
Selectable slew rates
Interrupt generation – edge triggered
CapSense and LCD drive support PSoC 4 also has two over-voltage tolerant ports , which enable
I2C Fast Mode power down specification compliance and have the ability to connect to higher
voltage buses while operating at lower VDD. The pins are organized in a port that is 8-bit wide.
A highspeed I/O matrix is used to multiplex between various signals that may connect to an I/O
pin. Pin locations for fixedfunction peripherals are also fixed.
4.Bluetooth Low-Energy Subsystem:
PSoC 4xxx Bluetooth Low-Energy (BLE) subsystem integrates the RF transceiver, digital PHY
modem, and link layer controller.
RF Transceiver :
The RF transceiver contains an integrated balun, which provides a single-ended RF port pin to
drive a 50-ohm antenna via a matching/filtering network. In the receive direction, this block

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


converts the RF signal from the antenna to a 1-MHz intermediate frequency and digitizes the
analog signal to 10- bit digital signal. In the transmit direction, this block takes 1 Mbps GFSK
modulated from digital PHY, up-converts it to radio frequency, and transmit it to air through
antenna.
Digital PHY Modem:
In the transmit direction, this sub-block takes the 1-Mbps serial data from the link layer
controller, generates GFSK direct modulated data, and sends it to the BLE analog section. On the
receive side, it takes the 1-MHz IF ADC data from the BLE analog section and uses digital
demodulator to generate the 1-Mbps serial data.
Link Layer Controller :
The link layer controller implements all timing critical functions specified in the Bluetooth Low-
Energy Link Layer specifications (packet framing/de-framing, CRC generation/ checking,
encryption/decryption, state machines, and packet transmission); it also provides interface to the
digital PHY. The communication between link layer hardware and firmware is done through
interrupt, FIFO, and registers.
5.Programmable Digital:
The PSoC 42xx-BL has up to four UDBs. Each UDB contains structured data-path logic and
uncommitted PLD logic with flexible interconnect. The UDB array provides a switched routing
fabric called the digital signal interconnect (DSI). The DSI allows routing of signals from
peripherals and ports to and within the UDBs. The UDB arrays in PSoC 42xx-BL enable custom
logic or additional timers/PWMs and communication interfaces such as I2C, SPI, I2S, and
UART. Fixed-Function Digital
Timer/Counter/PWM Block:
The Timer/Counter/PWM block consists of four 16-bit counters with user-programmable period
length. The functionality of these counters can be synchronized. Each block has a capture
register, period register, and compare register. The block supports complementary, dead-band
programmable outputs. It also has a kill input to force outputs to a predetermined state. Other
features of the block include center aligned PWM, clock pre scaling, pseudo random PWM, and
quadrature decoding.
Serial Communication Blocks:

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


The device has two SCBs. Each SCB can implement a serial communication interface as I2C,
UART, local interconnect network (LIN) slave, or SPI.
The features of each SCB include:
Standard I2C multi-master and slave function
Standard SPI master and slave function with Motorola, Texas Instruments, and National
(MicroWire) mode
Standard UART transmitter and receiver function with SmartCard reader (ISO7816), IrDA
protocol, and LIN
Standard LIN slave with LIN v1.3 and LIN v2.1/2.2 specification compliance
EZ function mode support for SPI and I2C with 32-byte buffer
Analog System
SAR ADC:
PSoC 42xx-BL has a configurable 12-bit 1-Msps SAR ADC and PSoC 41xx-BL has a similar
12-bit SAR ADC with 806 ksps. The ADC provides three internal voltage references (VDDA,
VDDA/2, and VREF) and an external reference through a GPIO pin. The SAR hardware
sequencer is available, which scans multiple channels without CPU intervention.
Continuous Time Block mini:
The Continuous Time Block mini (CTBm) provides continuous time functionality at the entry
and exit points of the analog subsystem. The CTBm has two highly configurable and high-
performance opamps with a switch routing matrix. The opamps can also work in comparator
mode. PSoC 42xx-BL has two such CTBm blocks, while PSoC 41xx-BL has one CTBm block.
The block allows open-loop opamp, linear buffer, and comparator functions to be performed
without external components. PGAs, voltage buffers, filters, and trans-impedance amplifiers can
be realized with external components. CTBm block can work in Active, Sleep, and Deep-Sleep
modes.
Low-Power Comparators:
The PSoC 4xxx-BL has a pair of low-power comparators, which can operate in all device
power modes. This functionality allows the CPU and other system blocks to be disabled while
retaining the ability to monitor external voltage levels during low-power modes. Two input
voltages can both come from pins, or one from an internal signal through the AMUXBUS.
7.Special Function Peripherals

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


LCD Segment Drive:
The PSoC 4 has an LCD controller, which can drive up to four commons and every GPIO can
be configured to drive common or segment. It uses full digital methods (digital correlation and
PWM) to drive the LCD segments, and does not require generation of internal LCD voltages.
1.10.2 CapSense PSoC buttons and sliders. CapSense functionality is supported on all GPIO
pins in PSoC 4 through a CapSense Sigma-Delta (CSD) block. The CSD also provides
waterproofing capability.
IDACs and Comparator:
The CapSense block has two IDACs and a comparator with a 12-V reference, which can be
used for general purposes, if CapSense is not used. 4 devices have the CapSense feature, which
allows you to use the capacitive properties of your fingers to toggle
Program and Debug :
PSoC 4 devices support programming and debugging features of the device via the on-chip SWD
interface. The PSoC Creator IDE provides fully integrated programming and debugging support.
The SWD interface is also fully compatible with industry standard third-party tools.
IoT Protocols

1. Constrained Application Protocol (CoAP)


CoAP is an internet utility protocol for constrained gadgets. It is designed to enable simple, constrained
devices to join IoT through constrained networks having low bandwidth availability.
This protocol is primarily used for machine-to-machine (M2M) communication and is particularly designed
for IoT systems that are based on HTTP protocols.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET


CoAP makes use of the UDP protocol for lightweight implementation. It also uses restful
architecture, which is just like the HTTP protocol. It makes use of dtls for the cozy switch of
statistics within the slipping layer.
2. Message Queue Telemetry Transport Protocol (MQTT)
MQTT (Message Queue Telemetry Transport) is a messaging protocol developed with the aid of Andy
Stanford-Clark of IBM and Arlen Nipper of Arcom in 1999 and is designed for M2M communication. It’s
normally used for faraway tracking in IoT.
Its primary challenge is to gather statistics from many gadgets and delivery of its infrastructure. MQTT
connects gadgets and networks with packages and middleware.
All the devices hook up with facts concentrator servers like IBM’s new message sight appliance. MQTT
protocols paintings on top of TCP to offer easy and dependable streams of information.
These IoT protocols include 3 foremost additives: subscriber, publisher, and dealer. The writer generates the
information and transmits the facts to subscribers through the dealer. The dealer guarantees safety by means
of move-checking the authorization of publishers and subscribers.

Dr.N.GOPALA KRISHNA, HOD-CSE, TIRUMALA ENGINEERING COLLEGE, NARASARAOPET

You might also like