You are on page 1of 131

How Communication

(Electromagnetic waves)

Works in Real-Time Projects?


Index content
Nowadays communication plays an essential role in the lives of millions of people as one
can observe the usage of cell phones and other wireless devices for exchanging
information in their daily lives. The wireless communication is the transfer of information
between two or more devices. The process of communication can be enhanced to
communicate the information quickly for long distance transmission and access with a
better quality.

Most of the common wireless technologies use radio waves (electromagnetic waves) for
transmitting the data. The communication has changed the dynamics of working
environment and workforce mobility. A professional can do work anywhere through a
wireless communication without sticking at a fixed location.

Therefore, this eBook is intended to give a brief idea of wireless technologies and their
practical implementation on real-time projects. We assure that the given theory and its
real-time implementing with hardware and software modules will certainly prove helpful
for the students and for those who are working on wireless modules.

Different wireless technologies given in this book are popular and predominant in several
applications, and therefore, necessarily ought to be known for the communication
specialists' students as well as hobbyists. In this eBook, each concept is discussed in brief
along with the step-by-step procedures of connecting wireless modules, which are
particularly highlighted in this document with some simple programming concepts.

- Edgefx Technologies

2
Table of Contents
Chapter 1
Why Communication is Required For Real Time Projects
1.1 Wireless Technology 8
1.1.1 Transmitter and Receiver 8
1.1.2 Transceivers 8
1.2 Wireless Communication for Real Time Projects 11
1.3 Advantages of Wireless Communication 11

Chapter 2
Basics of Wireless Communication
2.1 Basic Definitions 11
2.2 Importance of Modulation in Communication System 12
2.2.1 Modulation 12
2.2.2 Why Modulation is used in Communication 13
2.2.3 Different Types of Modulation 14
2.2.4 Analog Modulation 14
2.2.5 Types of Analog Modulations 14
2.2.6 Digital Modulation 16
2.2.7 Types of Digital Modulation 18
2.3 Wireless Sensor Networks in Communication (WSN) 19
2.3.1 Wireless Network Topologies in Communication (WSN) 20
2.3.2 Wireless Sensor Networks Applications 20
2.4 Network Communication Protocols 20
2.4.1 Serial Communication Protocols 21
2.4.2 Types of Serial Communication Protocols 24
2.4.3 Serial Peripheral Interface Protocol (SPI) 24
2.4.4 Practical Example of SPI Communication Protocol 28
2.4.5 Significance of RS-232 Communication Cable in Serial Communication 29
2.4.6 MAX-232 Usage in Serial Communication 33
2.5 Importance of Microwave Antennas in Communication System 34
2.5.1 Classification of Microwave Antennas 34
2.6 Open System Interconnection for Communication Networks (OSI mode) 38

3
Chapter 3
Design and Analysis of Transmitters and Transceivers in Wireless Modules
3.1 Wireless Communication with Transmitters 41
3.2 Design and Construction of Transmitter Modules 41
3.2.1 Block Diagram Explanation 42
3.3 Wireless Communication with Receivers 44
3.3.1 Block Diagram Explanation 45
3.4 Wireless Communication with Transceivers 46
3.4.1 Design and Construction of Transceiver Modules 46
3.4.2 Block Diagram Explanation 47

Chapter 4

Various Types of Efficient Communication Systems at the Cheapest Cost to Develop


Low-Cost Projects
4.1 Different Types of Communications 49
4.2 Sub-GHz Wireless Development 49
4.3 2.4 GHz Wireless Development 50

Chapter 5

Sub-GHz Wireless Communication with Transmitter and Transceivers


5.1 A. Sub-GHz Communication with Transmitters 51
5.1.1 Radio Frequency communication (RF) 51
5.1.1.2 RF Transmitter and Receiver Working Procedure 52
5.1.2 IR Transmission Communication (Infrared Signals) 52
5.1.2.1 Types of IR Communication 53
5.1.2.2 IR Transmitter and Receiver Working Procedure 53
5.1.2.3 Advantages of IR Communication 54
5.1.3 Radio Frequency Identification Communication (RFID) 54
5.1.3.2 Types of RFID Systems 55
5.1.3.3 A Passive RFID System Using Induction Coupling Method 55
5.1.3.4 A Passive RFID System Using EM Wave Propagation Method 56
5.1.3.5 Active RFID System Working Procedure 56

4
5.1.4 Global Position System Communication (GPS) 57
5.1.4.1 How Does GPS System Work? 57
5.2 B. Sub-GHz different Transceiver Protocols: (below 1GHz) 58
5.2.1 Global System for Mobile Communication Protocol (GSM) 58
5.2.1.2 GSM Architecture 59
5.2.2 En Ocean Wireless Communication Transceiver Module 60
5.2.3 IO-Home control Communication Transceiver Module 61
5.2.4 ONE-NET Communication Transceiver module 61
5.2.5 Z-Wave Communication Transceiver module 62

Chapter -6

2.4-GHz Wireless Communication with Transceivers


6.1 2.4-GHz Wireless Communication with Transmitters 63
6.1.1 Wi-Fi Wireless Communication Protocol 63
6.1.1.2 Wi-Fi Transceiver Module 64
6.1.1.3 Working Principle of W-Fi 65
6.1.1.4 Types of WI-FI Technologies 66
6.1.2 Bluetooth Wireless Communication Protocol 68
6.1.2.1 Bluetooth Transceiver Module 68
6.1.2.2 Bluetooth Specifications 69
6.1.2.3 Advantages of Bluetooth Technology 70
6.1.2.4 Bluetooth Applications 71
6.1.3 Zigbee Wireless Communication Protocol 72
6.1.3.1 Zigbee Architecture 73
6.1.3.2 Zigbee Operating Modes and Its Topologies 75
6.1.3.3 Zigbee Topologies 76
6.1.3.4 Applications of Zigbee Technology 77
6.1.4 6LowPan Protocol Transceiver Module 78
6.1.4.1 6LoWPan Working Procedure 79
6.1.4.2 Difference between Zigbee and 6LowPan protocols 80
6.1.5 IEEE802.15.4 Protocol 80
6.1.5.1 IEEE802.15.4 Architecture 81

5
6.1.6 Wireless Hart Protocol Transceiver module 83
6.1.6.1 Wireless Hart Working Procedure 84
6.1.7 ANT Protocol Transceiver Module 86
6.1.8 Ultra-low power Transceiver Module 86

Chapter-7

Practical Implementation of Wireless Module


7.1 Introduction 87
7.2 Implementation of 6LowPan Wireless Transceiver Module 87
7.2.1 Introduction to 6LowPan 87
7.2.2 6LowPAN Stack Layers 88
7.3 Step-by-Step Procedure of Developing a 6LowPan
Wireless Transceiver 96

Chapter-8

Interfacing GSM Module with Microcontroller


8.1 Introduction to GSM Modem 107
8.2 GSM Modem Interfacing 107
8.3 Steps for Connecting the GSM Modem to the Microcontroller 108
8.4 Working Procedure of GSM Modem 113

Chapter-9

Interfacing GPS Module with Microcontroller


9.1 Introduction to GPS Module 114
9.2 How GPS Determines a Position 114
9.3 Steps for Interfacing GPS Module to the Microcontroller 115
9.4 Working Procedure 118

6
Chapter-10

Interfacing RF Module with Microcontroller


10.1 Introduction to RF module 119
10.2 Interfacing RF module to the Microcontroller 119
10.3 Circuit Connections 119
10.4 RF Transmitter and Receiver Working Procedure 121

Chapter-11

Interfacing Zigbee Module with Microcontroller


11.1 Introduction to Zigbee 123
11.2 Zigbee Module Interfacing to the Microcontroller 124
11.3 Circuit Connections 124
11.4 Zigbee Protocol Working Procedure 124

Chapter-12

Interfacing Bluetooth Module with Microcontroller


12.1 Introduction to Bluetooth 127
12.2 Interfacing Bluetooth Module to the Microcontroller 127
12.3 Circuit Connections 127
12.4 Working Procedure of Bluetooth 128
12.5 Programming 129

7
Chapter 1

Why the Communication Is Required For Real-Time Projects?

1.1 Wireless Technology


The wireless communication has become a major feature for most of the electronic
products. The wireless technology is a process of sending information through invisible
waves in the air. Information such as data, voice and videos are carried through the radio
frequency of the electromagnetic waves. These electromagnetic signals are transmitted
by an enabled device to air or physical environment. The receiver captures these signals
and creates a communication bridge between the sender and receiver device.

Exchanging the information between two or more devices is called as a wireless


communication; and, it is possible by wireless devices. There are many wireless devices
available in the market today, such as RF, Zigbee, RFID, GPS, Bluetooth, GSM, etc. Each one
has its own advantages and disadvantages. The communication is possible in one way or
two ways wherein one way communication is implemented with the transmitter and
receiver devices and two-way communication is by the transceiver devices.

1.1.1 Transmitter and Receiver


The transmitters and receivers are two different devices that can be operated with
same frequency. They can easily fit into breadboards and work well with
microcontrollers to create a very simple wireless data link. This is a simple
communication wherein devices perform either transmitting or receiving
operation.

1.1.2 Transceivers
The transceiver is a combination of transmitter and receiver in a single package
such as mobile phone and cordless phones in which it is possible to communicate
both sides and work with different frequencies.

8
1.2 Wireless Communication for Real-Time Projects
Most of the real-time projects control various load parameters or variables based on
the input data conditions. A wireless communication is required for these projects to
carry the virtual information between the machinery to the control room. Consider the
below given projects for wireless technology usage.

Vehicle's Theft Location's Intimation to the Owner by GPS/GSM: This system


consists of a GPS modem which retrieves vehicle's location information in terms of
longitude and latitude values. In an event of a vehicle missing, the GPS modem sends the
vehicle information to the concerned authority's number by SMS through a GSM modem.
This is enhanced by GPS and GSM wireless communications.

Industrial Robot: In a pharmaceutical industry, it is impossible for humans to work in


places and areas where bad or foul smell
emanates and also in chemical environments;
hence, robots can perform the desired
operations in place of human beings. Therefore,
to control such a robot in desired positions with
desired movements, communication is
necessary by using RF and Zigbee technologies.

9
1.3 Advantages of Wireless Communication

Mobility: A user need not to stick at one place, but can access the communication
services at different places with mobile devices.

Flexibility: The wireless controlled devices can be placed where there is no provision or
need for any wire to transmit and receive data. Wireless devices thus provide more
flexibility for unique applications.

Speed: Sharing and transferring files within a network is very fast and thus saves time
while maintaining the reliability of the data.

Cost-Effective: The wireless communication requires software, which is easy to install.


Wired technology requires buried cables. If a buried cable gets damaged, it requires
repair or replacement, and therefore, the cost of maintenance will be high.

10
Chapter 2
Basics of Wireless Communication

In order to reach the top of a mountain, we must have to start from the bottom or lower
part of it. Prior to knowing about the communication and its complex procedures and
interfacing, we have to know about some of its basic concepts and information. So, this
chapter gives a brief idea on basic definitions, modulation concept, basic protocols, OSI
model, and so on.

2.1 Basic Definitions


Radio: A radio system usually includes both: a source of electromagnetic wave, and an
intended destination for that message. A source radio is referred to as the transmitter
while the destination radio is referred to as the receiver.

Frequency: The time taken to execute a number of electromagnetic wave cycles per sec
is called as frequency.

Electromagnetic spectrum: The electromagnetic spectrum is the range of all possible


frequencies of an electromagnetic radiation.

Band frequency
The grouping of radio frequencies is called band frequencies, which are used by wireless
communications like GSM, GPS, RF, Zigbee and other wireless communications systems.
A high-frequency band phone supports communication over long distances. The band
frequency is measured in Hertz. For example, a GSM network works with around
1900MHz; RF communication works with around 433 MHZ frequency.

Band Width
The difference between the upper frequency and the lower frequency is called band
width like 400 MHz – 868 MHz. A communication device works normally within a given
range and disconnects the communication outside the range of the frequency band,
which is observed by the base-band filter in the wireless module.

ISM (Industrial/Scientific/Medical)
The ISM bands are various sections of the RF spectrum set aside worldwide by the
governing bodies, such as the Federal Communications Commission (FCC) in the U.S. The
most common uses of these ISM bands include RFIDs, Bluetooth, RFIS, cordless phones
and Wi-Fi.

11
System on Chip (SoC)
RF-system-on-a-chip (i.e., “RF-SoC”) means
that the RF/analog/digital circuits are all
integrated with their memory blocks and
microprocessors/DSP integrated on a single
chip. The primary advantage of a single-chip
RF-SoC is that the component is less
susceptible to external noise pickup, cost-
effective and have long life.

2.2 Importance of Modulation in Communication System


We are living in an era of communication wherein we can easily transfer any information
(video, audio and other data) in the form of electrical signals to any other device or
destined area. Although it is common in our perceptual experience that sending or
receiving signals or data is simple, but it involves quite complex procedures, possibilities
and scenarios within the communication systems.

Modulation plays a key role in communication system to encode information digitally in


analog world. It is very important to modulate the signals before sending them to the
receiver section for larger distance transfer, accurate data transfer and low-noise data
reception.

2.2.1 Modulation
Modulation is a process of changing the characteristics
of the wave to be transmitted by superimposing the
message signal on the high-frequency signal. In this
process, video, voice and other data signals modify Modulation in
high-frequency signals – also known as carrier wave. communication system

This carrier wave can be DC or AC or pulse chain depending on the application used.
Usually a high-frequency sine wave is used as a carrier-wave signal.

12
2.2.2 Why Modulation Is Used in Communication?
In modulation technique, the message signal frequency is raised to a range so that it is
more useful for transmission. The following points describe modulation’s importance in a
communication system:

Ÿ In signal transmission, the signals from various sources are transmitted through a
common channel simultaneously by using multiplexers. If these signals are
transmitted simultaneously with certain bandwidth, they cause interference. To
overcome this, speech signals are modulated to various carrier frequencies in order
for the receiver to tune them to desired bandwidth of its own choice within the range of
transmission.

Ÿ Another technical reason is antenna size; the antenna size is inversely proportional to
the frequency of the radiated signal. The order of the antenna aperture size is at least
one by tenth of the wavelength of the signal. Its size is not practicable if the signal is 5
KHz; therefore, raising frequency by modulating process will certainly reduce the
height of the antenna.

Ÿ Modulation is important to transfer the signals over large distances, since it is not
possible to send low-frequency signals for longer distances.

Ÿ Similarly, modulation is also important to allocate more channels for users and to
increase noise immunity.

Need of modulation

13
2.2.3 Different Types of Modulation
There are two types of modulation: analog and digital modulation. These techniques
have already been discussed. In both the techniques, the baseband information is
converted to radio frequency signals, but in analog modulation these RF communication
signals have continuous range of values, whereas in digital modulation these are in
prearranged discrete states.

2.2.4 Analog Modulation


In this modulation, a continuously varying sine wave is used as a carrier wave that
modulates the message signal or data signal. The sinusoidal wave’s general function is
shown in the figure below, in which, three parameters can be altered to get modulation –
they are amplitude, frequency and phase, so the types of analog modulations are:

Ac cos(2πƒ ct+ Φ)
Analog Modulation

Amplitude Phase
Frequency

Angle
(Frequency = Rate of Change of Angle)

2.2.5 Types of Analog Modulations


ª Amplitude Modulation (AM)

ª Frequency Modulation (FM)

ª Phase modulation (PM)

14
Amplitude Modulation: The amplitude of the carrier wave is varied in proportion to
the message signal and the other factors like frequency and phase remain constant. The
modulated signal is shown in the below figure, and its spectrum consists of lower-
frequency band, upper-frequency band and carrier-frequency components. This type of
modulation requires greater band width, and more power. Filtering is very difficult in this
modulation.

Types of Analog Modulations

Frequency Modulation (FM): FM varies the frequency of the carrier in proportion to


the message or data signal while maintaining other parameters constant. The advantage
of FM over AM is the greater suppression of noise at the expense of bandwidth in FM. It is
used in applications like radio, radar, telemetry seismic prospecting, and so on. The
efficiency and bandwidths depend on modulation index and maximum modulating
frequency.

15
Phase Modulation: the carrier phase is varied in accordance with the data signal. In
this type of modulation, when the phase is changed, it also affects the frequency, so this
modulation also comes under frequency modulation.

Analog modulation (AM, FM and PM) is more sensitive to noise. If noise enters into a
system, it persists and gets carried till the end receiver. Therefore, this drawback can be
overcome by the digital modulation technique.

2.2.6 Digital Modulation


For a better quality and efficient communication, digital modulation technique is
employed. The main advantages of the digital modulation over analog modulation
include permissible power, available bandwidth and high noise immunity. In digital
modulation, a message signal is converted from analog to digital message, and then
modulated by using a carrier wave.

