You are on page 1of 91

ABSTRACT Defense and security to a nation is a vital issue nowadays.

Spying systems have become remarkably important for national security. It acts as a preventive measure of avoiding war. Such system would definitely be of use for armed Special Forces and anti terrorism management team. Existing electronic voice tracking system is microphone based. Though the microphone based system is sensitive to even a pin drop at a very short range, for long-range usage it is highly impracticable. These microphones need to be connected to a Radio Frequency module for transmission which can be very easily recognized by wide band RF scanning systems, which can recognize even the least electromagnetic changes. Any such RF emission device would invoke a very high degree of suspect and will be handled with utmost suspicion in the enemy lines. Here a long range laser vibrometer based spying system is used that will not require any materials to be hidden or implanted in any secret locations. The LASER based system would enable us to listen to any kind of sound produced several kilometers away from the target point. When people speak, it sets up vibrations on the nearby materials making use of reflecting materials (e.g. Glass windows) which vibrate with the sound of the speaker. The doppler shift in the PWM encoded LASER beam reflected from any kind of reflecting surface is detected. The doppler shift will be proportional to the

characteristics of the sound from the vibrating source. The voice clarity would also be reasonably good even from a range of several hundreds of kilometers. Such a device would be helpful to save innumerable hostages in future.

CHAPTER 1 PROJECT ELEMENTS

The chapter is a brief introduction about the various components and the technologies involved in the project has been discussed. Main technologies involved in this project are embedded systems and laser vibrometry. Then the goals, elements and the various applications of the device have been described in brief. 1.1 INTRODUCTION

The emerging new electronic revolution has set the stage for men to master the field of electronics. This is vividly seen in the new era of Embedded Systems, Wireless communication techniques like Bluetooth, CDMA and advanced Digital Signal Processing concepts like speech recognition. We as emerging engineers have tried to give a new dimension to this field and have successfully devised Long range voice tracking system using laser 1.1.1 EMBEDDED SYSTEMS Nowadays our life is full of interactions with embedded systems and processors. Each day we have contacts with 20 microprocessors in average, and most of these microprocessors are incorporated in embedded systems. An embedded system is a special-purpose computer built integratedly into a device. The embedded systems have varieties of types and sizes. It could range from a single microprocessor to a complex System-on-a-Chip system. Embedded systems usually have a processor and memory hierarchy. In addition to that, there are a variety of interfaces that enable the system to measure, manipulate, and interact with the external environment. The human interface may be as

simple as a flashing light or as complicated as real-time robotic vision. Embedded system usually provides functionality specific to its application. Its software often has a fixed function which is specific to the application. Instead of executing spreadsheet, word processing and engineering analysis applications, embedded systems typically execute control flows, finite state machines, and signal processing algorithms. They must often detect and react to faults in both the computing and surrounding electromechanical systems, and must manipulate application-specific user interface devices.

1.1.2 LASER VIBROETRY The project is aimed to provide our Indian defense system and the intelligence department with a gadget that would help them for spying from long distances and avoid many disasters or help them during disasters like 26/11. The main principle that we use in our project is laser vibrometry. For the communication from the aerial platform with the autonomous underwater vehicles, a laser Doppler vibrometer is under developing. The detection of the laser Doppler shift of the sea surface vibrating is implemented. The soundpressure level of 150.8 dB is obtained under the acoustic signal of 7 kHz. We are using this same principle in spying. When we speak we set the surrounding objects to vibrations with our sound waves. Thus by reflecting laser from glass windows or any other reflecting surface we can easily hear what the persons

nearby are talking or plotting to without the use of any microphones from a long distance . 1.1.3 DOPPLER SHIFT PRINCIPLE Light from a moving object tends to have a phase shift. This phase shift is towards the Violet spectrum when the object of light emission or the object of reflection comes close at a specific rate. Shift is towards the Red spectrum when the object moves away from the viewer. This is the principle of Doppler shift. By projecting a Red LASER on to a surface far away which is going to vibrate as per the received sound vibrations, there will be a change in the amount of light reflected with respect to the vibrations produced by the surface. When we apply Doppler shift to a reflected Infra Red LASER from this vibrating reflective surface, we get varying wavelength of light at a rate corresponding to the rate of oscillation. By detecting the rate of change of reflectivity with reference to the Doppler shift, it is possible for us to electronically process this information into binary signals

1.2

COMPONENTS OF THE DEVICE The Project has a red diode laser which is used for transmitting on a

reflecting surface such that it reflects back on the receiver and laser is used to pick up the sound vibrations from the surface. The Doppler shift radar module is the heart of our project. This module gives a binary stream as the output according to the variations in the wavelength of the reflected laser. It also gives

an analog output according to the variations in the intensity of the reflected laser. The microcontroller PIC18F4220 is used in the transmitter section along with a PWM module for modulating the laser. The microcontroller PIC16F877 is used in the receiver circuit along with radar module and a MP3 module.

1.3

EXISTING SYSTEM AND THEIR DISADVANTAGES

The previously existing system of electronic voice tracking systems are microphone based. There have been a lot of technological advancements in this field. Though the microphone is sensitive to even a pin drop at a very short range, for long range usage is highly impracticable. Moreover, these microphones need to be connected to a Radio Frequency module for transmission. Such Radio Frequency devices can be very easily recognized by wide band RF scanning systems which can recognize even the least electromagnetic changes can be easily recognized. Any such RF emission device would invoke a very high degree of suspect and will be handled with utmost suspicion in the enemy lines and the after effects can be drastic. There have also been directional parabolic microphones which have been introduced a few years back. Fig1.1 Picture of a high sensitive microphone.

Though manual eavesdropping system can be considered the best, it carries its own risks and if the spy is captured, it can be a threat to national security as fear

