Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Es Notes Unit 5

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

IV B.Tech.

I Sem (R15) ECE : Embedded Systems : UNIT -V 1

UNIT – V

1. serial communication basics-------------------------------------------------------- ---------1


2. UART---------------------------------------------------------- ---------------------------- 3
3. I2C------------------------------------------------------------------------------------------ 7
4. SPI----------------------------------------------------------------------------------------- --------10
5. Embedded Networking fundamentals---------------------------------------------------14
6. IoT overview and architecture------------------------------------------------------------ 15
7. Overview of wireless sensor networks and design examples--------------23
8. Adding Wi-Fi capability to the Microcontroller----------------------------------- 25
9. User APIs for Wireless and Networking applications ---------------------------------
30
10. Case study-1--------------------------------------------------------------------------------------31
11. Case study-2--------------------------------------------------------------------------------------32

1.SERIAL DATA COMMUNICATION - BASICS

Within a micro-computer system, the data transfer is in parallel because it is the fastest
method. But transferring the data over long distances, the parallel data transmission requires too
many wires and it is complicated and expensive. Therefore, the data to be sent for long distances is
converted into serial form so that it can be sent on a single
wire. At the destination, the received serial data is
converted into parallel form so that it can be easily
transferred on the micro-computer buses.

Methods of serial data transmission:

(i) Simplex :

In this mode, the data is transmitted only in one direction over a single communication
channel.

Ex: CPU to CRT display, Key board to CPU, Radio


signal

(ii) Half-dupplex :

In this mode, the data is transmitted in both directions, but only one direction at a time.
i.e., simultaneous data transfer is not possible

Ex: Walkie Talkie

(iii)Full-dupplex :

In this mode, the data transmission takes place in both directions simultaneously.
It requires two channels.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 2

Ex: Telephone communication


Synchronous Vs Asynchronous data transfer modes

Synchronous data transmission Asynchronous data transmission

Transmitter and Receiver are operated Transmitter and Receiver can operated with
with same CLK frequency. different CLK frequency.

SYNC pulses are required START and STOP bits are required

A group of characters can be For each character, the START & STOP bits
transmitted after sending the SYNC are required.
pulses
It is used in low speed data transmission
It is used in high speed data
transmission It is used to exchange data with other
equipment such as PC.
Generally used between CPU and other
devices on the same PCB, as the same
power supply and CLK are used. Ex: UART

Ex: SPI, I2C

UNIVERSAL ASYNCHRONOUS RECEIVER /TRANSMITTER(UART):

 .Asynchronous full duplex serial communication protocol


 .no clk signal is transmitted along with data
 .low data speed in high range
 .uart requires 2-signal lines for communication

TXD-transmit data

RXD-receive data

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 3

SERIAL PERIPHERAL INTERFACE:

 .It is a synchronous full duplex serial communication protocol


 .clk signal is transmitted along with data.
 .It is a 4-wire communication
 .spi requires 4-signal lines for communication

MOSI-MASTER OUT SLAVE IN

MISO-MASTER IN SLAVE OUT

SCLK-SERIAL CLOCK

SS-SLAVE SELECT

Inter integrated circuit:

 .it is a synchronous half duplex serial communication protocol


 .clk signal is transmitted along with data
 .data speed is low range(kbps)
 .it is often called as 2-wire transfer
 .The I2c bus uses only two bidirectional wires for communication.

SDA-SERIAL DATA

SCL-SERIAL CLOCK

2. UART
 .Asynchronous full duplex serial communication protocol
 .no clk signal is transmitted along with data
 .uart requires 2-signal lines for communication

TXD-transmit data

RXD-receive data

The UART features of TM4C123 microcontroller is: -


 UART‟s have programmable baud-rate generator allowing speeds up to 5 Mbps for
regular speed and 10 Mbps for high speed.
 Separate 16x8 transmit (TX) and receive (RX) FIFOs to reduce CPU interrupt service
loading with programmable FIFO length
 Standard asynchronous communication bits for start, stop, and parity, Line-break
generation and detection
 Fully programmable serial interface characteristics
5, 6, 7, or 8 data bits
Even, odd, stick, or no-parity bit generation/detection o 1 or 2 stop bit generation

 IrDA serial-IR (SIR) encoder/decoder providing

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 4

o Programmable use of IrDA Serial Infrared (SIR) or UART input/output


 Support of IrDA SIR encoder/decoder functions for data rates up to 115.2 Kbps half-
duplex
 Support of normal 3/16 and low-power (1.41-2.23 μs) bit durations
 Programmable internal clock generator enabling division of reference clock by 1 to 256 for
low-power mode bit duration

Block diagram of UART:

Simplified block diagram of UART

Uart register description:


UART Control register (UARTCTL)

 RXE (Receive enable): This bit should be enabled to receive data.


 TXE (Transmit Enable): This bit should be enabled to transmit data.
 HSE (High Speed enable): This bit is used to set the baud rate. By default the system clock
is divided by 16 before it is fed to the UART. The user can program HSE =1, to make
system clock divide by 8.
 UARTEN (UART enable): This bit allows user to enable or disable the UART. During the
initialization of the UART registers, this is disabled. To disable UART under any
circumstances, this bit is used.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 5

UART Line Control Register (UARTLCTH)

 STP2 (Stop bit2): Logic 0 -- no of stop bits =1


Logic 1-- no of stop bits =2
 FEN (FIFO Enable): UART has an internal 16-byte FIFO (first in first out) buffer to store