The carrier wave is keyed or switched on and off to create pulses such that the signal is
modulated. Similar to the analog, here the parameters like amplitude, frequency and
phase variation of the carrier wave decide the type of digital modulation.

2.2.7 Types of Digital Modulation


Digital modulation is of several types depending on the types of signal and applications
used such as Amplitude Shift Keying, Frequency Shift Keying, Phase Shift Keying,
Differential Phase Shift Keying, Quadrature Phase Shift Keying, Minimum Shift Keying,
Gaussian Minimum Shift Keying, Orthogonal Frequency Division Multiplexing, etc., as
shown in the figure.
Amplitude shift keying changes
the amplitude of the carrier
wave based on the base-band
signal or message signal, which
is in digital format. It is used for
low-band requirements and is
sensitive to noise.

Types of Digital Modulations

16
In frequency shift keying, the frequency of the carrier wave is varied for each symbol in
the digital data. It needs larger bandwidths as shown in the figure. Similarly, the phase
shift keying changes the phase of the carrier for each symbol, and it is less sensitive to
noise.

Digital Modulation

To avoid making this description complex, some mathematical equations and in-depth
information about digital communication systems have been exempted from it.

17
2.3 Wireless Sensor Networks in Communication (WSN)
In recent years, an efficient design of a Wireless Sensor Network (WSN) has become a
leading area of research. A sensor is a device that responds and detects some type of
input from both the physical or environmental conditions, such as pressure, heat, light,
etc. The output of the sensor is generally an electrical signal that is transmitted to a
controller for further processing.

A wireless sensor network can be defined as a network of devices that can communicate
the information gathered from a monitored field through wireless links. The data is
forwarded through multiple nodes, and with a gateway, the data is connected to other
networks like wireless Ethernet.

18
2.3.1 Wireless Network Topologies in Communication (WSN)
For radio communication networks, the structure of a WSN includes various topologies
like the ones given below:

Star Topologies
Star topology is a communication topology, where each node connects directly to a
gateway. A single gateway can send or receive a message to a number of remote nodes. In
star topologies, the nodes are not permitted to send messages to each other. This allows
low-latency communications between the remote node and the gateway (base station).

Due to its dependency on a single node to manage the network, the gateway must be
within the radio transmission range of all the individual nodes. The advantage includes
the ability to keep the remote nodes’ power consumption to a minimum and simply
under control. The size of the network depends on the number of connections made to
the hub.

Tree Topologies
Tree topology is also called as cascaded star topology. In tree topologies, each node
connects to a node that is placed higher in the tree, and then to the gateway. The main
advantage of the tree topology is that the expansion of a network can be easily
possible, and also error detection becomes easy. The disadvantage with this network
is that it relies heavily on the bus cable; if it breaks, all the network will collapse.

19
Mesh Topologies
The mesh topologies allow transmission of data from one node to another, which is
within its radio transmission range. If a node wants to send a message to another node,
which is out of radio communication range, it needs an intermediate node to forward the
message to the desired node. The advantage with this mesh topology includes easy
isolation and detection of faults in the network. The disadvantage is that the network is
large and requires huge investment.

2.3.2 Wireless Sensor Networks Applications


Ÿ These networks are used in environmental tracking, such as forest detection, animal
tracking, flood detection, forecasting and weather prediction, and also in commercial
applications like seismic activities prediction and monitoring.

Ÿ Military applications, such as tracking and environment monitoring surveillance


applications use these networks. The sensor nodes from sensor networks are
dropped to the field of interest and are remotely controlled by a user. Enemy tracking,
security detections are also performed by using these networks.

Ÿ Health applications, such as tracking and monitoring of patients and doctors use these
networks.

Ÿ The most frequently used wireless sensor networks applications in the field of
transport systems such as monitoring of traffic, dynamic routing management and
monitoring of parking lots, etc., use these networks.

Ÿ Rapid emergency response, industrial process monitoring, automated building


climate control, ecosystem and habitat monitoring, civil structural health monitoring,
etc., use these networks.

2.4 Network Communication Protocols


Electrically-coded information is called as serial data, which is transmitted bit-by-bit from
one device to another through a set of protocols. In the embedded system, control
sensors and actuators data is received or transmitted to the controller devices such as
microcontrollers so that the data is further analyzed and processed. As the
microcontrollers work with the digital data, the information from analog sensors,
actuators and other peripherals is converted into one byte (8-bit) binary word prior to
being transmitted to the microcontroller.

20
Serial Data Communication

This serial data is transmitted with respect to certain clock pulse. The data transmission
rate is referred to as the baud rate. The number of data bits that can be transmitted per
second is called as baud rate. Suppose the data is of 12 bytes, and then each byte is
converted into 8 bits so that the total size of the data transmission is about 96 bits/sec of
the data (12bytes*8 bits per byte). If the data can be transmitted once every second, the
baud rates are around 96 bits/sec or 96 baud. The display screen refreshes the data value
once every second.

2.4.1 Serial Communication Protocols


Introduction:
Protocol: A set of rules and regulations followed to transfer data is called as a protocol.
Communication: Exchange of information from one system to another system with a
medium is called a communication. medium is called a communication.
Communication Protocol: A set of rules and regulations that allow two electronic
devices to connect to exchange the data with each other.

2.4.2 Types of Serial Communication Protocols


There are two types of communication protocols that are classified as below:

1. Inter System Protocol

2. Intra System Protocol

21
1. Inter System Protocol: The inter system protocol is used to communicate two
different devices like communication between a computer and a microcontroller kit. The
communication is done through an interbus system.

Different Categories of Inter System Protocol


Ø UART Protocol
Ø USART Protocol
Ø USB Protocol

2. Intra System Protocol: The intra system protocol is used to communicate two devices
within a circuit board. While using this intra system protocol, the complexity of the
communication is reduced by expanding the peripherals. The circuit complexity and
power consumption can be increased by using intra system protocol. Using intra system
protocols circuit, the complexity and power consumption cost can be decreased, and it is
very secure for accessing data.

Different Categories of Intra System Protocol


Ø I2C Protocol
Ø SPI Protocol
Ø CAN Protocol

22
UART Protocol:
UART stands for universal asynchronous transmitter and receiver. UART Protocols is a
serial communication with two-wired protocol. The data-cable signal lines are labeled as
Rx and Tx. Serial communication is commonly used for transmitting and receiving the
signal. It transfers and receives the data serially bit-by-bit without class pulses. The UART
take bytes of data and sends the individual bits in sequential manner. UART is a half-
duplex protocol. Half-duplex means transferring and receiving the data, but not at the
same time. Most of the controllers have hardware UART on board. It uses a single data
line for transmitting and receiving the data. It has one start bit, 8-bit data and one stop bit
mean the 8-bit data transfer ones signal is high to low.

Ex: Emails, SMS, Walkie-Talkie, etc.

UART Protocol Data Flow

USART Protocol
USART stands for universal synchronous and asynchronous transmitter and receiver. It is
a serial communication of two-wire protocol. The data-cable signal lines are labeled as Rx
and TX. This protocol is used for transmitting and receiving the data byte-by-byte along
with the clock pulses. It is a full-duplex protocol means transmitting and receiving data
simultaneously to different board rates. Different devices communicate with
microcontroller with this protocol.

23
Ex: Telecommunications.

USART Protocol Data Flow

2.4.3 Serial Peripheral Interface Protocol (SPI)


The SPI communication stands for serial peripheral interface communication protocol,
which was developed by the Motorola in 1972. SPI interface is available on popular
communication controllers such as PIC, AVR, and ARM controller, etc. It has synchronous
serial communication data link that operates in full-duplex, which means, the data
signals carry on both the directions simultaneously.

SPI protocol consists of four wires such as MISO, MOSI, CLK, SS used for master/slave
communication. The master is a microcontroller, and the slaves are other peripherals like
sensors, GSM modem and GPS modem, etc. Multiple slaves are interfaced to the master
through a SPI serial bus. The SPI protocol does not support the multi-master
communication, and it is used for a short distance within a circuit board.

Serial Peripheral Interface Basics

24
MISO (Master in Slave out): The MISO line is configured as an input in a master device
and as an output in a slave device.
MOSI (Master out Slave in): The MOSI is a line configured as an output in a master device
and as an input in a slave device wherein it is used to synchronize the data movement.
SCK (Serial clock): This signal is always driven by the master for synchronous data
transfer between the master and the slave. It is used to synchronize the data movement
both in and out through the MOSI and MISO lines.
SS (Slave Select) and CS (Chip Select): This signal is driven by the master to select
individual slaves/Peripheral devices. It is an input line used to select the slave devices.

Master Slave Communication with SPI Serial Bus


1. Single Master and Single Slave SPI Implementation
Here, the communication is always initiated by the master. The master device first
configures the clock frequency which is less than or equal to the maximum frequency
that the slave device supports. The master then selects the desired slave for
communication by dragging the chip select line (SS) of that particular slave device to go
low state and active. The master generates the information on to the MOSI line that
carries the data from the master to the slave.

Master Slave Communication

25
2. Single Master and Multiple Slave Implementations

This is a multiple slave configuration


with one master and multiple slaves
through the SPI serial bus. The
multiple slaves are connected in
parallel to the master device with
the SPI serial bus. Here, all the clock
lines and data lines are connected
together, but the chip select pin
from each slave device must be
connected to a separate slave select
pin on the maser device.
Single Master and Multiple Slaves

In this process, the control of each slave device is performed by a chip select line (SS). The
chip select pin goes low to activate the slave device and goes high to disable the slave
device.
The data transfer is organized by using the shift registers at both the master and slave
devices with a given word size of about 8-bit and 16-bit, respectively. Both the devices are
connected in a ring form so that the maser shift register value is transmitted through the
MOSI line, and then the slave shifts data in its shift register. The data is usually shifted out
with the MSB first and shifting new LSB into the same register.

Data Transfer between Master and Slave

26
Significance of Clock Polarity and Phase
Generally the transmission and reception of data is performed with respect to the clock
pulses at the rising edges and falling edges. The Advanced microcontrollers have two
frequencies: internal frequency and external frequency. The SPI peripherals can be
added by sharing the MISO, MOSI and SCLK lines. The peripherals are of different types or
speeds like ADC, DAC, etc. So, we need to change the SPCR settings between the transfers
to different peripherals.

SPCR Register

The SPI bus operates in one of the 4 different transfer modes with a clock polarity (CPOL)
and clock phase (CPHA) which defines a clock format to be used. The clock polarity and
the phase clock rates depend on which peripheral device you are trying to communicate
with the master.
CPHA=0, CPOL=0: The first bit starts as a lower signal – the data is sampled at rising edge
and the data changes on falling edge.
CPHA=0, CPOL=1: The first bit starts with a lower clock – the data is sampled at falling
edge and the data changes on rising edge.
CPHA=1, CPOL=0: The first bit starts with a higher clock – the data is sampled at falling
edge and the data changes on rising edge.
CPHA=1, CPOL=1: The first bit starts with a higher clock – the data is sampled at rising
edge, and the data changes on falling edge.

27
SPI Bus Timings

Practical Example of SPI Communication Protocol:


Many microcontrollers have inbuilt SPI protocols that handle all of the sending and
receiving data. Any of the data mode operations (R/W) is controlled by a control and
status registers of the SPI Protocol. Here, you can observe the EEPROM interface to the
PIC16f877a microcontroller through the SPI protocol.
Here, 25LC104 EEROM is a 131072 bytes memory wherein the microcontroller transfers
two bytes of data to the EEROM memory through a SPI serial bus. The program for this
interfacing is given below.

Master Slave Communication through a SPI Serial Bus

28
#include<pic16f877x.h>
Sbit SS =RC^2
Sbit SCK= RC^3
Sbit SDI= RC^4
Sbit SDO= RC^5
Void initialize EEROM();
Void main()
{
SSPSPAT=0×00;
SSPCON=0×31;
SMP=0;
SCK=0;
SDO=0;
SS=1;
EE_adress=0×00;
SPI_write(0×80);
SPI_write(1234);
SS=0;
}

Advantages of SPI Protocol


Ø It is a full-duplex communication.
Ø It is high-speed data bus 10MHzs.
Ø It is not limited to 8bits while transferring
Ø Hardware interfacing is simple through SPI.
Ø Slave uses a master clock and doesn’t need precious oscillators.

2.4.5 Significance of RS-232 Communication Cable in Serial Communication


The RS-232(X) is a communication cable, commonly used for transferring and receiving
the serial data between two devices. It supports both synchronous and asynchronous
data transmissions. Many devices in the industrial environment are still using RS-232
communication cable. Rs-232 cable is used to identify the difference of two signal levels
between the logic 1 and logic 0. The logic 1 is represented by -12V, and the logic 0 is
represented by +12V.

29
RS-232 Cable

The RS-232 cable works at different baud rates like 9600 bits/s, 2400bits/s, 4800bits/s,
and so on. The RS-232 cable has two terminal devices namely Data Terminal Equipment
and Data Communication Equipment. Both the devices send and receive the signals. The
data terminal equipment is a computer terminal, and the data communication
equipment is a modem, or controller.

Nowadays most of the personal computers have two serial ports and one parallel port
(Rs232). These two types of ports are used for communicating with the external devices,
and they work in different ways. The parallel port sends and receives an 8-bit data at a
time over eight separate wires and this transfers the data very quickly. The parallel ports
are typically used to connect a printer to a PC.
A serial port sends and receives one-bit data at a time over one wire and transfers data
very slowly. The RS-232 stands for recommended standard and 232 is a number X, which
indicates the latest versions like RS-232c, Rs232s.

30
The most commonly used type of serial cable connectors are 9-pin connector DB9 and
25-pin connector DB-25. Each of them may be male or female type. Nowadays most of
the computers use DB9 connector for asynchronous data exchange. The maximum
length of RS-232 cable is 50ft.

Pin Description

It is a 25-pin connector, and each pin has its own function, which is as follows:
PIN 1: (Protective Ground); It is a ground Pin.
PIN 2: Transmits data
PIN 3: Receives data
PIN 2 & PIN 3: These pins are most important pins for data transmission and reception.
The 1 & 2-pins are used for transmitting data, and the pin-3 is used for data receiving
purpose.
PIN 4: Request to send
Pin 5: Clear to send
PIN 6: Data Set Ready
PIN 20: Data terminal Ready

31
PIN 4, PIN 5, PIN 6, and PIN 20: These pins are the handshaking pins (flow of control).
Normally terminals cannot transmit the data until a clear to send transmission signal is
received from the DCE.
PIN 7: This pin is the common reference for all signals, including data, timing, and control
signals. The DCE and DTE work properly across the serial interface. The pin-7 must be
connected to both ends as without interface it will not work.
PIN 8: This pin is also known as received line signal detect or carrier detect. This signal is
activated when a suitable carrier is established between the local and remote DCE
devices.
PIN9: This pin is DTE serial connector; this signal follows the incoming ring to an extent.
Normally this signal is used by a DCE auto answerable mode.
PIN 10: Test Pin.
PIN 11: stand by select.
PIN 12: Data Carrier Detect.
PIN 13: Clear to send.
PIN 14: Transmit data.
PIN 15: Transmit clock.
PIN 17: Receive clock.
PIN 24: External clock
PIN 15, 17, 24; Synchronous modems use the signals on these pins. These pins control
bit timing.
PIN 16: Receive data.
PIN 18: Test Pin.
PIN 19: (Signal Quality Detector); This pin Indicates the quality of the received carrier
signal because the transmitting modem must be send 0 or either 1 at each bit time , the
modem controls the timing of the bits from the DTE.
PIN 21 (Signal Quality Detector): This pin indicates the quality of the received carrier
signal because the transmitting modem must be send 0 or either 1 at each bit time. The
modem controls the timing of the bits from the DTE.
PIN 22(Ring Indicator): A ringing indicator means the DCE informs the DTE that the
phone is ringing. All the modems designed for direct connection to a phone network are
equipped with auto answer.
PIN 23: Data Signal Rate Detector.

32
2.4.6 MAX-232 Usage in Serial Communication
The Max 232 IC consists of two transmitter-receiver arrangement such that two serial
ports can be connected using the same chip. 5 capacitors of each 1microFarad are used
to generate the required RS232 standard voltage from the TTL/CMOS voltage. The
transmitters convert the TTL/CMOS level to RS232 level, whereas the receiver receives the
RS232 input and converts that to TTL level voltage.

MAX-232 with Serial Cable

Applications of Max 232


Typical applications of Max232 involve modems, computers, RS232 systems and
terminals. For a typical working application involving Max 232 as an intermediate
between the microcontroller and the RS 232 connected to the computer, one of the
transmitter input pins receives TTL input from the Microcontroller, and the capacitor
arrangement obtains the +/-10V signal, which is applied to the corresponding transmitter
output pin given to the RS232 port.