of revelation of national secrets and blackmail can be expected. Life of spies is valuable as any other human being and sacrificing his life would not be a right act to do. Satellite system uses cameras from which it sends various pictures to the base stations. There is no problem of suspicion in this type of spying although the main disadvantage of this type of spying is that it cannot track audio signals and hence there is no conclusion one can get what a person is up to from photographs.

1.4 ADVANTAGES OF OUR SYSTEM We here have designed a long range laser voice tracking system which does not use any kind of microphone or radio frequency reception. In fact, this kind of a system will not even require any materials to be hidden or implanted in any secret locations. There is no RF emission in our system and hence there will be no suspicion in the enemy lines. This system would be enabling us to listen to any kind of sound produced several kilometers away from the target point. As a result of which, we can hear anything from a very long distance, for example from our defense force to the enemy camp. The voice clarity would also be reasonably good even from a range of several hundreds of kilometers

CHAPTER 2 WORKING OF THE SYSTEM

10

2.1

BLOCK DIAGRAM OF THE SYSTEM

11

FIGURE 2.1 BLOCK DIAGRAM OF THE SYSTEM

2.2

BLOCK DIAGRAM EXPLANATION The figure 2.1 represents the overall sections that are present in the

project. As shown in the figure there are three sections in the project.

2.2.1 TRANSMITTER SECTION This section consists of the laser along with the PWM module for encoding the laser. The PIC18F4220 Microcontroller is used along with the transistor BC547 for switching the laser. Detailed explanation of this section is given in the later chapters. 2.2.2 RECEIVER SECTION This section consists of the radar module for receiving the reflected laser light and converting the variations in the reflected light to binary stream. Detailed explanation of this section is given in the later chapters. 2.2.3 CONTROLLER SECTION The PIC16F477A Microcontroller is the heart of this section.MP3 module is also used in this section to convert the digital signals to analog signals. The PIC18F4220 Microcontroller is used in the controller section of the transmitter. Detailed explanation of this section is given in the later chapters.

12

CHAPTER 3 TRANSMITTER SECTION

13

3.1 BLOCK DIAGRAM

Figure 3.1: FUNCTIONAL BLOCK DIAGRAM OF THE TRANSMITTER

3.1.1 EXPLANATION OF BLOCK DIAGRAM The battery gives a supply voltage to the laser and the microcontroller. PIC18F4220 microcontroller is used along with the PWM module for encoding the laser. The modulated laser beam is then transmitted. The FET transistors are used along with the PWM module for the purpose of pulsing the laser. The laser is pulsed at the rate of 300 kHz .This is similar to the carrier frequency for the transmitted laser. This 300 kHz is got by dividing by a calibration factor 160000 from the frequency of 48 MHz got from a crystal oscillator.

14

3.2 CIRCUIT DIAGRAM

15

16

Figure 3.2: PWM ENCODED TRANSMITTER SECTION

3.2.1 PWM FOR LASER The laser has to be encoded with a specific PWM frequency for finding the variations in Doppler shift. So in this case we select a PWM frequency of 300 kHz and the diode laser is being pulsed using FET transistors at this frequency. Since the PWM has to be precise we have to use a very high clock frequency of 48 MHz and we divide it by a calibration factor 160000. This clock frequency of 48 MHz is generated by a crystal oscillator since it has to be very precise. 3.2.2 ADVANTAGES OF CRYSTAL OSCILLATOR OVER LC A LC oscillator will undergo changes in climate and mechanical variations and the frequency output is never precise. Even the best tuned lc oscillator has a very high percentage of error possible. For example an lc oscillator which oscillates with the frequency of few MHz, with a difference in climate will produce a variation in frequency amounting to a few kHz. which is totally unacceptable in a high precision devices like ours. 3.2.3 DIODE LASER The laser diode is a light emitting diode with an optical cavity to amplify the light emitted from the energy band gap that exists in semiconductors as

17

shown below. They can be tuned by varying the applied current, temperature or magnetic field. The power of the laser used will depend on the distance to be used. A greater distance would mean the use of a higher powered laser. High powered lasers are not to be used for short range applications because they are very likely to cause a rise in temperature on the objects they fall on. Or, they would cause loss of vision even when viewing from side. They can even set things on fire

Figure 3.3: DIODE LASER

This is why we need a partially reflecting mirror which would adjust the intensity to be used. When we adjust the angle of the partially reflecting mirror, we can adjust the amount of light passing through/ reflected by it.

18

Figure 3.4: ARRANGEMENT OF A DIODE LASER

3.2.4 PIC MICROCONTROLLER The pic18F4220 Microcontroller is used in the transmitter section which is a 40 pin IC.The positive voltage of 5 volts is given to the vcc pin of the microcontroller. Port c is connected to the base of the transistor BC547. The o/p of the transistor which is the collector is connected to the PWM module which is also called as the current regulator. This is useful in reducing the noise and maintaining the same intensity for all the pulses that is transmitted. The modulation lines from the PWM module are then connected to the laser module to modulate it at a frequency of 300 kHz. The positive voltage for the microcontroller and the laser are given from a 9volt battery.

19

CHAPTER 4 CONTROLLER &RECEIVER SECTION

20

4.1BLOCK DIAGRAM OF THE RECEIVER SECTION

Figure 4.1 BLOCK DIAGRAM OF THE RECEIVER SECTION

4.2 OPERATIONAL BLOCK DIAGRAM

21

Figure 4.2 OPERATIONAL DIAGRAM OF THE RECEIVER

4.3CIRCUIT DIAGRAM OF THE RECEIVER SECTION

22

23

Figure 4.3 CIRCUIT DIAGRAM OF THE RECEIVER

4.3.1CIRCUIT DIAGRAM EXPLNATION The reflected laser is received in the Doppler module which gives a analog signal corresponding to the variations in the intensity of the laser and a