data
 WLEN (Word Length): The number of bits per character data in each frame can be 5, 6, 7,
or 8. we use 8 bits for each character data frame. Default world length mode is 5.
 BRK (Send Break): A Low level is continually output on the UnTx signal, after completing
transmission of the current character. For the proper execution of the break command,
software must set this bit for at least two frames (character periods).
 PEN (Parity Enable): Parity is enabled and parity bit is added to the data frame
 EPS (Even Parity Select): Odd parity is performed, which checks for an odd number of 1s
when EPS = 0.
 Even parity generation and checking is performed during transmission and reception,
which checks for an even number of 1s in data and parity bits when EPS = 1.

UART Data Register (UARTDR)

Data should be placed in data register before transmission. Only lower 8 bits are used.
Another set of register are used to check the source of error.
 OE: Overrun error (OE = 0: No data is lost).
 BE: Break error
 PE: Parity error
 FE: Framing error.

UART Flag Register (UARTFR)

 TXFE (TX FIFO Empty)


 RXFF (RX FIFO Full)
 TXFF (TX FIFOI Full)
 RXFE (RX FIFO empty)
 Busy: When a byte is written to the Data register the busy flag goes high.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 6

Baud Rate Generators: The SFR‟s used in setting the baud rate are UART Integer Baud-Rate
Divisor (UARTIBRD) and UART Fractional Baud-Rate Divisor (UARTFBRD). The block diagram
of the registers is given below:

RCGCUART (UART Run Mode Clock Gating Control): The RCGCUART register is used to
enable the clock to the UART. There is a each bit for each of the UART0 to UART7 modules. To
use UART0, we set to D0 = 1.

UART Transmission Step to perform UART Transmission:


 Program the RCGCUART register to get clock on UART0.
 Program the RCGCGPIO register to get the clock for PORTA.
 Program UARTCTL to disable UART0.
 Program the integer part and fractional part into baud rate registers: UARTIBRD and
UARTFBRD for UART0.
 Program UARTCC to select the system clock as UART clock.
 Set the bits in UARTLCRH register for 1 stop bit, no interrupt, no FIFO use, and for 8-bit
data size (for UART 0).
 Program TxE and RxE in UARTCTL to enable transmitter and receiver.
 Make PA0 and PA1 pins to use as digital pins.  Configure PA0 and PA1 pins for UART.
 Loop the program for wait on TxD output. Monitor the TXFF flag bit and when it goes
low, write a data into data register.

UART Reception Step by Step Execution of UART Reception:


 Program the RCGCUART register to get clock on UART0.
 Program the RCGCGPIO register to get the clock for PORTA.
 Program UARTCTL to disable UART0.
 Program the integer part and fractional part into baud rate registers: UARTIBRD and
UARTFBRD for UART0.
 Program UARTCC to select the system clock as UART clock.
 Set the bits in UARTLCRH register for 1 stop bit, no interrupt, no FIFO use, and for 8 -bit
data size (for UART 0).
 Program TxE and RxE in UARTCTL to enable transmitter and receiver.
 Make PA0 and PA1 pins to use as digital pins.
 Configure PA0 and PA1 pins for UART.
 Loop the program for wait on TxD output. Monitor the TXFF flag bit and when it goes
low, write a data into data register.
 Monitor the RXFE flag bit in UART Flag register and when it goes LOW read the received
byte from Data register and save before it gets overwrite.

3. INTER INTEGRATED CIRCUIT (I2C):

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 7

Inter IC (I2C) Communication Protocol:


Inter IC (i2c) (IIC) is important serial communication protocol in modern electronic systems.
Philips invented this protocol in 1986.
The objective of reducing the cost of production of television remote control motivated Philips to
invent this protocol.
IIC can be used to interface microcontroller with RTC, EEPROM and different variety of sensors.

I2C BUS

IIC protocol uses two pins for data transfer:


Serial Data Line (SDA) and Serial Clock Line (SCL).
The reduction in number of pins in comparison with parallel data transfer is evident.
This reduces the cost of production, package size and power consumption.
IIC is also best suited protocol for battery operated devices.
I²C Protocol
 A simple example of a transfer on I²C is shown in Figure 10.12, where the master reads
asingle byte from the slave.
 Transfers consist of a sequence of 8-bit bytes, which are sent with the MSB first and mustbe
acknowledged to confirm successful reception. The recipient does this by writing afurther
acknowledgment (A) bit of 0 to SDA.

1. The master sends a start condition (S) by pulling SDA low while SCL is high.
2. The master starts the clock and puts the first bit of the address on SDA after SCLhas gone low.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 8

3. The value on SDA is valid after SCL has gone high and is read by all slaves onthe bus.
4. The last two steps are repeated until all 7 bits of the address have been sent.
5. The final bit of the first byte specifies the direction for the rest of the transfer. Hereit is R/W= 1,
which shows that the master wishes to read data from the slave.
6. The ninth bit is the acknowledgment (A or Ack), which is low and is sent by theslave that
recognizes its address.
7. The master must check that a slave acknowledges the address and abort thetransfer if the low
bit is missing.
8. The next 8 clock cycles are used to transmit 1 byte of data from the slave to themaster. The
master continues to provide the clock.
9. The 9th bit would normally be an acknowledgment bit, which signals to the slave that the
master has received sufficient data.
10. There is a final cycle of the clock to set up the stop signal (P). The master sends a stop
condition (S) by pulling SDA high while SCL is high.