The receiver input pin receives 232 standard input from the RS232 port and accordingly
the corresponding receiver output pin gives the TTL standard output to the
microcontroller. Thus, the Max 232 IC can be used as an intermediate connection
between a microcontroller and a computer.

33
2.5 Importance of Microwave Antennas in Communication System
A system used for transferring the data between persons and equipment is called
communication system. The system usually consists of individual communication
networks, relay stations, transmission system, terminal equipment, interconnection
cable and inter-operations performing as an integrated whole.
Antenna plays a crucial role in this communication system, which is used to transmit and
receive the data. The classification of the antenna is based on the specifications like
frequency, polarization, radiation, etc.
The antenna that is operated at microwave frequency is knows as microwave antenna.
There are different types of microwave antennas over a wide range of applications
including home- communication-based applications.

2.5.1 Classification of Microwave Antennas


1. Micro Strip Patch Antenna
2. Horn Antenna
3. Parabolic Antenna
4. Plasma Antenna
5. MIMO Antenna

All the above types of antennas, their importance and applications are briefly discussed
below:

1. Micro Strip Patch Antenna


These antennas are also known as patch antennas. A micro-strip patch antenna consists
of a radiating patch that is bonded to a dielectric substrate on one side and has a ground
plane on the other side.
The patch is generally composed of conducting materials like copper or gold. The
operational frequency of these antennas range between 100 MHz and 100 GHz. Due to
the advantages like less weight, low volume and low fabrication cost, these antennas can
be manufactured in large quantities.
The micro strip patch antennas are well-known for their performance and extent of
usage. The usage of micro-strip antennas in the wide range could take over the usage of
conventional antennas in applications.
There are several applications that use the micro-strip patch antennas, such as global
positing satellites, cellular phones, personal communication system and paging devices.

34
All the above types of antennas, their importance and applications are briefly discussed
below.
1. Micro Strip Patch Antenna
These antennas are also known as patch antennas. A micro strip patch antenna consists
of a radiating patch that is bonded to a dielectric substrate on one side and has a ground
plane on the other side.
The patch is generally composed of conducting materials like copper or gold. The
operational frequency of these antennas range between 100 MHz and 100 GHz. Due to
the advantages like less weight, low volume and low fabrication cost, these antennas can
be manufactured in large quantities.
The micro strip patch antennas are well-known for their performance and extent of
usage. The usage of micro strip antennas in the wide range could take over the usage of
conventional antennas in applications.
There are several applications that use the micro-strip patch antennas, such as global
positing satellites, cellular phones, personal communication system and paging devices.

35
2. Horn Antenna
The Horn antenna or Microwave Horn is an antenna consisting of a waveguide whose end
walls are flared outside to form a megaphone like structure, as shown in the below figure.
These horns are widely used as antennas at ultra-high frequencies and microwave
frequencies that are well above 300 MHZ.

Horn Antenna

These are used to measure the gain of other antennas as calibrating antennas and
directive antennas for devices like automatic door openers and microwave-radio meters.
The advantages of the horn antenna include moderate directivity, low-standing wave
ratio and broad bandwidth. The gain of horn antenna ranges upto 25 db.These are
extensively used at microwave frequency when the power gain needed is moderate.

3. Parabolic Antenna
A parabola antenna is an antenna that uses a parabolic reflector, a curved surface with
cross sectional shape of a parabola to direct the radio waves. The shape of the antenna is
in the form of a dish; therefore, it is popularly known as dish antenna or parabolic dish.
High directivity is the main advantage of the parabolic antenna.

These antennas find their applications as high-gain antennas for point-to-point


communication and also as radio telescopes. In addition to this, the parabolic antennas
are also used as radar antennas because in radars there is a need for transmitting a
narrow beam of radio waves to local objects like ships, airplanes, etc.

36
Parabolic Antenna

4. Plasma Antenna
A plasma antenna is a type of radio antenna in which the plasma is used as a
development element instead of the metal elements that are used in traditional antenna.
It uses ionized gas as a conducting material because this gas ionizes when transmission
or reception takes place.

The Plasma antennas can be used for both


transmission and reception of the radio
signals as they are capable of operating up
to 90 GHz frequency range.
The plasma antenna has high-frequency
cutoff .It can transmit and receive high and
low-frequency signals while not interacting
with the high-frequency signals. The
applications of the plasma antenna are
high speed digital communications,
electronic intelligence, RFID, 4G and radar
systems.

37
5. MIMO Antenna
In radio, multiple-inputs and multiple-outputs or MIMO are used, and therefore, the
multiple antennas are used at both the transmitter and receiver ends to improve
communication’s performance. It is one of the smartest antenna technologies.

MIMO Antenna
MIMO Antenna
The multiple antennas in MIMO can be exploited in two ways: one is for the creation of
highly effective antenna directivity, and the other is for transmitting the parallel data
streams to increase the capacity of the system. The applications of the MIMO antennas
are mesh networks and RFID systems.
The above described various micro-wave antennas are essential devices in wireless
communication systems and also in satellite, radio and radar communications.

2.6 Open System Interconnection for Communication Networks (OSI Mode)


Any wireless module developed with OSI layers for transferring and receiving the
information between networked systems is an open system interconnection. The
OSI model consists of 7-layers such as:

38
1. Application layer
2. Presentation layer
3. Session layer
4. Transport layer
5. Network layer
6. Data link layer
7. Physical layer

Whenever a group of tasks is assigned to a system, the OSI layers divide the task, and then
assign it for each of the 7-layers for sending the information between networked
systems. Each layer is reasonably self-contained so that the tasks assigned to each layer
can be implemented independently. Most wired and wireless systems use at least the
first four layers, but many do not use all seven layers of the OSI model. If you want to
implement any wireless module, you can develop the code for the required layer using a
“Contiki” operating system.

Application Layer:
The application layer provides the application services for file transfers, email and
other network software services.

Presentation Layer:
The presentation layer is responsible for the delivery and formatting of
information to the application layer for further processing. The presentation layer
converts the data from the application task to a network format and vice versa,
and then sends to the network so that the application layer can accept it.

39
Session Layer
This layer launch for manages and terminates connections between applications.
The session layer sets up, coordinates, and terminates conversations, exchanges,
and dialogues between the applications at each end.
Transport Layer
This layer provides transparent transfer of data between end systems, or hosts,
and is responsible for end-to-end error recovery and flow control. It ensures
complete data transfer.
Network Layer
Network layer provides data routing paths for network communication. Data is
transferred in the form of packets via logical network paths in an ordered format
controlled by the network layer.
Data Link Layer
At this layer, data packets are encoded and decoded into bits. It supplies
transmission protocol information and handles errors in the physical layer, flow
control and frame synchronization. The data link layer is divided into two sub
layers:
The Media Access Control layer: The MAC layer is responsible for moving the
packets of data to the network nodes.
Logical Link Control (LLC) layer: The LLC layer controls frame synchronization, flow
control and error checking of data.
Physical Layer
The physical layer deals with the bit-level transmission between different devices
and supports electrical or mechanical interfaces by connecting to the physical
medium for synchronized communication. It provides the hardware means of
sending and receiving data on a carrier, including defining cables, cards and
physical aspects. Fast Ethernet, RS232, and ATM are protocols with physical layer
components.

40
Chapter 3

Design and Analysis of Transmitters and Transceivers in Wireless


Modules

3.1 Wireless Communication with Transmitters


A Radio system usually includes a source of electromagnetic wave with a planned
destination for that message. A source radio is referred to as the transmitter while the
destination radio is called the receiver which is designed and assembled from core
components. There are many wireless transmitters and receivers available such as RF,
Zigbee, Bluetooth, GT (FM), etc., which are interfaced to process the data from source to
destination – as an example – the digital data transfer from the microcontroller to the
receiver.

3.2 Design and Construction of Transmitter Modules


The transmitter modules like RF, RFID, GPS, etc., are constructed with Mixer or modulator,
crystal oscillator, power amplifier and filter circuits. The transmitters work with the
analog signals so we cannot directly interface to the digital devices like
microcontrollers/processors – but, here we need an external device, which is called as a
decoder.

Wireless Transmitter

41
3.2.1 Block Diagram Explanation
The block diagram mainly consists of three blocks that are microcontroller block, digital
to analog converter and transmitter blocks.

Microcontroller Block
This block is constructed with a microcontroller like PIC, 8051, AVR and ARM based on the
requirement for controlling the application. The microcontroller is a digital device: it
sends and receives only digital data like ‘0’ and ‘1s.’

Digital to Analog Converter


A digital to analog converter converts digital data into equivalent analog voltage or
current. The digital to analog converter is made with Op-Amp and binary biased
registers, as shown in the figure. In the circuit, the op-amp is connected in an inverting
mode. The circuit diagram represents 4- digits converter.
For example, the digital device generates ‘1101’ binary value that convents to give a
corresponding analog value like 13v.

D/A Converter

42
Wireless Transmitter Module
Modulator
Modulation is a process in which a modulator changes some quality of the higher-
frequency carrier signal related to a lower-frequency signal, and then mixes the high-
frequency signals in the modulator.

Amplifier
An amplifier is an electronic device that increases the signal power. There are four basic
types of amplifiers such as voltage amplifier, current amplifier, conductance amplifier
and power amplifier. The power amplifier is a basic amplifier that receives electrical
signals and processes them to amplify.

Power Amplifier

Band Pass Filter


A band-pass filter is a device that
passes frequencies within certain
range and rejects frequencies
outside the range. The main
function of the band-pass filter is to
limit the bandwidth of the output
signal to the band allocated for
transmission.
Band Pass Filter

43
Antenna:

The antenna is an electrical device that performs two functions in communication:

For transmission of a signal, radiofrequency's electrical energy from the transmitter is


converted into electromagnetic energy by the antenna and radiated into the surrounding
environment (atmosphere, space, water).

For reception of a signal, electromagnetic energy imposes on the antenna is converted


into radio-frequency, electrical energy and fed into the receiver."

Operation of Transmitters:
The Transmitter module is interfaced to the microcontroller with the help of a decoder.
The microcontroller sends digital data to the decoder. The decoder converts the binary
data into a current signal which passes through the modulator wherein high-frequency
signals from the oscillator are also received. These two signals are mixed, and then
passed through the amplifier. Amplifying the transmission signals through an amplifier
increases the strength of the signals. The band pass filter allows the signals with two
specific frequencies like 433MHz – 868 MHz to pass and reject the frequencies outside the
range. The antenna radiates power in the air.

3.3 Wireless Communication with Receivers


Design and Construction of Reciever Modules:
The Receiver modules are constructed with Band-pass filter, Low-noise amplifier, Mixer,
low- pass filter and an analog to digital converter. The receivers working with the analog
signals such as current signals or voltages cannot be directly interfaced to the digital
devices that need some external devices such as encoders.

Wireless receiver

44
3.3.1 Block Diagram Explanation
The block diagram mainly consists of three blocks: microcontroller, analog to digital
converter and receiver blocks.

Microcontroller Block:
This block is constructed with a microcontroller like PIC, 8051, AVR and ARM depending
on the requirement for controlling the application. The microcontroller is a digital device;
it sends and receives only digital data like ‘0’ and ‘1s'.

Analog to Digital Converter:


We already know that analog-to-digital
(ADCs) converters are the most widely used
devices to translate analog signals to digital
numbers so that a microcontroller can read
them easily. There are many ADC converters
like ADC0801, ADC0802, ADC0803, ADC0804
and ADC080. As an example, the below figure
depicts an ADC0804 converter. The above
ADC0804 converter is a very commonly used
8-bit analog to digital converter. It works with
0V to 5V analog input voltage. It has a single Analog to Digital converter

analog input and 8-digital outputs. Conversion time is yet another major factor in judging
the ADC. In an ADC0804, the conversion time varies depending on the clocking signals
applied to the CLK R and CLK IN pins, but it cannot be faster than 110 μs.

A Wireless Receiver Module


Low Noise Amplifier (LNA):
A Low-noise amplifier is an electronic amplifier placed at the front-end of a radio receiver
circuit to amplify a week signal by capturing it from an antenna. The effect of noise from
the subsequent stages of a receiver chain is reduced by the gain of the LNA. Boosting of a
desired signal power while adding as little noise and distortions as possible is possible
with a LNA amplifier. A good LNA has a low NF for example 1db and a large enough gain of
20db.

45
Low-Pass Filter
A low-pass filter is a filter that passes low-frequency signals and reduces the amplitude of
the signals with frequencies higher than the cut of frequencies.

Testing Procedure of Receivers


The A receiver module is interfaced to the microcontroller with the help of an encoder.
The band pass filter allows certain frequency signals sent by the transmitter. The low-
noise amplifier is used for increasing the signal strength and reducing the noise. The
mixer generates high frequency signal by mixing the week signal with the high frequency
signal (OSC). The ADC converts the current signals into digital signals like 0 and 1s format
to control the applications by the processor.

3.4 Wireless Communication with Transceivers


The transceivers make with both transmitter and receivers within a single chip to transmit
and receive the information in both ways like video, audio, text etc. In radio transceivers, a
user is able to perform a wide range of functions for both the receiver and host of signals
on radio frequencies. There are various kinds of transceivers available such as RF,
Bluetooth, Zigbee, Wi-Fi, GSM, etc., which are interfaced to process the data from the
source to destination.

3.4.1 Design and Construction of Transceiver Modules


The transceiver modules are constructed with Mixer, oscillator, power amplifier, band-
pass filter, low-noise amplifier and low-pass filter. The transceivers work with two signals
such as analog signal (current, voltage) and digital signal (0 or 1s). The transceivers consist
of inbuilt ADC and DAC units, and therefore, don’t need any external devices for
processing the data and converting it into digital or analog data.

Wireless Transceivers

46
3.4.2 Block Diagram Explanation
Digital to Analog Converter
The digital to analog converter converts digital data into equivalent analog voltage or
current. The digital to analog converter has Op-Amp and binary-biased registers, as
shown in the figure. In the circuit, the op-amp is connected in an inverting mode.

Modulator:
Modulation is a process in which a modulator changes some qualities of a higher-
frequency carrier signal related to a lower-frequency signal and mixes the signals.

Amplifier:
An amplifier is an electronic device that increases the signal power. There are four basic
types of amplifiers: voltage amplifier, current amplifier, conductance amplifier and
power amplifier. The power amplifier is a basic amplifier that receives the electrical
signals and processes them to amplify.

Band-Pass Filter
The band-pass filter is a device that passes frequencies within certain range and rejects
frequencies outside the range. The main function of the band-pass filter is limiting the
bandwidth of the output signal to the band allocated for transmission.

Antenna:
The antenna is an electrical device that does the following two functions in
communication:

Ÿ For transmission of a signal, radiofrequency's electrical energy from the transmitter is


converted into electromagnetic energy by the antenna and radiated into the
surrounding environment (atmosphere, space, and water).
Ÿ For the reception of a signal, the electromagnetic energy imposed on the antenna is
converted into radio-frequency electrical energy and fed into the receiver.

47
Low Noise Amplifier (LNA)
A Low-noise amplifier is an electronic amplifier placed at the front-end of a radio receiver
circuit to amplify a week signal by capturing it from an antenna. The effect of the noise
from the subsequent stages of a receiver chain is reduced by the gain of the LNA.
Boosting of a desired signal power while adding as little noise and distortions as possible
is possible with a LNA amplifier. A good LNA has a low NF for example 1db and a large
enough gain of 20db.

Low Pass Filter


A low pass filter is a filter that passes low-frequency signals and reduces the amplitude of
signals with the frequencies high than the cut of frequencies.

Analog to Digital Converter


We already know that analog-to-digital (ADCs) converters are the most widely used
devices for securing information and to translate analog signals to digital numbers so
that a microcontroller can read them easily. There are many ADC converters like
ADC0801, ADC0802, ADC0803, ADC0804 and ADC080.

Testing Procedure of Transceivers


The transceivers are interfaced to the microcontrollers without requiring any help of
driver ICs. The information is transmitted and received by the antenna through
electromagnetic waves at certain frequencies. The transmission and reception is not
possible at a time by the transceivers. The microcontroller sends the digital data and
transceiver converts that digital to analog signals through ADC which is then send to the
air by the microwave antennas. This data received by the other transceiver controls the
application or load.

48
Chapter 4
Various Types of Efficient Communication Systems at Cheaper Cost
to Develop Low-Cost Projects

4.1 Different Types of Communications


Many of the communication applications work based on a simple point-to-point
connection with low-data rate requirement (below 100kbits/s) or simple node
connections that collect and transmit a limited volume of data to a central control. For
these applications, most of the developers choose different radio-band operations which
are:

Ÿ 2.4GHz Wireless development


Ÿ Sub-GHz Wireless development

4.2 Sub-GHz Wireless Development: (0-999MHz)


A Sub-GHz wireless communication provides a cost-effective solution in a low-data
system that forms simple point-to-point communications with very large mesh networks.
For low-data-rate applications, such as home security or automation and smart-metering
systems, the Sub-GHz wireless systems offer several advantages, including long-range
applicability and reduced power consumption.

