Vous êtes sur la page 1sur 50

Data Acquisition console with wireless transmission using Radio Packet Controller

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:

To study the performance characteristics of a wireless data transmission system.

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

2.1 Wireless Systems

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.

The following situations justify the use of wireless technology:

* To span a distance beyond the capabilities of typical cabling,

* To avoid obstacles such as physical structures, RFI,

* To provide a backup communications link in case of normal network failure,

* To link portable or temporary workstations,

* To overcome situations where normal cabling is difficult or financially impractical,

* To remotely connect mobile users or networks.

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

2.2 Sensor Node

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

2.2.1 Building Blocks of Sensor Nodes

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

Power Supply Microcontroller ADC

Sensor 2

External Memory

Fig. 2.2 : General Block diagram of Wireless Sensor Node.

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.3 Power Source


Power consumption in the sensor node is for the Sensing, Communication and Data
Processing. More energy is required for data communication in sensor node. Energy
expenditure is less for sensing and data processing. The energy required of transmitting
1Kb data over a distance of 100 m is approximately the same as that for executing 3
million instructions by 100 million instructions per second/W processor. Batteries are the
main source of power supply for sensor nodes. Two types of batteries can be used viz.
rechargeable and non-rechargeable. With the device presented in this thesis, the system
would be capable of monitoring for about 15-20 Hrs continuous operation on a single set
of batteries.

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

This project is a typical embedded system development. Such an application is


amalgamation of both software and hardware.
The hardware consists of two units, namely field unit and central unit. The field unit
continuously acquires data using sensors and converts it into packetized data using PIC
microcontroller. This data packet is then transmitted to central unit via RF link using the
transceiver module. The transceiver used in this application is Radiometrix BiM-433
Transceiver operating in 433 MHz ISM band.

Sensor
Network PIC µ-controller

Packetized data
Ant

Transceiver

vcc GND

Fig 3.1: Field unit

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

MAX 232 Transceiver

vcc GND DATA

Fig 3.2 Central unit

3.2 Why BiM-433 Transceiver module?

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

The salient features of BiM-433 Transceiver module are

• Miniature PCB Mounting module

• License Exempt operation in 433 MHz ISM band

• SAW controlled FM transmission

• Double conversion Super-heterodyne receiver

• -107dBm receive sensitivity

• Single 4.5 to 5.5V supply < 15mA (Tx or Rx)

• Half duplex data at upto 40 kbit/s

• Reliable 30 meter in-building range

• Direct interface to 5V CMOS logic

• Fast 1ms power up enable for duty cycle power saving

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

3.3 Why PIC 18F252 Microcontroller?

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.

The combination of BiM-433 transceiver and PIC 18F252 microcontroller makes a


complete assembly which packetises and transmits the data over a radio link. This
arrangement is referred to as Radio Packet Controller in this project.

3.4 Resources for Developing Firmware

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

3.5 GUI Development

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

4.1 Steps for Hardware Development

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.

c) Now the diodes can be mounted taking note of their polarity.

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.

4.2 Field Unit Hardware

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

4.2.1 Circuit Diagram of Field Unit hardware

Fig.4.1. circuit diagram of field unit


19
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

Picture 4.1 Field Unit

20
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

4.3 Central Unit Hardware

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:

a) The RF signal is received by the BiM transceiver.


b) This received signal is routed to input pin of MAX232 IC through RxD pin of
BiM transceiver module.
c) MAX 232 converts the signal from TTL logic into CMOS logic which is
compatible to PC and is communicated through RS232 port.
d) This signal is decoded with the help of an algorithm and is displayed on the GUI.

21
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

4.3.1 Circuit Diagram of Central Unit Hardware

Fig.4.2 circuit diagram of central unit

22
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

Picture 4.2 Central Unit

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

5.1 Firmware Development :

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.

5.2 MPLAB IDE

MPLAB IDE is a software program that runs on a PC to develop applications for


Microchip microcontrollers. It is called an Integrated Development Environment, or IDE,
because it provides a single integrated "environment" to develop code for embedded
microcontrollers. MPLAB IDE is a "wrapper" that coordinates all the tools from a single
graphical user interface, usually automatically. For instance, once code is written, it can
be converted to executable instructions and downloaded into a microcontroller to see how
it works. In this process multiple tools are needed: an editor to write the code, a project
manager to organize files and settings, a compiler or assembler to convert the source code
to machine code and some sort of hardware or software that either connects to a target
microcontroller or simulates the operation of a microcontroller.