I2C in Tiva microcontroller TM4C123GH6PM


The TM4C123GH6PM controller includes four I2C modules with the following features:
Devices on the I2C bus can be designated as either a master or a slave
 Supports both transmitting and receiving data as either a master or a slave
 Supports simultaneous master and slave operation
 Four I2C modes => Master transmit o Master receive o Slave transmit o Slave receive
 Four transmission speeds: o Standard (100 Kbps) o Fast-mode (400 Kbps) o Fast-mode plus
(1 Mbps) o High-speed mode (3.33 Mbps)
 Clock low timeout interrupt
 Dual slave address capability
 Master and slave interrupt generation
 Master with arbitration and clock synchronization, multi-master support, and 7-bit
addressing mode.

Register description in I2C:


Slave Address register:
In a master device, the slave address is stored in I2CMSA. Addresses in I2C communication is 7-
bits. I2CMSA stores D7 to D1 bits and LSB of D0 indicate master is receiver of transmitter.

Data Register:

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 9

Control and Status Flag Register:

4.SERIAL PERIPHERAL INTERFACE(SPI):

Serial Peripheral Interface (SPI)


Serial peripheral interface (SPI) is a serial communication interface originally designed by
Motorola in late eighties.
SPI and I2C came into existence almost at the same time. Most of the modern day microcontrollers
will support SPI protocol.
Both SPI and I2C offer good support for communication with low-speed devices, but SPI is better
suited to applications in which devices transfer data streams.
Some devices use the full-duplex mode to implement an efficient, swift data stream for
applications such as digital audio, digital signal processing, or telecommunications channels, but
most off-the-shelf chips stick to half-duplex request/response protocols.
Description:
 synchronous serial communication protocol like I2C, where master generates clock and
data transfer between master and slave happens with respect to clock.
 Both master and slave devices will have shift registers connected to input (MISO for master
and MOSI for slave) and output (MOSI for master and MISO for slave) as shown in figure.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 10

 Communication between the devices will start after CS (chip select) pin will go low. (CS is
an active low pin). In SPI, the 8-bit shift registers are used. After passing of 8 clock pulses,
the contents of two shift registers are interchanged. SPI is full duplex communication.
 In SPI protocol both master and slaves use the same clock for communication When
CPOL= 0 the idle value of the clock is zero while at CPOL=1 the idle value of the clock is
one.
 CPHA=0 means sample data on the leading (first) clock edge, while CPHA=1 means
sample data on the trailing (second) clock edge. The idle value of the clock is zero the
leading clock edge is a positive edge but if the idle value of the clock is one, the leading
clock edge is a negative edge.
 In SPI protocol both master and slaves use the same clock for communication When
CPOL= 0 the idle value of the clock is zero while at CPOL=1 the idle value of the clock is
one.
 CPHA=0 means sample data on the leading (first) clock edge, while CPHA=1 means
sample data on the trailing (second) clock edge. The idle value of the clock is zero the
leading clock edge is a positive edge but if the idle value of the clock is one, the leading
clock edge is a negative edge.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 11

SPI in Tiva Microcontroller


The TM4C123 microcontroller includes four Synchronous Serial Interface (SSI) modules.
The TM4C123GH6PM SSI modules have the following features:
 Programmable interface operation for Freescale SPI, MICROWIRE, or Texas Instruments
synchronous serial interfaces
 Master or slave operation
 Programmable clock bit rate and prescaler
 Separate transmit and receive FIFOs, each 16 bits wide and 8 locations deep
 Programmable data frame size from 4 to 16 bits
 Internal loopback test mode for diagnostic/debug testing
 Standard FIFO-based interrupts and End-of-Transmission interrupt
 Efficient transfers using Micro Direct Memory Access Controller (μDMA)
 Separate channels for transmit and receive
 Receive single request asserted when data is in the FIFO; burst request asserted when FIFO
contains 4 entries
 Transmit single request asserted when there is space in the FIFO; burst request asserted
 When four or more entries are available to be written in the FIFO.
SPI data Transmission
 To perform SPI data transmission, follow the steps given below:
 Enable the clock to SPI module in system control register RCGCSSI.
 Before initialization, disable the SSI via bit 1 of SSICR1 register.
 Set the Bit Rate with the SSICPSR prescaler and SSICR0 control registers.
 Select the SPI mode, phase, polarity, and data width in SSICR0 control register.
 Set the master mode in SSISCR1 register.  Enable SSI using SSICR1 register.
 Assert slave select signal.
 Wait until the TNF flag in SSISR goes high, then load a byte of data into SSIDR.
 Wait until transmit is complete that is, transmit FIFO empty and SSI not busy.

Register description:

Clock to SSI: RCGCSSI register is used to enable the clock to SSI modules. We need to write
RCGSSI = 0x0F to enable the clock to all SSI modules.

SSICR0 (SSI control register 0):

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 12

SSI Clock Prescaler Register:

Data Register:

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 13

The SSIDR is used for both as transmitter and receiver buffer. In SPI handling 8-bit data, will be
placed into the lower 8-bits of the register and the rest of the register are unused. In the receive
mode, the lower 8-bit holds the received data.

Status Flag Register:


SSISR is used to monitor transmitter/receiver buffer is empty.

5. Embedded networking fundamentals:

Microcontrollers are used to design intelligent embedded systems such as smartphones, netbooks,
digital TVs, mp3 players, smart-watches, smart-sensors, etc. These smart things can be connected
together to form an embedded network that imparts intelligence to bigger things like homes,
buildings, fields, forests and cities.

Embedded networking technologies such as ZigBee, NFC, Bluetooth, Wi-Fi etc. are key elements
in designing internet enabled applications. For example, in a residential set-up, these enable
control of all devices remotely, even if there is no one physically present in the house. Such a
„Smart home’ allows the owner to monitor and control all smart equipment including power
controls, security devices such as surveillance camera, etc. remotely. That is possible by using Wi-
Fi technology, gateway solutions that provide connection to Cloud and of course the Internet to
access the devices. Other typical application areas are monitoring, smart Grid, Smart Transport,
smart plug, wearable devices, health monitoring etc.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 14

Embedded Network and Ethernet:


 Today's embedded systems designers and developers are increasingly asked to incorporate
Ethernet connectivity into their systems. Ethernet's ubiquity and longevity in connecting to
a network makes it an attractive networking choice for embedded systems.
 Ethernet is a local area network (LAN) technology that is widely used to connect
computers using wires or cables.
 Ethernet is similar to Wi-Fi technology, but with a different medium. Ethernet is wired,
and Wi-Fi is wireless.
 Ethernet is based on standards (IEEE802.3) that ensure reliability of network connections
and data transmission and interoperability.
 Ethernet networks are scalable from the simplest to most complex networks or up to 2^48
network nodes.
 Once equipment is connected to an Ethernet network, it can be monitored or controlled
through the Internet removing any distance barrier that may have inhibited remote
communication previously. Based on its ease of use, low cost, high bandwidth, stability,
security and compatibility across devices, Ethernet has become the de facto standard of
network access for 32-, 16- and even 8-bit microcontrollers.

As we see from the below block diagram, MCU and Ethernet controller can make any
device connected to the World Wide Web. Thus it helps in monitor, control or access
devices over internet.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 15

6. INTERNET OF THINGS-OVERVIEW:
 IoT is the internetworking of physical devices (also referred to as connected devices /
smart devices), vehicles, buildings and other items embedded with electronics, software,
sensors, actuators and network connectivity that enable them to collect and exchange data.

 The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and
digital machines, objects, animals or people that are provided with unique identifiers and
the ability to transfer data over a network without requiring human-to-human or human-
to-computer interaction.
 The IoT refers to the ever-growing network of physical objects that feature an IP address
for internet connectivity, and the communication that occurs between these objects and
other Internet-enabled devices and systems.
 IoT refers to physical & virtual objects that have unique identities are connected to internet
to facilitate intelligent applications that make energy, logistic,agriculture & many other
domains smarter.
 Smart devices are also called as “connected devices ” which are designed in such a way
that they capture and utilize every bit of data which you share or use in everyday life.
These devices will use this data to interact with you on daily basis and complete tasks.
These devices will bridge the gap between physical and digital world to improve the
quality and productivity of life, society and industries.

Fundamental components that make IOT a reality are :


Hardware- making physical objects responsive and giving them capability to retrieve data
and respond to instructions
Software - enabling the data collection, storage, processing, manipulating and instructing
Communication Infrastructure- which consists of protocols and technologies which enable
two physical objects to exchange data

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 16

IoT applications
1. Smart home 6. Industrial internet
2. Smart city 7. Connected health
3. Wearable's 8. Smart retail
4. Smart grids 9. Smart supply chain
5. Connected car 10. Smart farming

1. Smart home :
 Smart home is the one in which the devices have the capability to communicate with each
other as well as to their environment.
 A smart home gives owner the capability to customize and control home environment for
increased security and efficient energy management.
 Smart Home products are promised to save time, energy and money. Some of the Smart
home features are
- switch on air conditioning before reaching home
- switch off lights when we have left home
- unlock the doors to friends for temporary access even when you are not at home
- giving regular notifications about your home

2. Smart cities :
 IoT will solve major problems faced by the people living in cities like pollution, traffic
congestion and shortage of energy supplies etc.
 Products like cellular communication enabled Smart Belly trash will send alerts to
municipal services when a bin needs to be emptied.
 By installing sensors and using web applications, citizens can find free available parking
slots across the city.
 Also, the sensors can detect meter tampering issues, general malfunctions and any
installation issues in the electricity system.
 IoT solutions in the area of Smart City solve traffic congestion problems, reduce noise and
pollution and help make cities safer.
 Traffic management
 Water distribution
 Waste management
 Urban security and environmental monitoring
 Smart parking
 Smart street lighting

3. Wearables :
 Wearable devices are installed with sensors and software which collect data and
information about the users. This data is later pre-processed to extract essential insights
about user.
 These devices broadly cover fitness, health and entertainment requirements.
 A wireless enabled wearable device can measures data about person such as the no. of
steps walked.
 These devices can send data to a cloud based service

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 17

 The pre-requisite from internet of things technology for wearable applications is to be


highly energy efficient or ultra-low power and small sized.

4. Smart grids :
 The basic idea behind the smart grids is to collect data in automated fashion and analyze
the behaviour or electricity consumers and suppliers for improving efficiency, reliability,
and economics of electricity use.
 Smart Grids will also be able to detect sources of power outages more quickly and at
individual household levels like nearby solar panel, making possible distributed energy
system.
 Smart grid is an electrical grid which includes a variety of operations & energy measures.
 Smart meters
 Smart appliances
 Renewable energy resources
 Energy efficiency resources
 Power grids of the future will be highly reliable.