Advantages of Sub-GHz Wireless Communication


Ø Supports long distance communication
Ø Consumes very less Power
Ø Reduces the cost of development for long-range applications.
Ø Works without requiring batteries

Sub-GHz: Different Transmitter and Transceiver Modules


Transmitters:
Ø RF Protocol Module
Ø IR Protocol Module
Ø RFID Protocol Module
Ø GPS Protocol Module

49
4.3 2.4 GHz Wireless Developments: (2.4GHz)
The 2.4GHz wireless communication can provide cost-effective solutions in a high-data
system that forms simple point-to-point communications with small mesh networks.
For high-data rate applications, such as home security and data acquisition systems,
the 2.4 GHz wireless systems offer several advantages including short-range and
reduced-power consumption.

2.4 GHz Different Transceiver Modules


The 2.4GHZ is the frequency of the radio signal that allows you to sit anywhere
surrounding it to access information. The 2.4GHz supported different transceivers'
protocols include the following:
Ø WI-FI Protocol (802.11a,802.11b) Transceiver Module
Ø Bluetooth Protocol Transceiver Module
Ø Zigbee protocol Transceiver Module
Ø 6lowPan Protocol Transceiver Module
Ø Ultra-low-power Transceiver Module
Ø Wireless Hart Protocol Transceiver module
Ø ANT Protocol Transceiver Module
Ø Atmel AT86RF230-ZU Protocol Transceiver Module

Wi-Fi, Bluetooth and Zigbee technologies are heavily marketed. 2.4 GHz protocols are
used extensively in today's market.

Transceivers:
Ø GSMProtocol Module
Ø EnOcean Protocol Transceiver Module
Ø io-homecontrol Protocol Transceiver Module
Ø ONE-NET Protocol Transceiver module
Ø INSTEON Protocol Transceiver module
Ø Z-Wave Protocol Transceiver module

50
Chapter 5
Sub-Hz Wireless Communication with Transmitter and Transceivers

5.1 A. Sub-GHz Communications with Transmitters


5.1.1 Radio Frequency communication (RF)
In general, a wireless systems' designer has two overriding constraints: the system
must operate over a certain distance and transfer a certain amount of information
within a data rate. The RF modules are very small in dimension and have a widely
operating voltage range, i.e., 3V to 12V.

Basically the RF modules are 433 MHz, RF transmitter and receiver modules. The
transmitter draws no power when transmitting logic zero while fully suppressing the
carrier frequency, and thus, consumes significantly low power in a battery operated
mode. When logic one is sent, the carrier is fully on to about 4.5mA with a 3volts power
supply. The data is sent serially from the transmitter, which is then received by the tuned
receiver. The transmitter and receiver are duly interfaced to two microcontrollers for
data transfer.

RF Transmitter and Receiver

Features of RF Module:

Ø Receiver frequency: 433MHz Ø Receiver operating voltage: 5v


Ø Receiver t y p i c a l f re q u e n c y : Ø Transmitter frequency range: 433.92MHz
Ø Transmitter supply voltage: 3v~6v
105Dbm
Ø Transmitter output power: 4v~12v
Ø Receiver supply current: 3.5mA
Ø Low-power consumption

51
5.1.1.2 RF Transmitter and Receiver's Working Procedure
In many projects, we use RF modules for transmitting and receiving data because they
have high volumes of applications than IR. The RF signals travel in the transmitter and
receiver even when there is an obstruction. They operate at a specific frequency of
about 433MHz.

The RF transmitter receives serial data and transmits the data to the receiver through an
antenna which is connected to the 4th pin of the transmitter. When logic 0 is applied to
the transmitter, then there is no power supply in the transmitter. When logic 1 is applied
to the transmitter, then the transmitter gets on, and there is a high-power supply in the
range of 4.5mA with a 3V voltage supply.

5.1.2 IR Transmission Communication: (Infrared Signals)


IR Transmitter (IR Sensor)
These sensors can be utilized as a part of measuring the radiation temperature
without being in contact. For different radiation temperature ranges, various filters
are available. An infrared (IR) sensor is an electronic device that radiates or locates
infrared radiations to sense some parts of its surroundings. The Infrared radiations are
undetectable to human eyes.

An infrared sensor can be considered as a Polaroid that briefly recalls how an area’s
infrared radiation shows up. It is very regular for an infrared sensor to be coordinated into
movement indicators like those utilized as a feature of private or business security
systems. An IR sensor is shown in the figure; basically it has two terminals: positive and
negative. These sensors are undetectable to human eyes. They can measure the heat of
an object and also identify its movement. The wavelength region around 0.75µm to 1000
µm is the IR region. The wavelength region around 0.75µm to 3 µm is called close infrared;
3 µm to 6 µm is called mid infrared; and, higher than 6 µm is called far infrared. IR sensors
emit a frequency of 38 KHz.

52
5.1.2.1 Types of IR Communication
There are two types of Infrared communication:

Point to Point: It requires a line of sight between the transmitter and a receiver. In other
words the transmitter and the receiver should be pointed to each other and there
shouldn’t be any obstacles between them. Example is the remote control
communication.

Diffuse Point: It doesn’t require any line of sight and the link between the transmitter
and the receiver is maintained by reflecting or bouncing of the transmitted signal by
surfaces like ceilings, roof, etc. Example is a wireless LAN communication system.

5.1.2.2 IR Transmitter and Receiver Working Procedure


IR transmission:
The transmitter of an IR LED inside its circuit emits infrared light for every electric pulse
given to it. This pulse is generated as a button on the remote is pressed, thus completing
the circuit, providing bias to the LED.

IR communication Working Principle

The LED on being biased emits light of the wavelength of around 940nm as a series of
pulses, corresponding to the button pressed. However, along with the IR LED many other
sources of infrared light including human beings, light bulbs, sun, etc., interfere with the
transmitted information. A solution to this problem is through modulation. The
transmitted signal is modulated using a carrier frequency of 38 KHz (or any other
frequency between 36 to 46 KHz). The IR LED is made to oscillate at this frequency for the
time duration of the pulse. The information or the light signals are pulse width modulated
and are contained in the 38 KHz frequency.

53
IR Reception
This receiver consists of a photo detector that develops an output electrical signal as light
incident on it. The output of the detector is filtered using a narrow-band filter that
discards all the frequencies below or above the carrier frequency (38 KHz in this case).
The filtered output is then given to the suitable device like a Microcontroller or a
Microprocessor which controls the devices like a PC or a Robot. The output from the
filters can also be connected to the Oscilloscope to read the pulses.

5.1.2.3 Advantages of IR communication


Security: Infrared communication has high directionality and is capable of identifying
the source as a different source emitting radiation of different frequencies, and thus, the
risk of information being diffused is eliminated.

Safety: Infrared radiation is not harmful to human beings. Hence, infrared


communication can be used at any place.

High Speed data Communication: Data Communication: The data rate of Infrared
communication is about 1Gbps and can be used for sending information like video signal.

5.1.3 Radio Frequency Identification Communication (RFID)


Defining RFID
RFID or Radio Frequency Identification System is a technology based identification
system that helps identifying objects just through the tags attached to them, without
requiring any line of sight between the tags and the tag reader. All that is needed is a radio
communication between the tag and the reader.

5.1.3.1 A Basic RFID System


The RFID System consists of mainly three components such as:
A RFID tag: It consists of a silicon microchip attached to
a small antenna and mounted on a substrate and
encapsulated in different materials like plastic or glass
veil and with an adhesive on the back side, which is used
to attach the tags to objects.

RFID Tag

54
A reader: It consists of a scanner with antennas to transmit and receive signals and is
responsible for communication with the tag and receives the information from the tag.

RFID Reader

A Processor or a Controller: It can be a host computer with a microprocessor or a


microcontroller which receives the reader input and processes the data.

5.1.3.2 Types of RFID Systems


The RFID System is of two types:

Active RFID system: In these systems, the tags have their own power sources like
external power supplies units or batteries. The only constraint is the life time of the power
devices. These systems can be used for larger distances and to track high-value goods like
vehicles.

Passive RFID system: These are the systems wherein the tags get power through the
transfer of power from a reader antenna to the tag antenna. They are used for short-
range transmission.
Here, we are mostly concerned with the passive RFID system as it is most widely used in
regular applications like in retail market organizations.

5.1.3.3 A Passive RFID System Using Induction Coupling Method


In this approach, the RFID tag gets power from a reader through an inductive coupling
method. The reader consists of a coil connected to an AC supply such that a magnetic
field is formed around it. The tag coil is placed in the vicinity of the reader coil and an
electromotive force is induced to it by virtue of Faraday’s law of induction.

55
The EMF causes a flow of current in the coil, thus producing a magnetic field around it.
By the virtue of Lenz law, the magnetic
field of the tag coil opposes the reader’s
magnetic field and there is a subsequent
increase in the current through the
reader coil. The reader intercepts this as
load information. This system is suitable
for very short distance communication.
The AC voltage appearing across the tag
coil is converted to a DC by using a
rectifier and filter arrangement.
Passive RFID using inductive coupling

5.1.3.4 A Passive RFID System Using EM Wave Propagation Method

The antenna present in the reader transmits


electromagnetic waves which are received by
the antenna present in the tag as potential
difference across the dipole. This voltage is
rectified and filtered to get the DC power. The
receiver antenna is kept at a different
impedance that causes it to reflect a part of the
received signal. This reflected signal is received
by the reader and monitored accordingly.
Passive RFID using EM-Wave transmission
5.1.3.5 Active RFID System's Working
Principle
In the active RFID system, the reader sends
signal to the tag using an antenna. The tag
receives this information and resends this
information along with the information in its
memory. The reader receives this signal and
transmits it to the processor for further
processing. An Active RFID System

56
Passive RFID System's Working Principle
In a passive RFID system, the RFID card (tag) is swiped against the RFID reader, a carrier
signal of 125 KHz is sent to the tag coil that receives this signal and transmits it to the
processor for further processing.

5.1.4 Global Positioning System Communication (GPS)


What is GPS?
GPS or Global Positioning System is a satellite navigation system that furnishes location
and time information in all climate conditions to the user. The GPS is used for navigation
of planes, ships, cars and trucks as well. This system offers critical abilities to military and
civilian users around the globe. GPS provides continuous real time, 3-dimensional
positioning, navigation and timing worldwide.

5.1.4.1 How does a GPS System Work?


The GPS system consists of three segments:
1) The space segment: the GPS satellites
2) The control system, operated by the U.S. military,
3) The user segment, which includes both the military and civilian users and their GPS
equipment.

Space Segment:

The space segment is the number of


satellites in the constellation. It
comprises 29 satellites circling the
earth every 12 hours at an altitude of
12,000 miles. The function of the space
segment is utilized to route/navigate
signals and to store and retransmit the
route/navigation message sent by the
control segment. These transmissions
are controlled by highly-stable atomic
Space Segment

clocks on the satellites. The GPS Space Segment is formed by a satellite constellation
with enough satellites to ensure that the users have, at least, 4 simultaneous satellites in
view from any point on the Earth surface at any time.

57
Control Segment:
The control segment comprises a master-control
station and five monitoring stations outfitted
with atomic clocks, which are spread around the
globe. The five monitoring stations monitor the
GPS satellite signals and then send that qualified
information to the master control station
wherein the abnormalities are revised and sent
back to the GPS satellites through the ground
antennas. The Control segment can also be
Control Segment
referred to as a monitoring station.

User Segment:

The user segment comprises a GPS receiver that


receives signals from the GPS satellites and
determines how far away it is from other
satellite. This segment is mainly used by the U.S
military, missile guidance systems, and the
civilian applications of GPS are there in almost
every field. Most of the civilian use this for
transportation surveys, natural resources'
identification and for agricultural purpose and
User Segment
mapping too.

5.2 B. Sub-GHz, Different Transceiver Protocols: (below 1GHz)


5.2.1 Global System for Mobile Communication Protocol: (GSM)
Introduction
A GSM is a mobile communication modem. It stands for global system for mobile
communication (GSM). The idea of GSM was developed at Bell Laboratories in 1970. At
present, it is the most widely used mobile communication system in the world. GSM is an
open and digital cellular technology used for transmitting mobile voice and data services
and operates at 850MHz, 900MHz, 1800MHz and 1900MHz frequency bands.

58
GSM system was developed as a digital system using time division multiple access
(TDMA) technique for communication purpose. A GSM digitizes and reduces the data,
then sends it down through a channel with two different streams of client data, each in its
own particular time slot. The digital system has an ability to carry 64 kbps to 120 Mbps of
data rates.

GSM Modem

There are various cell sizes in a GSM system such as macro, micro, Pico and umbrella cells.
Each cell varies as per the implementation domain. There are five different cell sizes in a
GSM network: macro, micro, Pico and umbrella cells. The coverage area of each cell varies
according to the implementation environment.

5.2.1.2 GSM Architecture


A GSM network consists of the following components:
A Mobile Station: It is the mobile phone which consists of the transceiver, the display
and the processor and is controlled by a SIM card operating over the network.
Base Station Subsystem: It acts as an interface between the mobile station and the
network subsystem. It consists of the Base Transceiver Station which contains the radio
transceivers and handles the protocols for communication with mobiles. It also consists
of the Base Station Controller which controls the Base Transceiver station and acts as a
interface between the mobile station and mobile switching center.

Base Station Subsystem: It acts as an interface between the mobile station and the
network subsystem. It consists of the Base Transceiver Station which contains the radio
transceivers and handles the protocols for communication with mobiles. It also consists
of the Base Station Controller which controls the Base Transceiver station and acts as a
interface between the mobile station and mobile switching center.

59
Network Subsystem: It provides the basic network connection to the mobile stations.
The basic part of the Network Subsystem is the Mobile Service Switching Centre that
provides access to different networks like ISDN, PSTN etc. It also consists of the Home
Location Register and the Visitor Location Register which provides the call routing and
roaming capabilities of GSM. It also contains the Equipment Identity Register which
maintains an account of all the mobile equipment wherein each mobile is identified by its
own IMEI number. The IMEI stands for International Mobile Equipment Identity.

5.2.2 EnOcean Wireless Communication Transceiver Module


The EnOcean is an energy saving wireless technology used primarily for building
automation systems. EnOcean-based products (such as sensors and light switches) can
perform without batteries and are engineered to operate maintenance-free. The radio
signals from these sensors and switches can be transmitted wirelessly over a distance up
to 300 meters in the open and up to 30 meters inside building. It mostly works as a
unidirectional protocol without handshaking.
The transmission frequencies used for the devices include 902 MHZ, 868.3 MHz and 315
MHz.

The Parameters of the EnOcean Transceiver


Ÿ EnOceantechnology transceivers support UART and SPI protocol.
Ÿ EnOcean technology transceivers have SoC.
Ÿ EnOceantechnology transceivers support Amplitude shift keying (ASK) modulation
technique.
Ÿ The transmission distance is 20m.

60
5.2.3 IO-Home Control Communication Transceiver Module
IO-home control is a highly secure wireless technology included in a wide range of home
equipment marketed by partner brands specializing in the residential sector. It provides
security and energy savings every day by making the automated or motor-operated
equipment of your home in a very efficient way including roof windows, roller shutters,
interior and exterior solar screens, gates, garage doors, entrance doors, alarms, lighting,
heating, cooling and ventilation systems, etc.
The transmission frequencies used for the devices are 433 MHz, 868 MHz and 915 MHz.
The new version module is ADF7022.

The Parameters of IO-Home Control Transceiver


Ÿ IO-homecontrol transceivers support UART and SPI protocol.
Ÿ IO-homecontrol transceivers have SoC.
Ÿ IO-homecontrol transceivers support Amplitude Shift Keying (ASK) Modulation
technique.
Ÿ The transmission distance is very short: 20m.
Ÿ An IO-homecontrol transceiver's voltage is 1.8-3.6V.

5.2.4 ONE-NET Communication Transceiver Module


ONE-NET is an open source standard for wireless networking system. ONE-NET was
designed for low-cost, low-power (battery-operated) control networks for applications
such as home automation, security & monitoring, device control, and sensor networks.
ONE-NET supports star, peer-to-peer and multi-hop topology
The transmission frequencies used for the devices are 868 MHz and 915 MHZ

The parameters ofONE-NET Transceiver:


Ÿ The ONE-NET transceivers support UART and SPI protocol.
Ÿ The ONE-NET transceivers have SoC.
Ÿ The ONE-NET transceivers use Amplitude shift keying (ASK) modulation.
Ÿ The transmission distance is 500m.
Ÿ A ONE-NET transceiver's voltage is 1.8-3.6V.