25
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

5.3 PICSTART Plus Programmer

The PICSTART Plus is a Microchip microcontroller development programmer that


enables you to program user software into PICmicro microcontroller devices. PICSTART
Plus uses RS-232 Interface cable to connect to any standard PC serial port. The
PICSTART Plus development system is designed, tested and certified to meet the
Electromagnetic Compatibility requirements known as the CE compliance directives.

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).

5.4 The procedure to program a device

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

5.5 Execution Flow chart for packetizing data

28
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

START

INITIALIZE PORTS

INPUT DATA TEMP


LDR

MAKE DATA PACKET


“!,TT,LL.LL\r”

TRANSFER DATA PACKET TO TxD


PIN OF BiM Tx/Rx

NO LOO
P=
‘EN

YES

STOP

29
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

5.6 C Program for Radio Packet Controller

#include <18F252.h>
#device adc=10

#FUSES NOWDT //No Watch Dog Timer


#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES HS //High speed Osc (> 4mhz)
#FUSES PROTECT //Code protected from reads
#FUSES NOOSCSEN //Oscillator switching is disabled, main oscillator is source
#FUSES BROWNOUT //Reset when brownout detected
#FUSES BORV20 //Brownout reset at 2.0V
#FUSES PUT //Power Up Timer
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/
O
#FUSES WRT //Program Memory Write Protected
#FUSES NOWRTD //Data EEPROM write protected
#FUSES WRTB //Boot block write protected
#FUSES WRTC //configuration registers write protected
#FUSES CPD //Data EEPROM Code Protected
#FUSES CPB //Boot Block Code Protected
#FUSES EBTR //Memory protected from table reads
#FUSES EBTRB //Boot block protected from table reads

#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

float LDR_Val, Temperature; // variables for LDR and Temperature values

30
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

void Read_Temperature() // Function to read 1st ADC channel


{
byte i; // variable for loop
set_adc_channel(0);
delay_ms(100);
Temperature = 0;
for(i=0; i<100; i++)
Temperature += (float)read_adc(); // Add 100 values as obtained from sensor

Temperature /=100.0; // Average of 100 values

Temperature /= 2.0; // converting to equivalent temperature


}

void Read_LDR() // Function to read 2nd ADC channel


{
byte i; // variable for loop
set_adc_channel(1);
delay_ms(100);
LDR_Val = 0;
for(i=0; i<100; i++)
LDR_Val += (float)read_adc(); // Add 100 values as obtained from sensor

LDR_Val /= 100.0; // Average of 100 values

LDR_Val = (LDR_Val * 5.0) / 1024.0; // converting to equivalent LDR value


}

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)
{

Read_Temperature(); // Call functions to read


Read_LDR(); // temperature & LDR values

putc(0xff); // ASCII equivalent 255


putc(0xff);
putc(0x01);

printf("!,%2.0g,%2.2g\r\n",Temperature,LDR_Val); // making data packet

}
}

32
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

5.7 Data Packet Format

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.

Start Temperature LDR End


byte value value byte
! , T T , L L . L L \r

33
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

5.8 Graphical User Interface

Picture 4.1 Simulator GUI for data entry

34
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

Picture 4.2 GUI after data decoding & plotting

35
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

5.9 SIMULATOR GUI PROGRAM

Private Sub Command1_Click()


x = 100 'initial values
y=0
cnt = 0
w=1

For d = 1 To 1500 ‘loop to plot temperature values 15 times

Y1 = Mid$(Text1.Text, w, 2) ‘Extracting temperature value as string


y = y + (200 - Val(Y1)) 'sum of (200-value of temperature to plot)

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

For del = 1 To 20000000 'delay


Next del

w=w+3 ' To fetch next value

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

Private Sub Command2_Click()


Text1.Text = " "
Text2.Text = " "

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

5.10 TERMINAL GUI PROGRAM FOR PLOTTING

Private Sub Check1_Click()


If Check1.Value Then DTR 1 Else DTR 0
End Sub

Private Sub Check2_Click()


If Check2.Value Then RTS 1 Else RTS 0
End Sub

Private Sub Command1_Click()


