Silicon ChipDirect Conversion Receiver For Radio Amateurs; Pt.1 - July 2002 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Is our electricity too cheap for solar to succeed?
  4. Feature: Victoria's Solar Power Tower: A World First? by Sammy Isreb
  5. Project: Telephone Headset Adaptor by John Clarke
  6. Subscriptions
  7. Project: A Rolling Code 4-Channel UHF Remote Control by Ross Tester
  8. Order Form
  9. Feature: Applications For Fuel Cells by Gerry Nolan
  10. Product Showcase
  11. Weblink
  12. Project: Remote Volume Control For The Ultra-LD Amplifier by John Clarke & Greg Swain
  13. Review: Tektronix TDS 2022 Colour Oscilloscope by Leo Simpson
  14. Project: Direct Conversion Receiver For Radio Amateurs; Pt.1 by Leon Williams
  15. Vintage Radio: The Airzone 500 series receivers by Rodney Champness
  16. Notes & Errata
  17. Book Store
  18. Back Issues
  19. Market Centre
  20. Advertising Index
  21. Outer Back Cover

This is only a preview of the July 2002 issue of Silicon Chip.

You can view 28 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Telephone Headset Adaptor":
  • Telephone Headset Adaptor PCB pattern (PDF download) [12107021] (Free)
  • Panel artwork for the Telephone Headset Adaptor (PDF download) (Free)
Articles in this series:
  • Fuel Cells: The Quiet Emission-Free Power Source (May 2002)
  • Fuel Cells: The Quiet Emission-Free Power Source (May 2002)
  • Fuel Cells Explode! (June 2002)
  • Fuel Cells Explode! (June 2002)
  • Applications For Fuel Cells (July 2002)
  • Applications For Fuel Cells (July 2002)
Items relevant to "Remote Volume Control For The Ultra-LD Amplifier":
  • Ultra-LD 100W RMS Stereo Amplifier PCB patterns (PDF download) [01112011-5] (Free)
  • Ultra-LD 100W Stereo Amplifier PCB patterns (PDF download) [01105001-2] (Free)
  • Panel artwork for the Ultra-LD 100W RMS Stereo Amplifier (PDF download) (Free)
  • Ultra-LD Amplifier Preamplifier with Remote Volume Control PCB pattern (PDF download) [01107021] (Free)
Articles in this series:
  • Ultra-LD 100W Stereo Amplifier; Pt.1 (March 2000)
  • Ultra-LD 100W Stereo Amplifier; Pt.1 (March 2000)
  • Building The Ultra-LD 100W Stereo Amplifier; Pt.2 (May 2000)
  • Building The Ultra-LD 100W Stereo Amplifier; Pt.2 (May 2000)
  • 100W RMS/Channel Stereo Amplifier; Pt.1 (November 2001)
  • 100W RMS/Channel Stereo Amplifier; Pt.1 (November 2001)
  • 100W RMS/Channel Stereo Amplifier; Pt.2 (December 2001)
  • 100W RMS/Channel Stereo Amplifier; Pt.2 (December 2001)
  • 100W RMS/Channel Stereo Amplifier; Pt.3 (January 2002)
  • 100W RMS/Channel Stereo Amplifier; Pt.3 (January 2002)
  • Remote Volume Control For Stereo Amplifiers (June 2002)
  • Remote Volume Control For Stereo Amplifiers (June 2002)
  • Remote Volume Control For The Ultra-LD Amplifier (July 2002)
  • Remote Volume Control For The Ultra-LD Amplifier (July 2002)
Items relevant to "Direct Conversion Receiver For Radio Amateurs; Pt.1":
  • PIC16F84(A)-04/P programmed for the Direct Conversion Receiver (Programmed Microcontroller, AUD $10.00)
  • Firmware (HEX) file and source code for the Direct Conversion Receiver (Software, Free)
  • Direct Conversion Receiver for Radio Amateurs PCB pattern (PDF download) [06107021] (Free)
  • Panel artwork for the Direct Conversion Receiver for Radio Amateurs (PDF download) (Free)
Articles in this series:
  • Direct Conversion Receiver For Radio Amateurs; Pt.1 (July 2002)
  • Direct Conversion Receiver For Radio Amateurs; Pt.1 (July 2002)
  • Direct Conversion Receiver For Radio Amateurs; Pt.2 (August 2002)
  • Direct Conversion Receiver For Radio Amateurs; Pt.2 (August 2002)
