Professional Documents
Culture Documents
Communication: Works in Projects?
Communication: Works in Projects?
(Electromagnetic waves)
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
Chapter 5
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
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
Chapter-8
Chapter-9
6
Chapter-10
Chapter-11
Chapter-12
7
Chapter 1
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.
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.
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.
Frequency: The time taken to execute a number of electromagnetic wave cycles per sec
is called as frequency.
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.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.
Ac cos(2πƒ ct+ Φ)
Analog Modulation
Amplitude Phase
Frequency
Angle
(Frequency = Rate of Change of Angle)
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.
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.
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.
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.
Ÿ 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.
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.
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.
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.
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.
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.
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.
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.
25
2. Single Master and Multiple Slave Implementations
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.
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
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;
}
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.
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.
All the above types of antennas, their importance and applications are briefly discussed
below:
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.
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.
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.
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
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.’
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
43
Antenna:
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.
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 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.
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.
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:
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.
48
Chapter 4
Various Types of Efficient Communication Systems at Cheaper Cost
to Develop Low-Cost Projects
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.
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
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.
Features of RF Module:
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.
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.
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.
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.
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
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.
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
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.
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:
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.
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.
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.
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.
62
Chapter 6
2.4-GHz Wireless Communication with Transceivers
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.
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,
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.
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.
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.
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.
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.
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 use binary phase shift keying (bpsk) modulation
technique.
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 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
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.
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
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 Grid monitoring: Zigbee operations in this smart grid involve remote
temperature monitoring, fault locating, reactive-power management, and so on.
77
Applications of Zigbee Technology
Ÿ The 6LoWPan network transceivers use binary phase shift keying (bpsk) modulation
technique.
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.
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
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.
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.
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 use quadrature phase shift keying (QPSK and
DSSS) and supports modulation technique.
Ÿ 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.
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.
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 transceivers use Gaussian Frequency Shift Keying (GFSK) modulation
technique.
85
6.1.8 Ultra-low-power Transceiver Module
Ÿ The Ultra-low-power transceivers use and support On-Off keying (OOK) modulation
technique.
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.
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.
Ÿ An operating system maintains the information about the socket and its connection.
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.
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:
Ÿ 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).
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.
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
Ÿ Data frame,
Ÿ Beacon frame,
Ÿ Acknowledgement 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.
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).
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.
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.
Ÿ 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;
void NVIC_Configuration(void);
void GPIO_Configuration(void);
void USART_Configuration(void);
void USART1_IRQHandler(void);
void USART1_IRQHandler(void)
i = USART_ReceiveData(USART1);
if(j == NUM)
name[j] = i;
j = 0;
else
99
name[j++] = i;
name[j] = '\0';
void usart_init(void)
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA,
ENABLE);
/* NVIC Configuration */
NVIC_Configuration();
GPIO_Configuration();
USART_Configuration();
/* Enable the USART1 Receive interrupt: this interrupt is generated when the
UARTSend(menu, sizeof(menu));
100
while(1)
void GPIO_Configuration(void)
GPIO_InitTypeDefGPIO_InitStructure;
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);
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_Init(USART1, &USART_InitStructure);
/* Enable USART1 */
USART_Cmd(USART1, ENABLE);
void NVIC_Configuration(void)
NVIC_InitTypeDefNVIC_InitStructure;
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);
Ÿ Select the ‘debug’ menu. It checks the program for any errors.
Ÿ 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.
Ÿ 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.
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:
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.
Ÿ 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.
Ÿ Select the HyperTerminal and see the sending message on that window.
106
Chapter-8
Interfacing GSM module with the Microcontroller
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.
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
Ÿ 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.
Ÿ 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.
109
Step4: Program to the microcontroller
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();
110
Serial Interrupt programming:
111
Hardware Interrupt Program:
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
114
9.3 Steps for Interfacing a GPS module with the Microcontroller
Ÿ 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.
Ÿ 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
}
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
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
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.
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.
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();
126
Chapter-12
Interfacing a Bluetooth module with the Microcontroller
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.
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();
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
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