5. Connected car :

 A connected car is a vehicle which is able to optimize it’s own operation, maintenance as
well as comfort of passengers using onboard sensors and internet connectivity.
 It also sends information about its location to a cloud based service
 Most large auto makers as well as some brave startups are working on connected car
solutions. Major brands like Tesla, BMW, Apple, Google are working on bringing the next
revolution in automobiles.
Ex: Google’s self driving cars are known to all
Latest Locomotive From GE (250 sensors)

6. Industrial IoT :

 Industrial Internet is the new buzz in the industrial sector, also termed as Industrial
Internet of Things (IIoT). It is empowering industrial engineering with sensors, software
and big data analytics to create brilliant machines.
 The driving philosophy behind IIoT is that, smart machines are more accurate and
consistent than humans in communicating through data.
 IIoT holds great potential for quality control and sustainability.
 IoT automation solutions for industries from all big names like NEC, Siemens, Emerson
and Honeywell are already in the market.
 In the construction industry it is very important to determine the quality of concrete. The
EDC or Embedded Data Collector from Smart Structure helps with this big time.
 Smart Structures’ technology and solutions improve the quality of bridge pilings and deep
foundations while reducing the overall foundation costs

7. Connected health :

 Healthcare is one sector which is supposed to be highly boosted with advent of internet of
things applications.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 18

 Connected health is a model for healthcare delivery that uses technology to provide
healthcare remotely and maximize healthcare resources
 It provides increased flexible opportunities for consumers to engage with clinicians and
better self-manage their care.
 IoT in healthcare is aimed at empowering people to live healthier life by wearing
connected devices.

8. Smart retail :

 The potential of IoT in the retail sector is enormous. IoT provides an opportunity to
retailers to connect with the customers to enhance the in-store experience.
 A smart store is a term that is commonly used to describe the use of smart technologies
in retail . Smart stores usually deliver their services via the Web, smart phone apps,
and augmented reality applications in real stores.
 Smart phones will be the way for retailers to remain connected with their consumers even
out of store.
 They can also track consumers’ path through a store and improve store layout and place
premium products in high traffic areas.

9. Smart supply chain :

 A supply chain is a system of organizations, people, activities, information, and resources


involved in moving a product or service from supplier to customer.
 Supply chain activities involve the transformation of natural resources, raw materials, and
components into a finished product that is delivered to the end customer.
 Applications for tracking goods, real time information exchange about inventory among
suppliers and retailers and automated delivery will increase the supply chain efficiency.

10. Smart Farming: - Agriculture for the future

 The agricultural sector is going to face enormous challenges in order to meet population
growth, climate change, changing diets, changes to seasonal events in the life cycle of plant
and animals and competition for resources.
 One way to address these issues and increase the quality and quantity of agricultural
production is using sensing technology to make farms more “intelligent” and more
connected through the so-called “precision agriculture” also known as ‘smart farming’
 Smartphone applications can help farmers better manage chemical input, watering, and
machinery. Unmanned aerial vehicles can control crop picking. Geospatial technologies are
currently available to help farmers monitor and increase production.

 In practice, smart farming changes the way a farmer works:


 Crops are not only harvested, but also mapped using a combination of sensors,
digital photography techniques, and geospatial technologies
 Soil sensing systems provide information on the variability in soil productivity
status
 Crop sensing technology provides information about canopy characteristics
 Fertilizers/chemicals are allocated more strategically/efficiently by exploiting
spatial variations in soil fertility levels according to local demand

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 19

 Agrochemicals can be sprayed specifically on the crop when they are needed
 New techniques, such as variable rate technologies including sprayers, spreaders,
sensors, controllers, electromagnetic induction methods, geospatial technologies,
ultrasonic sensor systems, and remote sensing can be used

6.1. IoT ARCHITECTURE :

 IoT is the internetworking of physical devices (also referred to as connected devices and
smart devices), vehicles, buildings and other items embedded with electronics, software,
sensors, actuators and network connectivity that enable them to collect and exchange data.

 The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and
digital machines, objects, animals or people that are provided with unique identifiers and
the ability to transfer data over a network without requiring human-to-human or human-
to-computer interaction.

 Internet of things (IoT) can be any object that has a unique identifier and which can
send/receive data over a network. An IOT system comprises of devices that provide
sensing, actuation, and monitoring and control functions. The IoT devices are connected to
the internet and send information about themselves or about their surroundings over a
network.
 An IOT system comprises of a number of functional blocks that provide the system the
Capabilities for identification, sensing, actuation, communication and management as
shown in above figure.

1. Sensors and Actuators


2. Processors
3. Gateways
4. Management

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 20

5. Application

1. Sensors and Actuators :

 These form the front end of the IoT devices. These are the so called “Things” of the system.
Their main purpose is to collect data from its surrounding (sensors) or give out data to its
surrounding (actuators).
 These have to be uniquely identifiable devices with a unique IP address so that they can be
easily identifiable over a large network.
 These have to be active in nature which means that they should be able to collect real time
data. These can either work on their own (autonomous in nature) or can be made to work
by the user depending on their needs (user controlled).
 Sensors can be either on-board the IoT device or attached to the device. The IoT device can