Pt.1: By LEON WILLIAMS, VK2DOB Whether you’re a beginner who just wants to “listen in” or an experienced radio amateur busting to build something, this 7-7.3MHz direct conversion radio receiver is just the shot. It offers good performance and features audible readout of the tuned frequency in Morse code. It’s also very easy to build. I F YOU TAKE A WALK or a drive about your neighbourhood, chances are that you’ll find some strange looking wire structures or overgrown TV antennas straddling some backyards. They probably belong to an amateur radio operator but while you may have heard about 70  Silicon Chip amateur radio, you may not know what really goes on inside their radio room or “shack”. You might not realise that they could be talking to anoth­er amateur just down the road or perhaps even on the other side of the world. They could be simply having a chat using single side­band (SSB), or conversing in Morse code (CW) or even seeing each other using slow-scan television (SSTV). So, how can you find out what they’re up to? Build this receiver, that’s how – and maybe you’ll be in­spired to get your own amateur licence! Of course, you don’t have to be a beginner to build this receiver. If you have a licence already, you’ll know that there’s nothing more rewarding then assembling a radio receiver and hearing signals come through the headphones for the first time. Design features While it may not have all the bells and whistles of expen­sive commercial radios, this receiver performs extremely well and is certainly better than a lot of simple designs that have appeared www.siliconchip.com.au over the years. Not only that, it even has its own frequency counter run by a PIC microcontroller! A few decades ago, a receiver like this would have sported a metal tuning capacitor “gang” with a matching reduction drive and front-panel tuning dial, so that you could tell what fre­ quency you were on. Unfortunately, metal tuning gangs are now almost extinct and good reduction drives are very expensive. In this design, they are replaced by a BB212 dual variable-capacitance diode and a PIC16­F84 microcontroller. The BB212 replaces the tuning gang and looks like a normal plastic transistor. It actually contains two variable capacitance (varicap) diodes joined at their cathodes and we can obtain a wide shift in capacitance by varying the voltage at the junction. In this receiver, the Main and Fine tune potentiometers provide the vari­able voltage. Morse frequency readout The PIC microcontroller replaces the front-panel dial by accurately measuring the frequency of the local oscillator and injecting this as Morse code into the audio stages. To find the frequency that you are on, you simply press the FREQ button on the front of the receiver and hear the frequency announced (in Morse) in your headphones. Although a little unusual, this technique is low in cost and requires a minimum of components to provide an accurate frequency “readout”. In addition, it avoids the need for a big front panel and by using single PC board construction for the circuitry, we can fit the receiver into a small and inexpensive plastic case. The receiver runs off a regulated DC supply of 11-15V and uses readily available parts. And that’s not easy these days, as components for radio building are getting harder and harder to find. Tuning range The prototype receiver has been built for the 40-metre band (7.00MHz to 7.30MHz) but could be adapted to another narrow band of frequencies anywhere between say 1MHz and 15MHz. This would involve changing the local oscillator tuning compon­ ents and bandpass filter values for the new frequency. Note, however, www.siliconchip.com.au Fig.1: the basic scheme for a switching mixer. The transformer provides two outputs 180° out of phase (RFA and RFB) to the inputs of a double-throw switch. As the control pin (Local Osc) alter­nates between high and low, the switches open and close and each leg of the transformer is connected in turn to the low-pass filter and the output. that we haven’t done any work along these lines. Direct Conversion The receiver uses the Direct Conversion (DC) approach. This is different to the normal receivers you have, such as in your clock radio, TV or car radio. They will almost certainly use what is called a “superheterodyne” (superhet) receiver. A superhet converts the signal from the antenna down to an intermediate frequency (IF), amplifies it and then demodulates it (ie, con­verts it to audio) using a second mixer. By contrast, a DC receiver simplifies this by converting the input RF signal directly down to audio, in the first and only mixer stage. In greater detail, the mixer in a DC receiver accepts signals from the antenna and a signal from a local oscillator and produces the sum and difference of the two frequencies at its output. Of course, there’s no such thing as a perfect mixer and so there will be other frequencies in the output but these will be the dominant ones. For example, assume that a Morse MAIN FEATURES • • • • • Suitable for use with SSB and Morse code signals. Frequency range: 7.0-7.3MHz (can be modified to cover any narrow band of frequencies within the range 1-15MHz). Morse code frequency readout. Power supply: 12V DC. Easy-to-build single board construction. code signal on 7.100MHz is present at the antenna port of the mixer and that the local oscillator is tuned above the signal frequency at 7.101MHz. The main frequencies at the mixer output will be the sum of 14.201MHz and the difference of 1kHz. The inaudible high-frequency signals are filtered out with a simple low-pass filter, leaving the 1kHz tone for us to hear. An important thing to note here is that we could alterna­ tively have set our local oscillator to 7.099MHz, which is below the signal frequency, and the resultant audio tone frequency would still be 1kHz. Setting the local oscillator 2kHz away on either side of the signal frequency would result in a 2kHz audio tone and so on. The level of the audio tone is related to the amplitude of the antenna signal and is independent of the local oscillator level. Of course, the level of the local oscillator must be sufficient for proper mixer operation. While we need to offset the local oscillator for CW recep­tion, to receive SSB signals we need to tune the local oscillator so that its frequency is equal to the transmitter’s suppressed carrier frequency. When we adjust the local oscillator accurate­ly, the transmitter can be transmitting either the lower or upper sideband and we will still demodulate the audio correctly. In practice, tuning an SSB signal does not have to be this precise; we can adjust the local oscillator frequency a little either way and the audio will still be recognisable. Things are different if we want to receive an AM signal, however. Here the transmitted signal is sent with a full carrier as well as both sidebands. July 2002  71 Fig.2: this diagram shows the mixer’s input and output waveforms. Note that the waveforms are not to scale and are exaggerated for clarity. To demodulate this type of signal correctly, the local oscillator must be at exactly the same frequency and in phase with the transmitter carrier. If we don’t do this, the audio will sound modulated and will be hard to understand. It’s difficult to successfully demod­ ulate AM with a DC receiver without additional complicated circuitry. How­ev­er, it’s not really important for amateur use because the bulk of stations use CW or SSB and only a very small number of operators use AM. Limitations While DC receivers sound ideal, 72  Silicon Chip they do have some potential limitations. First, because there is generally little if any gain at RF, the bulk of the signal gain must take place at audio frequencies. In most cases, over 100dB is needed – especially if you want to power a speaker from antenna signals of less than a microvolt. Unfortunately, it is common for audio amplifiers operating at very high gains to end up with problems such as feedback, hum pick-up, noise and microphonics. However, the main limitation with a DC receiver is that we receive both sidebands simultaneously. For example, let’s assume that our local oscil- lator is set to 7.100MHz and we are listening to a CW station transmitting on 7.099MHz. The decoded signal will generate a 1kHz tone in our headphones. But if another station starts sending on 7.101MHz, this signal will also be decoded and generate a tone of 1kHz. Obviously, this situation makes reception of the first station quite difficult. A superhet receiver on the other hand can employ a narrow RF filter that only passes the wanted sideband, substantially eliminating interference from adjacent stations. So while a DC receiver may not be the ultimate, for straightforward amateur use they work extremely well considering the simplicity of the circuit and the low number of components used. Indeed, for the amateur builder, a DC receiver does have some advantages when compared to a superhet. They don’t require multiple mixers and oscillators and there are no complicated alignment procedures involving lots of RF and IF circuits. What’s more, there’s no need to purchase an expensive sideband filter. In practice, instability and noise in high-gain audio stages for DC receivers can be overcome with careful design. Similarly, the simultaneous reception of both sidebands is not really a big problem. People who have built and used DC receivers always comment on the fact that their performance belies their simplicity and that the recovered audio has an unexpected “purity” about it. This is probably due to the low number of tuned circuits used and the lack of multiple mixers and oscillators that con­tribute to signal degradation in a normal receiver. CMOS mixer Another unusual feature of this design is the use of a CMOS (74HC4066) analog switch as the front-end mixer. These chips are usually used to switch DC or audio signals but they are also equally capable of switching RF signals. Traditionally, to obtain strong mixer performance, diodes arranged in a ring con­figuration are used. However, diode mixers require quite a bit of power to get them to operate effectively and if not de­signed correctly, are likely to exhibit poor performance. The 74HC4066 on the other hand is www.siliconchip.com.au cheap and does an excel­lent job as an RF mixer. It has a very large dynamic range, which means that it can handle signals ranging from tiny sub-micro­ volt levels to several volts. But while a large range is obvious­ ly an advantage, the ability to receive small signals in the presence of much larger signals is even more important. And in this respect, the 74HC4066 excels. A strong signal handling capability is especially critical with direct conversion receivers, because at night on the 40-metre band (where extremely strong international shortwave stations abound), simpler mixers are prone to overload and demodulation of unwanted AM signals. The mixer used in this receiver is called a switching type and to better understand how it works, a simplified circuit is shown in Fig.1. In addition, Fig.2 shows the mixer’s input and output waveforms. Note that the waveforms are not to scale and are exaggerated for clarity. While it may not be obvious at first, the switch is equiv­alent to one half of the mixer in the main circuit (Fig.3). In practice, the double-throw switch is made from two CMOS analog gates with their outputs joined. Note that two of these switching circuits operate out of phase to provide differential signals – more on this later. In Fig.1, the transformer is connected so that it provides two outputs 180° out of phase (RFA and RFB) to the inputs of the double-throw switch. As the control pin (Local Osc) alter­nates between high and low, the switch effectively moves from side to side and each leg of the transformer is connected in turn to a low-pass filter and the output. If the control signal has the same frequency and phase as the input signal, the output resembles that produced from a full-wave diode rectifier. After low-pass filtering, the output cannot follow the RF waveform and the result is a steady DC voltage across the load. This is the “zero beat” condition. If, however, the input frequency and the control frequency are slightly different, the control switching is not coincident with the zero crossings of the input signal and the waveform gets “chopped”. The resultant output after low-pass filtering is a sinewave with a frequency equal to the differwww.siliconchip.com.au Parts List 1 PC board, code 06107021, 171 x 133mm 1 plastic instrument case, 200 x 160m x 70mm 12 PC board stakes 1 4MHz crystal (X1) 1 red binding post 1 black binding post 1 SO239 panel socket – square mount 1 3.5mm stereo PC mount phono socket (Jaycar PS-0133) 1 18-pin IC socket 4 small self-tapping screws 4 3mm screws and nuts 1 large knob 2 small knobs 1 red momentary pushbutton switch 1 black momentary pushbutton switch 3 5mm coil formers 3 6-pin coil bases 2 metal shielding cans 2 F16 ferrite slugs 1 large 2-hole ferrite balun former 1 470µH RF choke Semiconductors 1 PIC 16F84-04P (IC1) (programmed with DCRX.HEX) 1 74HC00 quad NAND gate (IC2) 1 74HC4066 analog switch (IC3) 2 LM833 dual op amps (IC4,IC5) 1 LM386 power amplifier IC (IC6) 3 BC547 NPN transistors (Q1,Q3, Q7) 1 BC557 PNP transistor (Q6) 2 BC337 NPN transistors (Q4,Q5) 1 MPF102 FET (Q2) 6 1N4148 signal diodes (D1-D6) 1 1N4004 power diode (D7) 1 7808 8V regulator (REG2) 2 78L05 5V regulators (REG1, REG3) 1 BB212 dual varicap diode (VC1) ence between the control and signal frequencies. Circuit description The circuit for the receiver was a little too big for a single diagram, so we’ve split it into two (Figs.3 & 4). We’ll look at the mixer and local oscillator sections first – see Fig.3. As shown, signals from the antenna are coupled to an input bandpass filter (BPF), which comprises T1, T2, the Capacitors 2 470µF 25VW PC electrolytic 1 470µF 16VW PC electrolytic 6 100µF 16VW PC electrolytic 3 10µF 16VW PC electrolytic 2 1µF 16VW PC electrolytic 17 0.1µF MKT polyester 1 .022µF MKT polyester 4 .01µF MKT polyester 1 .0047µF MKT polyester 5 .0033µF MKT polyester 1 .0015µF MKT polyester 2 470pF polystyrene 1 330pF polystyrene 2 220pF ceramic 1 33pF NPO ceramic 1 10pF NPO ceramic 1 5.6pF NPO ceramic 1 40pF trimmer capacitor (VC2) Resistors (0.25W, 1%) 1 1MΩ 3 3.3kΩ 6 100kΩ 2 2.2kΩ 4 47kΩ 2 1kΩ 4 22kΩ 1 560Ω 4 20kΩ 3 150Ω 1 11kΩ 6 100Ω 5 10kΩ 1 10Ω 8 4.7kΩ 2 4.7Ω 5% Trimpots 1 2kΩ horizontal trimpot (VR1) 1 5kΩ linear 24mm potentiometer (VR2) 1 500Ω linear 24mm potentiometer (VR3) 1 50kΩ horizontal trimpot (VR4) 1 10kΩ horizontal trimpot (VR5) 1 1kΩ linear 24mm potentiometer (VR6) Miscellaneous Light duty hookup wire, solder lug, tinned copper wire, 0.25mm enam­ell­ed copper wire, tinplate. 220pF resonat­ing capacitors and the 10pF coupling capacitor. This filter is reasonably broad to allow 7MHz signals to pass easily but it attenuates unwanted out-of-band signals. The filtered signal is then coupled to a pre­ amplifier stage based on transistor Q4. It is not absolutely necessary to incorporate an RF preamp in a DC receiver. However, it has been included in this design to compensate for the losses in the BPF and the mixer and July 2002  73 74  Silicon Chip www.siliconchip.com.au Fig.3 (left): the front-end circuitry of the DC receiver. The signal from the antenna is first fed to a bandpass filter and then to RF preamplifier stage Q4. Q4 in turn drives T3 which provides the two 180° out-of-phase signals to the mixer (IC3). FET Q2 is the local oscillator stage and this is tuned by the BB212 varicap diodes (VC1). to improve the overall signal-to-noise ratio. Q4’s collector drives the primary winding of broadband transformer T3. This transformer’s secondary windings are con­nected to provide the two 180° out-of-phase signals for the following mixer stage (IC3). Regulator REG3 provides a +5V supply for IC3 and also provides a 2.5V DC bias via two 4.7kΩ resistors at the centre tap of T3. This bias voltage is used to limit the signals fed to IC3 so that they are less than the supply rail voltages. Note that the centre tap is grounded for AC signals by the 100µF and 0.1µF capacitors. IC3a and IC3b form one half of the mixer, while IC3c and IC3d form the other half. The two lines labelled LOA and LOB are the local oscillator inputs – when one is high the other is low and vice versa. Switches IC3a and IC3c are turned on when LOA is high, while IC3b and IC3d turn on when LOB is high. The inputs to the switches are driven by the secondary of transformer T3, while their outputs are joined together to form the double-throw switches referred to earlier. This results in the demodulated audio signals at pins 2 and 9 being 180° out of phase with those at pins 3 and 10. This approach has the advantage of providing balanced (or differential) outputs and doubles the detected voltage compared to a circuit using just one set of gates. The balanced outputs are terminated by two 100Ω resistors and the RF is filtered out using a 0.1µF capacitor. IC4a, one half of an LM833 lownoise op amp, is configured as a differential amplifier with a gain of 22. A mid-rail (ap­prox.) reference voltage for the non-inverting input (pin 3) is obtained from the 5V output of REG3. Following IC4a, the signal is fed to IC4b. This stage is configured as a 2.2kHz 2-pole Butterworth low-pass filter with unity gain. It’s job is to filter out strong high audio frequen­cies early in the audio chain. The output from this stage appears on pin 7 and drives the audio amplifier input of Fig.4. Local oscillator The local oscillator is a Colpitts type and is based around an MPF102 FET (Q2). The main frequency determining components are the two 470pF capacitors, the 330pF capacitor, inductor L1 and the BB212 tuning diodes (VC1). Tuning is performed by varying the voltage at the cathode pin of VC1. Potentiometer VR2 is the main tuning control, while VR3 is the fine tuning control and adjusts the voltage by a smaller amount. To obtain the correct band coverage, two trimpots (VR4 and VR5) are adjusted to provide the required voltage for VR2 to span across. The local oscillator is powered from an 8V regulator (REG2) to guard it from power supply variations. As a further precaution against frequency drift, L1 is wound on a former without a core. A ferrite core has a tendency to affect the inductance of the coil with changes in temperature. The output of the local oscillator is coupled via a 5.6pF capacitor to emitter-follower stage Q3 which acts as a buffer. The signal on Q3’s emitter is then amplified to logic levels by NAND gate IC2a. A 1MΩ feedback resistor biases IC2a in linear mode and forces it to operate as a high gain amplifier. The output from IC2a is fed to IC2b which is configured as an inverter. As a result, the outputs of IC2a and IC2b operate 180° out of phase and they respectively provide the LOA and LOB signals for the mixer. The output from IC2b is also used to drive the frequency counter circuitry – see Fig.4. Diode attenuator An unusual feature of this receiver is the absence of a “normal” audio volume control pot (this would normally be con­nected between the audio preamp and the audio output stage). Instead, there are two points of variable electronic attenuation in the receiver, controlled simultaneously. In this case, simple diode atten­ uators are used. A charac­teristic of a diode is that if a DC current is passed through it, its effective AC impedance is altered. Increasing the diode current from 0mA to 5mA or 10mA, for example, causes the im­pedance to decrease dramatically. In this unit, two diodes are connected in series (at two separate points on the circuit) and the audio is fed to the junction of the two diodes – see Fig.4. A 10µF capacitor bypasses the supply and effectively places the diodes in parallel for AC signals. As the DC current in the diodes is increased, the im­pedance of the diodes decreases and more of the audio signal is shunted to ground. D2 and D3 form the first attenuator, with the current through the diodes fed PARALLAX BS2-IC BASIC STAMP $112.00 INC GST www.siliconchip.com.au July 2002  75 The two scope waveforms above show the receiver tuned to give an audible output. The yellow trace is the local oscillator measured at pin 3 or pin 6 of IC2. The blue trace is the input waveform measured at pin 4 or pin 8 of IC3. Note that there is a certain amount of crosstalk between the two waveforms, so that some of the local oscillator via a 150Ω current-limiting resistor. The 3.3kΩ series resistor connected between the output of IC4b and D2 and D3 is used to prevent the low impedance of the attenuator from loading the op amp’s output. This type of diode circuit is capable of attenuating sign­als by around 50dB. With no current in the diodes, there is essentially no attenuation of the signal. However, for this circuit to operate without distortion, the input signal level must be less than the diode turn-on voltage. This is the reason why the first attenuator is placed early in the audio chain. It is also interesting to note that if the receiver had simply employed a standard volume control late in the audio chain, a very large antenna signal could have easily resulted in clipping in the audio preamp stages due to the high gains used. Controlling the signal level early in the audio chain is neces­ sary to avoid distortion. So why not use automatic gain control (AGC) as normally found in a commercial radio? Unfortunately, it is almost impossi­ble to achieve successful results with AGC in a simple DC receiv­er. It was tried in the prototype but the usual problems of overshoot and distortion were encountered, so it was discarded. Amplifier stages IC5a and IC5b are each one half of an LM833 low-noise op amp and provide a fixed gain block. IC5a is 76  Silicon Chip hash appears on the blue input waveform. The second screen shot shows the result, measured at pin 5 of IC6, an audible tone at 378Hz. Note that although the frequencies on the left screen have an apparent difference of 19kHz, this a measurement inaccuracy due to lack of resolution; the true difference is 378Hz. configured for a gain of around 8.5 and the .0015µF capacitor across the 47kΩ feedback resistor provides low-pass filtering. IC5b is configured similar­ly except that its gain is around 4.7, with a .0033µF capacitor across the 22kΩ feedback resistor to provide further low-pass filtering. The large amount of low-pass filtering used in this receiv­er is necessary to separate the wanted signal from other nearby signals. A mid-rail bias voltage for both halves of IC5 is de­ rived via two 4.7kΩ resistors and is filtered using a 100µF ca­pacitor. Note that extensive capacitor bypassing has been em­ ployed throughout the circuit to eliminate audio instability. The values of the interstage coupling capacitors have also been selected to attenuate frequencies below 200Hz, to minimise sus­ceptibility to hum. The output from IC5b is fed through a 3.3kΩ resistor to the second diode attenuator stage, using D4 and D5. This works exactly the same as the first attenuator stage. Together, both attenuator stages provide a very large range of attenuation and by adjusting the Gain control (VR6), the enormous range of signal levels received by the antenna can be “evened” out. Following the second diode atten­ uator, the audio signal is fed to an LM386 audio power amplifier stage (IC6) which has a gain of 20. The input (pin 3) also receives the Morse code from the frequency counter via a 100kΩ limiting resistor. The 10µF ca- pacitor on pin 7 helps to reduce hum, while a Zobel network consisting of a 10Ω resistor and a 0.1µF capacitor is connected across the output to prevent instability at high frequencies. Power for IC6 is derived from the main +12V supply rail. This is applied to pin 6 via a 4.7Ω resistor which limits the current if the supply rail exceeds the maximum rating. The asso­ciated 470µF capacitor provides supply rail decoupling. The output from IC6 appears at pin 5 and drives a stereo headphone socket via a 470µF capacitor and a 4.7Ω resistor. Note that the headphone socket has both active inputs wired in paral­lel, so that the audio will appear on both sides of stereo head­phones. Headphone impedance It is anticipated that lightweight headphones will be used, which normally have an impedance of around 32Ω. However, the 4.7Ω resistor connected in series with the output socket will maintain a reasonable load for IC6 Fig.4 (right): the frequency counter section of the circuit is based on PIC microcontroller IC1. This measures the frequency of the local oscillator and generates a Morse code signal which is injected (via Q1 & VR1) into audio amplifier stage IC6. Diodes D2 & D3 and D4 & D6 attenuate the audio signal according to the current supplied by Q5. This in turn depends on the setting of gain control VR6. www.siliconchip.com.au www.siliconchip.com.au July 2002  77 Most of the parts are mounted on a single PC board and there’s very little external wiring, so the unit is very easy to build. The full constructional and alignment details will be published next month. age, to avoid thumps as the mute turns on and off. Frequency counter if a loudspeaker or low-impedance headphones are used. If a loudspeaker is to be used with the receiver, ensure that it is fitted with a stereo plug, because the sleeve connection of a mono plug will short one of the outputs to ground. Gain control Transistor Q5 is connected as an emitter follower and supplies the variable gain control current to the attenuator diodes. The voltage on its base is controlled by VR6 (Gain) and is applied via D6 and a 10kΩ current limiting resistor. The 4.7kΩ and 560Ω resistors in series with VR6 set the range for the gain control. When VR6’s wiper is at the high end, maximum current will flow through the diodes and attenuate the signal to a point where even the strongest signals are almost inaudible. 78  Silicon Chip Conversely, moving the wiper to the ground side re­sults in almost no diode current and therefore no attenuation of the audio signal. Signal muting When the frequency counter is producing audio tones, the received audio is muted so that the Morse code can be heard unhindered. It works as follows. The Mute line from the PIC chip (IC1) is normally low but is pulled high when Morse code is present. This turns on transis­tor Q7 which then turns on Q6 and Q5 to mute the received audio. At the same time, diode D6 becomes reverse biased and isolates the gain control (VR6). The associated 1µF capacitor (on the cathode of D6) smooths the DC voltage from VR6. It also provides a degree of ramping for the mute volt- IC1 (PIC16F84) forms the basis of the frequency counter. Although the addition of a microcontroller in a simple receiver may seem extravagant, the benefits of accurately knowing the tuned frequency far outweigh the extra cost and circuit complexi­ty. Power for IC1 is derived from REG1 which supplies +5V to pin 14, while pin 5 is connected to ground. The reset input (pin 4) is held permanently high via a 100Ω resistor and this simple system has proved to be sufficient to successfully reset the PIC each time the receiver is powered on. The internal oscillator appears at pins 15 and 16 and a 4MHz crystal is used to supply accurate timing for the internal counters. The accuracy of the frequency measurement is dependent on the crystal oscillating at exactly 4MHz, so trimmer capacitor VC2 is included to allow fine adjustment of www.siliconchip.com.au the crystal frequen­cy. Pins 7, 8 & 9 of the PIC’s Port B are allocated to a 3-bit digital-to-analog converter (DAC). This is used to synthesise an 800Hz sinewave to generate the Morse code audio signals. Follow­ing the DAC, a low-pass filter formed with 47kΩ resistors and .0033µF capacitors is used to round off the stepped waveform and make the waveform more sinusoidal. This sinewave is then buffered using emitter follower Q1, while trimpot VR1 adjusts the level injected into the audio amplifier. Using an internal look-up table, the PIC software modifies the generated Morse signal to help limit clicks or thumps in the audio. First, the start and finish of each Morse segment has a ramped amplitude rather than being abruptly started and stopped. Secondly, when no Morse is being generated, the output voltage is set midway so that the sinewave swings positive and negative around a central point. Two normally open pushbutton switches (S1 & S2) are con­nected to pins 10 & 11 of the PIC (Port B, bits 4 and 5). These pins have internal pullups and so are normally read as high. However, when a switch is pressed, the pin is pulled low and the software does a debounce check to test for a valid press. The FREQ switch (S2) is pressed to announce the current frequency of the local oscillator. The MEM switch (S1) allows you to store and retrieve a particular frequency (more on this later.) The PIC is in sleep mode until interrupted by a switch press. It then processes the command and when finished goes to sleep again. While in sleep mode, the PIC consumes very little current but more importantly, the crystal oscillator is shut down. If this were not done, subharmonics of the 4MHz oscillator would interfere with the receiver in normal operation. Pin 18 of Port A (RA1) is used to mute the received audio when the frequency is being announced. As mentioned earlier, it goes high at the start of the Morse code sequence and reverts to a low when the Morse code has finished. Reading the frequency When a frequency read is called, IC1 counts the receiver’s local oscillator cycles for exactly 100ms. For example if the local oscillator frequency www.siliconchip.com.au is 7,123,456Hz, then 712,345 cycles will be counted, giving a resolution of 10Hz. To count and store this value in binary form, a 20-bit register is required. However, the 16F84 only has a single 8-bit counter (Timer 0) that can be read directly. To make up this shortfall, we use an 8-bit software register for the most signif­icant register and the 8-bit Timer 0 prescaler for the least significant register. In operation, the signal from the local oscillator (LO) buffer appears at pin 12 of IC2c. The CLOCK line is held high for the duration of the read (100ms) – when the GATE line is high – to allow the LO pulses through to the PIC. After this period, the GATE line is taken low and the CLOCK is pulsed to allow the prescaler to be read. Pin 3 of IC1 (RA4) is the input to the pre­scaler and is programmed to divide by 256. The output of the pre­scaler is then fed to the clock input of Timer 0. The overflow bit of Timer 0 is polled during the counting period and the software register is increment­ed each time an overflow is detected. This gives a 24-bit counter – more than we need but easy to work with. Unfortunately, the prescaler is not readable directly by the software, so a trick is used to obtain its count. First, after the 100ms count period has elapsed, the Gate pin is taken low to inhibit counting of the local oscillator cycles. Now let’s assume that at the end of counting, a value of 200 remains in the prescaler. If the Clock pin is now continuous­ly pulsed, substituting for the local oscillator signal, the prescaler will overflow and increment Timer 0 after 55 pulses. So, if Timer 0 is monitored during this process for a change and the Clock pulses are counted, the value in the prescaler can be easily calculated. In this example, the count will equal 255 minus the Clock pulse count (55), or 200. If you find this process a little hard to follow, you will find more detailed information in the 16F84 datasheets and the DCRX.ASM software listing. Following the count period, the binary value is converted to 4-bit binary coded decimal (BCD) and finally announced in Morse code. That’s all we have space for this month. Next month, we'll describe the construction and give the full SC alignment details. ELAN Audio The Leading Australian Manufacturer of Professional Broadcast Audio Equipment Featured Product of the Month PC-BAL PCI Format Balancing Board Interface PC Sound Cards to Professional Systems Not only do we make the best range of Specialised Broadcast "On-Air" Mixers in Australia. . . We also make a range of General Audio Products for use by Radio Broadcasters, Recording Studios, Institutions etc. And we sell AKG and Denon Professional Audio Products For Technical Details and Professional Pricing Contact Elan Audio 2 Steel Crt South Guildford WA 6055 Phone 08 9277 3500 08 9478 2266 Fax email sales<at>elan.com.au WWW elan.com.au SMART FASTCHARGERS® 2 NEW MODELS WITH OPTIONS TO SUIT YOUR NEEDS & BUDGET Now with 240V AC + 12V DC operation PLUS fully automatic voltage detection Use these REFLEX® chargers for all your Nicads and NIMH batteries: Power tools  Torches  Radio equip.  Mobile phones  Video cameras  Field test instruments  RC models incl. indoor flight  Laptops  Photographic equip.  Toys  Others  Rugged, compact and very portable. Designed for maximum battery capacity and longest battery life. AVOIDS THE WELL KNOWN MEMORY EFFECT. SAVES MONEY & TIME: restore most Nicads with memory effect to capacity. Recover batteries with very low remaining voltage. CHARGES VERY FAST plus ELIMINATES THE NEED TO DISCHARGE: charge standard batteries in minimum 3 min., max. 1 to 4 hrs, depending on mA/h rating. Partially empty batteries are just topped up. Batteries always remain cool; this increases the total battery life and also the battery’s reliability. DESIGNED AND MADE IN AUSTRALIA For a FREE, detailed technical description please Ph (03) 6492 1368; Fax (03) 6492 1329; or email smartfastchargers<at>bigpond.com 2567 Wilmot Rd., Devonport, TAS 7310 July 2002  79