Vala Fathipour 810184162 Burglar Detector Circuit The block diagram below shows different sections of the burglar detector. Next, we will discuss each section in detail. Sensor LED/Buzzer Amplifier Active rectifier Oscillator Latch Low Pass Filter Comparator Sensors: Two sensors are used in this device: ultrasound transmitter/receiver and a microphone. The microphone circuit is shown below: The coupling capacitor is used to eliminate the DC offset, .i.e. to separate the DC biasing voltages and currents from the microphone circuit. Ultrasound transmitter/ receiver produce a 40 KHz sinusoidal wave. Amplifier: An inverting amplifier is used to amplify the signal from the sensors. The gain of the amplifier is -Rf/Ri. Note that the gain-bandwidth product for an amplifier is a constant. Thus the bigger the gain of the amplifier you chose, the smaller the bandwidth would be. Thus since I needed the bandwidth; I could not go for a very large gain. 1 The input and output waveforms are shown below: For ultrasound transmitter/ receiver, the input wave is a sinusoidal 40 KHz signal shown in green. The output of the amplifier, shown in red, is 180 degrees out of phase with the input signal. Active Rectifier: An active rectifier both amplifies and rectifies the signal. Rectification is required because the input to the comparator must be a DC signal. 2 Gain of the circuit is -(Rf IIRdiodeforward)/Ri . On the positive half cycle, since the diode conducts, the gain of the circuit drops significantly. On the negative half cycle, however, the diode doesn’t conduct and the gain will be as usual, i.e.- Rdiodeforward/Ri. Output signal of the rectifier: Low pass filter: Low pass filter is used to smooth out the output signal of the active rectifier before being fed to the comparator. 3 Note that the output from the op-amp is a 40 KHz sinusoidal wave, whereas the rectifier output consists of a range of frequencies. Thus we need to get rid of high frequencies and be left with a DC signal for the input of the comparator. This is done by designing the filter such that it attenuates largely signals of about 40K and above. The smaller the half power frequency is, the more 'DC' like the input to the comparator will be. However, since f1/2=1/(2πRC), a small half power frequency requires a great time constant. This would mean that the circuit would respond to changes in the outside world quite slowly i.e. the intruder might have come and gone by the time the DC level of the filter has moved and the comparator made a decision on it! Thus there is a tradeoff between the cut-off frequency of the circuit and the time constant of circuit =>Time constant<1/40KHz. I went for a time constant of 25ms. The frequency response is shown below. As it can bee seen, gain drops rapidly at frequencies about 40K. 4 Comparator: Comparator compares its input signal (output of the low pass filter) to a fixed voltage level, and based on that, makes a decision. The fixed voltage can be altered by a variable resistor. If the ultrasound beam was cut or if the microphone detected a sound, the DC level output of the filter goes high causing the inverting comparator to saturate and go low. This is then fed to the NAND gates which invert the 00 input into 11 output. 5 Note that two separate circuits have been used for the microphone and ultrasound transmitter/receiver, the connection is made after the comparator stage. Microphone circuit: The signal detected by the presence of the burglar, makes the DC level input of the comparator to go high. Comparator detects this and sends its output from high to low. Ultrasound circuit: There are two possible connections: 1. Placing the transmitter and the receiver in front of each other. Signal from the transmitter is always detected by the receiver. The signal is cut by the presence of the burglar and its DC level would go down. A non inverting comparator is required for this configuration, so that its output drops to 0 by the presence of the burglar. 2. Placing the transmitter and the receiver side by side. When the signal reflected by the burglar is detected by the receiver, the output of the inverting comparator goes from high to low. 6 I have used the second method as it is more compact and takes less space than having the receiver and the transmitter at two different positions. Latch: Latch is used to keep voltage constant i.e. the buzzer and the LED work as long as they are switched of by the user. The two inputs of the latch are taken from the output of the comparator (Vc) and the switch (Vs); which are both held at logic 1 at normal conditions. The latch output is thus 00 at normal conditions. For the SR LATCH, a cross coupled NAND gate is used. The transition table is shown below. Note that the illegal input is when both inputs are low. (This never happens as there don’t exist a time when burglar is detected and at the same time the switch is pressed. Set bar 0 0 1 1 Reset bar 0 1 0 1 Q+ 0 1 Q S Q Q R 7 Thus at normal conditions, when Vc and Vs are both high; the latch will remember its previous state and remain in it (usually with output 0). As soon as the burglar is detected; the comparator output (Vc) would drop to logic 0. Comparator output is connected to reset bar of the latch, this would mean that the output of the latch would be 1 and the LED and buzzer go off. The next action is to reset the alarm so that the buzzer and LED go off. This is done by pressing the switch(Vs), i.e. placing a 0 on the set bar and thus making the output of the latch to go low. Switch: The switch allows us to turn off LED and buzzer after they have gone off. It is normally open and Vs is at logic 1. When pressed, it is short circuited and Vs goes down to 0V. This would turn the buzzer and the LED off. A PIC microcontroller was used for the operation of ultrasound transmitter/receiver, the LED and the buzzer. Bellow are some pictures of the device: 8 Ultrasound transmitter Inverting amplifier Microphone Active rectifier Low Pass Filter Variable resistor Comparator Connection between the two circuits is made at this point Buzzer 9 10