collect various types of information from the on-board or attached sensors such as
temperature, humidity, light intensity, gas sensor, water quality sensor, moisture sensor..
etc. The sensed information can be communicated either to other devices or cloud-based
servers/storage.
 IoT devices can have various types of actuators attached that allow taking actions upon the
physical entities in the vicinity of the device. For example a relay switch connected to an
IoT device can turn an appliance on/off based on the commands sent to the device.

2. Processors Analysis & processing :

 Processors are the brain of the IoT system. Their main function is to process the data
captured by the sensors to extract the valuable data from the enormous amount of raw
data collected. In a word, we can say that it gives intelligence to the data.
 Processors mostly work on real-time basis and can be easily controlled by applications.
These are also responsible for securing the data – that is performing encryption and
decryption of data.
 Embedded hardware devices, microcontroller etc are the ones that process the data
because they have processors attached to it.

3. Gateways :

 Gateways are responsible for routing the processed data and send it to proper locations for
its (data) proper utilization.
 In other words, we can say that gateway helps in to and fro communication of the data. It
provides network connectivity, which is essential for any IoT system to communicate.
 Communication module is responsible for sending collected data to other devices or cloud
based servers/storage and receiving data from other devices and commands from remote
applications.
 This layer needs to have a consistently trusted performance in terms of public, private and
hybrid networks. Different IoT device works on different kinds of network protocols. All
this protocols are required to be assimilated in a single layer. This layer is responsible for
integrating various network protocols.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 21

 The gateway is comprised of embedded OS, Signal Processors and Modulators, Micro-
Controllers etc.
 LAN, WAN, PAN etc are examples of network gateways.

Figure : IOT architecture layers


4. Management:

 The Management Service Layeris responsible for Securing Analysis of IoT devices,
Analysis of Information (Stream Analytics, Data Analytics) and Device Management.
 It also secures the IoT system and by providing functions Such as authentication,
authorization, message and content integrity and data security.
 Data management is required to extract the necessary information from the enormous
amount of raw data collected by the sensor devices to yield a valuable result of all the data
collected. This action is performed in this layer.
 This layer is also responsible for data mining, text mining, service analytics etc.
 The management service layer has Operational Support Service (OSS) which includes
Device Modeling, Device Configuration and Management and many more.
 Also, we have the Billing Support System (BSS) which supports billing and reporting,
IoT/M2M Application Services, Security which includes Access Controls, Encryption,
Identity Access Management, Business Rule Management (BRM) and Business Process
Management (BPM).

5. Applications:
 Application layer forms the topmost layer of IoT architecture which are responsible for
effective utilization of the data collected.
 IOT application provides an interface that the users can to control and monitor various
aspects of the IOT system. Applications also allow users to view the systems status or
analyze the processed data.
 These cloud based applications are responsible for rendering effective meaning to the data
collected. Applications are controlled by users and are delivery point of particular services.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 22

 Examples of applications are home automation apps, e-health, e-governance, security


systems, transportation, industrial control hub etc. 

Smart Environment Application Domains

WLAN stands for Wireless Local Area Network which includes Wi-Fi, WAVE, IEEE 802.11
a/b/g/p/n/ac/ad, and so on
WPAN stands for Wireless Personal Area Network which includes Bluetooth, ZigBee, 6LoWPAN,
IEEE 802.15.4, UWB, and so on.

6. WIRELESS SENSOR NETWORKS:

Wireless Sensor Networks (WSNs) are networks of tiny, battery powered sensor nodes with
limited on- board processing, storage and radio capabilities. Recent advances in micro-electro-
mechanical systems (MEMS) technology, embedded electronics and wireless communication have
made itpossible to develop low-power and low-cost sensor nodes that are small in size and
communicate using wireless medium over short distances. The sensor units in the nodes can sense
any desired parameter (like temperature, pressure humidity, movement etc.) in an area that is
covered by the network. The sensed data is then relayed through the network to the base station,

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 23

where information can be generated and acted upon to serve the purpose for which the network
has been deployed.

WSNs are on the verge of being utilized for many challenging real-life applications like early
earthquake warning systems, battlefield surveillance, environment and habitat monitoring,
healthcare, smart homes and buildings etc... This involves deploying a large number of nodes in
the area to be sensed by the network. This large-scale deployment often requires the nodes to
possess self- organizing capability to form a network without any human intervention. A typical
cluster-based sensor network topology as shown in Fig. consists of a base station, cluster-head
nodes and sensor nodes. The base station is normally connected to the outside world through
internet link or a user terminal.

Various Wireless Protocols and their Applications

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 24

Comparison of different wireless technologies

Near Field Communication (NFC)


NFC is a wireless communication technology that enables two devices to interact when they are in
very close proximity to each other. For example, smartphones and other such devices can use NFC
to interact with NFC-enabled machines (for e.g. battery-charging portals, ticket-vending machines,
ATM, etc.) to exchange information at a distance of less than 10cm.

Zigbee
ZigBee is an industry-standard wireless networking technology that is suitable for applications
that require infrequent low-power data transfer at low data rates within a 100m range, such as
inside a home or a building. It is an IEEE 802.15.4 based specification for a suite of high-level
communication protocols used to create personal area networks (PAN’s) with small, low-power
digital radios. ZigBee- based PAN’s are suitable for applications like - home entertainment and
control, building automation, industrial control and implementing wireless sensor networks. It
operates in the ISM radio bands with data rates that can vary from 20 kbit/s to 250 kbit/s.