24

digital signal corresponding to the variations in the wavelength of the reflected light. The received light is first passed on by a comparator op amp which compares the intensity with the light intensity of the led. If the light is of less intensity than the reference light then it is amplified by a three stage preamplifier and a amplifier LM386.TL074 is the 3 stage preamplification IC. The op amp LM386 used for comparator is fixed along with the radar module in the receiver section. The other 2 amplification IC are fixed in the controller section along with the microcontroller.

4.4 RADAR RECEIVER MODULE According to the properties of waves there is a frequency component and a amplitude component. When we take this for a digital processing we have to separate these two components or else we will have only the frequency component and the amplitude will be the same resulting in squeaking sound and no proper or clear audio. This is the reason why we have to separate the amplitude component. The radar receiver module has 4 pins out of which first pin has to be fed negative voltage input. Second pin has to be fed a positive input. The third pin streams a binary output in the digital mode. This binary stream is given in accordance to the variations in the wavelength of the reflected laser which nothing but the Doppler shift principle. This stream binary input must be fed into the microcontroller and it determines the frequency of the voice received. The fourth pin gives us a change in analog voltage with respect to the amplitude and the Doppler shift of the received light .These changes in

25

analog voltage are given to the microcontroller ADC for processing. This determines the amplitude of the signal which has been received. Doppler shift sensing module is designed to collect, process and plot vibration data for any vibrating surface. It is capable of detecting vibrations in a frequency range of 0 to 400 KHz. The module has a Sampling rates of 6.25K to 800K samples per second. It has a storage capacity of up to 64 K data samples ( 2 bytes per sample). Processor collects the data, performs digital conversion and transmits the data to a PC for storage and subsequent analysis and plot generation. The laser sensor has a maximum displacement range of 190 inches, a maximum velocity of 144 inches/sec and resolution of 0.1 micro inches. The sensor can receive a usable reflected signal from most secular reflective surfaces.

4.5 CIRCUIT DIAGRAM OF THE CONTROLLER SECTION

26

4.4: CIRCUIT DIAGRAM OF THE CONTROLLER SECTION

27

4.5.1 CONTROLLER SECTION It consists of the microcontroller 16F877A for which the explanation is given in the next chapter. DAC MODULE OR THE MP3module is used for the purpose of synchronizing. The ADC values and the frequency values after calibration are streamed out into the port b of the microcontroller. This output cannot be given directly to the speaker or an audio processing system as it is a pure binary data having two separate components of frequency and amplitude. So they have to be merged together. This is where we make use of an MP3 module. The MP3 module will merge these two data and convert it into an analog waveform using an inbuilt ADC which is preprogrammed.

28

4.5: PIN DIAGRAM OF THE DAC MODULE

CHAPTER 5 PIC MICROCONTROLLER 16F877A

29

5.1 PIC MICROCONTROLLER: The controller we use in our project is a PIC16F877A manufactured by Microchip. We use this controller in the receiver section.

5.2 PIN DIAGRAM:

Fig 5.1 PIN DIAGRAM

5.3 FEATURES OF 16F877A:

30

1) High-Performance RISC CPU: a) Only 35 single-word instructions to learn b) All single-cycle instructions except for program branches, which are two-cycle c) Operating speed: DC 20 MHz clock input d) DC 200 ns instruction cycle e) Up to 8K x 14 words of Flash Program Memory, f) Up to 368 x 8 bytes of Data Memory (RAM), g) Up to 256 x 8 bytes of EEPROM Data Memory h) Pin out compatible to other 28-pin or 40/44-pin i) Ease of programming with Micro C

2) Peripheral Features: a) Timer0: 8-bit timer/counter with 8-bit prescaler b) Timer1: 16-bit timer/counter with prescaler c) Can be incremented during Sleep via external d) crystal/clock e) Timer2: 8-bit timer/counter with 8-bit period f) Register, prescaler and postscaler g) Two Capture, Compare, PWM modules h) Capture is 16-bit, max. resolution is 12.5 ns i) Compare is 16-bit, max. resolution is 200 ns

31

j) PWM max. resolution is 10-bit k) Synchronous Serial Port (SSP) with SPI l) (Master mode) and I2C (Master/Slave) m) Universal Synchronous Asynchronous Receiver n) Transmitter (USART/SCI) with 9-bit address detection o) Parallel Slave Port (PSP) 8 bits wide with external RD, WR and CS controls (40/44-pin only) p) Brown-out detection circuitry for Brown-out Reset (BOR)

3) Analog Features: a) 10-bit, up to 8-channel Analog-to-Digital b) Converter (A/D) c) Brown-out Reset (BOR) d) Analog Comparator module with: i. ii. Two analog comparators Programmable on-chip voltage reference

e) (VREF) module i. Programmable input multiplexing from device

f) Inputs and internal voltage reference i. Comparator outputs are externally accessible

32

4) Special Microcontroller Features: a) 100,000 erase/write cycle Enhanced Flash b) Program memory typical c) 1,000,000 erase/write cycle Data EEPROM d) memory typical e) Data EEPROM Retention > 40 years f) Self-reprogrammable under software control g) In-Circuit Serial Programming (ICSP) via two pins h) Single-supply 5V In-Circuit Serial Programming i) Watchdog Timer (WDT) with its own on-chip RC j) Oscillator for reliable operation

33

5.4 BLOCK DIAGRAM:

34

Fig 5.2 BLOCK DIAGRAM

35