61
5.2.5 Z-Wave Communication Transceiver module
Z-Wave developed by Zensys is a two-way RF mesh networking technology that targets
home control and energy management applications. Like Zigbee, Bluetooth Z-Wave
offers a low latency, low-power, cost-effective solution. Z-Wave comes as a single-chip
solution with CPU, flash memory and radio. It works in the sub-1-GHz band at frequencies
of 908.42 MHz in the U.S. and 868.42 MHz in Europe, and 865.2 MHz in India.

Z-Wave’s mesh network architecture uses source routing and can support up to 232
nodes on a single network. These networks can be combined and coexist with other
common home networks, including Bluetooth and Wi-Fi without interference.

The parameters of Z-Wave Transceiver:


Ÿ Z-Wave transceivers support UART and SPI protocol.
Ÿ Z-Wave transceivers have SoC.
Ÿ Z-Wave transceivers use binary phase shift keying (BPSK) modulation.
Ÿ The transmission distance is 30m.
Ÿ Z-Wave transceiver's voltage is 2.1-3.6V.

Z-Wave wireless network

62
Chapter 6
2.4-GHz Wireless Communication with Transceivers

6.1 2.4-GHz Wireless Communication with Transmitters


6.1.1 Wi-Fi Wireless Communication Protocol

Introduction of Wi-Fi
Wi-Fi is a popular wireless networking technology. Wi-Fi stands for “wireless fidelity”. The
Wi-Fi was invented by NCR corporation AT&T in Netherlands in 1991. By using this
technology, we can exchange the information between two or more devices. Wi-Fi has
been developed for mobile computing devices, such as laptops, but it is now extensively
used for mobile applications and consumer electronics like televisions, DVD players and
digital cameras.
There should be two possibilities in communicating with the Wi-Fi connection that may
be through access point to the client connection or client-to-client connection. Wi-Fi is a
one type of wireless technology. It is commonly called as wireless LAN (Local Area
Network). Wi-Fi allows local area networks to operate without cable and wiring. It is
making a popular choice for home and business networks. A computer’s wireless
adaptor transfers the data into a radio signal and then into antenna for users.

Wi-Fi Communication

63
6.1.1.2 Wi-Fi Transceiver Module
Wi-Fi is a high-speed internet connection and network connection without the use of any
cables or wires. The wireless network operates three essential elements that are radio
signals, antenna and router. The radio waves are keys which make the Wi-Fi networking
possible.

The computers and cell phones are ready with Wi-Fi cards. Wi-Fi compatibility is a new
creation to communicate within the ground connected with community network. The Wi-
Fi consists of a Wide Area Network (WAN) and Personal Area Network (PAN) to
communicate with the other devices.

Ÿ The Wi-Fi Network transceivers support UART and SPI protocols.


Ÿ The Wi-Fi network transceivers have SoC.
Ÿ Binary Phase Shift Keying (BPSK), Quadrature Phase Shift Keying and Quadrature
Amplitude Modulation (QAM) techniques are used.
Ÿ Wi-Fi developing companies in India are Vie Technology Pvt. Ltd (Chennai), Atlas
Comnet Pvt. Ltd (Delhi).
Ÿ The operating voltage of Wi-Fi transceivers is between 2.7-3.6V.

64
6.1.1.3 Working Principle of W-Fi:
Wi-Fi is a high-speed internet connection and network connection without the use of any
cables or wires. The wireless network operates three essential elements that are radio
signals, antenna and router. The radio waves are keys which make the Wi-Fi networking
possible. The computers and cell phones are ready with Wi-Fi cards. Wi-Fi compatibility is
a new creation to communicate within the ground connected with community network.
The actual broadcast is connected with in sequence – in fact – it is completed by a way of
stereo system surf as well as the worth of wires monitoring to classification prone. The
Wi-Fi consists of a Wide Area Network (WAN) and Personal Area Network (PAN) to
communicate with the other devices.
Wi-Fi allows a person in order to get access to Web any place in the actual provided area.
You can now generate a system within resorts, library, schools, colleges, campus,

personal institutes, as well as espresso stores


on the open public spot to help make your
company much more lucrative as well as
interactive with its own customers. Wi-Fi is
compatible with all devices and capable of
surfing and sharing a company's information
without using cable or wires. The radio
signals transmitted from antennas and
routers are picked up by the Wi-Fi receivers,
such as computers and cell phones that are ready with Wi-Fi cards. Whenever a computer
receives the signals within the range of 100-150 feet from the router, it connects the
device immediately. The range of the Wi-Fi depends upon the environment and on the
indoor or outdoor ranges. The Wi-Fi cards read signals and create an internet connection
between the user and network. The speed of the device that uses Wi-Fi connection
increases as the computer gets closer to the main source; and, the speed decreases as
the computer gets further away. Many new laptops, mobile phones have inbuilt Wi-Fi
cards and, therefore, you don’t have to do anything which is one of the best thing. If it is a
free-based type of network connection, the user will be promoted with a login ID and
password. The free-base network connections also work well in some areas. The Wi-Fi
network connection is creating hot spots in the cities. The hot spots are a connection
point of Wi-Fi network. It is a small box that is hardwired into the internet. There are many
Wi-Fi hot spots available in public places like restaurants, airports, and hotels offices,
universities, etc.

65
Security:
Security is an important element in the Wi-Fi technology. Security is our personal
decision, but if we have a wireless connection, we should pay attention to protect our
private details. We may get connected easily to unsecured wireless routers with the Wi-Fi
connection. Therefore, the main problem is security because if somebody gets access to
your wireless router using the data like downloadable games, downloadable apps, illegal
music and movie files and does some illegal activities, then it becomes necessary to
provide security to the wireless technologies based devices.

How to Make the Security?


All routers have a web page that you can connect to for configuring the Wi-Fi security. And
turn on WEP (Wire Equivalence Privacy) and enter a password and remember this
password. Next time when you connect your laptop, the Wi-Fi router will ask you to enter
the connection password and you can enter that password.

6.1.1.4 The Types of WI-FI Technologies

802.11a: It supports wireless LAN and provides 1 to 2 Mbps transmission in the 2.4 GHz
band frequency using either frequency hopping spread spectrum or direct sequence
spread spectrum.

802.11b: It supports wireless LAN and provides fast 11 Mbps transmission in the 2.4 GHz
band frequency. This specification uses only DSSS.

802.11ac: It supports wireless WAN and provides fast 1300 Mbps transmission in the 2.4
and 5.0 GHz band frequencies. It is fast accessing and cost effective.

Wi-Fi-802.11g: In 2002 and 2003, this technology supporting newer standard products. It
is the best technology of 802.11a and 802.11b. The 802.11 b supports bandwidth up to 54
mbps and it uses a 2.4 GHz frequency for greater range. This technology's cost is more
than 802.11b. It is fast accessible with optimum speed.

Wi-Fi-802.11n: The 802.11n is the newest WIFI technology. It was designed to improve on
802.11g .The amount of bandwidth supported by utilizing multiple wireless signals and
antennas instead of one. It supports 100 mbps bandwidth and increased signal intensity.

66
Applications
Ÿ Mobile applications
Ÿ Business applications
Ÿ Home applications
Ÿ Computerized application
Ÿ Automotive segment
Ÿ Browsing internet
Ÿ Video conference

Advantages
Ÿ Wireless laptop can be moved from one place to another place.
Ÿ Wi-Fi network communication devices without wires can reduce the cost of wires.
Ÿ Wi-Fi setup and configuration is easy than cabling process.
Ÿ It is completely safe and it does not interfere with any network.
Ÿ It can be used to connect internet via hot spots.
Ÿ Can be used to connect internet wirelessly.
Ÿ

Disadvantages
Ÿ Wi-Fi generates radiations which can harm the human health.
Ÿ We must disconnect the Wi-Fi connection whenever we are not using the server.
Ÿ There are some limits to transfer the data; we are unable to transfer the data for long
distance.
Ÿ Wi-Fi implementation is very expensive when compared to the wired connection.

67
6.1.2 Bluetooth Wireless Communication Protocol

Bluetooth wireless technology was named after a Danish Viking and King, Harald
Blatand; his last name means “Bluetooth” in English. He is credited with uniting Denmark
and Norway, just as Bluetooth wireless technology is credited with uniting two disparate
devices.

The Bluetooth technology emerged from the task undertaken by Ericsson Mobile
Communications in 1994 to find alternative to the use of cables for communication
between mobile phones and other devices. In 1998, the companies Ericsson, IBM, Nokia
and Toshiba formed the Bluetooth Special Interest Group (SIG) which published the
1stversion in 1999.

The first version was 1.2 standard with a data rate speed of 1Mbps. The second version
was 2.0+EDR with a data rate speed of 3Mbps. The third was 3.0+HS with a speed of
about 24 Mbps. The latest version is 4.0.

6.1.2.1 Bluetooth Transceiver Module

Bluetooth technology is a high-speed low powered wireless technology link that is


designed to connect phones or other portable equipment together.

It is a specification (IEEE 802.15.1) for the use of low-power radio communications to link
phones, computers and other network devices over short distance without wires.
Wireless signals transmitted with Bluetooth cover short distances; typically up to 30 feet
(10 meters). It is achieved by embedded low-cost transceivers into the devices. It supports
on the frequency band of 2.45GHz and can support up to 721 Kbps along with three voice
channels.

This frequency band has been set aside by international agreement for the use of
industrial, scientific and medical devices (ISM).rd-compatible with 1.0 device. Bluetooth
can connect up to “eight devices” simultaneously and each device offers a unique 48-bit
address from the IEEE 802 standard with the connections being made point-to-point or
multipoint.

68
Ÿ The Bluetooth Network transceivers support SPI protocol.
Ÿ The Bluetooth network transceivers have SoC.
Ÿ The Bluetooth network transceivers use Gaussian Frequency Shift Keying (GFSK)
modulation technique.
Ÿ Manufacturing companies of Bluetooth are Mega Byte Technologies (Bangalore),
Bitsmind Technologies (Chennai).
Ÿ The operating voltage of Bluetooth transceivers is between 2-3.6V.
Ÿ A network node consists of PAN RF transceiver for 2.4GHz spectrum.

Bluetooth Network consists of a Personal Area Network. The latest version of the
standard Bluetooth is Bluetooth 4.0, which is introduced as a low-energy technology,
which means, it operates at low power.

6.1.2.2 Bluetooth Specifications

Core Specifications: It defines the Bluetooth protocol stack and the requirements for
testing and qualification of Bluetooth-based products.

The profiles specification: It defines usage models that provide detailed information
about how to use the Bluetooth protocol for various types of applications.

The core specification consists of 5 layers:

69
Radio: Radio specifies the requirements for radio transmission – including frequency,
modulation, and power characteristics – for a Bluetooth transceiver.

Baseband Layer: It defines physical and logical channels and link types (voice or data);
specifies various packet formats; transmits and receives timing; and, controls channel
and the mechanism for frequency hopping (hop selection) and device addressing. It
specifies point-to- point or point-to-multipoint links. The length of the packet can range
from 68 bits (shortened access code) to a maximum of 3071 bits.

LMP- Link Manager Protocol (LMP): It defines the procedures for link set up and
ongoing link management.

Logical Link Control and Adaptation Protocol (L2CAP): It is responsible for adapting
upper-layer protocols to the baseband layer.

Service Discovery Protocol (SDP): – It allows a Bluetooth device to query other


Bluetooth devices for device information, services provided, and the characteristics of
those services.
The 1st three layers comprise the Bluetooth module, whereas the last two layers make up
the host. The interfacing between these two logical groups is called Host-Controller
Interface.

6.1.2.4 Advantages of Bluetooth Technology


Bluetooth technology removes the problem of radio interference by using a technique
called Speed-Frequency Hopping. This technique utilizes 79 channels of particular
frequency band, with each device accessing the channel for only 625 microseconds, i.e.,
the device must toggle between transmitting and receiving data from one time slot to
another. This implies that the transmitters change frequencies 1,600 times every second,
meaning that more devices can make full use of a limited slice of the radio spectrum. This
ensures that the interference won’t take place as each transmitter will be on different
frequencies. The power consumption of the chip (consisting of transceiver) is low, at
about 0.3mW, which makes it possible for least utilization of battery life. It guarantees
security at bit level. The authentication is controlled using a 128-bit key. It is possible to
use Bluetooth for both transferring of data and verbal communication as Bluetooth can
support data channels of up to 3 similar voice channels. It overcomes the constraints of
line of sight and one-to-one communication as in other mode of wireless
communications like infrared.

70
6.1.2.5 Bluetooth Applications
Cordless Desktop: All or most of the peripheral devices (mouse, keyboard, printer,
speakers, etc.) are connected to the PC cordlessly.

Ultimate Headset: It can be used to allow one headset to be used with myriad devices,
including telephones, portable computers, stereos, etc.

Automatic Synchronization This usage model makes use of the hidden computing
paradigm, which focuses on applications in which devices automatically carry out certain
tasks on behalf of the user without user intervention or awareness.

Multimedia Transfer: Exchange of multimedia data like songs, videos, pictures can be
performed between devices using Bluetooth.

71
6.1.3 Zigbee Wireless Communication Protocol
Zigbee modules are the wireless communication modules that are built based on Zigbee
standard. They utilize the IEEE 802.15.4 protocol. Zigbee standards are standards with a
range between Bluetooth and WIFI. They are basically RF modules. Wireless technology
can be challenging without the right combination of expertise and resources. The Zigbee
is an arrangement of modular products that make deploying wireless technology easy
and cost-effective. The module can communicate up to 100 feet indoors or 300 feet
outdoors.

It can be used as a serial replacement or you can put it into a command mode and
configure it for a variety of broadcast and mesh-networking options. The Zigbee modules
provide wireless connectivity to devices.

Ÿ The Zigbee Network transceivers support UART and SPI protocol.

Ÿ The Zigbee network transceivers have SoC.

Ÿ The Zigbee network transceivers use binary phase shift keying (bpsk) modulation
technique.

Ÿ The operating voltage of Zigbee transceivers is 1.8v--3.8V.

Ÿ A Network node consists of 802.15.4 RF transceiver.

Zigbee Transceiver

72
6.1.3.1 Zigbee Architecture
Zigbee system structure consists of three different types of devices such as Zigbee
coordinator, Router and End device. Every Zigbee network must consist of at least one
coordinator which acts as a root and bridge of the network. The coordinator is
responsible for handling and storing the information while performing receiving and
transmitting data operations. Zigbee routers act as intermediary devices that permit data
to pass to and fro through them to other devices. End devices have limited functionality to
communicate with the parent nodes such that the battery power is saved as shown in the
figure. The number of routers, coordinators and end devices depends on the type of
network such as star, tree and mesh networks.

Zigbee System Structure

Zigbee protocol architecture consists of a stack of various layers wherein IEEE 802.15.4 is
defined by the physical and MAC layers while this protocol is completed by accumulating
Zigbee’s own network and application layers.

73
Zigbee Protocol Architecture

Physical Layer: This layer does modulation and demodulation operations up on


transmitting and receiving signals respectively. This layer’s frequency, date rate and
number of channels are given below.

Physical Layer of Zigbee Protocol

MAC Layer: This layer is responsible for reliable transmission of data by accessing
different networks with the carrier sense multiple access collision avoidance (CSMA). This
also transmits the beacon frames for synchronizing communication.

Network Layer: This layer takes care of all network-related operations such as network
setup, end device connection and disconnection to network, routing, device
configurations, etc.

74
Application Support Sub-Layer: This layer enables the services necessary for Zigbee
device object and application objects to interface with the network layers for data
managing services. This layer is responsible for matching two devices according to their
services and needs.

Application Framework: It provides two types of data services as key value pair and
generic message services. Generic message is a developer defined structure, whereas
the key value pair is used for getting attributes within the application objects. ZDO
provides an interface between the application objects and APS layer in Zigbee devices. It
is responsible for detecting, initiating and binding other devices to the network.

6.1.3.2 Zigbee Operating Modes and Its Topologies


Zigbee's two-way data is transferred in two modes: Non-beacon mode and Beacon
mode. In a beacon mode, the coordinators and routers continuously monitor active state
of the incoming data and, hence, more power is consumed. In this mode, the routers and
coordinators do not sleep because at any time any node can wake up and communicate.
However, it requires more power supply and its overall power consumption is low
because most of the devices are in an inactive state for over long periods in the network.

In a beacon mode, when there is no data communication from the end devices, then the
routers and coordinators enter into sleep state. Periodically this coordinator wakes up
and transmits the beacons to the routers in the network. These beacon networks work
for time slots, which means, they operate when the communication needed results in
lower duty cycles and longer battery usage. These beacon and non-beacon modes of
Zigbee can manage periodic (sensors data), intermittent (Light switches) and repetitive-
data types.

Zigbee communication
Operation

75
6.1.3.3 Zigbee Topologies

Zigbee Topologies

