Académique Documents
Professionnel Documents
Culture Documents
Chapter 1
Scope of the Project
1
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
1.1 Aim:
1.2 Objectives :
In order to achieve the aim of this project, following objectives have been set:
a) To develop hardware modules for wireless data transmission
b) To develop codes for the microcontroller for packetising the data to be
transmitted
c) To establish RF link between the two modules
d) To develop a Graphical User Interface (GUI) to plot the received data .
e) To carryout experiments to measure various parameters like packet loss rate,
and achievable ranges in different environments.
2
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Chapter 2
Background
3
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
4
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Radio Frequency (RF) and wireless have been around for over a century with Alexander
Popov and Sir Oliver Lodge laying the groundwork for Guglielmo Marconi’s wireless
radio developments in the early 20th century. The most prominent of his experiments was
in December, 1901 where he successfully transmitted Morse code from Cornwall,
England to St-John’s, Canada.
Wireless communication is the transfer of information over a distance without the use of
electrical conductors.
Wireless operations permits services, such as long range communications, that are
impossible or impractical to implement with the use of wires. The term is commonly used
in the telecommunications industry to refer to telecommunications systems which use
some form of energy to transfer information without the use of wires.
Below are the various components of a wireless system, described in brief, for better
understanding of the project.
5
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Sensor nodes can be imagined as small computers, extremely basic in terms of their
interfaces and their components. They usually consist of a processing unit with limited
computational power and limited memory, sensors, a communication device (usually
radio transceivers or alternatively optical), and a power source usually in the form of a
battery. Other possible inclusions are energy harvesting modules(like solar panel),
secondary ASICs,etc.
The main challenge is to produce low cost and tiny sensor nodes. With respect to these
objectives, current sensor nodes are mainly prototypes. Miniaturization and low cost are
understood to follow from recent and future progress in the fields of MEMS and NEMS.
Energy is the scarcest resource of sensor nodes, and it determines the lifetime of the
system. Wireless Sensor Networks are meant to be deployed in large numbers in various
environments, including remote and hostile regions, with ad-hoc communications as key.
For this reason, algorithms and protocols need to address the following issues:
1. Lifetime maximization
2. Robustness and fault tolerance
Sensor node is the main building block of Wireless Sensors network. A sensor node, also
known as a mote, is a node in a wireless sensor network that is capable of performing
some processing, gathering sensory information and communicating with other connected
nodes in the network. The typical architecture of the sensor node is shown in figure 2.2.
Main constituent parts of the sensor node are described in general.
6
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
2.2.1.1 Microcontroller.
Microcontroller performs tasks, processes data and controls the functionality of other
components in the sensor node. Microcontrollers are most suitable choice for sensor
node. In general purpose microprocessor, the power consumption is more than the
microcontroller, therefore it is not a suitable choice for sensor node. In Wireless Sensor
Networks, the wireless communication should be modest i.e. simpler, easier to process
modulation and signal processing tasks of actual sensing of data is less complicated.
Transceiver
Sensor 1
Sensor 2
External Memory
2.2.1.2 Transceiver
Sensor nodes make use of ISM band which gives free radio, huge spectrum allocation
and global availability. The various choices of wireless transmission media are Radio
frequency, Optical communication (Laser) and Infrared. Laser requires less energy, but
needs line of sight for communication and also sensitive to atmospheric conditions.
Infrared like laser, needs no antenna but is limited in its broadcasting capacity. Radio
7
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Frequency (RF) based communication is the most relevant that fits to most of the WSN
applications. WSN’s use the communication frequencies between about 433MHz and
2.4GHz. The functionality of both transmitter and receiver are combined into a single
device known as transceivers are used in sensor nodes. The operational states are
Transmit, Receive, Idle and Sleep.
2.2.1.4 Sensors
Sensors are hardware devices that produce measurable response to a change in a physical
condition like temperature and pressure. Sensors sense or measure physical data of the
area to be monitored. The continual analog signal sensed by the sensors is digitized by
Analog-to-Digital converter and sent to controllers for further processing. Characteristics
and requirements of Sensor node should be small size, consume extremely low energy,
operate in high volumetric densities, be autonomous and operate unattended, and be
adaptive to the environment. As wireless sensor nodes are micro-electronic sensor device,
they can only be equipped with a limited power source. Each sensor node has a certain
area of coverage for which it can reliably and accurately report the particular quantity that
it is observing.
8
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Unlike traditional wired systems, deployment costs would be minimal. Instead of having
to deploy thousands of feet of wire routed through protective conduit, installers simply
have to place quarter-sized device, such as the one pictured in Figure above, at each
sensing point.
9
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Chapter 3
Introduction
10
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
3.1 Introduction
Sensor
Network PIC µ-controller
Packetized data
Ant
Transceiver
vcc GND
11
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
The central unit consists of another BiM-433 transceiver module which is interfaced to
PC for monitoring purpose via RS 232 link.
PC
Ant
The BiM-433 module integrates a low power UHF FM transmitter and matching superhet
receiver and TX/RX change over circuits to provide a low cost solution to implementing
a Bidirectional short range radio data link. It operates in ISM band of 433.05 MHz to
434.79 MHz. The high data rates (upto 40kbit/s) and fast TX/RX changeover (<1ms)
make the BiM-433 transceiver ideal for high integrity one to one links / multi-node
packet switch networks. Rapid RX power up ( <1ms ) allows effective duty cycle power
saving of the receiver for battery powered applications.
12
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Further details regarding BiM-433 transceiver module are provided in the Appendix A.
13
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
PIC 18F252 includes a number of peripheral features like Timers, MSSP, ADC, USART,
CCP etc. It is fantastic features of PIC with regard to peripheral that it has earned its
name PIC which stands for Peripheral Interface Controller.
The microcontroller PIC 18F252 is 28 pin chip. Out of 28 pins 22 pins can be used as I/O
ports almost independently. Many pins are multiplexed and provide dual functionality.
The pin description and other details of PIC 18F252 are given in Appendix B for ready
reference.
Software has two main objectives as interfacing and packet programming. Certain tools
and softwares are required to program the programmable device. Tools are required
during and after development of firmware. Typical tools required during firmware
development are editor to develop applications in assembly or a high level language. The
source file written using an editor is required to be converted into machine readable form
i.e. binary format. For this either an assembler or a compiler could be used. The hex file
so obtained is loaded into microcontrollers’ program memory using a programmer.
By using MPLAB IDE, all the functions are integrated, allowing the engineer to
concentrate on completing the application without the interruption of separate tools and
different modes of operation. The program for acquiring data from sensors and
packetising has been developed in C language for PIC 18F252 microcontroller.
14
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Before the hardware can be tested by interfacing with GUI, it is proper to test it using a
terminal program; all PCs are equipped with hypertext terminal which can be used to test
the device. However hypertext terminal sends the ASCII value for incoming binary data
to window or file as per the settings made. Other terminal program meant for serial data
can also be used; such programs can be easily downloaded from internet. Testing the
application with hyper terminal like programs also removes another probable source of
error during initial testing. Once application is found working correctly it can be
interfaced with GUI.
In this project, the GUI has been programmed in Visual Basic 6.0. It is a 5th generation
programming language with lots of functionalities and provides extensive help and
support library.
The codes of GUI and packet controller program are included in chapter 5 .
15
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Chapter 4
Hardware Development
16
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
a) First start by checking the PCB to make sure it is clean and free from dirt.
b) Next mount all the passive components, this includes the resistors and capacitors.
d) Next the active components are fitted, this includes all the ICs and the voltage
regulator. The voltage regulator does not require a heat sink, so it can be placed flat
against the PCB. The ICs may be mounted in sockets or soldered directly to the PCB.
e) Now the pin-headers are fitted to the appropriate holes on the PCB. If you prefer
not to use pin- headers and connectors, you may solder the wires of the external
components directly to the PCB.
f) Now the circuit is ready to attach the external components. These include the
microcontroller, transceiver module and the DB-9 connector.
Now the serial connector is prepared. DB-9 connector is used in this project. The
IBM PC serial port contains several data and handshake lines. Only the Transmit Data
(TD), Receive Data (RD) and common ground (GND) lines would be used.
Handshaking will be done in software. In order to make the serial port alert the Data
Terminal Ready (DTR) line to the Data Set Ready (DSR) and Data Carrier Detect
(DCD) lines are needed to be connected. We also need to connect the Request To
Send (RTS) line to the Clear To Send (CTS) line. This has the effect of tricking the
serial port into thinking that it is always ready to receive and send data. These links
should be soldered inside the connector itself. Only 3 wires are required for the
connection to the transceiver. Connect the three wires to the RD (pin 2), TD (pin 3)
17
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
and GND (pin 5) lines of the connector. For the transmitter, wire only the TD (pin 3)
and GND (pin 5) lines.
The field unit comprises of a temperature sensor IC LM 35, PIC 18F252 microcontroller
and a BiM transceiver .The execution sequence of the field unit is given below:
a) LM35 senses the temperature data within temperature range -55 °C to +150 °C. It
generates 10mV signal per 1 °C.
b) LM35 is interfaced to port A of PIC 18F252.
c) PIC acquires 100 samples of voltage signal, averages them and then converts into
corresponding temperature value in degree Celsius.
d) In similar fashion, the light intensity is sensed by LDR and gives the
corresponding voltage signal through the other channel.
e) These two data fields are then combined to form a single data packet and
transferred to BiM transceiver through port C for transmission over RF link.
18
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
20
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Central unit constantly monitors any change that occurs at the field unit site. In this unit,
the BiM transceiver module is interfaced with the PC through MAX 232 IC. The
sequence of execution is given below:
21
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
22
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
23
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Chapter 5
Firmware Development
And
GUI
24
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
While developing software it is important to realize that error free building of firmware
do not guarantee desired performance. The tool being used is capable of only brining of
syntax errors. Logical errors are needed to be removed for desired performance.
Simulator is used to bring out and remove logical errors from the source code. External
stimulus is given to the code while running on PC, and the results are analyzed for
desired performance, ambiguity if any is then taken care off by removing logical errors in
the firmware.
The resources required for developing the firmware are
1. MPLAB IDE
2. PROGRAMMER KIT
3. High Level Language Support.
25
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
The PICSTART Plus development programmer has number of features, important among
them is its capability to program PICmicro microcontrollers, including program memory,
configuration bits and ID locations. It operates as a Windows® application on a PC-
compatible host system within the MPLAB Integrated Development Environment (IDE).
Using MPLAB IDE, you can create, display and edit data to be programmed into PIC
micro microcontrollers (MCUs).
Select Configure>Select Device to select the device you wish to program from the list of
available devices. When you select a device, indicators next to the Microchip Tools
names show the level of support for that device: green - supports the device, yellow -
limited support and red - no support. You can continue only if device being programed is
supported by PIC START Plus programmer.
MPLAB IDE supports number of programers like MPLAB ICD2, AN851, MPLAB MP3,
PROMATE II. After selecting the programmer, PICSTART Plus in this case,
programmer is required to be enabled.
After doing all this the Hex File is loaded into Program Memory. MPLAB IDE provides
options to do this. If you have a hex file ready for programming into a PICmicro
microcontroller, select File>Import and navigate to the location of your hex file. Select
your hex file and click Open to load your hex code into the MPLAB IDE Program
26
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Memory window. If the Program Memory window is not open, select View>Program
Memory to open it.
If you do not have a hex file to program your device, you can build one using MPLAB
IDE Projects. The MPLAB IDE provides a text editor for generating source code and is
compatible with various assemblers/compilers for assembling/compiling your source
code into hex code in MPLAB IDE program memory. Special care is needed to be payed
to the configuration bits as they decide various modes in which final application runs. If
you need to change the configuration bits for a device from the factory-default settings , it
could be performed either by selecting appripriate option from MPLAB IDE or by
implementing it in the code.
Once this is done , the chip being programmed is required to be tested to ensure it is
blank, if it is not, options are available to erase the existing chip. Though if already
programmed chip is programmed again previous coder is over written. After
programming the chip with desired code, program could be verified and read. Any
discrepency if any is displayed on output window. All the said options are provided in
MPLAB IDE and are very easy to use. The chip can be inserted in the prototype
hardware and finally tested.
27
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
28
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
START
INITIALIZE PORTS
NO LOO
P=
‘EN
YES
STOP
29
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
#include <18F252.h>
#device adc=10
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
30
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
31
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
void main()
{
setup_adc_ports(ALL_ANALOG); // Initialisation for
setup_adc(ADC_CLOCK_INTERNAL); // PIC micro controller
setup_spi(SPI_SS_DISABLED);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_ccp2(CCP_OFF);
while(TRUE)
{
}
}
32
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
The data packet generated by above program consists of 11 bytes of data where TT gives
two digit temperature value and LL.LL gives light intensity value upto two decimal
places. The first byte ‘!’ indicates starting of a new packet and last byte ‘\r’ indicates end
of the data packet.
33
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
34
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
35
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
cnt = cnt + 1
If cnt = 100 Then
x = x + 20 'increment x-axis value by 20 pixels
y = y / 100 'Avg of 100 values
Picture1.Circle (x, y), 2, vbRed ‘Draw a circle at corresponding x & y values
y=0
cnt = 0
Text2.Text = Text2.Text + Y1 + " : "
Text2.Refresh
36
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
End If
If x >= 500 And w < 15 Then ‘The end of x-axis on picture box
Picture1.Cls
x = 100 'initial value of x
End If
Next d
End Sub
Picture1.Cls
End Sub
37
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
38
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Private Sub Command2_Click() ‘Clear all text boxes & picture box
Text3.Text = ""
Text5.Text = ""
Text2.Text = ""
Text4.Text = ""
Text6.Text = ""
Text7.Text = ""
Picture1.Cls
End Sub
39
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
CLOSECOM
End Sub
If (dat > -1) And (dat <> 13) And (dat <> 10) Then
Text5.Text = Text5.Text + Chr$(dat) 'actual data decode here
Text2.Text = Text2.Text + Chr$(dat)
cnt = cnt + 1
Count1 = Count1 + 1
'Extraction of data
If cnt = 11 Then
Data = Text2.Text
Text4.Text = Text4.Text + Data + ";--- "
Text4.Refresh
temp1 = Mid$(Text2.Text, 5, 2) ‘Temperature extraction
temp = Val(temp1) ‘Convert to float
Text6.Text = Text6.Text + temp1 + " "
Text2.Text = ""
cnt = 0
40
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
End If
'plotting
ty = 100 – temp ‘Y-axis temperature value
ly = 200 - (ldr * 10) ‘Y-axis LDR value
x = x + 20
End If
'initialisation
Count1 = 0
End If
End Sub
41
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Chapter 6
Experiments
42
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
The experiment was carried out in parade ground, Rozi Temple area, ward room area and
near salt panes to find the maximum achievable range. For this purpose, the central unit
was connected to a laptop and field unit was moved till the data received was
unrecognizable. Following observations were made:
43
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Above readings were taken with a 10dB attenuator between the receiver and the spectrum
analyzer.
As mentioned in the data sheet of BiM-433 transceiver, it was practically found that the
data received at around 25 meters was garbled with -103dBm of the received power
(value given in the data sheet is -100dBm).
45
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
The fidelity of the system can be found out by calculating the ratio of faithfully received
data packets to the total number of data packets received in a specified time. Following
table shows the observations made at the various ranges in parade ground.
Hence, it was observed that the system is operating satisfactorily till 50 meters of range.
46
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
Chapter 7
Conclusion
47
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
The system developed here is found to be operational and would suffice the following
requirements of a user:
Moreover, the experiments carried out at various locations have given us an insight to
how the communication is affected by various environmental conditions.
Finally, almost all the objectives as set in the beginning have been achieved to a
considerable extent.
48
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
CHAPTER 8
Future Scope
49
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller
This module can be utilized for much more capabilities then demonstrated in this project.
So, quite more efforts are required in following areas:
50
INS VALSURA Faculty Of Training Projects