5.5 I/O PORTS: 5.5.1 PORT A: PORT A is a 6-bit wide, bidirectional port. The corresponding data direction register is TRISA. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected pin). Reading the PORTA register reads the status of the pins, whereas writing to it will write to the port latch. All write operations are readmodify-write operations. Therefore, a write to a port implies that the port pins are read; the value is modified and then written to the port data latch. Pin RA4 is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The RA4/T0CKI pin is a Schmitt Trigger input and an open-drain output. All other PORTA pins have TTL input levels and full CMOS output drivers. Other PORTA pins are multiplexed with analog inputs and the analog VREF input for both the A/D converters and the comparators. The operation of each pin is selected by clearing/setting the appropriate control bits in the ADCON1 and/or CMCON registers. The TRISA register controls the direction of the port pins even when they are being used as analog inputs. The user must ensure the bits in the TRISA register are maintained set when using them as analog inputs.

BLOCK DIAGRAM OF RA0-RA3 PINS:

36

Fig 5.3BLOCK DIAGRAM OF REGISTERS 5.5.2 PORTB AND TRISB REGISTER: PORT B is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISB. Setting a TRISB bit (= 1) will make the corresponding PORTB pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an output (i.e., put the contents of the output latch on the selected pin).Three pins of PORTB are multiplexed with the In-Circuit

37

Debugger and Low-Voltage Programming function: RB3/PGM, RB6/PGC and RB7/PGD. The alternate functions of these pins are described in Four of the PORTB pins, RB7:RB4, have an interruption-change feature. Only pins configured as inputs can cause this interrupt to occur (i.e., any RB7:RB4 pin configured as an output is excluded from the interruption-change comparison). The input pins (of RB7:RB4) are compared with the old value latched on the last read of PORTB. The mismatch outputs of RB7:RB4 are ORed together to generate the RB port change interrupt with flag bit RBIF (INTCON<0>). This interrupt can wake the device from Sleep. The user, in the Interrupt Service Routine, can clear the interrupt in the following manner: a) Any read or write of PORTB. This will end the mismatch condition. b) Clear flag bit RBIF. A mismatch condition will continue to set flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be cleared. The interrupt-on-change feature is recommended for wake-up on key depression operation and operations where PORTB is only used for the interrupt-onchange feature. Polling of PORTB is not recommended while using the interrupt-on-change feature. BLOCK DIAGRAM OF PORTB PINS:

38

Fig 5.4: RB0-RB3

Fig 5.5: RB7-RB4

39

5.5.3 PORTC REGISTERS: PORTC is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISC. Setting a TRISC bit (= 1) will make the corresponding PORTC pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISC bit (= 0) will make the corresponding PORTC pin an output (i.e., put the contents of the output latch on the selected pin).PORTC is multiplexed with several peripheral functions. PORTC pins have Schmitt Trigger input buffers. When the I2C module is enabled, the PORTC<4:3> pins can be configured with normal I2C levels, or with SM bus levels, by using the CKE bit (SSPSTAT<6>).When enabling peripheral functions, care should be taken in defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to make a pin an input. Since the TRIS bit override is in effect while the peripheral is enabled, read-modify write instructions (BSF, BCF, and XORWF) with TRISC as the destination, should be avoided. The user should refer to the corresponding peripheral section for the correct TRIS bit settings.

BLOCK DIAGRAM OF PORTC PINS

40

Fig 5.6: RC2:0, 7:5

Fig 5.7: RC 4:3

41

5.5.4 PORT D REGISTERS: PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an input or output. PORTD can be configured as an 8-bit wide microprocessor port (Parallel Slave Port) by setting control bit, PSPMODE (TRISE<4>). In this mode, the input buffers are TTL. PORT D BLOCK DIAGRAM

Fig 5.8 PORT D BLOCK DIAGRAM 5.5.5 PORT E REGISTERS: PORTE has three pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) which are individually configurable as inputs or outputs. These pins have Schmitt Trigger input buffers. The PORTE pins become the I/O

42

control inputs for the microprocessor port when bit PSPMODE (TRISE<4>) is set. In this mode, the user must make certain that the TRISE<2:0> bits are set and that the pins are configured as digital inputs. Also, ensure that ADCON1 is configured for digital I/O. In this mode, the input buffers are TTL. Register 4-1 shows the TRISE register which also controls the Parallel Slave Port operation. PORT E pins are multiplexed with analog inputs. When selected for analog input, these pins will read as 0s.TRISE controls the direction of the RE pins, even when they are being used as analog inputs. The user must make sure to keep the pins configured as inputs when using them as analog inputs.

Fig 5.9 PORT E BLOCK DIAGRAM

43

5.5.6 ANALOG TO DIGITAL CONVERTER MODULE: The Analog-to-Digital (A/D) Converter module has five inputs for the 28-pin devices and eight for the 40/44-pin devices. The conversion of an analog input signal results in a corresponding 10-bit digital number. The A/D module has high and low-voltage reference input that is software selectable to some combination of VDD, VSS, RA2 or RA3.The A/D converter has a unique feature of being able to operate while the device is in Sleep mode. To operate in Sleep, the A/D clock must be derived from the A/Ds internal RC oscillator. The A/D module has four registers. These registers are: A/D Result High Register (ADRESH) A/D Result Low Register (ADRESL) A/D Control Register 0 (ADCON0) A/D Control Register 1 (ADCON1) The ADCON0 register, shown in Register 11-1, controls the operation of the A/D module. The ADCON1 register configures the functions of the port pins. The port pins can be configured as analog inputs (RA3 can also be the voltage reference) or as digital I/O.

44

A/D BLOCK DIAGRAM:

Fig 5.10 A/D BLOCK DIAGRAM

45