Zigbee supports several network topologies; however, the most commonly used
configurations are star, mesh and cluster-tree topologies. Any topology consists of one or
more coordinators. In a star topology, the network consists of one coordinator which is
responsible for initiating and managing the devices over the network. All the other
devices are called end devices that directly communicate with the coordinator. This is
used in industries where all the end point devices are needed to communicate with the
central controller, and this topology is simple and easy to deploy.

In mesh and tree topologies, the Zigbee network is extended with several routers
wherein the coordinator is responsible for staring them. These structures allow any
device to communicate with any other adjacent node for providing redundancy to the
data. If any node fails, the information is routed automatically to other device by these
topologies. As the redundancy is the main factor in industries, hence mesh topology is
mostly used. In a cluster-tree network, each cluster consists of a coordinator with leaf
nodes, and these coordinators are connected to the parent coordinator that initiates the
entire network.
Due to the advantages of Zigbee technology like low-cost and low-power operating
modes and its topologies, this short-range communication technology is best suited for
several applications compared to other proprietary communications, such as Bluetooth,
Wi-Fi, etc. some of these comparisons such as the range of Zigbee, standards, etc., are
given below.

76
Comparison table of Zigbee

6.1.3.4 Applications of Zigbee Technology

Industrial Automation: In manufacturing and production industries, a communication


link continually monitors various parameters and critical equipment. Hence, Zigbee
considerably reduces this communication cost as well as optimizes the control process
for greater reliability.

Home Automation: Zigbee is perfectly suited for controlling home appliances remotely
as a lighting system control, appliance control, heating and cooling system control, safety
equipment operations and control unit, surveillance unit, and so on.

Smart Metering: Zigbee remote operations in smart metering include energy


consumption response, pricing support, security over power theft, etc.

Smart Grid monitoring: Zigbee operations in this smart grid involve remote
temperature monitoring, fault locating, reactive-power management, and so on.

This is all about a brief description of Zigbee technology’s architecture, operations


modes, configurations and applications. We hope that we have given you enough
content on this title, for you to understand it better. We are pioneers in developing
Zigbee-based projects. For further help and technical assistance, you can contact us.

77
Applications of Zigbee Technology

6.1.4 6LowPan Protocol Transceiver Module

6 Low Pan is an internet-based wireless-node-sensor network, which sends and receives


data directly from a wireless network without requiring other conversions.
It is an advanced wireless network of zigbee

It is an advanced wireless network of Zigbee. The 6LowPAN protocol is a high-level-


wireless communication protocol. The 6LowPan device can transmit data over a long
distance by helping data pass through intermediate devices and allowing it to cover more
distance than the mesh network. The 6LowPan is used in applications that require only
low data rate, long battery life and secure networking.

Ÿ The 6LoWPan Network transceivers support UART, SPI or USB protocol.

Ÿ The 6LoWPan network transceivers have SoC.

Ÿ The 6LoWPan network transceivers use binary phase shift keying (bpsk) modulation
technique.

Ÿ The operating voltage of 6LowPan transceivers is 1.3-42V.

Ÿ A network node consists of 802.15.4 RF transceiver.

78
6.1.4.1 6LoWPAN's Working Procedure

6LoWPAN is a name of IPv6 over Low power Wireless network. There are two types of
devices in 6LoWPan network: Nodes and routers. A router is responsible for establishing,
maintaining, and controlling a 6LoWPan network.

The 6LoWPan devices have public IPv6 addresses so several applications can directly
communicate with the end devices by their addresses and easily find out the whole
wireless sensor network topology. It is very fast accessible and cheap compared with the
Xbee protocol.

6.1.4.2 Difference between Zigbee and 6LowPAN Protocols

79
6.1.5 IEEE802.15.4 Protocol

Ÿ The IEEE802 is a one standard committee that develops and maintains wired and
wireless communication networks standards. For example 802.3 is wired Ethernet,
802.11 for wireless LAN and Wi-Fi.
Ÿ The 802.15 group of standards specifies a variety of personal area networks for
different applications. For 802.15.1 is a Bluetooth, and 802.15.3 is a high-data-rate
category for ultra-wideband technologies.
Ÿ The 802.15.4 is a new version of network protocol that supports wireless personal
area networks(WAN)
Ÿ The 802.15.4 maximum transmission distance is 10m. It can be used with Zigbee,
Bluetooth and WI Media technologies and other internet protocols.
Ÿ The basic framework conceives a 10-meter communications range with a transfer
rateof 250 kbit/s.
Ÿ IEEE 802.15.4 specifies the physical layer and media access control for low-rate
wireless personal area networks (LR-WPANs).
Ÿ The feature of the 802.15.4 protocol that contributes mostly to long battery life is the
extremely low duty cycle.
Ÿ IEEE 802.15.4 offers three operational frequency bands: 2.4 GHz, 915 MHz, and 868
MHz. There is a single channel between 868 and 868.6 MHz, 10 channels between 902
and 928 MHz, and 16 channels between 2.4 and 2.4835 Ghz.

80
IEEE802 Protocol

6.1.5.1 IEEE802.15.4 Architecture


OSI Communication (Open System Interconnection)

Most networking systems, both wired and wireless, use the OSI communications model.
Most systems also use at least the first four layers, but many do not use all seven layers.

OSI Communication Layers

81
The 802.15.4 standard defines the Physical Layer (PHY) and Media Access Control (MAC)
layer of the Open Systems Interconnection (OSI) model of the network operation.The PHY
defines frequency, power, modulation, and other wireless conditions of the link. The MAC
defines the format of the data handling. The remaining layers define other measures for
handling the data and related protocol enhancements including the final application.

The 802.15.4 standard uses only the first two layers plus the logical link control (LLC) and
service specific convergence sub-layer (SSCS) additions to communicate with all upper
layers as defined by the additional standards.

IEEE802.15.4 Protocol stack

82
6.1.6 Wireless Hart Protocol Transceiver Module
The wireless Hart is a wireless sensor networking technology based on Highway
Addressable Remote Transducer protocol (HART). Before the release of wireless Hart
technology, many industries had been using Zigbee and Bluetooth technologies but
these technologies were unable to meet the exacting requirement of industrial control.
Wireless HART is a wireless mesh network communications protocol for process
automation applications. It adds wireless capabilities to the HART Protocol while
maintaining compatibility with the existing HART devices, commands, and tools.

Ÿ The WirelessHart Network transceivers support UART and SPI protocol.

Ÿ The WirelessHart network transceivers have SoC.

Ÿ The WirelessHart network transceivers use quadrature phase shift keying (QPSK and
DSSS) and supports modulation technique.

Ÿ The operating voltage of Wireless HART transceivers is 3.6V.

Ÿ A network node consists of 802.15.4 RF transceiver.

Ÿ The transmission distance is about 1 to 250m.

6.1.6.1 Wireless Hart Working Procedure

Each Wireless HART network includes three main elements:

Ÿ Wireless field devices are connected to a process or plant equipment. This device
could be a device with WirelessHART built in or an existing installed HART-enabled
device with a WirelessHART adapter attached to it.

Ÿ Gateways enable communication between the devices and host applications


connected to a high-speed backbone or other existing plant-communications
network.

A Network Manager is responsible for configuring the network, scheduling


communications between devices, managing message routes, and monitoring network
health. The Network Manager can be integrated into the gateway, host application, or
process automation controller.

83
Each device in the mesh network can serve as a router for the messages from other
devices. In other words, a device doesn't have to communicate directly to a gateway, but
just forwards its message to the next closest device. This extends the range of the
network and provides redundant communication routes to increase reliability.

6.1.7 ANT Protocol Transceiver Module


ANT is a proprietary open access multi-cast wireless sensor network technology.
Each ANT channel consists of one or more transmitting nodes and one or more
receiving nodes, depending on the network topology. Any node can transmit or
receive, so the channels are bidirectional.
ANT accommodates three types of messaging: broadcast, acknowledged, and
burst. Broadcast is a one-way communication from one node to another (or
many). The receiving node(s) transmit no acknowledgment, but the receiving node
may still send messages back to the transmitting node.

This technique is suited for sensor applications and is the most economical
method of operation.
Acknowledged messaging confirms receipt of data packets. The transmitter is
informed of success or failure, although there are no retransmissions. This
technique is suited to control applications.

84
Ÿ The ANT Network transceivers support UART and SPI protocol.

Ÿ The ANT network transceivers have SoC.

Ÿ The ANT transceivers use Gaussian Frequency Shift Keying (GFSK) modulation
technique.

Ÿ The operating voltage of Wireless HART transceivers is 2-3.6V.

Ÿ A network node consists of 802.15.4 RF transceiver.

Ÿ The transmission distance is about 50 to 100m.

85
6.1.8 Ultra-low-power Transceiver Module

Ultra-low-power technology is a high-speed low-powered wireless technology, which


establishes communication from router to computers. All nodes are routers; they can
transmit and receive the data from an accelerometer device to the computers.

Ÿ The Ultra-low-power transceivers support UART and SPI protocol.


Ÿ The Ultra-low-power transceivers have SoC.

Ÿ The Ultra-low-power transceivers use and support On-Off keying (OOK) modulation
technique.

Ÿ The operating voltage of Wireless HART transceivers is 2.1-3.6V.

Ÿ A network node consists of 802.15.4 RF transceiver.

Ÿ The transmission distance is 20m.

86
Chapter-7
Practical Implementation of Wireless Module

7.1 Introduction
Nowadays many people are looking for new development technologies as every day
latest products are being released by companies. Coming to wireless technology, there
are many wireless modules available such as RF, Zigbee, Bluetooth and 6LowPan, etc.
And, every time these modules are coming out with new versions like Bluetooth 4,
Zigbee 5.6, etc., which means the technology is same, but developers are
implementing these modules’ with, advanced features at lower cost.
Assuming that Zigbee 1.0 module uses a PIC microcontroller implemented by using
some layers on OSI model, Zigbee 1.0 can be extended to produce another version,
such as Zigbee 2.0, with an advanced microcontroller involving some more layers. As
an example, the following explanation of implementing 6Lowpan communication
module with an advanced microcontroller for fast data access is quite easy to
understand.

7.2 Implementation of 6LowPan Wireless Transceiver Module


7.2.1 Introduction to 6LowPAN
The 6LowPAN is a wireless network device like a wireless router (like Zigbee) that
communicates with Personal Area Network (PAN). Many wireless transceivers are IP
network protocols as the modules are designed with IPV6 network layer. IP network
requires that all nodes or network nodes must be configured with the TCP/IP suite, and
each node must have a unique address. The 6lowpan network communicates with two
devices such as 6lowpan router and nodes. The router is responsible for the 6lowpan
network. The 6LowPan router connected to the server forwards the packets to IP enabled
device such as computers, printers, cell phones.

The nodes directly communicate with the servers and require no additional conversion
devices. So, communication accessing is very fast compared with the other network
protocols. The 6lowpan has an inbuilt coordinator that converts data from 6lowpan
standard to internet standard. The 6LowPAN router does not directly support multiple
communications but some additional layers are added to support multiple
communication.

87
7.2.2 6LowPAN Stack Layers
6LowPAN stack layers consist of PHY layer,
MAC layer, adaptation layer, network layer,
transport layer and application layer.
Basically, it employs how the IEEE 802.15.4
devices communicate with each other over
a wireless channel.

Application Layer
The 6LowPAN application layer uses a
socket interface for a specific application.
Each 6LowPAN application opens a socket
which is then used to receive or send
packets. Each socket is associated with a
protocol, TCP or UDP, and source and/or
destination ports. An application that
contains socket function calls can be used
freely in multithreaded applications.

88
6LoWPAN application interface a specific application

Socket:
When a computer program needs a connection to a local or Wide Area Network, such as
the Internet, it uses a software component called a socket. It is an identification of the
computer designed with IP address.

89
The socket is the basic concept of network communication in the socket API.

Ÿ It defines an endpoint of communication for a process.

Ÿ An operating system maintains the information about the socket and its connection.

Ÿ Based on the sockets, sending and receiving the data is performed.

A socket communication basically needs 4 parameters:

1. Source Identifier (IP address)

2. Source Port

3. Destination Identifier

4. Destination Port

Transport Layer:

Transport layers work transparently within the layers above to deliver and receive data
without errors. The send side breaks application messages into segments and passes
them on to the network layer. The receiving side then reassembles segments into
messages and passes them to the application layer.

6lowPAN transport layer is responsible for process-to-process delivery. It delivers data


segment to the appropriate application process on the host computers. This layer has
two types of transport protocols: User Datagram Protocol (UDP) and Transmission
Control Protocol (TCP).

At the source side, either TCP or UDP connections is established based on the application.
Hence, either TCP or UDP process is created. The data from the application layer is
organized in either UDP or TCP segments and attached to create process (TCP or UDP
process).

At the destination side, after the UDP or TCP segments are received from the network
layer, the transport layer processes the segment probably based on the protocol used
and sends it to the application layer. However, the most common protocol applied with
6LowPAN is the UDP. In aspect of performance, efficiency and complexity, TCP is not
preferably used with 6LowPAN.

90
The transport layer doing such things which are: layer does the things which are:
connection oriented communication, same order delivery, data integrity, flow control,
traffic control, multiplexing and byte orientation.

Network Layer:

Network layer provides data routing paths for network communication. Data is
transferred in the form of packets via the logical network paths in an ordered format
controlled by the network layer.

The 6LowPAN network layer provides internet working capability to sensor nodes. The
main considerations of this layer are addressing, mapping and routing protocols. The
routing technique enables data transmission over multiple paths. The 6LowPAN has two
routing protocols which are “mesh-under routing and route-over”. The main difference of
mesh-under routing and route-over routing is packet and fragmentation.

Mesh-under routing: The network layer does not perform any IP routing inside a
LowPAN called mesh-under routing. The adaption layer performs the mesh routing and
forward packets to the destination over multiple radio hops based on IEEE802.15.4 frame
or 6LowPAN header.

The IP packets are fragmented (pieces) by the adaption layer to a number of fragments;
these fragments are delivered to the next destination by mesh routing and finally reach
the destination. Different fragments of IP packets can go through different paths and
they all gather at the destination. If all the fragments reach successfully, then the
adaption layer of the destination node reassembles all fragments and creates IP packets.
A mesh-under routing functions are placed at the link layer in many cases.

Route-over routing: The network layer performing any IP routing inside a LowPAN is
called route-over routing. In route-over scheme all the routing decisions are taken in the
network layer itself, wherein each node acts as an IP router.

The adaptation layer of 6LowPAN establishes a direct mapping between the frame and IP
headers. When the IP packets are fragmented by the adaptation layer, the fragments are
sent to the next destination based on the routing table. The adaptation layer of the next
journey checks received fragments. If all the fragments are received successfully, then
the adaptation layer creates IP packets and sends them to the network layer. If the
packets are created, the network layer sends the IP packets to the transport layer.

• The routes over routing functions are placed at the IP layer (network layer).

91
Adaptation Layer:

The 6LowPAN format defined on IPv6 communication is carried out in 802.15.4 frames
and specifies the adaptation layer’s key elements. 6LowPAN has three primary elements:

Ÿ Fragmentation and Reassembly

Ÿ Header Compression

Ÿ Routing

One IPv6 that needs to be transmitted over IEEE 802.15.4 frame has to be divided to more
than 16 fragments. The Adaptation layer should handle these fragmentation and
reassembly process.

Data Fragmentation

92
IEEE802.15.4 MAC Layer

The MAC stands for media access control; it is one of the layers of 6LowPAN. The MAC
layer is responsible for moving data packets from one network to the other shared
channels. The MAC layer consists of a sub-layer, which is a “Data link Layer”.

The main job of the MAC protocol is the flexible usage of medium, and this is done
through a channel access mechanism.

Channel Access Mechanism: is a way to divide the main resource between nodes, the
radio channel, by the flexibility of the usage of it. It tells each node when to transmit and
when to expect receiving data. The channel access mechanism is the core of the MAC
protocol. The channel access mechanism is mainly classified into three types: TDMA,
CSMA and polling.

TDMA (Time Division Multiplex Access): The base station has the responsibility to
coordinate the nodes of the network. The time on the channel is divided into time slots,
which are generally of fixed size. Each node of the network is allocated with a certain
number of slots where it can transmit. Slots are usually organized in a frame, which is
repeated on a regular basis.

TDMA is not well suited for data networking applications, because it is very strict and
inflexible. IP is connectionless and generates burst traffic, which is very unpredictable by
nature. TDMA uses fixed-size packets and usually a symmetrical link, which doesn't suit IP
well (variable size packets).

CSMA/CA and CSMA/CD:

CSMA/CA stands for “Carrier Sense Multiple Access/Collision Avoidance”

The CSMA/CA is used by most wireless LANs in the ISM bands. The basic principle of
CSMA/CA is listening before talking and Argument. This is an asynchronous message
passing mechanism (connectionless), delivering the best energy service lacking
bandwidth and latency guarantee. Its main advantage is that it is suited for network
protocols such as TCP/IP and adapts quite well with the variable condition of traffic and is
quite robust against interferences. But the CSMA/CA protocol can't directly detect
collisions like Ethernet and only tries to avoid them.

