chapter 3 tone producers When an internet request from Baraka or Manyara is made, the first step to turn on the necessary communications equipment is to produce a specific set of analog tones that the decoder will recognize. Each set of tones consists of two audio frequency tones. One set of tones corresponds to an internet request for Manyara, and one set of tones corresponds to an internet request for Baraka. The first consideration in this design was how to produce an audio frequency sinusoid. Phase shift oscillators were chosen because they are easy to implement and require a small number of parts. They only require resistors, capacitors, and one op-amp. Another consideration in the design was the operating voltage. Early on, it was decided that most things would be powered with 5V. Part of this decision was based on the radio transmitters and receivers. The radio transmitter used 5V for power and its input was a 0 to 5V signal. The LM324 quad op-amp was chosen because it can run off of a low supply voltage, it has four op-amps per case, and it is designed to work as a single supply op-amp. Typically op-amps use typical plus/minus voltage rails and a 0V reference, For the tone producer circuit, the voltage rails were 5V and 0V, and the reference was 2.5V. The reference was made from a simple voltage divider. The resistors for the voltage divider were chosen to be as high as possible while still remaining a reliable 2.5V reference. The phase shift oscillator circuit is shown in figure 3.G. Rf 5 - ¼ LM324 Vout + R 2.5 C C C R 2.5 R 2.5 Figure 3.G: Phase Shift Oscillator The frequency of oscillation can be calculated using the following equation. f 1 2RC 6 In order for the circuit to oscillate, the feedback resistor must be chosen such that: R f 29 R To create a set of two tones, two tones were simply added together using a summing amplifier. This summing amplifier was implemented using the same integrated circuit as the rest of the circuit. One problem with the entire analog tone encoding/decoding was the radios. The radios that were being used earlier in the semester used ASK modulation. This meant that the signal was run through a comparator before being sent. This comparator did not switch exactly at 2.5V, and there was some hysteresis. Therefore, when decoding the signals, the original signal could not be recovered. To resolve this issue, a 'zero' crossing detector was added as the last stage to the tone producing circuit. The 'zero' is in quotes because, since the reference is 2.5V, it is actually a 2.5V crossing detector. This crossing detector is exactly centered where the signal is biased, and there is zero hysteresis. Therefore, the signal could be recovered after being made into a squarewave. The crossing detector was also implemented on the same op-amp. The circuit is powered from a 24VDC supply, which is fed through a 5V regulator. Before going through the regulator, the 24VDC is fed through a relay. The relay contact is only closed when a 5V signal from the computer's serial port is sent. Since the serial port cannot supply enough current to switch the relay, a simple transistor circuit was added. The transistor circuit requires the serial port to provide only 5mA. This current saturates the transistor. A resistor was added in series with the relay coil to limit the coil current. This was necessary because the relay was made to switch from 5V, but is being switched with 24V. Complete schematics of the tone producers are provided in Appendices G and H. tone decoder Once the tones are modulated, transmitted, received, and demodulated, the signal must be decoded. The decoder was actually designed before the tone producers, as it is a much more complicated circuit. Like the decoder, this circuit was designed to run off of 5V. This is largely because the radio receiver requires 5V to run and has an output of 0.8V to 4V. Once again this circuit was setup to have 0V and 5V rails with a 2.5V reference. The voltage divider for the 2.5V used fairly low resistor values to maintain a reliable 2.5V reference. LM324 op-amps are also being used in this circuit because they are cheap, low voltage, single supply op-amps. The first stage of the decoder is simple voltage follower. This stage acts as buffer. The input impedance of this stage is very high and the output is able to supply up to 20mA. The output of this stage is fed to the four band-pass filters. The band pass filters are the most important part of the circuit. The goal was to create sharp band-pass filters while using only one op-amp. Butterworth filters were considered, but it was decicded that they require too many stages to achieve the desired sharpness. Therefore, second order filters with imaginary roots were used. One of these filters is shown below figure H. C4 C3 R1 R5 Vin 5 R2 - ¼ LM324 + 2.5 Vout 2.5 Figure H: Second Order Band-Pass Filter To choose the components for each filter, A simple algorithm was followed. First the center frequency gain was chosen to be H 1.2 . Then the sharpness was chosen to be Q 10 . After that the center frequency was chosen: 0 2f 0 . Next a standard capacitor value was chosen: C C 4 C5 . Once all these parameters were chosen, the resistors were calculated using the following equations: R1 Q0 H 0 C R2 Q0 0 C 2Q02 H R5 2Q0 0C This process had to be tweaked and redone several times to find a filter with a center frequency close enough to the oscillator frequency. After building several of the filters with a sharpness of 7, the circuit was redesigned with a sharpness of 10. The higher the sharpness, the more difficult it was to use standard components to obtain the correct center frequency. The output of each filter is fed to a peak detector. This circuit detects the highest peak of the AC signal and makes it a DC level. A resistor was added to the typical peak detector so that once the decoder is no longer receiving the signal, the capacitor quickly loses its charge. The peak detector detects one diode drop lower than the actual peak of the waveform. Therefore, when no signal passes through the filters, the peak detector voltage is about 2V, but when a signal passes through the filters, the peak detector is about 3V. This stage is shown in figure I. The next stage in the circuit is a 2.5V crossing detector. When the signal is above 2.5V, the output is 5V, or a logical 1. When the signal is below 2.5V, the output is 0V, or a logical 0. These logic signals are connected to an 74LS08, which is an integrated circuit containing AND gates. The output of these AND gates are connected to the input of the microcontroller. Therefore, the microcontroller only receives an input if both of a pair of two tones are received. The frequencies for the tone signaling were changed at one point because the radio made the signals into squarewaves. Because of this, some harmonics were registering as different tones and creating false inputs. Also, interference sometimes creates false inputs. A safety feature was implemented so that the microcontroller must recieve the signal for a full second to register as an input. In order for the decoder and reciever to be turned on and off at night, a two coil latching relay is used to switch on an off the circuit. The latching relay is controlled by the microcontroller. Transistors are used to amplify the current to switch the relays. A complete schematic of the decoder is provided in Appendix I. references: LM324 datasheet small orange realay datasheet FM transmitter and reciever datasheet wierzba's 303 notes wierzba's 302 notes wierzba's402 notes