5.5.7 APPLICATION IN OUR PROJECT: PIC 16F877a is the brain of the receiver in our project. It is connected to the Doppler shift radar module. It removes the carrier frequency of 300 kHz. The streamed binary data is given to the port A of the microcontroller from where it has to be sampled and the rate of the binary streaming is found. There will be a change in the binary stream which is at 300 kHz with respect to the voice frequency. There will be a change in the binary stream which is at 300 kHz with respect to the voice frequency. This gives us the frequency component of the voice. The amplitude component which is present as voltage variations with respect to amplitude changes of the signal of our voice which is fed into the ADC port and the ADC sampling is done. The ADC values are obtained in the form of binary data and this corresponds to the changes in frequency. Thus the frequency component and the amplitude component will be found to be synchronized. The ADC values and the frequency values after calibration are streamed out into the port b of the microcontroller.

46

CONNECTION DIAGRAM:

Fig 5.11 CONNECTION DIAGRAM OF PIC 16F877A

47

CHAPTER 6 PIC 18F4220 MICROCONTROLLER

48

6.1

PIC MICROCONTROLLER: The other controller we use in our project is a PIC18F4220

manufactured by Microchip. We use this controller in the transmitter section.

6.2

PIN DIAGRAM:

Fig 6.1PIN DIAGRAM OF 18F4220

49

6.3 FEATURES OF 18F4220: 1) Low-Power Features: a. Power Managed modes: i. ii. iii. i. ii. iii. iv. v. vi. vii. Run: CPU on, peripherals on Idle: CPU off, peripherals on Sleep: CPU off, peripherals off PRI_RUN: 150 A, 1 MHz, 2V PRI_IDLE: 37 A, 1 MHz, 2V SEC_RUN: 14 A, 32 kHz, 2V SEC_IDLE: 5.8 A, 32 kHz, 2V RC_RUN: 110 A, 1 MHz, 2V RC_IDLE: 52 A, 1 MHz, 2V Sleep: 0.1 A, 1 MHz, 2V

b. Power Consumption modes:

c. Timer1 Oscillator: 1.1 A, 32 kHz, 2V d. Watchdog Timer: 2.1 A e. Two-Speed Oscillator Start-up 2) Peripheral features: a. High current sink/source 25 mA/25 mA b. Three external interrupts c. Up to 2 Capture/Compare/PWM (CCP) modules: i. ii. Capture is 16-bit, max. resolution is 6.25 ns (TCY/16) Compare is 16-bit, max. resolution is 100 ns (TCY)

50

iii. i. ii. iii. iv.

PWM output: PWM resolution is 1 to 10-bit One, two or four PWM outputs Selectable polarity Programmable dead-time Auto-Shutdown and Auto-Restart

d. Enhanced Capture/Compare/PWM (ECCP) module:

e. Compatible 10-bit, up to 13-channel f. Analog-to-Digital Converter module (A/D) with programmable acquisition time g. Dual analog comparators h. Addressable USART module: i. RS-232 operation using internal oscillator block (no external crystal required) 3) Special Microcontroller Features: a. 100,000 erase/write cycle Enhanced Flash program memory typical b. 1,000,000 erase/write cycle Data EEPROM memory typical c. Flash/Data EEPROM Retention: > 40 years d. Self-programmable under software control e. Priority levels for interrupts f. 8 x 8 Single-Cycle Hardware Multiplier g. Extended Watchdog Timer (WDT): i. ii. Programmable period from 41 ms to 131s 2% stability over VDD and Temperature

h. Single-supply 5V In-Circuit Serial Programming (ICSP) via two

51

pins i. In-Circuit Debug (ICD) via two pins j. Wide operating voltage range: 2.0V to 5.5V 6.4 BLOCK DIAGRAM:

52

Fig 6.2BLOCK DIAGRAM OF 18F4220

6.5 I/O PORTS: 6.5.1 PORT A: PORTA is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISA. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected pin).Reading the PORTA register reads the status of the pins, whereas writing to it, will write to the port latch. The Data Latch register (LATA) is also memory mapped. Read-modify-write operations on the LATA register read and write the latched output value for PORTA. The RA4 pin is multiplexed with the Timer0 module clock input and one of the comparator outputs to become the RA4/T0CKI/C1OUT pin. Pins RA6 and RA7 are multiplexed with the main oscillator pins; they are enabled as oscillator or I/O pins by the selection of the main oscillator in Configuration Register 1H. When they are not used as port pins, RA6 and RA7 and their associated TRIS and LAT bits are read as 0. The other PORTA pins are multiplexed with analog inputs, the analog VREF+ and VREF- inputs and the comparator voltage

53

reference output. The operation of pins,RA3:RA0 and RA5, as A/D converter inputs is selected by clearing/setting the control bits in the ADCON1 register (A/D Control Register 1). Pins RA0 through RA5 may also be used as comparator inputs or outputs by setting the appropriate bits in the CMCON register.

BLOCK DIAGRAM OF RA0-RA3 PINS:

6.3: BLOCK DIAGRAM OF RA3:RA0 RA4/T0CKI PIN

6.4 BLOCK DIAGRAM OF RA5 PINS

54

6.5.2 PORTB AND TRISB REGISTER: PORTB is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISB. Setting a TRISB bit (= 1) will make the corresponding PORTB pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an output (i.e., put the contents of the output latch on the selected pin). The Data Latch register (LATB) is also memory mapped. Read-modify-write operations on the LATB register read and write the latched output value for PORTB. Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is performed by clearing bit RBPU (INTCON2<7>). The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are disabled on a Power-on Reset. Four of the PORTB pins (RB7:RB4) have an interruption - change feature. Only pins configured as inputs can cause this interrupt to occur (i.e., any RB7:RB4 pin configured as an output is excluded from the interruption- change comparison). The input pins (of RB7:RB4) are compared with the old value latched on the last read of PORTB. The mismatch outputs of RB7:RB4 are ORed together to generate the RB Port Change Interrupt with Flag bit, RBIF (INTCON<0>).

55