93
MAC Address:

The local network addresses used in IEEE802 networks and FDDI networks are called
MAC address. A MAC address is a unique serial number. Once a MAC address is assigned
to a particular network interface (typically at the time of manufacturing), then that device
should be uniquely identifiable amongst all the other network devices in the world. This
assures that each device in a network has a different MAC address (analogous to a street
address). This makes it possible for the data packets to be delivered to a destination
within a sub network that is host, hub. Switches.

MAC Layer Data Frames:

A frame usually transmits serial data bit by bit and contains a header field and a trailer
field, which "frame" the data (Some control frames contain no data.). The frame is data
that is transmitted between network points as a complete unit with addressing and
necessary protocol control information.

Data Frame

MAC FRAMEs

The MAC data service is to let the transmission and receiving of MAC protocol data units
(MPDU) across the PHY data service

In IEEE 802.15.4 standard defines 4-frame structures for MAC layer:

Ÿ Data frame,

Ÿ Beacon frame,

Ÿ Acknowledgement frame,

Ÿ MAC command frame.

94
Basically, the MAC “data frame” is used for data transfer; MAC “beacon frame” is
generated by the coordinator for synchronization; MAC “command frame” is used by the
MAC management entity and the MAC “acknowledgement frame” acknowledges
successful reception of the frame.

General MAC layer frame format

Physical Layer

The 6LowPAN PHY layer provides two services: PHY data service and the PHY
management service, which interface to the Physical Layer Management Entity (PLME)
Service Access Point (SAP) known as the PLME-SAP.

The PHY data services ultimately provides transmission and reception of data packets
between MAC and PHY across the physical radio channel, as well as the PHY management
service interface, which offers access to every layer management function and maintains
a database of information on related personal area networks.

It is based on IEEE802.15.4 with data rate of 250 Kbps and operates at a frequency of 2400
– 2483.5 MHz. The PHY layer protocol data unit of IEEE 802.15.4 is compliant with a
maximum payload of 127 bytes

The PHY is prefixed by the synchronization Header (SHR) fields encompassing the
Preamble Sequence and Start of Frame Delimiter fields, and a PHY Header (PHR)
encompasses Frame Length/Reserved.

95
The SHR forgives the receiver to achieve symbol synchronization. As a result, the SHR,
PHR, and PHY payload form PHY packet.

Role of Physical layer: The physical layer deals with bit-level transmission between
different devices and supports electrical or mechanical interfaces connecting to the
physical medium for synchronized communication.

This layer plays with most of the network’s physical connections - wireless transmission,
cabling, cabling standards and types, connectors and types, network interface cards, and
more - as per network requirements. However, the physical layer does not deal with the
actual physical medium (like copper, fiber).

7.3 Step-by-Step Procedure of Developing a 6LowPAN Wireless Transceiver


Aim of the project

To design and implement a 6LowPAN Wireless Module

Concept

The MAC protocols are implemented for positive acknowledgement and MAC level
retransmissions to avoid losing packets on the air.

The principle is quite simple: Each time a node receives a packet, it sends back
immediately a short message (an ACK) to the transmitter to indicate that it has
successfully received the packet without errors. If for any reasons, after sending a packet,
the transmitter doesn't receive an acknowledgment, it knows that the packet has lost, so
it retransmits the packet (after contending again for the medium, like in Ethernet).

MAC protocols implement to stop and go mechanism; they transmit the next packet of
the queue only if the current packet has been properly acknowledged. The rationale is
that it makes the protocol simpler, minimize latency and avoid sequencing packets.

Basic Idea Behind the Design:

The STM32F108 microcontroller generates the output logic pulses to transmit and
receive the data from antenna using a stack layer. It is a 40-pin microcontroller. The
Crystal interfaced to input pins of the microcontroller provide accurate clock signals at
the crystal frequency.

96
Steps for Developing the Project
Step1: Circuit Designing

The STM32F108 microcontroller crystal operates at 72 MHz frequency because it can give
exact clock pulses for data synchronizing. Two capacitors are connected to the crystal
oscillator with a range of 20pf to 40pf which is used to stabilize the clock signals. The
STM32F108 microcontroller sometimes goes to block the state or missing time
calculation. At that time we need to reset the microcontroller. When the microcontroller
is reset, it takes maximum 3sec time delay with the help of the 10k resistor and 10uf
capacitor.

Circuit Components: Software Components:

Hardware Components: Ÿ Contiki Operating system

Ÿ Red Led Ÿ Coocox IDE

Ÿ Crystal Ÿ Proteus software

Ÿ Reset Ÿ Embedded C language

Ÿ STM32F Microcontroller

Ÿ Capacitors

Ÿ Resistors

Ÿ Antenna (Stick)

Circuit Connections

The 3.5V DC supply is given to the 40-pin of the microcontroller which drives the circuit.
The crystal is connected to the 18th and 19th pin of the microcontroller. The reset circuit
is interfaced at 9-pin of the microcontroller. The Red LED is connected to the pin PA.5 of
the microcontroller.

97
Step 2: Microcontroller Program Coding

Ÿ First open the Coocox software. This shows the menu bar with file, edit, view, project
and tools option.

Ÿ Select the project option and select the ‘new project option’ from the drop-down menu.
Give a name to the project, and then select the ‘Chip option’ in the box.

Ÿ Select a microcontroller for your project. Select the exact type of ST microcontroller
from the drop-down menu. Here STM32F103C8 microcontroller is selected. A folder
with the name ‘source group’ is created in the ‘target’ folder.

Ÿ Select the basic components of the microcontroller: you can select ‘GPIO’ ‘USART’
protocol’ and required options. ‘USART’ protocol’ and required options.

Ÿ Click the ‘File’ menu on the menu bar. Select ‘new file’ from the drop-down menu.

98
The USART Protocol Programming:

#include “stm32f10x_usart.h"

#include “stm32f10x_rcc.h"

#include “stm32f10x_gpio.h"

#include “misc.h"

#define NUM 10

inti,j;

char name[NUM+1] = {'\0'};

void NVIC_Configuration(void);

void GPIO_Configuration(void);

void USART_Configuration(void);

void USART1_IRQHandler(void);

void USART1_IRQHandler(void)

if ((USART1->SR & USART_FLAG_RXNE) != (u16)RESET)

i = USART_ReceiveData(USART1);

if(j == NUM)

name[j] = i;

j = 0;

else

99
name[j++] = i;

name[j] = '\0';

void usart_init(void)

const unsigned char menu[] = " Welcome to CooCox!\r\n";

/* Enable USART1 and GPIOA clock */

RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA,
ENABLE);

/* NVIC Configuration */

NVIC_Configuration();

/* Configure the GPIOs */

GPIO_Configuration();

/* Configure the USART1 */

USART_Configuration();

/* Enable the USART1 Receive interrupt: this interrupt is generated when the

USART1 receive data register is not empty */

USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);

/* print welcome information */

UARTSend(menu, sizeof(menu));

100
while(1)

void GPIO_Configuration(void)

GPIO_InitTypeDefGPIO_InitStructure;

/* Configure USART1 Tx (PA.09) as alternate function push-pull */

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_Init(GPIOA, &GPIO_InitStructure);

/* Configure USART1 Rx (PA.10) as input floating */

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;

GPIO_Init(GPIOA, &GPIO_InitStructure);

void USART_Configuration(void)

USART_InitTypeDefUSART_InitStructure;

USART_InitStructure.USART_BaudRate = 9600;

USART_InitStructure.USART_WordLength = USART_WordLength_8b;

USART_InitStructure.USART_StopBits = USART_StopBits_1;

USART_InitStructure.USART_Parity = USART_Parity_No;

USART_InitStructure.USART_HardwareFlowControl=USART_HardwareFlowContro

101
l_None;

USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

USART_Init(USART1, &USART_InitStructure);

/* Enable USART1 */

USART_Cmd(USART1, ENABLE);

void NVIC_Configuration(void)

NVIC_InitTypeDefNVIC_InitStructure;

/* Enable the USARTx Interrupt */

NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;

NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;

NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;

NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

NVIC_Init(&NVIC_InitStructure);

USART_SendData(USART1, *pucBuffer++);// Last Version


USART_SendData(USART1,(uint16_t) *pucBuffer++);

/* Loop until the end of transmission */

while(USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)

Ÿ Select the ‘debug’ menu. It checks the program for any errors.

Ÿ Save this code with ‘.C’ extension.

Ÿ Open the flash magic window. Select the ‘C’ file to be added.

102
Step 3: Circuit Drawing

This circuit is designed with the help of Proteus software. It is a circuit designing software
which contains a database of components. The components can be used to build the
circuit. Each and every component is available in the components' library.

Ÿ Open the Proteus software. A window with a menu bar appears.

Ÿ Click the file menu.

Ÿ Select ‘new design’ from the drop-down menu.

Ÿ Click the library menu.

Ÿ Select ‘pick devices/symbol’ from the drop-down menu.

Ÿ Select the relevant comment by double clicking on it, so that the component appears
on the window.

Ÿ Add all the components and draw the circuit with proper connections.

103
Step 4: MAC Layer Development:
The MAC layer is implemented to support the IPv6/6LowPAN stack in the Contiki
operating system. It is a lightweight and convenient operating system for users. This
phase supports point- -to-point data connectivity between a router device and an end
device.

Contiki Operating System


Contiki is an open source, highly portable, multi-tasking operating system for memory-
efficient network-embedded systems and wireless-sensor networks. Contiki is designed
for microcontrollers with small amounts of memory. A typical Contiki configuration is 2
kilobytes of RAM and 40 kilobytes of ROM. Contiki provides IP communication, both for
IPv4 and IPv6. Contiki and its IPv6 stack are IPv6 Ready Phase 1 certified and, therefore,
have the right to use the IPv6 ready silver logo. Contiki introduced the idea of using IP
communication in low-power sensor networks. The HOST is a network router that
communicates wirelessly like Wi-Fi, 6LowPAN, etc.

104
Step 5: Code Dumping
Loading the code to the microcontroller is called dumping. The microcontrollers
understand only binary language. So we need to load the hex code into the
microcontroller. There are lots of software available in the market for loading the code to
the microcontroller. Here we have used ‘Willer’ programmer software to dump the code
to the STM32F103C8 microcontroller. The programmer kit comes with the software and
the hardware kit.

This software needs to be installed onto the computer. The hardware kit comes with a
socket wherein the microcontroller is placed. The following are the steps to load the code
onto the microcontroller:

Contiki Operating System


Contiki is an open source, highly portable, multi-tasking operating system for memory-
efficient network-embedded systems and wireless-sensor networks. Contiki is designed
for microcontrollers with small amounts of memory. A typical Contiki configuration is 2
kilobytes of RAM and 40 kilobytes of ROM. Contiki provides IP communication, both for
IPv4 and IPv6. Contiki and its IPv6 stack are IPv6 Ready Phase 1 certified and, therefore,
have the right to use the IPv6 ready silver logo. Contiki introduced the idea of using IP
communication in low-power sensor networks. The HOST is a network router that
communicates wirelessly like Wi-Fi, 6LowPAN, etc.

This software needs to be installed onto the computer. The hardware kit comes with a
socket wherein the microcontroller is placed. The following are the steps to load the code
onto the microcontroller:

105
Ÿ Interface the hardware (programmer kit) to the computer by a serial cable.

Ÿ Place the microcontroller on the socket of the hardware kit. Press the lock button to
ensure that the microcontroller is connected to the board.

Ÿ Open the software installed in the computer. It displays some operating modes.

Ÿ Select any mode. A window with a menu bar appears.

Ÿ Click the ‘file’ menu and select the ‘load file’ option from the drop-down menu.

Ÿ Click the ‘auto’ button so that the hex file is loaded to the microcontroller.

Step 6: Simulating the Circuit


Ÿ Open the project in the Coocox software.

Ÿ Click the ‘Debug’ menu.

Ÿ Select the HyperTerminal and see the sending message on that window.

106
Chapter-8
Interfacing GSM module with the Microcontroller

8.1 Introduction to GSM Modem


A GSM modem is either a mobile
phone or a modem device, which
can be used to make a computer or
any other processor communicate
over a network. A GSM modem
requires a SIM card for operation
and operates over a network range
subscribed by the network operator.
It can be connected to a computer
through a serial, USB or Bluetooth
connection.

GSM Modem

A GSM modem can also be a standard GSM mobile phone with an appropriate cable and
software driver to connect to a serial port or USB port on your computer. The GSM
modem is usually preferred instead of a GSM mobile phone. The GSM modem has a wide
range of applications in transaction terminals, supply chain management, security
applications, weather stations and GPRS mode remote-data logging.

8.2 GSM modem interfacing


Nowadays many applications of the projects such as home automation, remote control
industrial machines and security system, etc., are controlled by a SMS using
microcontroller and GSM Modem. A GSM modem is a specialized type of modem which
accepts a SIM card, and operates through a subscription with the mobile operator. Many
people don't know how to interface a GSM modem to a microcontroller and, therefore,
the following steps explain the basics of interfacing a GSM module to the microcontroller.

107
8.3 Steps for Connecting a GSM modem to the microcontroller
Step1: Configuring the GSM Modem

Ÿ The GSM modem is a specific type of modem which accepts the SIM for
communication. First, insert a SIM into the GSM modem which uses the same number/
account as the caller phone.
Ÿ The modem supports a list of ‘AT commands’ for handling the text messages. These AT
commands programmed in the microcontroller ensure sending or receiving of the
SMS from the GSM modem, without which the text messages cannot be sent or
received.
Ÿ For example : Initializing commands for different types of modem are given below:

Siemens: AT+CNMI=1,1,0,2,1

WaveCom: AT+CNMI=2,1,0,1,1

SonyEricsson: AT+CNMI=3,1,0,1,0

Motorola USB modem: AT+CNMI=3,1,0,0,0

Ÿ The modem is configured to send notifications to the microcontroller upon receiving a


new text.

Ÿ Configure the modem port speed as a rule such as 9600 or 19200 bps baud rates.

108
Step2: Testing the GSM Modem

Ÿ The GSM modem consists of two LEDs such as green and red LEDs for the indication of
network connection. If there is no network, then the red LED glows, and if a network is
available then the green LED glows so that one can observe the GSM modem's
working.

Ÿ Connect a power supply to a SIM contained GSM modem and wait till it is registered in
the GSM network. Then you can send a SMS to the GSM modem for testing; if it
receives the message from the mobile – it is working fine, or else – it is faulty.

Step3: Interfacing the GSM Modem with the Microcontroller

Ÿ The GSM modem cannot be connected directly to the microcontroller because the
microcontroller works with 5v DC power supply, whereas the GSM modem with
a12V DC. Therefore, the voltages levels mismatch.
Ÿ The GSM modem is interfaced to the microcontroller through a MAX-232 device with
the help of RS-232 cable for serial data communication wherein the MAX-232 device is
used to convert the TTL/COM logic levels to RS-232 logic levels during serial
communication of microcontroller to the GSM modem.
Ÿ The RS-232 defines the interface between data terminal equipment and data
communication equipment using serial binary data exchange. The RS-232 cable is
commonly available with the 9 or 25 pin wiring and has jumpers to provide
‘handshaking’ pins for those devices that require it.

GSM Modem Interfacing with 8051 Microcontroller

109
Step4: Program to the microcontroller

1. Transmitting single character

2. Transmitting word

3. Receiving char

#include<reg51.h>
Void init_RS 232();
Void Tx_Char(unsigned char ch);
Void Tx_String(unsigned char *str);
Void Rx_Char();

Void init_RS 232()


{
TMOD|=0x20; //Timer 1 in mode 2 ( Auto Reload mode)
TH1=0XFD; //0xFD for 9600bps
SCON=0x50; //Enable TI and RI pins using Serial control Register
TR1=1; //Start Timer 1;
}
Void Tx_Char(unsigned char ch)
{
SBUF=ch; // Load the character into SBUF register to transmit.
while(!TI); //wait for TI flag to raise high
TI=0; //clear TI for further transmission.
}
Void Tx_String(unsigned char *str)
{
while(*str)
Tx_Char(str++);
}
Void Rx_Char()
{
while(RI==1); //wait for RI flag to receive any character
Ch=SBUF; // capture the character from SBUF into Ch variable
RI=0; //clear RI flag for further reception
}
If a user wants to create an SMS to some other mobile through microcontroller upon
interrupt either from internal or external device, he/she can follow the below program in
addition to the above one.

110
Serial Interrupt programming:

111
Hardware Interrupt Program:

Step5: Circuit Connections:


