Silicon ChipAM/FM/CW Scanning HF/VHF RF Signal Generator - July 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Publisher's Letter: Publisher's Statement
  6. Publisher's Letter
  7. Feature: Techno Talk by Mark Nelson
  8. Feature: Net Work by Alan Winstanley
  9. Back Issues: Net Work by Alan Winstanley
  10. Project: Speech Synthesiser with the Raspberry Pi Zero by Tim Blythman
  11. Project: AD584 Precision Voltage References by Jim Rowe
  12. Project: AM/FM/CW Scanning HF/VHF RF Signal Generator by Andrew Woodfield
  13. Project: High-current Solid-state 12V Battery Isolator by Bruce Boardman
  14. Feature: Circuit Surgery by Ian Bell
  15. Feature: AUDIO OUT by Jake Rothman
  16. Feature: Make it with Micromite by Phil Boyce
  17. Feature: PICn’Mix by Mike Hibbett
  18. Feature: Max’s Cool Beans by Max the Magnificent
  19. Feature: Electronic Building Blocks by Julian Edgar
  20. PCB Order Form
  21. Advertising Index

This is only a preview of the July 2020 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • Techno Talk (July 2020)
  • Techno Talk (July 2020)
  • Techno Talk (August 2020)
  • Techno Talk (August 2020)
  • Techno Talk (September 2020)
  • Techno Talk (September 2020)
  • Techno Talk (October 2020)
  • Techno Talk (October 2020)
  • (November 2020)
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
  • Techno Talk (June 2025)
  • Techno Talk (July 2025)
  • Techno Talk (July 2025)
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 entry-level 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 × 102mm, available from the PE PCB Service. 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 one with a DMM set to measure ohms before fitting them, as the colour bands can be hard to distinguish). Don’t forget the 47Ω resistor hiding under S4. Then mount diodes D1 and D2, ensuring they are oriented as shown. Next, mount IC1’s socket 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 and 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 socket (CON1) and then the electrolytic capacitors. These are polarised: 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 oriented 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. 28 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 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. 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 continuity 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 L2 so that it is around 1mm 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). Practical Electronics | July | 2020 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. If you want to achieve the alternative inductor values mentioned last month, reduce the number of turns to six, then stretch L2 by around 0.5mm. 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. 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. Practical Electronics | July | 2020 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 soldering 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 before 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 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. Next, 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 an 8×2pin 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. 29 REMOVE THESE SMD RESISTORS 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.9kresistor 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. 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 is similar except some LCDs may require short jumper wires to connect to the PCB. The final two components 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 fiddly, 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. (This is hardly a tragedy – the choice is yours!) Now plug in the ATmega328 microcontroller (IC1), making sure its pin 1 is oriented correctly, towards 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. 30 CONNECT THE RSET (PIN 12) WIRE HERE the upper-left corner of the board. (If you haven’t already programmed it or purchased a programmed chip, see the panel below detailing the programming instructions.) Further testing Later, we will be attaching REG1 to the metal case. However, since we haven’t built it yet, 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 and amplitude (see the operating instructions below). Power the unit down before finishing construction. 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 pad closest to the AD9850 IC). Practical Electronics | July | 2020 Parts list – HF/VHF RF SIGNAL GENERATOR 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. 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 and L2, and L2 and 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 ready-made 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 July 2020 page of the PE 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 × 250mm sheet, making it relatively inexpensive to build. Practical Electronics | July | 2020 1 double-sided PCB, coded 04106191, 152.5 x 102mm (from the PE PCB Service) 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] – IMPORTANT see below 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 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) – a programmed IC is available from: www.siliconchip.com.au/Shop/9/5056 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 Resistors (all 0.25W 1% metal film) 2 470k 1 270k 5 10kΩ 1 3.9k 1 2.7kΩ 5 1k 1 820 1 390 5 220 8 56 2 47 2 27 1 10k mini horizontal trimpot (VR1) 1 500 9mm vertical PCB-mount or 16mm standard potentiometer (VR2) Encoders: we have discovered that some rotary encoders look identical but work differently, resulting in erratic operation. The V14 firmware addresses this; by default, it works with pulse-type encoders. You can identify these by testing continuity across the two internal switches; if they are both always open when the encoder is at rest, it is a pulse type. With the level type, one or both switches may be closed at rest, depending on the encoder’s rotation. If you have a level-type encoder and V14 software, solder a 100kΩ resistor from pin 28 of the Atmel chip to ground, on the underside of the PCB. That will change the software to work with level-type encoders. This grade of aluminium is light 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 31 Programming the ATmega328 micro You can purchase a pre-programmed microcontroller (see parts list). Alternatively, 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 a few pounds. Suitable free software is available for Windows, Linux and iOS online. This description focuses on the Windows version. You need to install the USBasp drivers and download programming software. For Windows, this includes: 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 July 2020 page of the PE 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 cut the power supply to the module. This is of no concern. Plug the six-pin connector from the USBasp programmer into CON3 on the 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. Alternatively, 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 regulator (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. It can be printed and covered with self-adhesive plastic film. eXtreme Burner http://extremeelectronics.co.in/avrtutorials/gui-software-for-usbasp-basedusb-avr-programmers/ AVRDUDESS http://blog.zakkemble.net/avrdudess-agui-for-avrdude/) Khazama http://khazama.com/project/programmer 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. 32 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. Trim the front panel artwork to cut out the holes for the various controls and display and test-fit onto the completed metalwork. 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 art shops. While tacky, press the panel artwork into place. Remove the rotary encoder nut 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%. Practical Electronics | July | 2020 before attaching the front panel, then reattach it on top. Reproduced by arrangement with 3D-printed knobs SILICON CHIP magazine 2020. Suitable knobs may be www.siliconchip.com.au available from normal -20dB -20dB -20dB -20dB RF OUT suppliers. However, I designed the knobs 0-20dB for my Signal Generator using DesignSpark Mechanical and 3Dprinted them from grey PLA filament. MODE SCAN My knob STL files BAND can also be down0-50MHz 70-120MHz loaded from the July 2020 page of the PE website for those wishing to print their TUNE STEP own knobs. They POWER press into place and hold securely. ZL2PD HF/VHF AM/FM/CW Scanning Signal Generator It’s useful to add siliconchip.com.au four self-adhesive DC IN rubber feet to the rear of the metal enclosure. This prevents Fig.8: download this panel label from the July 2020 page of the PE website (as a PDF). Just print any sharp corners of and laminate it, cut out the display and switch holes, then cut it to size and glue it to the outside top of the case. the aluminium box from scratching the The display shows the current out- each click as RE1 is rotated. When you bench and helps to keep the oscillator push this button, the underline below in one place on the workshop bench. put frequency and operating mode; the Signal Generator always starts at the LCD frequency display moves to 10.000MHz in CW (unmodulated) mode. indicate the current step setting. Using the Signal Generator The display also features a frequenThe Band switch (S4) selects beBriefly press power switch S3 to turn the Signal Generator on. The display cy ‘dial’ which covers a 1MHz span tween the two output frequency rangwill show a start-up message, then af- with 100kHz markers. As you rotate es, 0-50MHz (left) and 70-120MHz RE1 (‘TUNE’), the output frequency (right), while S5-S8 at the top, in comter a short delay, the normal screen. If you cannot see any text on the dis- changes and the cursor on this scale bination with VR2 at right, set the output amplitude. play, adjust VR1. This sets the LCD con- shifts across the ‘dial’. Pushing RE1’s knob in (the ‘STEP’ The Band switch must be in the trast. You can see examples of the varicorrect position for the currently selected ous possible displays in the first article pushbutton) changes the increments in which the frequency is adjusted with frequency to get the expected output in this series, published last month. SILICON CHIP 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. Practical Electronics | July | 2020 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. 33 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, and the standard display screen. 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 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. 34 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 Signal Generator are shown in Figs.9-12. These were captured using a Siglent 3GHz spectrum analyser. See the figure captions for details. Fig.13 demonstrates how effective the high-pass filter is, despite being made from a 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). 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) 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 PINdiode-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! Practical Electronics | July | 2020