This interrupt can wake the device from Sleep. The user, in the Interrupt Service Routine, can clear the interrupt in the following manner: a) Any read or write of PORTB (except with the MOVFF (ANY), PORTB instruction). This will end the mismatch condition. b) Clear flag bit RBIF. A mismatch condition will continue to set flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be cleared. The interrupt-on-change feature is recommended for wake-up on key depression operation and operations where PORTB is only used for the interrupt-on-change feature. Polling of PORTB is not recommended while using the interrupt-on-change feature. RB3 can be configured by the configuration bit, CCP2MX, as the alternate peripheral pin for the CCP2 module (CCP2MX = 0). BLOCK DIAGRAM OF PORTB PINS:

56

FIG 6.5

BLOCK DIAGRAM OF PINS RB2:RB4

6.6BLOCK DIAGRAM OF RB2:RB0 PINS

57

6.5.3 PORTC REGISTERS: PORTC is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISC. Setting a TRISC bit (= 1) will make the corresponding PORTC pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISC bit (= 0) will make the corresponding PORTC pin an output (i.e., put the contents of the output latch on the selected pin).The Data Latch register (LATC) is also memory mapped. Read-modify-write operations on the LATC register read and write the latched output value for PORTC.PORTC is multiplexed with several peripheral functions. The pins have Schmitt Trigger input buffers.RC1 is normally configured by configuration bit, CCP2MX (CONFIG3H<0>), as the default peripheral pin of the CCP2 module (default/erased state, CCP2MX = 1).When enabling peripheral functions, care should be taken in defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to make a pin an input. The user should refer to the corresponding peripheral section for the correct TRIS bit settings. BLOCK DIAGRAM OF PORTC PINS:

58

FIG6.7

BLOCK DIAGRAM OF PORTC PINS

59

6.5.4 PORT D REGISTERS: PORTD is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISD. Setting a TRISD bit (= 1) will make the corresponding PORTD pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISD bit (= 0) will make the corresponding PORTD pin an output (i.e., put the contents of the output latch on the selected pin).The Data Latch register (LATD) is also memory mapped. Read-modify-write operations on the LATD register read and write the latched output value for PORTD. All pins on PORTD are implemented with Schmitt Trigger input buffers. Each pin is individually configurable as an input or output. Three of the PORTD pins are multiplexed with outputs P1B, P1C and P1D of the Enhanced CCP module. PORTD can also be configured as an 8-bit wide microprocessor port (Parallel Slave Port) by setting control bit, PSPMODE (TRISE<4>). In this mode, the input buffers are TTL.

60

BLOCK DIAGRAM OF PORT D:

FIG 6.8 BLOCK DIAGRAM OF PORT D 6.5.5 PORT E REGISTERS: Depending on the particular PIC18F2X20/4X20 devices selected, PORTE is implemented in two different ways. For PIC18F4X20 devices, PORTE is a 4-bit wide port. Three pins (RE0/AN5/RD, RE1/AN6/WR and RE2/AN7/CS) are individually configurable as inputs or outputs.These pins have Schmitt Trigger input buffers. When selected as an analog input, these pins will read as 0s.The corresponding data direction register is TRISE. Setting a TRISE bit (= 1) will make the corresponding PORTE pin an input (i.e., put the corresponding output

61

driver in a High-Impedance mode). Clearing a TRISE bit (= 0) will make the corresponding PORTE pin an output (i.e., put the contents of the output latch on the selected pin). TRISE controls the direction of the RE pins even when they are being used as analog inputs. The user must make sure to keep the pins configured as inputs when using them as analog inputs. BLOCK DIAGRAM OF PORT E:

FIG 6.9 BLOCK DIAGRAM OF PORT E

62

6.6 CAPTURE MODE In this mode the microcontroller captures the time taken by the charges to neutralize at the anode plates (i.e.) the transit time is captured and half the value is stored as the switching time for microcontroller. Each Capture/Compare/PWM (CCP) module contains a 16-bit register which can operate as a: 16-bit Capture register 16-bit Compare register PWM master/slave Duty Cycle register Both the CCP1 and CCP2 modules are identical in operation, with the exception being the operation of the special event trigger. Table 5.3.1 & 5.3.2 shows the resources and interactions of two ccp modules.

TABLE 6.6 a RESOURCES

TABLE 6.6 b INTERACTIONS

63

6.6.1 CCP REGISTER FORMAT

FIGURE 6.10 CCP FORMAT R- READABLE BIT, W- WRITABLE BIT, U- UNIMPLEMENTED BIT (0) -n VALUE OF POR RESET Bit 7-6: Unimplemented: Read as '0'. Bit 5-4: CCPxX: CCPxY: PWM Least Significant bits. Bit 3-0: CCPxM3:CCPxM0: CCPx Mode Select bits 0000 = Capture/Compare/PWM off (resets CCPx module) 0100 = Capture mode, every falling edge 0101 = Capture mode, every rising edge 0110 = Capture mode, every 4th rising edge 0111 = Capture mode, every 16th rising edge 1000 = Compare mode, set output on match (CCPxIF bit is set) 1001 = Compare mode, clear output on match (CCPxIF bit is set) 1010 = Compare mode, generate software interrupt on match (CCPxIF bit is set, CCPx pin is unaffected) 1011 = Compare mode, trigger special event (CCPxIF bit is set, CCPx pin is Unaffected); CCP1 resets TMR1; CCP2 resets TMR1 and starts an A/D conversion (if A/D module is enabled) 11xx = PWM mode

64

6.6.2 CAPTURE MODE OPERATION In Capture mode, CCPR1H:CCPR1L captures the 16-bit value of the TMR1 or TMR3 registers when an event occurs on pin RC2/CCP1/P1A. An event is defined as one of the following: every falling edge every rising edge every 4th rising edge