CLOSECOM
OPENCOM Text1.Text ‘Open COM port as per text box
DTR 0
Check1.Value = False
RTS 0
Check2.Value = False
End Sub

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

Private Sub Form_Load()


CLOSECOM
OPENCOM "COM1:9600,N,8,1" ‘Open COM port with
DTR 0 ‘9600 bps baud rate
Check1.Value = False
RTS 0
Check2.Value = False
Text2.Text = " "
Text4.Text = " "
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me

39
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

CLOSECOM
End Sub

Private Sub Timer1_Timer()


Do
dat = READBYTE ‘Read data from COM1 port
‘This data is in ASCII value
If dat > -1 Then
Text3.Text = Text3.Text + Str$(dat) + " " ‘Convert data to string for
n=n+1 ‘display

If n = 8 Then n = 0: Text3.Text = Text3.Text + Chr(13) + Chr(10)


Text3.Refresh ‘Line feed after evry 8 inputs
End If

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 + " "

ldr1 = Mid$(Text2.Text, 8, 4) ‘LDR value extraction


ldr = Val(ldr1) ‘convert to float
Text7.Text = Text7.Text + ldr1 + " "

Text2.Text = ""
cnt = 0

40
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

End If

If Count1 = 100 Then

'plotting
ty = 100 – temp ‘Y-axis temperature value
ly = 200 - (ldr * 10) ‘Y-axis LDR value

x = x + 20

Picture1.Circle (x, ty), 2, vbGreen ‘Plot for temperature


Picture1.Circle (x, ly), 2, vbRed ‘Plot for LDR value

If x = 360 Then ‘ End of x-axis


Picture1.Cls
x = 100 ‘Initial value of x
End If

End If

'initialisation
Count1 = 0

End If

If dat = 13 Then ‘Line feed


Text5.Text = Text5.Text + Chr$(13) + Chr$(10)
Text5.Refresh
End If
Loop Until dat = -1

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

To study the characteristics of the Transceiver, a few experiments were conducted


which included range variation at different locations and performance analysis of
the transmitter using spectrum analyser. The experiments have delivered results
which are comparable to the data sheet of BiM-433 module.

6.1 Experiment 1: To find maximum range of module at different locations

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:

Location Range Achieved

Parade Ground 50- 55mtrs

Salt Panes 40-45mtrs

Rozi Temple Area 30-35 mtrs

Wardroom Area 10-15 mtrs

43
INS VALSURA Faculty Of Training Projects
Data Acquisition console with wireless transmission using Radio Packet Controller

6.2 Experiment 2: Performance Analysis of transmitter using spectrum analyser

The transmitter characteristics were observed using spectrum analyser at NEU(J),


Jamnagar. The spectrum analyser was connected to a standard gain dipole antenna which
was made to receive signal from the field unit with varying distance. As expected, the
received power was decreasing with increase in range. Following graph represents the
observed trend.

Graph 6.1 Distance Vs Received Power

Distance Received power (dBm)


3 -65.17
6 -68.9
10 -71.17
15 -86.3
20 -93.5
25 -96
44
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.

Picture 6.1: Received signal on spectrum analyser

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

6.3 Experiment 3: To find out the fidelity of the system.

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.

Range Total No. of No. of Faithfully Percentage of


Packets Received received packets faithfully received
packets
10 mtr 10 10 100
20 mtr 10 10 100
30 mtr 10 9 90
40 mtr 10 10 100
50 mtr 10 7 70
55 mtr 10 1 10

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:

a) Remote monitoring of maximum 10 parameters


b) It can be employed to transmit data upto 50 meters in open spaces and upto 15
meters inside buildings.
c) In the specified range the system has been quite faithful in transmitting the data.
d) The system can be receive the signal as low as -100 dBm .

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:

a) Designing a multi-node architecture instead of current peer to peer


communication hardware.
b) Development of two way communication hardware which would enable
controlling of field unit from central unit.
c) Study the application of directional antenna instead of isotropic antenna and
thereby increasing the range of the system.
d) The data packet used currently contains only two data fields; more bulky data
packet can be employed by transferring a large amount of data and study its
consequences on the efficiency of the system.
e) Furthermore applications of the system should be looked upon.

50
INS VALSURA Faculty Of Training Projects

Vous aimerez peut-être aussi