Silicon ChipBuilding the RF Signal Generator (Part 2) - July 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: New motor vehicles should have built-in dashcams
  4. Feature: Radiation Hardening by Dr David Maddison
  5. Project: Dual Battery Isolator for 4WD, RVs, Caravans, etc by Bruce Boardman
  6. Feature: Modern PCBs – how they’re made by Tim Blythman
  7. Product Showcase
  8. Project: Speech Synthesis using a Raspberry Pi Zero by Tim Blythman
  9. Subscriptions
  10. Feature: El Cheapo Modules: AD584 Precision Voltage References by Jim Rowe
  11. Serviceman's Log: Repairs for a 'key' client by Dave Thompson
  12. Project: Building the RF Signal Generator (Part 2) by Andrew Woodfield, ZL2PD
  13. Project: DSP Active Crossover and 8-channel Parametric Equaliser by Phil Prosser & Nicholas Vinen
  14. Vintage Radio: The National Panasonic AKQ Walkabout portable by Ian Batty
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Outer Back Cover

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

You can view 37 of the 112 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 "Dual Battery Isolator for 4WD, RVs, Caravans, etc":
  • Battery Isolator Control PCB [05106191] (AUD $7.50)
  • Battery Isolator Mosfet PCB [05106192] (AUD $10.00)
  • Battery Isolator PCB patterns (PDF download) [05106191-2] (Free)
  • Battery Isolator lid panel artwork and drilling template (PDF download) (Free)