FIGURE 6.11 CAPTURE MODE BLOCK DIAGRAM 6.6.3TIMER1 MODE SELECTION Timer1 must be running in timer mode or synchronized counter mode for the CCP module to use the capture feature. In asynchronous counter mode, the capture operation may not work. 6.6.4SOFTWARE INTERRUPT When the capture mode is changed, a false capture interrupt may be generated. The user should keep bit CCP1IE (PIE1<2>) clear to avoid false interrupts and Should clear the flag bit CCP1IF following any such change in operating mode.

65

6.6.5CCP PRESCALER There are four prescaler settings, specified by bits CCP1M3:CCP1M0. Whenever the CCP module is turned off, or the CCP module is not in capture mode, the prescaler counter is cleared. Any reset will clear the prescaler counter. Switching from one capture prescaler to another may generate an Interrupt. Also, the prescaler counter will not be cleared; therefore, the first capture may be from a non-zero prescaler. The following example shows the recommended method for switching between capture prescaler. This example also clears the prescaler counter and will not generate the false interrupt. 6.7 COMPARE MODE In compare mode the microcontroller compares the value, the transit time value (i.e.) already stored. This operation is done with the help of comparator. Once the timer value matches microcontroller switches off the power supply. There by neutralization stops which causes the rocket lift. 6.7.1 COMPARE MODE OPERATION In Compare mode, the 16-bit CCPR1 register value is constantly compared against the TMR1 register pair value. When a match occurs, the RC2/CCP1 pin is: Driven high Driven low Remains unchanged The action on the pin is based on the value of control bits CCP1M3:CCP1M0 (CCP1CON<3:0>). At the same time, interrupt flag bit CCP1IF is set.

66

FIGURE 6.12 COMPARE MODE BLOCK DIAGRAM 6.7.2 CCP PIN CONFIGURATION The user must configure the RC2/CCP1 pin as an output by clearing the TRISC<2> bit. 6.7.3 TIMER1 MODE SELECTION Timer1 must be running in Timer mode or Synchronized Counter mode if the CCP module is using the compare feature. In Asynchronous Counter mode, the Compare operation may not work. 6.7.4 SOFTWARE INTERRUPT MODE When Generate Software Interrupt mode is chosen, the CCP1 pin is not affected. The CCPIF bit is set causing a CCP interrupt (if enabled).

67

6.7.5 SPECIAL EVENT TRIGGER In this mode, an internal hardware trigger is generated, which may be used to initiate an action. The special event trigger output of CCP1 resets the TMR1 register pair. This allows the CCPR1 register to effectively be 16-bit programmable periods register for Timer1. The special event trigger output of CCP2 resets the TMR1 register pair and starts an A/D conversion

68

CHAPTER 7 LM 386

69

7.1 LM 386 DESCRIPTION The UTC LM386 is a power amplifier, designed for use in low voltage consumer applications. The gain is internally set to 20 to keep external part count low, but the addition of an external resistor and capacitor between pin 1 and pin 8 will increase the gain to any value up from 20 to 200.The inputs are ground referenced while the output automatically biases to one-half the supply voltage. The quiescent power drain is only 24 milliwatts when operating from a 6 voltage supply, making the LM386 ideal for battery operation. 7.1.1 PIN CONFIGURATION

FIG 7.1 PIN DIAGRAM OF LM 386

70

7.1.2 BLOCK DIAGRAM:

FIG 7.2 BLOCK DIAGRAM OF LM386 7.2 FEATURES Battery operation Minimum external parts

71

Wide supply voltage range: 4V~12V Low quiescent current drain:4mA Voltage gains:20~200 Self-centering output quiescent voltage Low distortion:0.2%(Av =20,Vs=6V,RL=8,Po=125mW,f=1kHz) 7.3 ADAVNTAGES Can design the circuit on the breadboard Easy to modify circuits Little stress on components with repeat insertions Time required for design is short. 7.4 DISADVANTAGES Connections are easily dislodged Not a permanent solution Contacts can wear out with repeated use. 7.5 APPLICATIONS AM-FM radio amplifiers

Portable tape player amplifiers Intercoms

72

TV sound systems Line drivers

7.5.1 APPLICATIONS IN OUR PROJECT The analog variations after the filtering of the carrier wave are amplified by a set of pre amplifiers. This is used for the purpose of amplification.

CHAPTER 8 TL 074

73

8.1 TL074 DESCRIPTION The JFET-input operational amplifiers in the TL07_ series are designed as low-noise versions of the TL08_ series amplifiers with low input bias and offset currents and fast slew rate. The low harmonic distortion and low noise make the TL07_ series ideally suited for high-fidelity and audio preamplifier applications. Each amplifier features JFET inputs (for high input impedance) coupled with bipolar output stages integrated on a single monolithic chip. The C-suffix devices are characterized for operation from 0C to 70C. The I-suffix devices are characterized for operation from 40C to 85C. The M-suffix devices are characterized for operation over the full military temperature range of 55C to 125C. 8.1.1 PIN CONFIGURATION

74

FIG 8.1 PIN DIAGRAM OF TL 074

8.1.2 SYMBOL

FIG 8.2 SYMBOL OF TL074 8.2 FEATURES Battery operation Minimum external parts Wide supply voltage range: 4V~12V Low quiescent current drain:4mA Voltage gains:20~200 Ground referenced input

75

Self-centering output quiescent voltage Low distortion:0.2%(Av =20,Vs=6V,RL=8,Po=125mW,f=1kHz)

8.3 ADAVNTAGES Can design the circuit on the breadboard Easy to modify circuits Little stress on components with repeat insertions Time required for design is short.

8.4 DISADVANTAGES Connections are easily dislodged Not a permanent solution Contacts can wear out with repeated use. 8.5 APPLICATIONS SWITCHING TIME TEST CIRCUIT GATE CHARGE TEST CIRCUIT UNCLAMPED ENERGY TEST CIRCUIT