Bluetooth
It is an important short-range communication technology that is widely used in smartphones and
many other fixed as well as mobile devices, for data transfer and building personal area networks.
It operates in the 2.4 GHz ISM frequency band and uses frequency hopping spread spectrum
technique. Bluetooth is a packet-based protocol with a master-slave structure. One master may
communicate with upto 7 slaves in a piconet. Two or more piconets can be connected to form a
bigger network, called a scatternet. Bluetooth is widely used in applications like handsfree
headset, smartphone-to-smartphone data transfer, wireless communication between smartphone
and car-stereo system, cable-free connection between PC and I/O modules like mouse, keyboard,
printer etc.

Wi-Fi
Wi-Fi is a wireless local area network (WLAN) technology that allows electronic devices to
network using the 2.4 GHz or 5 GHz ISM radio bands. It is based on the IEEE 802.11 MAC and
physical layer standards for WLAN and is the most pervasive choice for connectivity with the
Internet, especially in the home LAN environment. Wi-Fi supports very fast data transfer rates,
but consumes a lot of power which makes it unviable for low-power applications. Nevertheless,
the embedded networks, wireless sensor network applications and Internet-of-Things
implementations explicitly make use of Wi-Fi as a preferred choice for connectivity to the Internet.

8. Simple Link Wi-Fi Network Processor : CC3100

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 25

The CC3100 device is the industry's first Wi-Fi Certified chip used in the wireless
networking solution. The CC3100 device is part of the new SimpleLink Wi-Fi family that
dramatically simplifies the implementation of Internet connectivity. The CC3100 device integrates

all protocols for Wi-Fi and Internet, which


greatly minimizes host MCU software requirements. With built-in security protocols, the CC3100
solution provides a robust and simple security experience. Additionally, the CC3100 device is a
complete platform solution including various tools and software, sample applications, user and
programming guides, reference designs and the TI E2E support community.

The Wi-Fi network processor subsystem features a Wi-Fi Internet-on-a-Chip and contains
an additionaldedicated ARM MCU that completely offloads the host MCU. This subsystem
includes an 802.11 b/g/nradio, baseband, and MAC with a powerful crypto engine for fast, secure
Internet connections with 256-bitencryption. The CC3100 device supports Station, Access Point,
and Wi-Fi Direct modes. The device alsosupports WPA2 personal and enterprise security and
WPS 2.0. This subsystem includes embeddedTCP/IP and TLS/SSL stacks, HTTP server, and
multiple Internet protocols.The power-management subsystem includes integrated DC-DC
converters supporting a wide range ofsupply voltages. This subsystem enables low-power
consumption modes, such as the hibernate with RTCmode requiringabout 4 μA of current.The
CC3100 device can connect to any 8, 16, or 32-bit MCU over the SPI or UART Interface. The
devicedriver minimizes the host memory footprint requirements requiring less than 7KB of code
memory and 700B of RAM memory for a TCP client application.

Figure (a) CC3100 Hardware (b) CC3100 Software

Features of CC3100 :

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 26

1. CC3100 is a Simple Link Wi-Fi Network Processor with Power-Management Subsystem


2. Dedicated ARM MCU
3. Wi-Fi Driver and Multiple Internet Protocols in ROM
4. 802.11 b/g/n Radio, Baseband, and Access Control (MAC), Wi-Fi Driver and Supplicant
5. TCP/IP and TLS/SSL stacks
6. Industry-Standard Application Programming Interfaces (APIs)
7. Powerful Crypto Engine for Fast, Secure Wi-Fi and Internet Connections with 256-Bit AES
8. WPA2 Personal and Enterprise Security
9. Simple Link Connection Manager for Autonomous and Fast Wi-Fi Connections
10. Host interface : Interfaces with 8, 16, and 32-Bit MCU or ASICs Over SPI or UART Interface
11. ROM Code Memory size is 7KB and Data memory RAM is 700 Bytes.
12. Power Management System :
 Integrated DC-DC Supports a Wide Range of Supply voltages
 VBAT Wide-Voltage Mode: 2.1 to 3.6 V
 Pre-regulated 1.85-V Mode
13. Advanced Low-Power Modes
 Hibernate with RTC : 4 μA
 Low-Power Deep Sleep (LPDS) : 115 μA
 Idle Connected : 690 μA
 RX Traffic (MCU Active) : 53 mA
 TX Traffic (MCU Active) : 223 mA
14. Clock Source
 40 MHz Crystal with Internal Oscillator
 32.768 kHz Crystal or External RTC Clock

15. Ambient Temperature Range: –40°C to 85°C

APPLICATIONS:-
 Connected appliances
 Smart energy
 M2M communication
 Cloud connectivity
 Home automation
 Security systems
 Smart energy
 Access control
 Industrial control
 Internet gateway
 IP Network Sensor Nodes

8. 1Adding Wi-Fi capability to MCU for IoT applications :

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 27

 Microcontroller based design can be easily connected to the internet with Wi-Fi using the
TI Simple Link CC3000/CC3100 network processor module.

 The TI CC3100 module is a self-contained wireless network processor that simplifies the
implementation of Internet connectivity, and it allows your device to connect on a network
using a smart phone, PC or tablet.

 TI’s SimpleLink Wi-Fi solution minimizes the software requirements of the host
microcontroller (MCU) and is thus the ideal solution for embedded applications using any
low-cost and low-power MCU.

 The TI CC3100 module reduces development time, lowers manufacturing costs, saves