Items relevant to "Speech Synthesis using a Raspberry Pi Zero":
  • Raspberry Pi Audio Breakout PCB [01106191] (AUD $5.00)
  • TDA1543A DAC IC (Component, AUD $2.00)
  • TDA1543 DAC IC (Component, AUD $3.00)
  • Raspberry Pi Speech Synthesis software (Free)
  • Raspberry Pi Audio Breakout PCB pattern (PDF download) [01106191] (Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Building the RF Signal Generator (Part 2)":
  • AM/FM/CW Scanning HF/VHF RF Signal Generator PCB [04106191] (AUD $15.00)
  • ATmega328P programmed with the firmware for the RF Signal Generator [0410619A.HEX] (V14) (Programmed Microcontroller, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • Firmware for the RF Signal Generator [0410619A.HEX] (Software, Free)
  • AM/FM/CW Scanning HF/VHF RF Signal Generator PCB pattern (PDF download) [05105191] (Free)
  • AM/FM/CW Scanning HF/VHF RF Signal Generator panel artwork, cutting diagrams and STL files (downloads) (Free)
Articles in this series:
  • An AM/FM/CW Scanning HF/VHF RF Signal Generator (June 2019)
  • An AM/FM/CW Scanning HF/VHF RF Signal Generator (June 2019)
  • Building the RF Signal Generator (Part 2) (July 2019)
  • Building the RF Signal Generator (Part 2) (July 2019)
Items relevant to "DSP Active Crossover and 8-channel Parametric Equaliser ":
  • DSP Crossover CPU PCB [01106193] (AUD $5.00)
  • DSP Crossover LCD Adaptor PCB [01106196] (AUD $2.50)
  • DSP Crossover front panel control PCB [01106195] (AUD $5.00)
  • DSP Crossover DAC PCB [01106192] (AUD $7.50)
  • DSP Crossover power supply PCB [01106194] (AUD $7.50)
  • DSP Crossover ADC PCB [01106191] (AUD $7.50)
  • DSP Active Crossover complete PCB set (7 boards) [01106191-6] (AUD $40.00)
  • PIC32MZ2048EFH064-250I/PT programmed for the DSP Active Crossover/Equaliser (V8) (Programmed Microcontroller, AUD $30.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • Firmware and source code for the DSP Active Crossover/Equaliser project [0610619A.HEX] (Software, Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (Free)
Articles in this series:
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)

Purchase a printed copy of this issue for $10.00.

An AM/FM/CW Scanning HF/VHF RF Signal Generator Part 2 by Andrew Woodfield, ZL2PD We introduced this RF signal generator last month. It is an ideal entrylevel test instrument for anyone into radio: capable, yet low in cost and quite easy to build. None of the parts are too hard to come by, either. . . Now let’s get into building it – and getting it up and running. We also have some performance plots and instructions on how to use it. T he signal generator is built on one double-sided PCB coded 04106191, measuring 152.5 x 102mm. Refer to the PCB overlay diagram, Fig.5. Most of the top (component-side) surface has been retained as a ground plane for added shielding. No SMD parts are used in the construction of the signal generator, making it relatively easy to build. Start by fitting all the resistors where shown. It’s best to check each part with a DMM set to measure ohms before fitting them, as the colour bands can be hard to distinguish (eg, brown can look like red, as can orange). Don’t forget the 47Ω resistor hiding under S4! Then mount diodes D1 and D2, ensuring they are orientated as shown. Next, mount the socket for IC1, with its notched end facing the top of the board. Now fit the ceramic and MKT capacitors, which are not polarised. Don’t get the different values mixed up though. There’s also one of these under S4. Follow with trimpot VR1 and plastic package transistors Q1, Q2, Q4 & Q5. Q4 is a different type than the other three. Next, solder 6-pin header CON3 and two-way headers CON4 and JP1 to the board, followed by the power 74 Silicon Chip socket (CON1) and then the electrolytic capacitors. These are polarised; in each case, the longer lead must go to the pad marked with a “+” on the PCB. The stripe on the can indicates the negative side. Fit the three pushbutton switches, with the flat side orientated as shown in Fig.5, ensuring they are pushed down fully onto the board before soldering their pins. S3 is red while S1 and S2 are black. You now have almost enough components mounted to test the power supply. It is recommended that you attach REG1 to the case for heatsinking, but we haven’t built the case yet. Anyway, the easiest way to do this is to cut the three regulator leads short, then solder 25mm lengths of mediumduty hookup wire to the stubs, using some small diameter heatshrink tubing to insulate the solder joints and the lead stubs. You can then solder these three leads to the regulator pads on the PCB, ensuring that it is soldered the right way around - ie, so that if you hold it up above the board with the wires not crossing over, the tab is facing away from the board as shown in Fig.5. Early testing Now you can apply 12V power to Australia’s electronics magazine DC input connector CON1 and make some checks. Unfortunately, there is no power-on indicator LED at this stage (there will be when MOD1 is fitted), so the simplest check is to measure the voltage at the right-hand pin of JP1 relative to a ground point such as the mounting screw hole in the middle of the board. At this stage, there should be little to no voltage yet. Now briefly press power switch S3, and you should measure close to 5V on the right-hand pin of JP1. Press S3 again and that voltage should drop away to almost zero. That confirms that the power supply section is working correctly. Modifying the AD9850 module Minor modifications are required to the AD9850 module before mounting it on the PCB. Three SMD resistors need to be removed and a thin wire soldered to one of the free pads. These changes are shown in Fig.6 and the accompanying photo of the modified module. The module I used is, I believe, the most common version but there appear to be other versions available that use the same circuit but a different layout. So if your module does not look exactly the same as mine, don’t panic! You can use a DMM set on continusiliconchip.com.au Fig.5: use this overlay diagram as a guide to building the Signal Generator. We’ve shown both LCD screens in place here, (Jaycar QP5516 and Altronics Z7013; one on top of the other) but you would only fit one or the other. Edge connector CON2’s middle pin is soldered on the underside of the board. VR2 can be a standard 16mm pot mounted through the board, with the body on the underside, or a 9mm vertical PCB-mounting type. ity mode to identify the resistors connected to pins 3, 4 and 12 of the IC and then remove them. You can do this by heating the ends of the resistors alternately with a soldering iron while holding the body of the resistor with tweezers. Once enough heat has been applied, you can lift it right off the board. If you have a hot air rework station, that makes it even easier. It’s then just a matter of soldering a 100mm length of light-duty hookup wire, or Kynar (wire wrap wire) to the now-empty pad which connects to pin 12 of the IC, as identified in the photo. This will be soldered to the main board later. Winding coils L1-L3 The three inductors, L1-L3, are wound with 0.8mm diameter (26 gauge) enamelled copper wire. These are air-cored, meaning the coils are first wound around a suitably sized former, then the former is removed. The coil diameters should all be 3mm, so a 3mm drill bit shaft or 3mm diameter metal tube would be suitable. The coil is then self-supporting when mounted on the PCB. L1 and L3 need to be 160nH while L2 is 150nH. To achieve this, wind 11 turns for each coil, but then stretch siliconchip.com.au L2 so that it is around one millimetre longer than the other two. That reduces its inductance to the required value. (You could, of course, use an inductance meter to verify the coils if you have one). If you want to achieve the alternative inductor values mentioned last month, reduce the number of turns to six, then stretch L2 by around half a millimetre. Now remove the enamel at each end of the remaining wire on each coil. Some enamel coatings vaporise while being tinned, but most must be scraped off with a sharp knife. Take care if you use the latter approach, especially to avoid cutting yourself. You can verify that you’ve scraped off the insulation properly by tinning the wire ends and then checking that the solder has adhered. But note that you don’t want a lot of excess lead length on these coils; just enough to make it through the mounting holes on the PCB and be soldered on the underside. So cut the wire ends to length before stripping the enamel. Don’t stretch or compress the coils to fit the pads on the PCB as this will affect their inductance; just use a short length of extra wire at one or both ends to reach the mounting pads. Australia’s electronics magazine Winding the transformer T1 is wound on a 7mm-long ferrite balun core. Begin with 400mm of 0.315mm diameter (28 gauge) enamelled copper wire. Fold the wire in half so the two cut ends meet, then twist the two wires together to produce a twisted wire similar to that shown in Fig.7. It can have anywhere from one to five twists every 20mm; this isn’t critical. Twisting the wire simply makes winding the wire onto the core a little easier. Wind four turns of the twisted wire onto the core and trim the ends of the ‘bifilar’ wires, so you have four short lengths of wire each about 20mm long appearing at one pig-nose end of the core. Tin these four ends. Use a multimeter to identify the start and end of the two coils. The start of one coil and the end of the other (shown as ‘AS’ and ‘BF’ in the diagram) go to the two central mounting pads for T1 (either together into one pad, or separately into each), while the other two wires go to the mounting pads at either end. It doesn’t matter which goes to which, as the coil is symmetrical. Again, cut the leads to leave just a minimal amount and then strip the enamel off and tin them before solderJuly 2019  75 Fig.6: these three SMD resistors must be removed from the AD9850 DDS module. One of the pads which connected to the now-gone 3.9kresistor makes a handy connection point for the extra wire needed to connect pin 12 of the IC (RSET) to the collector of transistor Q1 on the main board, for output level control. See also the close-up photo at right. ing them to the board. This should allow you to mount the balun close to the board, so it won’t rattle around after the wires are soldered. Proceeding with construction Now fit metal can transistor Q3 close to the PCB, leaving about 1mm between the bottom of the device and the upper PCB surface. Don’t install it firmly down on the PCB because the metal case of the transistor is internally connected to the collector terminal of Q3. Also, before you solder it in place, check the metal case is not touching any adjacent component leads. Next, fit your modified AD9850 DDS module by soldering two 10-pin headers to the PCB, then soldering the module to the pins on top of these headers. The wire you connected to that module earlier connects to the lead of transistor Q1 which is closest to MOD1. RevB PCBs have a dedicated pad for this wire. Otherwise, solder it directly to Q1’s lead, on the top side of the PCB. Either way, trim the wire to length be- Two inter-coil screens, show in red on the overlay) must be fitted between the coils as shown here. These can be cut from a scrap of tinplate (eg, a food tin). This photo also shows the mounting of the 7805 regulator on the case heatsink. 76 Silicon Chip REMOVE THESE SMD RESISTORS CONNECT THE RSET (PIN 12) WIRE HERE fore stripping and soldering it. This wire should ideally be routed under the module for neatness. If you keep it short, it won’t move around later. Next, fit output socket CON2. As it’s an edge connector, push it onto the edge of the PCB, with the central pin sliding over the central pad on the bottom side. Solder that central pin, plus the posts on either side, on both the top and the bottom sides of the PCB. As this is a fairly substantial chunk of metal being soldered to copper planes, you will need a hot iron and The modified AD9850 module in situ on the main PCB. The three SMD resistors are all removed and the yellow wire is soldered to the appropriate pad – the one marked R6. (make sure it is the one closest to the AD9850 IC). Australia’s electronics magazine siliconchip.com.au be generous with the solder. Then install mini slide switches S5S9. The board is designed with slots to suit their lugs, so you can solder them right down onto the PCB. Again, be generous with the solder to ensure good joints. The next job is to mount the LCD. There are three possible headers to suit different LCD module styles, although Jaycar QP5516 or Altronics Z7018 are the best fit. For the Jaycar LCD, solder a 8x2-pin DIL header to the row of pins nearest the left edge of the PCB, then attach the four short tapped spacers to the corner mounting holes from the bottom of the board, using 5mm machine screws. You can then slip the LCD over the pin header and attach it using four more 5mm machine screws, then solder the header pins to the top of the LCD. The procedure for the other LCDs are similar except some LCDs may require short jumper wires to connect to the PCB. The final two components proper to fit are rotary encoder RE1 and potentiometer VR2. Mounting RE1 is easy; make sure it’s perpendicular to the PCB and pushed all the way down before soldering its pins. Solder its five pins and two mounting lugs; you will need a hot iron for the latter, and be generous with the solder. For VR2, we’ve provided two different options. The prototype used a 16mm potentiometer with its body on the underside of the PCB and its shaft passing up through a hole. Mounting it in this way is a bit fid- Parts list – HF/VHF RF SIGNAL GENERATOR 1 double-sided PCB, coded 04106191, 152.5 x 102mm 1 AD985x-based DDS module (MOD1) 1 PCB-mount barrel power socket (CON1) 1 SMA edge-mount socket (CON2) 1 2x3 pin header (CON3) 2 2-way pin headers (CON4) 1 jumper shunt/shorting block (JP1) 1 16x2 alphanumeric LCD with backlight (LCD1) [eg, Jaycar QP5521 or Altronics Z7018] 1 500mm length of 0.8mm diameter enamelled copper wire (for winding L1-L3) 1 400mm length of 0.315mm diameter enamelled copper wire (for winding T1) 1 7mm ferrite balun core (for T1) [Jaycar LF1222, Altronics L5235] 1 PCB-mount vertical rotary encoder with integral switch (RE1) [Jaycar SR1230] 1 28-pin narrow DIL socket (for IC1) 2 10-pin headers (for mounting MOD1) 1 16-pin SIL or 8 x 2 DIL header (for LCD) 4 6.3mm long M3 tapped Nylon spacers (for LCD) 8 5mm M3 panhead machine screws (for LCD) 2 black PCB-mount momentary pushbuttons (S1,S2) [eg Jaycar SP0721, Altronics S1096] 1 red PCB-mount momentary pushbuttons (S3) [Jaycar SP0720, Altronics S1095] 5 DPDT mini slide switches (S4-S8) [Jaycar SS0852, Altronics S2010/S2020] 1 9mm diameter knob to suit VR2 1 28-34mm diameter knob to suit RE1 1 0.5mm thick tin plate or cleaned tin-plated steel cans (eg, a large Milo tin lid) 2 0.8mm thick aluminium sheets, 300 x 250mm 1 adhesive panel label, 157 x 107mm 4 small self-adhesive rubber feet Hookup wire, misc. enclosure hardware Semiconductors 1 ATmega328P microcontroller programmed with 0410619A.hex, DIP-28 (IC1) 1 7805 5V 1A linear regulator, TO-220 (REG1) 3 BC548 NPN transistors, TO-92 (Q1,Q2,Q5) 1 2N4427 NPN RF transistor, TO-39 (Q3) 1 BC327 PNP transistor, TO-92 (Q4) 2 1N4148 small signal diodes (D1,D2) Capacitors 2 10µF 50V electrolytic 1 1µF 50V electrolytic 11 100nF 63V MKT 1 10nF 63V MKT 1 1nF 63V MKT or 50V ceramic 2 15pF 50V C0G/NP0 ceramic 2 10pF 50V C0G/NP0 ceramic Fig.7: autotransformer T1 is easy to make, with just four bifilar turns wound on the small ferrite balun core. AF and BS are interchangeable and are connected together on the PCB. Resistors (all 0.25W 1% metal film)          4-band code 5-band code 2 470k yellow violet yellow brown or yellow violet black orange brown 1 270k red violet yellow brown or red violet black orange brown 5 10kΩ brown black orange brown or brown black black red brown 1 3.9k orange white red brown or orange white black brown brown 1 2.7kΩ red violet red brown or red violet black brown brown 5 1k brown black red brown or brown black black brown brown 1 820 grey red brown brown or grey red black black brown 1 390 orange white brown brown or orange white black black brown 5 220 red red brown brown or red red black black brown 8 56 green blue black brown or green blue black gold brown 2 47 yellow violet black brown or yellow violet black gold brown 2 27 red violet black brown or red violet black gold brown 1 10k mini horizontal trimpot (VR1) 1 500 9mm vertical PCB-mount or 16mm standard potentiometer (VR2) siliconchip.com.au Australia’s electronics magazine July 2019  77 Programming the ATmega328 micro To program AVR family microprocessors, you need a programmer such as the USBasp (see www.fischl.de/usbasp/ for details and drivers). This can be purchased online from many suppliers for just a few dollars. Suitable free software is available for Windows, Linux and Apple IOS online. This description will focus on the Windows version. You need to install the USBasp drivers and download suitable programming software. For Windows, this includes eXtreme Burner (http://extremeelectronics.co.in/avr-tutorials/gui-software-forusbasp-based-usb-avr-programmers/), AVRDUDESS (http://blog.zakkemble.net/ avrdudess-a-gui-for-avrdude/) and Khazama (http://khazama.com/project/ programmer/). Plug it in and complete the installation of the USBasp programmer into your PC. If you have the option of 3.3V or 5V programming levels, select 5V. Launch the programming software you downloaded earlier and set the target device to “ATmega328” or “Atmega 328P”, depending on your chip. Both may be used. Now download the HEX file for this project from the SILICON CHIP website (if you don’t already have it) and select it as the file to be used to program the chip in your software. Make sure JP1 has not been fitted to your signal generator board; if it has, remove it now. Note that since some of the ATmega328 pins connect to the AD9850 module, the AD9850 module’s power LED will still light up and flash while the programmer is connected and running, despite having removed JP1 and therefore dly, but there are two benefits: this is a standard part that’s easier to get, and its shaft will line up perfectly with pushbuttons S1/S2 and the access hole for trimpot VR1 (if provided). Alternatively, if you can get your hands on a 9mm PCB-mounting rightangle potentiometer, it will be dead easy to mount to the PCB, as it’s fitted similarly to RE1. However, due to the location of the hole for the 16mm pot’s shaft, its shaft will sit around 3.5mm lower than S1/ S2 and VR1. 78 Silicon Chip cut the power supply to the mod- ule. This is of no concern. Plug the six-pin connector from the USBasp programmer into CON3 on the signal generator PCB, making sure that pin 1 on the programmer cable lines up with the pin 1 indicator on the PCB. Now select “Write FLASH buffer to chip” or “Write – Flash” to program the ATmega328 with the HEX file. The LEDs on the USBasp will blink furiously for a minute or two while the HEX file is loaded into the ATmega328. A bar graph may be displayed in some cases on the PC screen, to show progress. You then have to program the ATmega328 internal ‘fuses’. These configure the operating characteristics of the ATmega328 to suit the software being run on the device. For this step, insert the following settings into the relevant Fuse page/section of the programming software, then click on “Write” to send the data to the fuses: Low byte: 0xE2 High byte: 0xD9 Extended byte: 0xFF Lock byte: 0xFF Since the processor and display are powered via the programmer, once programming is complete, the display will briefly show the start-up message and then the initial signal generator screen. At this point, you can unplug the programming cable from CON3 and place a shunt on JP1. But this is hardly a tragedy. So the choice is yours. Now plug in the ATmega328 microcontroller (IC1), making sure its pin 1 is orientated correctly, to towards the upper-left corner of the board. If you haven’t already programmed it or purchased a programmed chip, see the panel above detailing the programming instructions. Further testing Later, we will be attaching REG1 to the metal case but since we haven’t Australia’s electronics magazine built it yet, so for further testing, temporarily attach a flag heatsink or attach it to a spare sheet of metal using a machine screw and nut. You can now apply 12V power to CON1, press S3 and check that you can control the output frequency, amplitude etc (see the operating instructions below). Power the unit down before finishing construction. Fitting the shields You will notice several holes around the buffer, attenuator, output and band select/HPF sections of the board. There are also lines on the PCB ‘silkscreen’ between these holes. This is where shield plates can be fitted. However, you do not need to fit shields in most of these areas; the only ones that are critical are those between the three high-pass filter sections (between L1 & L2 and L2 & L3). So you only really need to cut two shield pieces and mount them using four posts in the holes provided. These are shown in red on the PCB overlay diagram, Fig.5. Each shield piece should be around 8mm high and cut from 0.5mm tin plate, or recycled tin cans (a fruit or Milo tin lid is ideal). The strips are then mounted to the board using component leads off-cuts soldered into the holes shown in red. This is simple yet effective. You could fit shields in the other locations but testing has shown that it makes virtually no difference to the device’s performance so I don’t feel that it’s worth the time and effort to do so. Making the enclosure I couldn’t find a suitable readymade box for the signal generator, so I came up with a relatively easy way to make one. It’s a simple folded metal box and works well, resulting in a unit that is light but robust, compact and effectively shielded. Dimensioned drawings of the metalwork are available on the SILICON CHIP website – they’re a little too large to publish here! The two panels are cut and folded from 0.8mm thick aluminium sheets. The top cover and base may each be cut from a small 300 x 250mm sheet, making it relatively inexpensive to build. This grade of aluminium is light siliconchip.com.au -20dB -20dB -20dB -20dB RF OUT 0-20dB MODE SCAN BAND 0-50MHz TUNE SILICON CHIP STEP 70-120MHz POWER ZL2PD HF/VHF AM/FM/CW Scanning Signal Generator DC IN siliconchip.com.au Fig.8: this panel label can be photocopied here or downloaded from the SILICON CHIP website (as a PDF) and then printed. You could then laminate it, cut out the display and switch holes, then cut it to size and glue it to the outside top of the case. enough to be cut and folded easily with hand tools, but heavy enough to form a sturdy box for the signal generator. Several holes need to be drilled and cut into the panel for the controls, slide switches, regulator and the LCD. Aside from standard drills, a metal nibbling tool is ideal for cutting out the rectangular holes. Final finishing during fitting can be completed with a fine file. The completed PCB is mounted using spacers and 3mm machine screws. It’s best to line it up with the holes in the lid to figure out exactly where it will sit in the case before marking and drilling out the three mounting holes in the base. Alternately, as in the prototype, the signal generator PCB can be held onto the front panel using the rotary encoder nut, although it would probably be better to attach using at least one tapped spacer too. Small self-tapping screws are used to hold the cover to the base of the box. Once you’ve cut and bent the sheets, rivet or screw the 7805 regusiliconchip.com.au lator (REG1) onto the metal cover just before the final step of screwing the cover to the base. The front panel artwork is shown in Fig.8 above. This can be printed on a colour printer and covered with transparent self-adhesive plastic film. Trim the artwork to cut out the holes for the various controls and display and test-fit onto the completed metal-work. The most reliable method to fix the artwork in place is to spray the rear side of the artwork with adhesive spray obtainable from most stationary shops. While tacky, press the panel artwork into place. Remove the rotary encoder nut before attaching the front panel, then re-attach it on top. 3D-printed knobs Suitable knobs may be available from normal suppliers. However, I designed the knobs for my Signal Generator using DesignSpark Mechanical and 3D-printed them from grey PLA filament. My knob STL files can also be downAustralia’s electronics magazine loaded from the SILICON CHIP website for those wishing to print their own knobs. They press into place and hold securely. It’s useful to add four self-adhesive rubber feet to the rear of the enclosure. This prevents any sharp corners of the aluminium box from scratching the bench and helps to keep the oscillator in one place on the workshop bench. Using the Signal Generator Briefly press power switch S3 to turn the signal generator on. The display will show a start-up message, then after a short delay, the normal screen. If you cannot see any text on the display, adjust VR1. This sets the LCD contrast. You can see examples of the various possible displays in the first article in this series, published last month. The display shows the current output frequency and operating mode; the generator always starts at 10.000MHz in CW (unmodulated) mode. The display also features a frequency ‘dial’ which covers a 1MHz span July 2019  79 Fig.9: the CW (carrier wave, ie, unmodulated) output at 10MHz/-28dBm with a span of about 9-37MHz, selected to include the first two harmonics. This shows the second harmonic (20MHz) at around -40dB and the third (30MHz) at around -47dB. Fig.10: analysis of the AM output at 10MHz/-12dBm with a 20kHz span (ie, 9.99-10.01MHz). The 1kHz sidebands are visible either side of the carrier, as are the 1kHz modulation tone distortion products at ±2kHz (-21dB below the 1kHz fundamental) and ±3kHz (-26dB below the fundamental) indicating acceptable audio distortion levels. The modulation depth is the industry test standard, 30%. with 100kHz markers. As you rotate RE1 (‘TUNE’), the output frequency changes and the cursor on this scale shifts across the ‘dial’. Pushing RE1’s knob in (the ‘STEP’ pushbutton) changes the increments in which the frequency is adjusted with each click as RE1 is rotated. When you push this button, the underline below the LCD frequency display moves to indicate the current step setting. The Band switch (S4) selects between the two output frequency ranges, 0-50MHz (left) and 70-120MHz (right), while S5-S8 at the top, in combination with VR2 at right, set the output amplitude. The Band switch must be in the correct position for the currently selected frequency to get the expected output amplitude. The HPF is very effective at minimising energy from aliasing below 70MHz, so the output level can be lower than expected by over 60dB if the incorrect selection is made. But no damage will occur as a result of an incorrect setting. While the upper range is described as 70-120MHz, tuning and operation are maintained up to 150MHz, although output levels fall significantly above 120MHz. The maximum output of +7dBm is with S5-S8 all in the up position and VR2 fully clockwise. For each 20dB of attenuation you need, switch one of S5-S8 into the down position (it doesn’t matter which). Then for fine attenuation adjustments, rotate VR2. For example, if you want -30dBm, set any one of S5-S8 down (+7dBm - 20dB = -13dBm) and then VR2 should be set quite low, to give an additional 17dB of attenuation. (Note standard DDS amplitude rolloff impact above 30MHz – see Fig.3 in part 1.) The signal generator mode is selected with brief presses of the Mode key (S2). This selects between CW, AM, FM-NB (±1.5kHz deviation), FM-WB (±3kHz deviation), FM-BC (±50kHz deviation), or SCAN mode. Pressing the Mode key again will select the initial CW (unmodulated) mode, again along with the standard display screen. 80 Silicon Chip Frequency scanning mode If the SCAN mode is selected, the display changes to show the currently saved Start and End frequencies for the scan, and the number of steps selected. At power-on, this is set to 200 steps. If this is the first time after power has been applied, the default frequency settings (starting at 1MHz and ending at 30MHz) are shown. Otherwise, the last used settings will be displayed. Pressing the Scan button again allows each parameter to be selected for adjustment. Use the TUNE and STEP controls to set the Start and End frequencies in turn; here, the STEP button selects the tuning step as usual. When the scan Steps parameter is selected with the SCAN button, the TUNE control has no effect but pressing the STEP button allows the number of steps to be selected (10, 20, 50, 100, 200 or 500 per scan). Finally, pressing SCAN again saves the selected values and starts the scan. The display now reports SCAN instead of the number of steps. The scanning frequency increment is calculated by the processor using the entered values. The scanning speed is surprisingly fast. Scanning may be interrupted and restarted using the SCAN key. When stopped, the Start and End frequencies, as well as the number of scan steps, can be adjusted again, and the scan restarted. To exit the scan mode, press the MODE key. This also stops the scan and resets the signal generator to the last scanned frequency, and CW mode. At each stage, the output can be checked with a suitable oscilloscope or with other RF test instruments. Performance Typical output signals from the Generator are shown in Figs.9-12. These were captured using a Siglent 3GHz spec- Australia’s electronics magazine siliconchip.com.au Fig.11: a “narrow band” 1.75kHz frequency modulated signal with a 10MHz carrier and a 20kHz span. The iconic equi-spaced 1kHz sidebands of a standard FM signal are clearly visible. Fig.12: “wideband” or broadcast radio style FM, again with the carrier at 10MHz, this time captured with a 500kHz frequency span. This clearly illustrates that most of the signal energy falls within the 200kHz channel bandwidth permitted for broadcast FM signals. trum analyser. See the figure captions for details. Fig.13 demonstrates how effective the high-pass filter is, despite being made from self-wound air-cored inductors. This shows that the filter provides 60dB of attenuation for signals below 40MHz with a virtually flat passband from 70MHz up. The filter roll-off is quite steep at around 75dB/octave (the span from 40MHz to 70MHz is about 0.8 octaves). to offset the sinX/X roll-off for frequencies up to about 50MHz, at the cost of a reduced maximum output level at lower frequencies. Extended frequency coverage also appears possible through the use of alternative high-pass filters and/or by replacing the AD9850 module with one based on the pincompatible AD9851. Some minor additional software changes would be required to permit the AD9851 to be used. The AD9851 can be clocked at up to 180MHz, which may allow the generator to operate up to 100MHz in a single range, and possibly up to 300MHz with a modified HPF. Suitable AD9851 modules are available from the same sources as the AD9850-based module. Adding other modulation modes such as FSK and BPSK is also feasible, but adding QPSK, for example, may be beyond the reach of this design. Moving to an even more advanced DDS device, such as one based on the more modern AD99xx series chips,could be done. However, this would substantially increase the overall cost and complexity of the device. It is also possible to replace the basic passive output variable attenuator network with a more elegant PIN diode based system. This involves using components that are more difficult to obtain, but sufficient space has been left in this area of the PCB for such an addition. Finally, you could consider adding a numeric keypad on the front panel to permit the direct entry of frequencies, tuning step and scan settings, plus you could add a settings memory for frequently used configuration. However, this would likely require a processor change, or potentially even an additional microcontroller for handling keypad entry, to obtain the necessary spare I/O pins. Having said all that, the design as presented is a good compromise between low complexity and cost, while still having a useful frequency range and a good set of features. It makes a great entry-level RF signal generator – a “must” for anyone interested in radio at any level! SC Future possibilities It is possible to add further features to the software. With the supplied software, less than 30% of IC1’s program memory is used. For example, RF output levelling would be possible, by using the pin 11 PWM output which drives the RSET pin of the AD9850 module (currently used to provide AM) Fig.13: measured performance of the high-pass filter comprising inductors L1-L3 and four small ceramic capacitors. As you can see, the response is pretty much flat from 70MHz to 400MHz, but signals from 0-40MHz are attenuated by 60dB. The transition is smooth and quick, at around 75dB/octave, or 2dB/MHz. siliconchip.com.au Australia’s electronics magazine July 2019  81