76

CHAPTER 9 CRYSTAL OSCILLATOR


77

9.1

INTRODUCTION The crystal oscillator oscillates at a frequency determined by the crystal

since the crystal is the feedback element. The frequency of operation is very stable making the circuit to be used in various electronic applications. The piezoelectric effect is the effect under the influence of the mechanical pressure in which the voltage gets generated across the opposite faces of the crystal. The crystal has a greater stability in holding the constant frequency. The crystal oscillators are preferred when greater frequency stability is required. The main substances exhibiting the piezoelectric effect are quartz, Rochelle salt and tourmaline. Rochelle salts have the greatest piezoelectric

78

activity. Rochelle salt is mechanically weakest of the three and break very easily. Tourmaline shows least piezoelectric effect but it is mechanically strongest. Quartz is the compromise between the piezoelectric activity of the Rochelle salt and the mechanical strength of tourmaline. 9.1.1 ADVANTAGES o The frequency of oscillation is constant over a long period of time. o The frequency of oscillation is not affected by the changes in the supply voltage, load and temperature. 9.1.2 DISADVANTAGES o The basic limitation of the crystal oscillator is that it has a very limited tuning range. 9.2 CRYSTAL OSCILLATOR The crystal oscillator in our project provides a crystal frequency of 48MHz. it is generally used in any electronic operation for its frequency stability. It is actually connected to the clock in and clock out pin of the PIC microcontroller. It is generally used to provide the clocking signal to activate the PIC microcontroller. It consists of two capacitors of 22 microfarads. When the crystal is not vibrating it is equivalent to a capacitance due to the mechanical mounting of the crystal. Such a capacitance existing due to two metal plates separated by a dielectric crystal slab is called mounting capacitance or the shunt capacitance. When the crystal is vibrating and is providing a crystal

79

frequency of 48MHz there are internal frictional losses which are denoted by a resistance R. The mass of the crystal, which is the indication of the inertia, is represented by the inductance L. in vibrating condition it has some stiffness that is represented by the capacitance C. This RLC network forms a resonating circuit. The crystal frequency generated is inversely proportional to the thickness of the crystal. For very high frequencies the thickness of the crystal must be made as small as possible. But by making the crystal less thick the crystal becomes mechanically weaker and hence may get damaged under the mechanical vibrations. So practically the crystal oscillators are used for less frequency. The crystal oscillators have two resonating frequency namely the parallel and the series resonating frequency.

CHAPTER 10
80

VOLTAGE REGULATORS

10.1 INTRODUCTION The main function of voltage regulator is to provide a stable dc voltage for powering other electronic devices. It should be capable of providing substantial output current. The IC 7805 is a 3 pin IC where the input of 12volts gets regulated to 5volts and is supplied to the microcontroller. It also provides a very high stability to the overall circuit operation. It consists of an LED which glows at

81

the time of movement of the wheelchair. The modern voltage regulators are monolithic chips and they provide a constant supply voltage though the load varies in the circuit. This property of the voltage regulator is used in our project as we involve the usage of the Stepper motors in which the load varies rapidly as the speed of the motor is increased [ref 1] . The various types of voltage regulators which are classified according to the operation are 1. Current limited voltage regulators. 2. Switching voltage regulators. 3. Shunt voltage regulators. 10.2 APPLICATION IC 7805 is used which regulates the power supply of 12volts from the battery to 5volts and then it is connected to the PIC microcontroller. The pin to which the regulator is connected is the VSS pin of the microcontroller.

82

CHAPTER 11 FUTURE ENHANCEMENTS

11.1 FUTURE ENHANCEMENTS AND APPLICATIONS In future this device can be used in Anti-terrorism.To collect evidence during warfare.This device would be of utmost use for our Indian defense systems and for our intelligence departments. Can be used effectively to save a lot of lives in case of wars or hijacks.

83

Fig11.1FUTURE ENHANCEMENTS

In future our device can be extended as Satellite Spying System. In satellites with the help of servos and image processing the receiver can be made to adjust itself for the reflected laser light

84

CHAPTER 12 CONCLUSION

12.1 CONCLUSION We consider this would be of much use to our Indian defense systems to prevent loss of life and property due to atomic warfare and can avoid disasters of the future effectively.

85

This can be used effectively to save a lot of lives in case of wars. The prototype is made for the demonstration and the pictures of the prototype are shown below.
LASER DIODE MODULE & ITS DRIVER DOPPLER SHIFT RECEIVER & PRE AMPLIFIER

PRE AMPLIFIERLM386 DIODE LASER MICRO CONTROLLER 18F4220 LM386

MICROCONTROLLER & DAC SEGMENT


FRONT VIEW REAR VIEW

86

MICROCONTROLLER 16F877A

DAC MODULE

MECHANICAL SET UP POWER AMPLIFIER

BOARD

QUARTZ LENS

APPENDIX 1 PROGRAM CODE FOR MICROCONTROLLER 16F877A IN BASICPRO # include modefs.bas'

87

TrisA= % 0xff ' ADCON0=0x82' DEFINE ADC_BITS 10 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 1 TrisC =% 0xff'' TrisB = %00000000' Pwm Var BYTE' unsigned long Amplitude FI con C.0, Loop: Pulsin FI, 1, pwm IF Pwm = 3 THEN Pwm=0 PulseoutB.0, Pwm ADCIN0, Amplitude Hpwm Port B.1, Amplitude, 1 Endif Goto Loop end

APPENDIX 2 PROGRAM CODE FOR MICROCONTROLLER 18F4220 IN MICROC

#include<18f4220>

88

trisC=0; void main() { portC=0; while(1) { portC=~portC; delay_us(3); } }

89

90

You might also like