board space, eases certification, and minimizes the RF expertise required. This complete
platform solution includes software drivers, sample applications, API guide, user
documentation, and a world-class support community.

 The unit communicates with the host MCU using SPI as the primary interface.

 CC3100 technology can pass information between your design and networked PCs, smart
phones, and tablets with just SPI communication connectivity and basic Wi-Fi connectivity
knowledge.

 This device supports WPA2 personal and enterprise security and WPS 2.0 and Embedded
TCP/IP and TLS/SSL stacks, HTTP server, and multiple Internet protocols.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 28

 The CC3100 device integrates all protocols for Wi-Fi and Internet, which greatly minimizes
host MCU software requirements. With built-in security protocols, the CC3100 solution
provides a robust and simple security experience. 

 The CC3100 device can connect to any 8, 16, or 32-bit MCU over the SPI or UART Interface.

Host Interface :

 Interfaces over a 4-wire serial peripheral interface (SPI) with any MCU or a processor at a
clock speed of 20 MHz.
 Interfaces over UART with any MCU with a baud rate up to 3 Mbps.
 Simple APIs enable easy integration with any single-threaded or multithreaded
application.

(a) SPI Host Interface

 The CC3100BOOST and the MSP430F5529 are connected via the SPI interface as shown in
below. The device interfaces to an external host using the SPI interface.
 The CC3100 device can interrupt the host using the HOST_INTR line to initiate the data
transfer over the interface.
 The SPI host interface can work up to a speed of 20 MHz.

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 29

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 30

9.User APIs for Wireless and Networking applications

An Application Programming Interface (API) is a set of subroutine


definitions, communication protocols, and tools for building software applications. In
general terms, it is a set of clearly defined methods of communication among various
components. Basically, an API specifies how software components should interact.
Just as a graphical user interface (GUI) makes it easier for people to use programs,
application programming interfaces make it easier for developers to use certain
technologies in building applications.

Device API – Manages hardware-related functionality such as start, stops, set, and get
deviceconfigurations.
WLAN API – Manages WLAN, 802.11 protocol-related functionality such as device mode
(station,AP, or P2P), setting provisioning method, adding connection profiles, and setting
policy.
Socket API – The most common API set for user applications, and adheres to BSD socket
APIs.
NetApp API – Enables different networking services including the Hypertext Transfer
Protocol (HTTP) server service, DHCP server service, and MDNS client\server service.
NetCfg API – Configures different networking parameters, such as setting the MAC
address,acquiring the IP address by DHCP, and setting the static IP address.
File System API – Provides access to the serial flash component for read and write
operations of networking or user proprietary data.

Host Interface :

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 31

 Interfaces over a 4-wire serial peripheral interface (SPI) with any MCU or a processor at a
clock speedof 20 MHz.
 Interfaces over UART with any MCU with a baud rate up to 3 Mbps.
 Simple APIs enable easy integration with any single-threaded or multithreaded
application.
 The CC3100BOOST and the MSP430F5529 are connected via the SPI interface as shown in
below.
10.CASE STUDY-1
Tiva based “Sensor Hub BoosterPack”
Weather broadcasting system require some smart technique to monitor the weather conditions of
different places. It is useful for the meteorological department for the detection of the
environmental condition with the help of a balloon.
In this case study we are using four sensors Accelerometer, gyroscope, temperature sensor and
pressure sensor. The Tiva booster pack with various sensors is mounted on the balloon and
accelerometer used for the detection of acceleration of the balloon and gyro scope is used for the
position detection of the balloon and pressure and temperature sensor senses pressure and
temperature of the environment respectively. These all gathered information sent to the ground
station with the help of satellite communication system installed at the balloon and the
meteorological department‟s ground station. The collected information is used for the public
weather broadcasting.

11.CASE STUDY-2
Smart Plug with Remote Disconnect and Wi-Fi Connectivity

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 32

In this application, the WiFi enabled Smart plug helps you to control any connected device from
home or remotely from anywhere in the world with internet access.
It can be used in home appliances like control portable heaters or window ac, turn on a light,
Smart Grid and in building automation.
A smart plug is an electronic device, generally connected to other devices or networks via
different wireless protocols such as Bluetooth, NFC, WiFi, 3G, etc., that can operate to some extent
interactively and autonomously.

The applications like home automation and building automation require two main aspects of
Smart Plug technology.
 Android and cloud based remote access.
 Remote disconnect and Wi-Fi connectivity based upon power consumption.
In this case study the WiFi enabled Smart Plug utilizes a TIVA Launchpad to monitor the energy
consumption for a single load and control the high-voltage side of the design. This data is then
passed to a CC3100 module to communicate the data over Wi-Fi to a Cloud server. A solid state
relay enables the application to control the load, based on its energy consumption. And this
system is powered from a highly compact and efficient UCC28910D High-Voltage Flyback
Switcher with Primary-Side Regulation and Output Current Control.

Texas Instruments UCC2891x High-Voltage Flyback Switcher is dedicated to isolated flyback power supplies and
provides output voltage and current regulation without the use of an optical coupler. The device incorporates a 700V power
FET and a controller that processes operating information from the auxiliary flyback winding and from the power FET to
provide precise output voltage and current control. 

VISVODAYA TECHNICAL ACADEMY :: KAVALI


IV B.Tech. I Sem (R15) ECE : Embedded Systems : UNIT -V 33

VISVODAYA TECHNICAL ACADEMY :: KAVALI

You might also like