Documente Academic
Documente Profesional
Documente Cultură
ABSTRACT
Data Acquisition using RF communication has two main functional aspects: measurement & communication. This project
focuses on developing an embedded system to extract temperature data from an temperature sensor, display the instantaneous value on LCD and the same data is transmitted over a distant place using RF(Zigbee) communication. This project consists of two parts. One is transmitter section which is built around microcontroller based 16F877A architecture, ADC, Sensors to measure temperature & smoke and a Zigbee transceiver to transmit data. On the other hand receiver consists of Zigbee transceiver to receive the data and display the data on the LCD display. Instantaneous data of temperature is displayed on LCD and Buzzer indication is provided if temperature is more than 400 or smoke is detected.
ACKNOWLEDGEMENT
It gives us immense pleasure to express our deep sense of gratitude to the people who have helped and supported us throughout the course and the process of completion of this project.
We would like to take this opportunity to thank Dr B.G.Sangameshwara, Principal, SJCE for providing a healthy environment in college and for extending the facilities to carry out the project work.
We owe a special thanks to our Internal guide Asst. Prof S.Gopalakrishna. His guidance and encouragement has helped up leaps and bounds in completing this project. He has constantly reviewed our project and gave us various suggestions for implementing and enhancing our project. He has also guided us in preparing our report by providing us with various other details needed in completing our report.
We would like to thank our family members and friends for morally encouraging us in everything we do.
CONTENTS
CHAPTER 1: INTRODUCTION WHAT IS DATA AQUASITION ?........................................................................6
1.1
2.2
CHAPTER 3: PERIPHERALS
3.1
POWER SUPPLY
.12
3.2
RS 232
12
3.4
SMOKE DETECTOR
..16
3.5
BUZZER
.17
3.6
DOT MATRIX LCD
.18
3.7
MICROCANTROLLER
.18
CHAPTER 4: RF COMMUNICATION
4.1 ZIGBEE
4.1.1 Characteristics of Zigbee20 4.1.2 Network topologies supported by Zigbee21 4.1.3 ARCITECTURE.. .22 4.1.4 Types of traffic..23 4.1.5 Block diagram of Zigbee Transceiver24 4.2 Type of modulation 25
..29
5.2 RF receiver
..32
...33
CHAPTER 7: SOFTWARE
7.1 MPLAB IDE V8.60
.35
7.2 STEPS IN DEVELOPING A PROGRAM.36
.. .38
APPENDIX: 10. CONCLUSION .40 11. FUTURE SCOPE.. 40 12. REFERENCE ..40
CHAPTER 1 - INTRODUCTION
1.1
Data acquisition involves gathering signals from measurements sources and digitalizing the signal for storage analysis and presentation on PC or LCD. Data acquisition systems come in many PC technology forms to offer flexibility. Here we used RF communication to acquire data and explained in detail in next chapters.
2.1
blocks. Temperature sensor Smoke sensor Microcontroller LCD displays Power supply Buzzer indication RF (Zigbee) communication module. This system senses the temperature and smoke and continuously and send data to Microcontroller. Controller PIC16F877 consists of ADC where it converts analog signal to digital and send to LCD input and UART.
Normal conditions:
When temperature < 40C & smoke is absent. Temperature data will be displayed in transmitter as well as receiver
Abnormal conditions:
Three abnormal conditions can appear When temperature 40C & smoke is absent, temperature data will be displayed in receiver side and buzzer alarm is provided to indicate the rise in temperature .
When temperature < 40C but smoke is present, temperature data will be displayed in receiver side and display will be given as SMOKE IS PRESENT along with the buzzer alarm.
When temperature 40C & smoke is present, temperature data will be displayed in receiver side and display will be given as SMOKE IS PRESENT along with the buzzer alarm.
10
2.2
BLOCKDIAGRAM
TRANSMITTER
Power Supply
Temperatu re Sensor
MICRO CONTROLLE R
RS23 2
RF TRANSRE CIVER
Smoke Sensor
LCD
RECEIVER
11
Power Supply
RF TRANSRECI VER
MICRO
RS232
LCD
CONTROLLE R
BUZZER
FIG 2.1 shows the transmitter section of data acquisition system and FIG2.2 shows the receiver section of data acquisition system. Following are the components of these transmitter and receiver section
Digital input of 5V is provided for microcontroller and all other sensor circuitry and 12V is provided for Zigbee module. The same is followed in both transmitter and receiver section.
Temperature sensor converts the temperature into an equivalent voltage output. IC LM35 is such a sensor. Here we describe a simple temperature measurement and display system based on LM35 sensor and PIC16F877A microcontroller. The temperature in degrees Celsius is displayed on a 162 LCD. Continuous monitoring of temperature with 1-second update interval (which can be varied in the program) Temperature measurement using LM35 precision integratedcircuit sensor.
12
Here Smoke Sensors that can detect the presence of combustible gas and smoke at concentrations from 300 to 10,000 ppm. Owing to its simple analog voltage interface, the sensor requires one analog input pin from the microcontroller. The product can detect the presence of the smoke and send the output in form of analog signals. Our range can function at temperature ranging from -20 to 50C and consume less than 150 mA at 5V. Two basic types of smoke detectors are used today: ionization and photoelectric. The sensing chambers of these detectors use different principles of operation to sense the visible or invisible particles of combustion given off in developing fires. Ionization smoke detector is used here.
2.2.4 MICROCONTROLLER
PIC16F877 is used for computation of sensor data. This controller consists of 10 bit ADC where it converts analog data in to digital form. This data is compared with a reference temperature and smoke details. The result will be displayed on LCD and sent to UART for RF communication. In receiver side same PIC16F877 controller is used where it takes the RS232 signal and decodes. These details will be displayed in LCD.
2.2.5 LCD Dot matrix LCD of 16 dots per character and two lines is used here. It has parallel input of 8 bit. Temperature value is displayed in first line smoke data is displayed n second line. This display is provided both in transmitter and receiver side. 2.2.6 Buzzer Rise in temperature data more than 40degree or the presence of smoke will be indicated by BUZZER. 2.2.7 ZIGBEE module
13
CHAPTER 3 - PERIPHERIALS
3.1 Power supply:
The microcontroller and other devices get supply from AC to DC adaptor through 7805, 5 volt regulator. The adaptor output voltage level is 12V DC non-regulated. The 7805/7812 voltage regulators are used to convert 12V to 5V DC. This voltage regulator gives the regulated output to all peripherals.
14
3.2
RS232
Standard Details:
In RS-232, user data is sent as a time-series of bits. Both synchronous and asynchronous transmissions are supported by the standard. In addition to the data circuits, the standard defines a number of control circuits used to manage the connection between the DTE and DCE. Each data or control circuit only operates in one direction, that is, signaling from a DTE to the attached DCE or the reverse. Since transmit data and receive data are separate circuits, the interface can operate in a full duplex manner, supporting concurrent data flow in both directions. The standard does not define character framing within the data stream, or character encoding.
MAX-
232:
15
FIG-3.3 Functional diagram and Logic Diagram of MAX232 Fig-3.3 shows the functional diagram and logical diagram of MAX232. When a MAX232 IC receives a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL Logic 1 to between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite from the RS232 Control Line voltages at the same logic state
16
The later MAX232A is backwards compatible with the original MAX232 but may operate at higher baud rates and can use smaller external capacitors 0.1 F in place of the 1.0 F capacitors used with the original device. The newer MAX3232 is also backwards compatible, but operates at a broader voltage range, from 3 to 5.5 V. Pin to pin compatible: ICL232, ST232, ADM232, HIN232
3.3
The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature (in C) In this project, LM35s are used for temperature sensing. Vs of the LM35s are given 5V and the Vout pins are connected to AN0 of PIC16F877A (ADC channel).Since the sensor gain (average slope) of the LM35 is 10mV /C and ADC has 10 bit (210 1000), so pin 5 (Vref) from PIC16F876A must be given for 1V by using the voltage divider concept. For preventing the offset, voltage for pin 5 (Vref) should be adjustable.
3.3.1 Temperature recorder: LM35 pin-out
sensor
17
The LM35 is connected to analogue input AN0 which is also the data input line for programming the 12F675 using ICSP so you need a way of connecting the sensor and the programming input at the same time with the programming input overriding the sensor output (and not damaging the sensor). This is done here by using 1k resistor that reduces the current flowing back into the sensor and at the same time is not too large (so that the ADC can easily convert the sensor output value - the impedance must be equal to or smaller than 10k Ohm from the sensor). The voltage reference for the circuit is taken from pin 6 using a resistor divider giving a 2.5V reference. This is simply done to increase the resolution of the ADC as for the LM35 only 0-1V is generated so you loose ADC range when using a 5V reference. You could use a lower reference value but this value gives reasonable results. Alternatively you could use an amplifier to scale the LM35 output up which would make the ADC less sensitive to noise but for this project it is simpler not to do so. Note: The large decoupling capacitor on the supply input of the 12F675. This reduces noise overall and gives a more consistent reading. However using a plug block and ADC is not a very good idea as there is no ground plane and no control over current paths which you would be able control in a PCB. In a commercial system the internal ADC is often not used at all as it is essential to separate the noise introduced to the ADC using separate grounds and shielding - some designs encase the ADC in a custom metal shield and along with a ground plane connecting to the shield gives the best possible result. To overcome noise problems on the ADC the software averages the input readings so you get a better result.
18
3.4
SMOKE DETECTOR
A smoke detector is a device that detects smoke, typically
as an indicator of fire. Commercial, industrial, and mass residential devices issue a signal to a fire alarm system, while household detectors, known as smoke alarms, generally issue a local audible and/or visual alarm from the detector itself. Most smoke detectors work either by optical detection (photoelectric) or by physical process (ionization), while others use both detection methods to increase sensitivity to smoke. Sensitive alarms can be used to detect, and thus deter, smoking in areas where it is banned such as toilets and schools.
Ionization method
An ionization type smoke detector is generally cheaper to manufacture than an optical smoke detector; however, it is sometimes rejected because it is more prone to false (nuisance) alarms than photoelectric smoke detectors. It can detect particles of smoke that are too small to be visible. It includes about 37 kBq or 1 Ci of radioactive element americium241, corresponding to about 0.3 g of the isotope. The radiation passes through an ionization chamber, an air-filled space between two electrodes, and permits a small, constant current between the electrodes. Any smoke
19
Alpha radiation, as opposed to beta and gamma, is used for two additional reasons: Alpha particles have high ionization, so sufficient air particles will be ionized for the current to exist, and they have low penetrative power, meaning they will be stopped by the plastic of the smoke detector and/or the air.
Working Principle
Ionization detectors have an ionization chamber and a source of ionizing radiation. The source of ionizing radiation is a minute quantity of americium-241 (perhaps 1/5000th of a gram), which is a source of alpha particles (helium nuclei).The ionization chamber consists of two plates separated by about a centimeter. The battery applies a voltage to the plates, charging one plate positive and the other plate negative. Alpha particles constantly released by the americium knock electrons off of the atoms in the air, ionizing the oxygen and nitrogen atoms in the chamber. The positively-charged oxygen and nitrogen atoms are attracted to the negative plate and the electrons are attracted to the positive plate, generating a small, continuous electric current. When smoke enters the ionization chamber, the smoke particles attach to the ions and neutralize them, so they do not reach the plate. The drop in current between the plates triggers the alarm.
3.5 BUZZER:
FIG-3.5 Buzzer
20
Weight: 1 gram Dimensions: 12mm Diameter, 8.5mm High, Pin Spacing - 7.5mm 3.6 DOT MATRIX LCD:
3.7 MICROCONTROLLER:
PIC 16F877 is used for computation the analog signals from sensor to digital form.
of
21
Low-power, high-speed Flash/EEPROM technology Fully static design Wide operating voltage range (2.0V to 5.5V) Commercial and Industrial temperature ranges Low-power consumption 10-bit, up to 8-channel Analog-to-Digital Converter (A/D) Analog Comparator module with: Two analog comparators. Programmable on-chip voltage reference (VREF) module. Programmable input multiplexing from device inputs and internal voltage reference. Comparator outputs are externally accessible.
22
CHAPTER 4 - RF COMMUNICATION
4.1 .1 CHARECTERISTICS OF ZIGBEE
The focus of network applications under the IEEE 802.15.4 / ZigBee standard include the features of low power consumption, needed for only two major modes (Tx/Rx or Sleep), high density of nodes per network, low costs and simple implementation. These features are enabled by the following characteristics 2.4GHz and 868/915 MHz dual PHY modes. This represents three license-free bands: 2.4-2.4835 GHz, 868870 MHz and 902-928 MHz. The number of channels allotted to each frequency band is fixed at 16 channels In the 2.45 GHz band, 10 channels in the 915 MHz band, and 1 channel in the 868 MHz band Maximum data rates allowed for each of these frequency bands are fixed as 250kbps @2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868 MHz. Allocated 16 bit short or 64 bit extended addresses. Allocation of guaranteed time slots (GTSs)
23
Carrier sense multiple access with collision avoidance (CSMA-CA) channel access Yields high throughput and low latency for low duty cycle devices like sensors and controls. Fully hand-shake acknowledged protocol for transfer reliability. Low power consumption with battery life ranging from months to years. Energy detection (ED). Link quality indication (LQI). Multiple topologies : star, peer-to-peer, mesh topologies
Star Topology
In the star topology, the communication is established between devices and a single central controller, called the PAN coordinator. The PAN coordinator may be mains powered while the devices will most likely be battery powered.
Peer-to-peer Topology
In peer-to-peer topology, there is also one PAN coordinator. In contrast to star topology, any device can communicate with any other device as long as they are in range of one another. A peer-to-peer network can be ad hoc, self-organizing and self-healing. It also allows multiple hops to route messages from any device to any other device in the network. It can provide reliability by multipath routing.
24
Cluster-tree Topology
Cluster-tree network is a special case of a peer-to-peer network in which most devices are FFDs and an RFD may connect to a cluster-tree network as a leave node at the end of a branch. Any of the FFD can act as a coordinator and provide synchronization services to other devices and coordinators. Only one of these coordinators however is the PAN coordinator. The PAN coordinator forms the first cluster by establishing itself as the cluster head (CLH) with a cluster identifier (CID) of zero, choosing an unused PAN identifier, and broadcasting beacon frames to neighboring devices. A candidate device receiving a beacon frame may request to join the network at the CLH. If the PAN coordinator permits the device to join, it will add this new device as a child device in its neighbor list. The newly joined device will add the CLH as its parent in its neighbor list and begin transmitting periodic beacons such that other candidate devices may then join the network at that device. Once application or network requirements are met, the PAN coordinator may instruct a device to become the CLH of a new cluster adjacent to the first one. The advantage of this clustered structure is the increased coverage area at the cost of increased message latency.
4.1.3 ARCHITECTURE
The LR-WPAN architecture is defined in terms of a number of blocks in order to simplify the standard. These blocks are called layers. Each layer is responsible for one part of the standard and offers services to the higher layers. The layout of the blocks is based on the open systems interconnection (OSI) seven-layer model. The interfaces between the layers serve to define the logical links between layers. The LR-WPAN architecture can be implemented either as embedded devices or as devices requiring the support of an external device such as a PC. An LR-WPAN device comprises a PHY, which contains the radio frequency (RF) transceiver along with its low-level control mechanism, and a MAC sub layer that provides access to the physical channel for all types of transfer.
25
ARCITECTURE OF ZIGBEE
FIG-4.1 Zigbee architecture
26
27
Channel filtering and frequency offset compensation is performed digitally. The signal level in the channel is estimated to generate the RSSI level. Data filtering is also included for enhanced performance. With the 40 ppm frequency accuracy requirement from [1], a compliant receiver must be able to compensate for up to 80 ppm or 200 kHz. The CC2420demodulator tolerates up to 300 kHz offset without significant degradation of the receiver performance. Soft decision is used at the chip level, i.e. the demodulator does not make a decision for each chip, only for each received symbol. De-spreading is performed using over sampled symbol co-relaters. Symbol synchronization is achieved by a continuous start of frame delimiter (SFD) search. When a SFD is detected, data is written to the RXFIFO and may be read out by the microcontroller at a lower bit rate than the 250 kbps generated by the receiver. The demodulator also handles symbol rate errors in excess of 120 ppm without performance degradation.
QPSK uses four points on the constellation diagram, equispaced around a circle. With four phases, QPSK can encode two bits per symbol
28
The mathematical analysis shows that QPSK can be used either to double the data rate compared with a BPSK system while maintaining the same bandwidth of the signal, or to maintain the datarate of BPSK but halving the bandwidth needed. In this latter case, the BER of QPSK is exactly the same as the BER of BPSK - and deciding differently is a common confusion when considering or describing QPSK. The advantage of QPSK over BPSK becomes evident: QPSK transmits twice the data rate in a given bandwidth compared to BPSK at the same BER. The engineering penalty that is paid is that QPSK transmitters and receivers are more complicated than the ones for BPSK. However, with modern electronics technology, the penalty in cost is very moderate.
29
4.2.2 phase-shift
Offset quadrature phase(OQPSK) is a variant of keying modulation using 4 values of the phase to is sometimes called quadrature phase-shift (SQPSK).
30
Taking four values of the phase (two bits) at a time to construct a QPSK symbol can allow the phase of the signal to jump by as much as 180 at a time. When the signal is low-pass filtered (as is typical in a transmitter), these phase-shifts result in large Amplitude fluctuations, an undesirable quality in communication systems. By offsetting the timing of the odd and even bits by one bit-period, or half a symbol-period, the in-phase and quadrature components will never change at the same time. In the constellation diagram shown on the right, it can be seen that this will limit the phase-shift to no more than 90 at a time. This yields much lower amplitude fluctuations than nonoffset QPSK and is sometimes preferred in practice. The picture on the right shows the difference in the behavior of the phase between ordinary QPSK and OQPSK. It can be seen that in the first plot the phase can change by 180 at once, while in OQPSK the changes are never greater than 90. The modulated signal is shown below for a short segment of a random binary data-stream. Note the half symbol-period offset between the two component waves. The sudden phase-shifts occur about twice as often as for QPSK (since the signals no longer change together), but they are less severe. In other words, the magnitude of jumps is smaller in OQPSK when compared to QPSK.
31
32
33
34
Fig-6.1 shows the basic schematic of project data acquisition using RF(zigbee) Transmitter. These two inputs are taken where the temperature data and smoke details are sensing. Microcontroller PIC16F877 is used to take the following input and convert in to RS232 form and send the data in to Zigbee module. This data is sent wia wireless communication to remote places. The same data is displayed on LCD also. Individual module Schematic is as shown in below Fig.
35
36
5.2
RF RECEIVER
37
Fig5.4 shows the basic schematic of project Data acquisition using RF(zigbee) Receiver. On the receiver side same Zigbee transceiver module collects the RF data. This data is converted in to RS232 form by MAX232 converter. The data from MAX232 is giver to PIC16F877 receiver. This data is collected or monitored in remote places where it is displayed in LCD and buzzer indication is provided if temperature is more than 40o. Buzzer indication is also provided if there is a presence of smoke. START
Configure all ports and Registers as per the requirement CHAPTER 6 - FIRMWARE
LOGIC
NO
YES
Display Temperature value and Smoke status as normal Turn ON the Buzzer
STOP
38
Above flow chart shows the software flow of DATA ACQUISITION USING RF COMMUNICATION All the ports should be initialized as output port because it should not pick any other noise. The required port which is used for input should be made as input. Microcontroller PIC16F877 consists of 10bit ADC where it receives analog signal and converts in to digital form as shown in block diagram Fig-6.1
FIG-6.1 ADC from PIC controller and displayed on LCD. The temperature data and smoke details are taken as input from I/O pin. Now the reference is fixed as it compares with 40degree of temperature value and 200 relative humidity of smoke value. If these value varies beyond the limit then Buzzer indication is provided at receiver section. Indication provided on LCD both at transmitter and receiver section. IC PIC16F877A is an 8-bit microcontrollerwith 8k14-bit flash program memory, 368 bytes of RAM and many other extra peripherals like ADC, universal synchronous asynchronous receiver transmitter, master synchronous serial port, timers, compare capture and pulsewidth modulation modules, and analogue comparators. It is based on the reduced instruction set computer (RISC) architecture.
39
CHAPTER 7 - SOFTWARE
7.1 MPLAB IDE v8.60
MPLAB IDE is a Windows Operating System (OS) software program that runs on a PC to develop applications for Microchip microcontrollers and digital signal controllers. It is called an Integrated Development Environment, or IDE, because it provides a single integrated "environment" to develop code for embedded microcontrollers.
Embedded systems
An embedded system is typically a design making use of the power of a small microcontroller, like the Microchip PIC MCU or dsPIC Digital Signal Controller (DSCs). These microcontrollers combine a microprocessor unit (like the CPU in a desktop PC) with some additional circuits called "peripherals", plus some additional circuits on the same chip to make a small control module requiring few other external devices. This single device can then be embedded into other electronic and mechanical devices for low-cost digital control.
MPLAB Editor
The MPLAB Editor is an integrated part of the MPLAB IDE Integrated Development Environment. The editor is always available when MPLAB IDE is running.
40
MPLINK object linker (the linker) combines object modules generated by the MPASM assembler or the MPLAB C18 C compiler into a single executable (hex) file. The linker also accepts libraries of object files as input, as geneated by the MPLIB object librarian. The linking process is controlled by a linker script file, which is also input into MPLINK linker.
The MPLAB ICD 2 is a low-cost in-circuit debugger (ICD) and in-circuit serial programmer (ICSP). MPLAB ICD 2 is intended to be used as an evaluation, debugging and programming aid in a laboratory environment. The MPLAB ICD 2 offers these features: Real-time and single-step code execution Breakpoints, Register and Variable Watch/Modify In-circuit debugging Target Vdd monitor Diagnostic LEDs MPLAB IDE user interface RS-232 serial or USB interface to a host PC
41
8.2 APPLICATIONS:
The major applications of data acquisition using RF communication (ZIGBEE) is Manufacturing industries where the continuous data needed to be monitored data communication is required for different modules in industrial campus.
42
8.3 LIMITATIONS:
Range of communication reduced when there is obstacles between transmitter and receiver. Since no security data may be received by unintended receiver.
43
9.2. RESULT
The input dc 12V is given to the power supply circuit. The power ON LED indication is provided to each of the modules. This power on indication is mainly implemented for debug purpose. In transmitter side as soon as circuit powers ON it senses the temperature & Smoke data and displays on LCD. Refer Tablexx for detailed transmitter and receiver LCD display output. On the receiver side, the input dc 12V is given to the power supply circuit. The power ON LED indication is provided to each of the modules. This power on indication is mainly implemented for debug purpose. If any data is collected by receiver from transmitter then it shows the corresponding value on LCD. If no data is received by receiver it waits for the data by displaying weather monitoring using ZIGBEE.
Table.9.1 Display pattern for different conditions of input Condition Temperature is within 40 degree Celsius and absent of smoke TRANSMITTER RECEIVER
44
When receiver is not receiving data from transmitter then the display will be shown as below FIG 8.1
10. CONCLUSION:
The fundamental aim of this project is to design a wireless weather system which enables to monitor the weather parameter in an industry by using zigbee technology and display the
45
12. REFERENCES
www.zigbeealliance.com www.wikipedia.org Wireless Communication System by Roody Coolen Communication Electronics by Freznel
46
DATASHEE T