The 5v DC power supply is given 40th pin of
the microcontroller to run the circuit. The
GSM modem is interfaced with the 10 and11
pins of the microcontroller with the help of
the MAX-232 device for transmitting and
receiving the information serially. The LCD
display is connected to port 0 of the
m i c ro c o n t ro l l e r f o r d i s p l a y i n g t h e
predefined information. A crystal is oscillator
connected to the 18th and 19th pins of the
microcontroller to provide clock pulses. The
RESET button is connected to the 9th pin of
the microcontroller for rebooting the
controller when it is not functioning
properly.

112
8.4 The Working Procedure of a GSM modem
A GSM modem communicates with the microcontroller with a mobile phone through a
UART protocol and needs three basic signals: RXD (receive), TXD (transmit), GND
(ground), respectively.

The GSM modem interfaced with the microcontroller controls industrial appliances by
SMS. As each load has an assigned unique-identify number like ‘1111’ is load1, and ‘0000’
is load2 is the program in the microcontroller.
The GSM modem continuously monitors the signals from the input. When the GSM
modem receives the SMS from a user phone, that data is sent to the microcontroller,
serially.

The microcontroller compares this data with the stored one, and if the data matches, the
microcontroller generates corresponding signals to control the electrical load.

113
Chapter-9
Interfacing GPS module with Microcontroller

9.1 Introduction to GPS Module


GPS or Global Positioning System is a satellite navigation system that furnishes location
and time information in all climate conditions to the user. GPS is used for navigation in
planes, ships, cars and trucks also. The system gives critical abilities to military and civilian
users around the globe. GPS provides continuous real time, 3-dimensional positioning,
navigation and timing worldwide.

9.2 How GPS Determines Position


The working/operation of global positioning system is based on the ‘trilateration’
mathematical principle. The position is determined from the distance measurements to
satellites. From the figure, the four satellites are used to determine the position of the
receiver on the earth. The target location is confirmed by the 4th satellite. And three
satellites are used to trace the location. The fourth satellite is used to confirm the target
location of each of those space vehicles. A Global positioning system consists of a
satellite, a controlling station, a monitoring station and a receiver. The GPS receiver takes
the information from the satellite and uses the method of triangulation to determine a
user’s exact position.

114
9.3 Steps for Interfacing a GPS module with the Microcontroller

Step1: Testing Procedure of GPS Module


Ÿ Connect a power supply to the GPS receiver and wait until it is registered with the GPS
network. Once registered, the GPS provides satellite signals to the user.

Ÿ The GPS module consists of two LEDs such as green and red LEDs for the indication of
network connection wherein the Red-LED is ON for no network and the green LED for
network availability as similar to the GSM modem.

Step2: Interfacing the GSM Modem with the Microcontroller


Ÿ The GPS receiver is interfaced to the microcontroller through MAX-232 device with the
help of RS-232 cable for serial data communication. The MAX-232 device is used to
convert the TTL/COM logic levels to the RS-232 logic levels during the serial
communication of the microcontroller to the GSM modem.

Ÿ The RS-232 defines the interfacing between the data terminal equipment and the data
communication equipment using a serial binary-data exchange. The RS-232 cable is
commonly available with the 9 or 25 pin wiring and has jumpers to provide
‘handshaking’ pins for those devices that require it.

115
Step3: Program to the microcontroller:
Receiving:
Void Rx_Char()
{
while(RI==1); //wait for RI flag to receive any character
Ch=SBUF; // capture the character from SBUF into Ch variable
RI=0; //clear RI flag for further reception
}

WAP for GPS modem to microcontroller:


Here is a watchdog timer, which monitors the data from the GPS modem, and the GPS
module resets for every 15 sec if it doesn’t receive the accurate data. This process runs
for 10 minutes, and once it gets the accurate data, the timer turns off.
#include<reg51.h>
sbit a=P2^1;
int count;
void serial() interrupt 2
{
TR1=1;
SBUF==p;
count++;
}
void main()
{
SCON=0x50;
TMOD=0x20;
IE=0x92;
WDTRST=0x84;
TH1=0xfd;
TR1=1;

while(1)
{

for(i=0;i<4;i++)
{
WDTRST=0x1E;
WDTRST=0xE1;
}
count<=12;
a=1;
}
}
116
}
Step4: Circuit Connections
The 5v DC power supply is given the 40th pin of the microcontroller to run the circuit.
The GPS modem is interfaced to the 10th pin of the microcontroller with the help of
the MAX-232 device for transmitting and receiving the information serially. An LCD
display connected to the port0 of the microcontroller displays the predefined
information, and the crystal oscillator connected to the 18th and 19th pins of the
microcontroller provides the clock pulses. The Reset button connected to the 9th pin
of the microcontroller reboots the controller when it does not function properly.

117
9.4 Step5: Working Procedure:
The GPS module is communicate the microcontroller with longitude latitude of points
through a UART protocol as need a two basic signals which are namely TXD (transmit),
GND(ground). These GPS receivers not only track the exact location but can also compute
velocity and time.
The GPS module using to track the vehicle position on the earth based on longitude and
latitude points. For example the microcontroller is programmed with predefined
locations using longitude and latitude points.
The GPS modules continuously send the data to the microcontroller serially. The
microcontroller compares this data to predefine stored data which is matches to
announce the location name and display on LCD display.

118
Chapter-10
Interfacing RF module with Microcontroller

10.1 Introduction of RF module


In many projects we use RF modules for transmitting and receiving data because it has
high volume of applications than the IR. RF signals travel in the transmitter and receiver
even if there is an obstruction. The RF operates at a specific frequency of about 433MHz.
An RF transmitter receives serial data and transmits this to the receiver through an
antenna which is connected to the 4th pin of the transmitter. When the logic 0 is applied
to the transmitter, then there is no power supply in the transmitter. When the logic 1 is
applied to the transmitter, then the transmitter is on; and, there is a high power supply in
the range of 4.5mA with 3V voltage.

10.2 Interfacing the RF module to the microcontroller


The RF modules such as RF transmitter and RF receiver are interfaced to the
microcontroller with the help of decoder and encoder ICs. The RF modules working with a
certain frequency range transfer and receive the data with analog form, but for a
microcontroller working with the binary data ‘0’ or ‘1s', the RF transmitter is interfaced to
such microcontroller with the help of an encoder, and the RF receiver is connected to the
microcontroller with help of a decoder.

10.3 Circuit Connections


Transmitter
From the circuit, the power supply +3.3V are connected to the 48th pin and ground is
connected to the 8th pin of the microcontroller. Here two switches are connected to the
16th and 17th pins of the microcontroller for controlling the load. A 2*8 LCD display is
connected to the microcontroller to display the information. The RF transmitter is
connected to the 30th pin of the microcontroller for sending the input signals to the
receiver.

119
Receiver:
Ay receiver end has similar connections for power supply as the microcontroller needs
+3.3V, which is same as the transmitter. The RF receiver is connected to the 31st pin of
the microcontroller. The LCD display is connected to the portA of the microcontroller for
displaying the information. The crystal is connected to the 5th and 6th pins of the
microcontroller. The reset button is connected to the 9th pin of the microcontroller.

120
10.4 RF Transmitter and Receiver's Working Procedure
RF transmitter:
Transmitter modules are usually interfaced to the microcontroller, which provides binary
data by sending it to the encoder. The encoder converts the digital data into analog data
and sends it to the RF transmitter module.

RF Receiver
The RF receiver receives the data from the transmitter and sends it to the decoder. The
decoder decodes that data in binary format and sends it to the microcontroller. The
microcontroller generates output signals based on the decoder values to control the
loads.

For example, switching on and off the LED lights through RF technology
A group of LEDs connected to the microcontroller's PORTA terminal.
Reciever Block Code:
#include<reg51.h>
Sbit D0 = P2^0;
Sbit D1 = P2^1;
Sbit D2 = P2^2;
Sbit D3 = P2^3;
Sbit LIGHT = P1^0;
bit INT0_FLAG=0;
Void Int_ISR()
{
INT0_FLAG=1;
}
Void main()
{
P2=0XFF; //P2 as input port
While(1)
{
If(INT0_FLAG)
{
If(D0==1 && D1==1 && D2==1 && D3==0)
LIGHT=1;
If(D0==1 && D1==1 && D2==0 && D3==1)
LIGHT=0;
INT0_FLAG=0;
}
}
}

121
Transmitter Block Code:
#include<reg51.h>
Sbit SW1 = P2^0;
Sbit SW2 = P2^1;
Sbit D0 = P1^0;
Sbit D1 = P1^1;
Sbit D2 = P1^2;
Sbit D3 = P1^3;
Void main()
{
P2=0xFF; //make as input port
While(1)
{
If(SW1==0)
{
D0=1;
D1=1;
D2=1;
D3=0;
}
Else if (sw2==0)
{
D0=1;
D1=1;
D2=0;
D3=1;
}
}
}

122
Chapter-11
Interfacing a Zigbee Module with the Microcontroller

11.1 Introduction to Zigbee


In this present communication world, there are numerous high data rate communication
standards, but none of these meet the sensors’ and controlling devices’ communication
standards. These high-data rate communication standards require low-latency and low-
energy consumption even at lower bandwidths. The available proprietary wireless
systems’ Zigbee technology's low-cost and low-power consumption and its excellent and
superb characteristics makes this communication best suited for several embedded
applications, industrial controlling devices, and home automation systems, and so on.

Zigbee Technology

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.

123
11.2 Interfacing Zigbee Module to the Microcontroller
The Zigbee is a transceiver module constructed with transmitter and receiver. The Zigbee
module can be directly interfaced to the microcontroller of Rx and Tx pins and doesn’t
require any external middleware devices. The Zigbee is half-duplex protocol wherein
transmitting and receiving the data is not possible at the same time.

In manufacturing and production industries, a communication link continually monitors


various parameters and critical equipment. Hence, Zigbee considerably reduces this
communication cost as well as optimizes the control process for greater reliability.

11.3 Circuit Connections


The Zigbee module is connected to the microcontroller with Rx and Tx pins as a
transmitting and receiving module for the information from the designation.

11.4 Zigbee Protocol's Working Procedure


Zigbee is particularly designed locally for networks in home environment, and it does not
directly communicate with the servers on the internet.

Zigbee devices are needed to send and collect the data back to the managing server on
the internet with an additional mechanism.

For example, a gateway can be placed to connect a ZigBee network to the Internet. In a
ZigBee network, end devices collect data and send data to the gateway, which then
translates the data from the ZigBee protocol format to Internet Protocol format, and vice
versa. This allows ZigBee devices to communicate with the servers on the Internet.

124
ZigBee is a popularly adopted communication technology in smart-grid systems. There
are three types of devices in a ZigBee network: coordinator, routers, and end devices. A
coordinator is responsible for establishing, maintaining, and controlling a ZigBee
network.

It allocates network addresses to other nodes that join the network successively. Routers,
sometimes called as Relay nodes, take care of data transmission and have the capability
to extend the scope of a ZigBee network. End devices collect data and transmit it to
routers or coordinators.

125
Programming:

The Zigbee's transmitting and receiving data as a corresponding program is given here.

1. Transmitting single character

2. Transmitting word

3. Receiving char

#include<reg51.h>
Void init_RS 232();
Void Tx_Char(unsigned char ch);
Void Tx_String(unsigned char *str);
Void Rx_Char();

Void init_RS 232()


{
TMOD|=0x20; //Timer 1 in mode 2 ( Auto Reload mode)
TH1=0XFD; //0xFD for 9600bps
SCON=0x50; //Enable TI and RI pins using Serial control Register
TR1=1; //Start Timer 1;
}
Void Tx_Char(unsigned char ch)
{
SBUF=ch; // Load the character into SBUF register to transmit.
while(!TI); //wait for TI flag to raise high
TI=0; //clear TI for further transmission.
}
Void Tx_String(unsigned char *str)
{
while(*str)
Tx_Char(str++);
}
Void Rx_Char()
{
while(RI==1); //wait for RI flag to receive any character
Ch=SBUF; // capture the character from SBUF into Ch variable
RI=0; //clear RI flag for further reception
}

126
Chapter-12
Interfacing a Bluetooth module with the Microcontroller

12.1 Introduction to Bluetooth


A Bluetooth technology is a high-speed low-powered wireless technology link that is
designed to connect phones or other portable equipment together. It is a specification
(IEEE 802.15.1) for the use of low power radio communications to link phones, computers
and other network devices over short distance without wires. The wireless signals
transmitted with Bluetooth cover short distances, typically up to 30 feet (10 meters).

It is achieved by embedded-low-cost transceivers into the devices. It supports on the


frequency band of 2.45GHz and can support up to 721kbps along with three voice
channels. This frequency band has been set aside by international agreement for the use
of industrial, scientific and medical devices (ISM).rd-compatible with 1.0 devices.

Bluetooth can connect up to “eight devices” simultaneously, and each device offers a
unique 48 bit address from the IEEE 802 standard with the connections being made point
to point or multipoint.

12.2 Interfacing a Bluetooth Module to the Microcontroller


The Bluetooth is a transceiver module constructed with a transmitter and receiver. The
Bluetooth module is directly interfaced to the microcontroller of Rx and Tx pins as it
doesn't need any external middleware devices. The Bluetooth is a half-duplex protocol
transmitting and receiving the data, but not at the same time.

12.3 Circuit Connections


The Zigbee module is connected to the microcontroller with the Rx and Tx pins as
transmitting and receiving the information from the designation.

127
12.4 Working Procedure of Bluetooth
A typical Bluetooth network consists of a Personal Area Network (PAN) or a Piconet containing a
minimum of 2 and a maximum of 8 Bluetooth peer devices – usually a single master and upto 7
slaves. A master is the device that initiates communication with other devices. The master device
governs the communications link and traffic between itself and the slave devices associated
with it. A slave device is the device that responds to the master device. Slave devices are required
to synchronize their transmitting and receiving timing with that of the masters. In addition,
transmissions by slave devices are governed by the master device (i.e., the master device
dictates when a slave device may transmit). Specifically, a slave may only begin its transmissions
in a time slot immediately following the time slot in which it was addressed by the master, or in a
time slot explicitly reserved for use by the slave device.

128
The frequency hopping sequence is defined by the Bluetooth device address
(BD_ADDR) of the master device. The master device first sends a radio signal asking
for response from the particular slave devices within the range of addresses. The
slaves respond and synchronize their hop frequency as well as clock with that of the
master device.
Scatter nets are created when a device becomes an active member of more than one
piconet. Essentially, the adjoining device shares its time slots among the different
piconets.

12.5 Programming
For a Bluetooth transmitting and receiving the data programs are given below.
1. Transmitting word
2. Receiving char
#include<reg51.h>
void init_RS 232();

void Tx_String(unsigned char *str);


void Rx_Char();

void init_RS 232()


{
TMOD|=0x20; //Timer 1 in mode 2 (Auto Reload mode)
TH1=0XFD; //0xFD for 9600bps
SCON=0x50; //Enable TI and RI pins using Serial control Register
TR1=1; //Start Timer 1;
}
void Tx_String(unsigned char *str)
{
while(*str)
Tx_Char(str++);
}
void Rx_Char()
{
while(RI==1); //wait for RI flag to receive any character
Ch=SBUF; // capture the character from SBUF into Ch variable
RI=0; //clear RI flag for further reception
}

129
About the Edgefx Team

The credit for each and every bit of information added to this eBook goes to the
team of Edgefx technical writers and authors. The team of Edgefx has been
relentlessly working to ensure that the researched and practically implemented
and pragmatically proven written work of this eBook must serve the purpose of its
readers. With the unmatched technical expertise and pioneering works in the field
of electronics, electrical and robotic engineering Edgefx Kits and solutions has
been providing technical solutions and project kits to millions of engineering
students around the globe, since 1997. The credit for the projects and the circuits
goes to the technical team of the Edgefx.

Right to readers

This book is intended to give practical knowledge on building the electronic


projects in the simplest way possiblewith the practical circuit examples. Any
person interested and looking forward to have this book can enjoy the privilege
and authority to download, reprint and distribute this book. However, no person is
entitled to make any modifications or alternations to the book and to use it for his
or her own monetary profits.

Legal Info

The content, information, concepts, technical inputs, and other such data is the
sole property of the Edgefx Technologies and the team involved in research and
writing. Therefore, the technical content including the images is solely authorized
as the copyrighted material of the Edgefx technologies. The information written in
each and every chapter is written based on relevant research and inputs by the
team of authors. The projects and circuits mentioned in this book are the
properties of Edgefx team and are fully tested and authenticated.

130
Ways to Interact with the

Edgefx Team
https://www.facebook.com/edgefx
https://www.facebook.com/edgefx You
Tube

If you are an engineering student, looking for projects, then the following
link will be of immense help to you:

http://www.edgefxkits.com

If you are looking forward to the technical solutions and information on any
topic relevant to electronics, electrical, robotics and communication, then
click the links given below:

http://www.elprocus.com/

You can also contact us through the social media by liking the following
Facebook pages:

https://www.facebook.com/edgefx

https://www.facebook.com/elprocus

131

You might also like