Professional Documents
Culture Documents
PROJECT MEMBERS
ABSTRACT To design a wireless paging system using RF for our campus in which one can simply type message on PC which would be displayed wirelessly on LCD`s at different places in campus.
ACKNOWLEDGMENT
First of all, thanks to Allah because given us power to complete this task just in time. Even we faced with a lot of difficulties along to complete this task; but we still manage to complete it. We also want to acknowledge our supervisor, Co-supervisor and software engineer fellows. We also appreciate the University authority for given us permission to carry out experiment in labs. University also provided apparatus and the material we used for study task
DEDICATION
SUCCESS ALWAYS SOLICITS FOR TWO THINGS EXERTION AND FORTUNE
If we are successful then our exertion is the efforts of our parents, which they made to, fulfill our wishes, and our fortune is due to their prayers hence this project is dedicated to our parents and mentors who have been a source of constant encouragement for us and to our idols who have given us inspiration throughout our degree.
CERTIFICATE
is certified that the contents and form of thesis entitled RF BASED WIRELESS CAMPUS PAGING SYSTEM submitted by ZIA UL IKRAM, MUBASHIR ALI, SYED MUHAMMAD ALI and UMER RAZA CHEMA have been found satisfactory for the requirement of the degree.
It
Examiner: _________________________________
CHAPTER 1 Introduction:
The system we are going to design is based on RF Transmitter, FSK Modulator, De Modulator, MAX 232 and Microcontroller. Our project has a lot of practical applications. In universities we can use our project as messenger or announcer for example if Dean of University wants to announce message then he simply write through a Keypad and it will be displayed all electronic notice board wirelessly through out the campus. We are using Microcontroller RF Transmitter, FSK Modulator, De Modulator, MAX 232 and key Pad for message typing. A person will type message through key Pad , that will be send to Microcontroller , which will send the message from its serial port to FSK Modulator , which will convert binary bits from controller to frequencies of ( 1200 and 2200) HZ. Because DC signal ca not be transmitted in air , These frequencies will be transmitted through FM transmitter , on receiving end FM receiver will receive it and give these two frequencies to FSK De Modulator which will again convert back to binary form , binary data will be given to controller again and then displayed on LCD. And we can also use our project to monitor Water level in a Dam, We can transfer data through a land line cable without Modem. And can we also use it in many other applications.
BLOCK DIAGRAM
1. The Paging system can operate as a stand-alone unit, or be integrated with other existing facility systems such as Nurse Call, Fire/Alarm, Access Control and more. 2. The elderly, handicapped, children or co-workers can call for attention by pressing the button on the transmitter 3. It is also being used as AlertWave Mass Notification
and Personnel Alerting System which uses an advanced high-power RF communication technology that operates on dedicated military RF bands, to provide audible and silent alerts to any facility size. The system can interface with BioChem detection devices, fire/alarm systems and other monitoring sensors to provide rapid response to any given situation.
CHAPTER 2
HARD WARE USED AND DETAILS
2.1) POWER SUPPLY:
A device, such as a generator or a transformer-rectifier-filter arrangement, that produces the power needed to operate an electronic equipment.
It may use an electromechanical mechanism, or passive or active electronic components. Depending on the design, it may be used to regulate one or more AC or DC voltages. With the exception of shunt regulators, all modern electronic voltage regulators operate by comparing the actual output voltage to some internal fixed reference voltage. Any difference is amplified and used to control the regulation element. This forms a negative feedback servo control loop. If the output voltage is too low, the regulation element is commanded to produce a higher voltage. For some regulators if the output voltage is too high, the regulation element is commanded to produce a lower voltage; however, many just stop sourcing current and depend on the current draw of whatever it is driving to pull the voltage back down. In this way, the output voltage is held roughly constant. The control loop must be carefully designed to produce the desired tradeoff between stability and speed of response. We have used LM7805 voltage regulator. Fig is given below.
Port 1=input Port 2=common Port 3=output Operating temperature=40c^o to +125c MAX232 The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals. The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a single + 5 V supply via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as power supply design does not need to be made more complicated just for driving the RS-232 in this case.
The receivers reduce RS-232 inputs (which may be as high as 25 V), to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V. 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.
Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is transmitted through discrete frequency changes of a carrier wave. The simplest FSK is binary FSK (BFSK). BFSK literally implies using a couple of discrete frequencies to transmit binary (0s and 1s) information. With this scheme, the "1" is called the mark frequency and the "0" is called the space frequency. The time domain of an FSK modulated carrier is illustrated in the figures to the right.
For
fsk we IC
XR
GENERAL
2206
DESCRIPTION
The XR2206 is a monolithic function generator integrated circuit capable of producing high quality sine, square, triangle, ramp, and pulse waveforms of high-stability and accuracy. The output waveforms can be both amplitude and frequency modulated by an external voltage. Frequency of operation can be selected externally over a range of 0.01Hz to more than 1MHz.
PIN CONFIGURATION
XR 2211
GENERAL DESCRIPTION
The XR-2211 is a monolithic phase-locked loop (PLL) system especially designed for data communications applications. It is particularly suited for FSK modem applications. It operates over a wide supply voltage range of 4.5 to 20V and a wide frequency range of 0.01Hz to 300kHz. It can accommodate analog signals between 10mV and 3V, and can interface with conventional DTL, TTL, and ECL logic families. The circuit consists of a basic PLL for tracking an input signal within the pass band, a quadrature phase detector which provides carrier detection, and an FSK voltage comparator which provides FSK demodulation. External components are used to independently set center frequency, bandwidth, and output delay. An internal voltage reference proportional to the power supply is provided at an output pin.
PIN CONFIGURATION
2.9) TRANSISTER
NPN
A bipolar (junction) transistor (BJT) is a type of transistor. It is a threeterminal device constructed of doped semiconductor material and may be used in amplifying or switching applications. Bipolar transistors are so named because their operation involves both electrons and holes, as opposed to uni polar transistors, such as field-effect transistors, in which only one carrier type is involved in charge flow. Although a small part of the
transistor current is due to the flow of majority carriers, most of the transistor current is due to the flow of minority carriers and so BJTs are classified as minority-carrier devices. NPN BJT with forward-biased EB junction and reverse-biased BC junctionAn NPN transistor can be considered as two diodes with a shared anode region. In typical operation, the emitterbase junction is forward biased and the basecollector junction is reverse biased. In an NPN transistor, for example, when a positive voltage is applied to the base emitter junction, the equilibrium between thermally generated carriers and the repelling electric field of the depletion region becomes unbalanced, allowing thermally excited electrons to inject into the base region. These electrons wander (or "diffuse") through the base from the region of high concentration near the emitter towards the region of low concentration near the collector. The electrons in the base are called minority carriers because the base is doped p-type which would make holes the majority carrier in the base. In our project we use NPN Transistor C945 i-e
2.11) LED
A light-emittingdiode (LED) is a semiconductor diode that emits light when an electric current is applied in the forward direction of the device, as in the simple LED circuit. The effect is a form of electroluminescence where incoherent and narrow-spectrum light is emitted from the p-n junction in a solid state material. LEDs are widely used as indicator lights on electronic devices increasingly in higher power applications such as flashlights and area lighting
2.12)
DIODE
Diodes have two active electrodes between which the signal of interest may flow, and most are used for their unidirectional electric current property. The varicap diode is used as an electrically adjustable capacitor. The directionality of current flow most diodes exhibit is sometimes generically called the rectifying property. The most common function of a diode is to allow an electric current to pass in one direction (called the forward biased condition) and to block the current in the opposite direction (the reverse biased condition). Thus, the diode can be thought of as an electronic version of a valve. We use diode IN4007.
32
A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for transmitters receivers. We join cystal oscilator to Microcontroller P-18 to 19.
2.4MICROCONTROLLER:
The microcontroller is the mastermind of the whole system and provides key functionality. In our project Atmel 89C51 microcontroller is used. It is a general-purpose device used to fetch data and perform limited calculation on that data and control its environment base on these calculations. Microcontrollers are mainly used in industries for control applications and also use in consumer products. They are suited for controlling I/O devices in designs that requires minimum components. Count, Microcomputers also implement logical components
14
b) Easier Evaluation and Design: The use of microcontroller simply eases the design. Because of its smaller size it occupies a smaller area. c) On Chip Facilities: The I/O and memory subsystems contained in a microcontroller specialize these devices so that they can be interfaced with hardware and control functions of the applications. Also it provides the on-chip oscillator and an external oscillator can be connected to get a specific frequency. d) Increase Frequency: The degree of control and programmability, which microcontroller provides, significantly enhances the effectiveness of the application. The System under construction becomes more flexible and provides more improvements and modifications. If changes are required, then it can be done easily by changing the program. e) Increased Reliability: The reliability of a microcontroller based system is at least ten times higher than that of hardwired implementations. One microcontroller can replace a large number of logic devices and thus provides more reliability to the system.
15
16
The Idle Mode: In Idle mode the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The contents of the on chip RAM and all the Special Function Registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. Power Down Mode: In power down mode the oscillator is stopped and the instruction that invokes power down is the last instruction executed. The on chip RAM and SFRs retain their values until the power down mode is terminated. The only exit from the power down mode is a hardware reset. Status Of External Pins During Idle Mode and Power Down Mode: The status of the external pin in the idle and power down mode is shown in the table below. Mode Program ALE PSEN 1 1 0 0 Port 0 Data Float Data Float Port1 Data Data Data Data Port2 Port3
Memory Idle Internal 1 Idle External 1 Power Internal 0 Down Power External 0 Down
1 9
2.4.6) Ports:
Port 0:
Port 0 is an 8 bit open drain bi- directional I/O port available at ins 32-39. As on output port each pin can sink eight TTL inputs it may also be configured to be the multiplexed low ordered address data bus during accesses to external program and data memory. Port 0 also receives the code byte during flash programming and outputs the code byte during program verification. Port 1: Port 1 is an 8-bit bi directional I/O port on Pins 1-8. The port 1 output buffers can sink/source four TTL inputs. When 1s are written to port 1 pins. They are pulled high by internal pull-up Resisters and can used as an input. It also receives the low order address bytes during flash programming and verification. In Our case we use it as an input port which collects data from IR receiver output and on doing further operation by a controller gives the output at LED.
20
Port 2:
Port 2 is an 8-bit bi directional I/O port on Pins 21-28. The port 1 output buffers can sink/source four TTL inputs. When 1s are written to port 2 pins. They are pulled high by internal pull-ups and can used as an input. Port 2 emits the high order address byte during fetches from external program memory and during access to external data. Memory that uses 16 bit address (MOV @ DPTR). Port 3: Port 3 is an 8-bit bi directional I/O port with internal pull ups. The port 1 output buffers can sink/source four TTL inputs. When 1s are written to port 3 pins. They are pulled high by internal pull-ups and can used as an input. Port 3 also serves the function of various special features of the AT89C51 are listed in table below. Port 3 also receives some control signals for Flash programming and verification.
21
Port Pins
Alternate function
RXD(Serial Input Port) TXD (Serial Output Port) INT0 (external interrupt0) INT1 (external interrupt1) T0 (timer0 external input) T1 (timer1 external output) WR (external data memory write strobe) RD (external data memory read strobe)
In our project we have use timer at pin 3.4. INTERRUPTS USED: An interrupt is the occurrence of a condition an event that causes a temporary suspension of a program while the condition is serviced by another program. Interrupts play an important role in the design and implementation of microcontroller applications. The program that deals with an interrupts is called an Interrupt Service Routing (ISR) OR INTERRUPT HANDLER. There are five interrupts sources on the AT89C51, two external interrupt two timers interrupt and a serial interrupts. All interrupts disabled by default after system reset and enable individually.
22
8 PIN CONNECTIONS: Pin connections of 89C51 are presented in the following table.
S.No 1 2 4 5 6 7 8
Connection
Function
IR receivers pins Receive the data from receivers 1--4 Servo motor Led GND Vcc Reset circuit Crystal Oscillator Rotate the camera to the desired angle Blinks Reset the microcontroller Gives the required frequency to microcontroller
OPERATIONS
CHAPTER 4
CHAPTER 4
MICROCONTROLLER CODE
TX
TX SIDE
#include <AT89X51.H> unsigned char RecCh; void InitSerial() { SCON = 0x50; //mode 1, 10 bit TMOD = 0x20; //Timer 1 auto reload mode TH1 = 0xfd; //9600 baud rate over 11.0592MHz crystal TH1 = 256 - ((Crystal/384)/Baud Rate) TR1 = 1; //Turn timer1 On EA = 1; //Enable All Interrupts ES = 1; //Enable Serial Port Interrupt }//end void InitSerial() //===================================== serial() interrupt 4 { if(RI) { RecCh = SBUF; RI = 0; TI = 0; SBUF = RecCh+5; } } void main() { InitSerial(); while(1) { //============================================================== ===== }}
RX SIDE
#include <lcd4bitx51.h> //#include<AT89X51.h> sbit Led = P1^0; #define FRAMESIZE 32 unsigned char SrlDataInCtr; unsigned char SrlDataIn[FRAMESIZE + 1]; void InitSerial() { SCON = 0x52; /* mode 1: 8-bit UART, enable receiver */ TMOD |= 0x20; /* timer 1 mode 2: 8-Bit reload */ TH1 = 0xA0; /* reload value 600 baud */ EA = 1; /* Enable all interupts. */ ES = 1; /* enable serial port interrupt */ TR1 = 1; /* timer 1 run */ } void SerialInt() interrupt 4 { if(RI) { RI = 0; if(SrlDataInCtr < FRAMESIZE) SrlDataIn[SrlDataInCtr ++] = SBUF; } if(TI) { TI = 0; } } void PrintLCDEx(unsigned char String[], unsigned char nCount) { unsigned char i; for(i = 0; i < nCount; i ++) PutCharLCD(String[i]); } void main()
{ unsigned int LedCtr = 0; SrlDataIn[FRAMESIZE] = '\0'; InitLCD_rimsDEV2763 (); PrintLCD(" LCD Controller"); NextLineLCD(); PrintLCD(" Version 1.0."); InitSerial(); while(1) { LedCtr ++; if(LedCtr > 30000) { LedCtr = 0; Led = ~Led; } if(SrlDataInCtr == FRAMESIZE) { LocateLCD(1, 1); PrintLCDEx(SrlDataIn, 16); LocateLCD(2, 1); PrintLCDEx(SrlDataIn + 16, 16); SrlDataInCtr = 0; } } }