Silicon Chip1MHz-6GHz Arduino-based Digital RF Power Meter - August 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Businesses need to handle ‘black swan’ events better
  4. Feature: Measuring distance & motion with lidar and SODAR by Dr David Maddison
  5. Project: USB SuperCodec by Phil Prosser
  6. Feature: Microchip’s new Hello FPGA kit by Tim Blythman
  7. Project: A homemade Switchmode 78XX replacement by Tim Blythman
  8. Serviceman's Log: Fixing heaters – it’s a gas by Dave Thompson
  9. Product Showcase
  10. Project: 1MHz-6GHz Arduino-based Digital RF Power Meter by Jim Rowe
  11. Vintage Radio: Velco 1937 'kit' radio restoration by Ken Kranz
  12. PartShop
  13. Project: The Colour Maximite 2 – part two by Geoff Graham & Peter Mather
  14. Feature: Vintage Workbench by Alan Hampel
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: DIY Reflow Oven, April-May 2020
  18. Outer Back Cover

This is only a preview of the August 2020 issue of Silicon Chip.

You can view 38 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 "USB SuperCodec":
  • USB SuperCodec PCB [01106201] (AUD $12.50)
  • USB SuperCodec Balanced Input Attenuator add-on PCB [01106202] (AUD $7.50)
  • Parts source grid for the USB SuperCodec (Software, Free)
  • USB SuperCodec PCB pattern (PDF download) [01106201] (Free)
  • USB SuperCodec Balanced Input Attenuator add-on PCB pattern (PDF download) [01106202] (Free)
  • USB SuperCodec front panel artwork (PDF download) (Free)
  • Drilling and cutting diagrams for the USB SuperCodec Balanced Input Attenuator (PDF download) (Panel Artwork, Free)
Articles in this series:
  • USB SuperCodec (August 2020)
  • USB SuperCodec (August 2020)
  • USB SuperCodec – part two (September 2020)
  • USB SuperCodec – part two (September 2020)
  • USB SuperCodec – part three (October 2020)
  • USB SuperCodec – part three (October 2020)
  • Balanced Input Attenuator for the USB SuperCodec (November 2020)
  • Balanced Input Attenuator for the USB SuperCodec (November 2020)
  • Balanced Input Attenuator for the USB SuperCodec, Part 2 (December 2020)
  • Balanced Input Attenuator for the USB SuperCodec, Part 2 (December 2020)
Items relevant to "A homemade Switchmode 78XX replacement":
  • Switchmode 78xx Replacement PCB [18105201] (AUD $2.50)
  • Kit for the Switchmode 78xx Regulator replacement (Component, AUD $13.50)
  • Switchmode 78xx Regulator PCB pattern (PDF download) [18105201] (Free)
Items relevant to "1MHz-6GHz Arduino-based Digital RF Power Meter":
  • Wideband Digital RF Power Meter PCB [04106201] (AUD $5.00)
  • 16x2 Alphanumeric serial (I²C) LCD module with blue backlight (Component, AUD $12.50)
  • Arduino sketch for the Wideband Digital RF Power Meter (Software, Free)
  • Wideband Digital RF Power Meter PCB pattern (PDF download) [04106201] (Free)
  • Wideband Digital RF Power Meter lid panel artwork & drilling diagrams (PDF download) (Free)
Items relevant to "Velco 1937 'kit' radio restoration":
  • Velco 1937 Radio Files (SPICE models and Valve Data) (Software, Free)
Items relevant to "The Colour Maximite 2 – part two":
  • Colour Maximite 2 PCB [07107201] (AUD $10.00)
  • Colour Maximite 2 front & rear panels (PCB, AUD $10.00)
  • Colour Maximite 2 software and documentation (Free)
  • Colour Maximite 2 PCB pattern (PDF download) [07107201] (Free)
  • Colour Maximite 2 front and rear panel cutting diagrams and front panel artwork (PDF download) (Free)
Articles in this series:
  • The all-new Colour Maximite 2 (July 2020)
  • The all-new Colour Maximite 2 (July 2020)
  • The Colour Maximite 2 – part two (August 2020)
  • The Colour Maximite 2 – part two (August 2020)
Items relevant to "Vintage Workbench":
  • Tektronix T-130 LC Meter Supplemental Materials (Software, Free)
Articles in this series:
  • Vintage Workbench (June 2020)
  • Vintage Workbench (June 2020)
  • Vintage Workbench (July 2020)
  • Vintage Workbench (July 2020)
  • Vintage Workbench (August 2020)
  • Vintage Workbench (August 2020)

Purchase a printed copy of this issue for $10.00.

by Jim Rowe Low-cost, Wideband Digital RF Power Meter Simple to build and low in cost, this RF Power Meter will be very useful for anyone who needs to measure radio frequency signals from 1MHz to 6GHz. By itself, it can only handle power levels up to about 3mW (5dBm), but its range can easily be extended using fixed attenuators. W hile reviewing Banggood’s little RF Power Meter to extend its power range. I freely admit this last idea was that was published last month (siliconchip.com. copied from Banggood’s RF Power Meter... au/Article/14498), it occurred to me that we could design a similar device that wouldn’t cost much more to The Meter’s heart The Analog Devices AD8313 demodulating logarithmic build, but would handle much higher frequency signals. I also realised that its construction could be made easy amplifier chip in the RF Detector module forms the heart by using other low-cost prebuilt modules that I had re- of the Meter. It accurately converts an RF signal into a corresponding decibel-scaled DC output voltage. It maintains viewed recently. The concept quickly solidified around using an Arduino accurate log conformance for signals from 1MHz to 6GHz Nano module as the ‘brains’, together with the Banggood and provides useful operation to 8GHz. The input range is typically 60dB (referenced to 50), RF Detector module I reviewed in the March 2018 issue with errors less than ±1dB up to 5.8GHz. (siliconchip.com.au/Article/11005). Fig.1 shows how the AD8318 works. It has nine cascaded In a sense, this is a simpler and lower-cost replacement for my Digital RF Level and Power Meter from the October amplifier/limiter stages, each with a gain of 8.7dB. The outputs of each amplifier 2008 issue. stage are connected to At the same a full-wave detector time, it offers some cell, and the output worthwhile encurrents of the detechancements, like tor cells are summed a much wider freand fed to a currentquency range (from to-voltage converter 1MHz up to above S which produces out6GHz), the ability put voltage VOUT. to send the results The voltage-to-curof each measurerent converter at upment to your PC for per right allows addata logging, and Fig.1: an internal block diagram for the AD8318 log detector IC. The justment of the slope an allowance for differential input signal passes through a string of nine amplifiers/limits and of VOUT. For example, fixed attenuators at the outputs of each one go to full-wave detectors. The direct currents from the Meter’s input, each detector are summed and converted to a voltage which appears at VOUT. when the VSET and 66  Silicon Chip Australia’s electronics magazine siliconchip.com.au Features and Specifications Function: A compact, low-cost RF power and level meter with LCD screen and USB interface Frequency range: from 1MHz to over 6.0GHz Input impedance: 50 nominal Maximum input power level: +5dBm (3.2mW/398mV RMS) Minimum input power level: -60dBm (1nW/224µV RMS) Measurement range: -60dBm (224µV RMS) to +33dBm (10V RMS) with recommended attenuators Measurement linearity: about ±1dBm, 10MHz to 1GHz, +6dBm/-4dBm, 1MHz to 4.0GHz (see measurement plots) Measurement resolution: approximately ±0.1% Power supply: 5V DC at less than 120mA via USB micro-B socket SC Ó VOUT pins are tied together, this sets the output slope to a nominal -25mV/ dB. The AD8318 also includes an internal temperature sensor and bias stabilisation on the cascaded gain stages, so that changes in ambient temperature do not unduly affect accuracy. And all of this impressive technology is squeezed into a tiny 4 x 4mm 16-lead LFCSP surface-mount package. Fig.2 shows the measured transfer characteristic of an AD8318 at four different frequencies: 100MHz, 1GHz, 2GHz and 4GHz. It’s very close to linear at -25mV/dB at all four frequencies, between 0dBm and -60dBm. Fig.3 is the full circuit of the Banggood log detector module we are using. There’s very little in it apart from the AD8318 and a 78L05 regulator, which provides the AD8318 with a regulated +5V supply. (We are actually bypassing the 78L05 in this project, as you’ll learn shortly.) The full circuit The full circuit for our new RF Power Meter is shown in Fig.4. The Banggood AD8318-based log detector module is at upper left, connected to the rest of the circuit via CON2. The Arduino Nano MCU ‘brain’ is on the right. IC1 in the centre an LTC2400CS8 high-resolution (24-bit) ADC (analog-to-digital converter) used to digitise the output voltage from the log detector module. siliconchip.com.au Fig.2: a plot of VOUT vs input signal level for the AD8318 at four different frequencies (with the default slope setting of -25mV/ dB). As you can see, the linearity is excellent, and the frequency has minimal effect on the measured RF power level. This ADC requires a reference voltage to set its input scaling, and this is provided by accurate 2.500V reference REF1, an LT1019ACS8. IC1 digitises its input voltage under the control of the Arduino MCU via an SPI interface using Nano pins 1 (SCK), 30 (MISO) and 28 (SS-bar). After the MCU processes the digitised sample data, it displays the calculated RF power and voltage levels on the 16x2 LCD module via CON1. This is via an I2C interface using MCU pins 8 (SDA) and 9 (SCL) – the LCD module is an I2C serial type. Three pushbutton switches (S1-S3) are connected to MCU pins 25, 23 and 21. These are used to tell the unit when      SC 1MHZ – 8GHZ LOGARITHMIC DETECTOR MODULE  Fig.3: the circuit of the pre-assembled log detector module is very simple. The RF signal is terminated with a 51Ω resistor (52.3Ω might be better) and coupled to the inputs of IC1 via a pair of 1nF capacitors. The output from IC1 is fed to a pin header, while power is supplied via a 2-way terminal block. We’re bypassing 5V regulator REG1 in this project. Australia’s electronics magazine August 2020  67        16 x 2 LCD SC  WIDEBAND DIGITAL RF POWER METER Fig.4: thanks to the use of three prebuilt modules, the circuit of the RF Power Meter is not too complicated. The Arduino Nano uses 24-bit analog-to-digital converter IC1 to read the output of the log detector with high precision. 2.5V reference REF1 ensures that IC1 measures that signal with reference to a very stable voltage. The whole circuit is powered from the 5V pin of the Nano, which gets its power from a USB charger or computer. you have connected one or more external RF attenuators ahead of the Meter’s RF input, to increase its measurement range. It then adjusts its display to give correct readings. Since the Meter is designed to operate from a 5V DC supply derived via the USB cable connected to the Arduino Nano, the supply for the rest of the Meter circuitry is taken from MCU pin 12. This goes directly to the LCD module (again via CON1). For the rest of the circuitry, it is filtered by inductor RFC1 and several bypass capacitors. We are making a few minor modifications to the Banggood Log Detector module to simplify using it in the RF Meter project. The 78L05 regulator on the module needs an input of at least 7V for proper regulation, but we don’t have that. Instead, we have a well-filtered 4.75V rail after the 4.7 series resistor. So we are bypassing the 78L05 in the module by connecting the supply wire from CON2 directly to its output pin 1. To make sure that the 78L05 isn’t damaged by reverse current, it’s a good idea to remove the 10k resistor in series with the LED at the input of the 78L05. It’s pretty unlikely that such a small current would damage the regulator, but the LED won’t be visible once the case is on anyway, so it just wastes power if left in-circuit. The only other modification needed is to fit a 1nF SMD ceramic capacitor (2012/0805-size) across the two pads just to the left of the 2-pin output connector on the log detector 68  Silicon Chip PCB. This provides additional filtering for the AD8318’s internal feedback loop – it’s shown as COBP on Fig.4. All of these modifications should be clear from both the notes on the circuit (Fig.3) and the close-up photo of the log detector module PCB below. CONNECT +5V WIRE TO THESE PADS REMOVE THIS RESISTOR ADD 1nF CAPACITOR ACROSS THESE PADS A few minor modifications need to be made to the Banggood module before fitting it to the PCB. Australia’s electronics magazine siliconchip.com.au       Pin 8 of IC1 (the LTC2400 ADC) is taken to the centre pin of JP1, a three-pin header. This allows the sampling frequency of IC1 to be set for optimum rejection of any power line frequency components in its input signal. When the jumper shunt fitted to JP1 is in the lower position, the sampling frequency is set to reject 60Hz components (as you’d need in the USA), but if the jumper shunt is fitted in the upper position, the sampling frequency is set to reject 50Hz components. So the latter position is the best one for use in Australia, New Zealand or the UK.  What the firmware does The firmware sketch for the RF Power Meter is called “RF_Power_Meter_sketch.ino” and is available for free downloading from the SILICON CHIP website. When uploaded to the Arduino Nano’s ATmega328P micro, it does several things. Its main task is to direct IC1, the ADC, to take a sequence of 10 measurements of the output voltage VOUT from the log detector module. It then averages each group of measurements and calculates from that the corresponding RF power level in dBm and the equivalent voltage level in millivolts or microvolts. These figures are then sent to the LCD module for display, and are also sent out via the Meter’s USB data line for display and possible logging on a computer. The firmware’s other main task is to check between measurement cycles for any presses of the Select Attenuation pushbutton switch, S1. If S1 has been pressed, it then swings into ‘change attenuation’ setting mode and it monitors any presses of switches S3 (‘Increase’) or S2 (‘Decrease’) and adjusts its setting for the external attenuation in steps of 1dB. Then when S1 is pressed again, it saves the new external attenuation figures and returns to its normal measurement mode. The attenuation value is set to zero each time the unit is powered up. SILICON CHIP Fig.5: this PCB overlay diagram and the photo below shows which parts go where. The only polarised parts are IC1, REF1 and the Arduino Nano module. Pushbutton switches S1-S3 are mounted on the lid and wired back to the board using flying leads, while the header on the LCD screen (also mounted on the lid) is soldered directly to the pins of CON1 as the last step in the assembly. Construction The complete RF Power Meter is housed in a diecast aluminium box measuring 119 x 93.5 x 56.5mm. Pushbutton switches S1-S3 and the LCD module all mount on or behind the box lid/front panel. All of the other modules and components are mounted on a double-sided PCB measuring 109 x 83mm and coded 04106201. This also mounts behind the box lid/front panel, via four pairs of spacers. Begin construction by first fitting the passive SMD components to the main PCB, using the overlay diagram of Fig.5 and the matching photo as a guide. Then fit RFC1, which is larger and will probably need a hotter iron. It’s best to smear a thin layer of flux paste on its pads before soldering it in place. After this, install IC1 siliconchip.com.au and REF1, which are both in SOIC-8 SMD packages. Next mount 4-pin SIL headers CON1 and CON2, along with the 3-pin header for JP1. Then you can fit the four PCB terminal pins, which all push through their matching holes in the main PCB and are soldered to the pads underneath. Two are to the left of RFC1 (TPGND and TP5V), while a third pin (TP2.5V) is to the right of REF1 and the fourth (TP VOUT) is to the right of CON2. You should then be able to fit the Arduino Nano module to the PCB, with its 30 pins passing down through the Australia’s electronics magazine August 2020  69 matching holes and soldered to the pads underneath. The final step in assembling the main PCB is to fit the AD8318 log detector module. It mounts on the top of the main PCB using four 10mm long M3 machine screws, with an M3 nut used on each screw as a spacer, and then further M3 nuts underneath to complete the job. Once it has been secured, plug a 4-pin SIL socket into header CON2 and solder four short lengths of lightduty hookup wire to its pins, then to the matching points on the module using Fig.5 as a guide. By the way, although the log detector module shown in the photos and diagrams is fitted with a small two-way terminal block power and a two-pin header for Vout, the module as supplied may not have these. Neither connector is required in this application, as you can simply solder the wires to the pads on the PCB. Case preparation There are only two holes to be cut in the box proper: an 11mm diamFig.6: only two holes need to be made in the main part of the case, with the eter round hole in the front, and a 9 locations and sizes shown here. The round hole is for the SMA RF input x 11mm rectangular hole in the rear. connector while the rectangular cutout allows a USB micro-B plug to be inserted The location of each of these holes is into the socket on the Nano board shown in Fig.6. There are 12 holes to be cut in the box lid, which becomes the Meter’s front panel. The locations and sizes of these holes are shown in Fig.7. There are three 12.5mm holes for the three pushbutton switches and a 65 x 15mm rectangular hole for the LCD ‘window’. The remaining small holes are for mounting the LCD module and the main PCB. After you have made and deburred all the holes in the lid/front panel, it’s a good idea to attach a dress front panel to the front for a professional appearance. We have prepared an actual-size artwork for this, which can be downloaded from the SILICON CHIP website as a PDF file. You can print this out in colour and then hot-laminate it in an A5 laminating pouch. After this you can cut it to size, punch four 3mm holes (one in each corner) and then attach it to the front of the lid using either thin double-sided cellulose tape or contact adFig.7: most of the holes that need to be made are actually in the case lid, including hesive. Once it is securely attached, a large rectangular cutout for the LCD screen. This is best made by drilling a cut out the remaining holes using a series of small (say 2mm) holes around the inside of the perimeter, knocking the inside part out, then filing the edges to shape. You can use a similar technique for sharp hobby knife. For other options to make a panel the USB socket hole in the base. 70  Silicon Chip Australia’s electronics magazine siliconchip.com.au Photos of the front (above) and rear (at right) of the assembled project showing the holes required, These photos match Fig.6, opposite. label, see siliconchip.com.au/Help/FrontPanels The next step is to attach an 80 x 25mm rectangle of thin clear plastic (say, 0.4mm thick) behind the LCD window cutout, to protect the screen from dirt and damage. This can be attached using standard cellulose tape, taking care not to cover the LCD module mounting holes. The lid assembly can now be finished. Mount the LCD module behind the window using four 16mm-long M2.5 countersunk screws, four 9mm-long untapped spacers, three or four Nylon washers and then four M2.5 nuts as shown in Fig.8 and the photos. Then you can mount the three pushbutton switches using the supplied plastic nuts, and finally attach a 25mmlong M3 tapped spacer near each corner using a 6mm long M3 machine screw. The rear of your lid/front panel should now look like the photo. Next, cut six 25mm lengths of single-core hookup wire (three red and three black) and strip off about 4-5mm of the insulation at both ends of each. Then solder one end of each red and black pair of wires to the connection lugs at the rear of each pushbutton switch. These are to connect the switches to their matching pads on the main PCB. After plugging a four-pin SIL socket into CON1, attach the main PCB using four 12mm M3 screws through each corner of the PCB, with a 6mm long untapped spacer between the PCB and each 25mm long tapped spacer – see Fig.8. The only trick is making sure that the wires from each pushbutton pass through their matching holes in the main PCB, although you can adjust them later if necessary. Once all the switch wires are through their corresponding PCB pads, upend the assembly and solder the wires to those pads. The final step is to solder the four pins of the SIL header on the LCD module to the corresponding pins at the top of the SIL socket you fitted to CON1. You may need to slightly bend the LCD header pins using a pair of needle-nose pliers, so that they are close to the pins of the SIL socket, allowing them to be soldered together. If this proves a little tricky, it can help to temporarily remove the nearby tapped spacers, which can be replaced easily once the connections have been made. Don’t fit this assembly into the box just yet, since it’s a good idea to check a few key voltages at this stage. It may also be necessary to adjust the contrast of the LCD to get the clearest display once the Meter firmware has been uploaded. Testing and setup First, connect the Meter up to a USB 5V power supply siliconchip.com.au using a mini-B cable. As soon as power is applied, the LCD’s backlight should illuminate. Get out your DMM and check a few voltages relative to the TPGND pin at the left Parts list – Wideband Digital RF Power Meter 1 diecast aluminium box, 119 x 93.5 x 56.5mm [Jaycar HB5064 or similar] 1 double-sided PCB coded 04106201, 109 x 83.5mm 1 Arduino Nano or compatible module 1 1-8000MHz AD8318-based RF Logarithmic Detector module [eBay, AliExpress, Banggood] 1 16x2 LCD module with LED backlight and I2C serial interface [SILICON CHIP Cat SC4198] 3 panel-mounting SPST pushbutton switches (S1-S3) [Jaycar SP0700 or similar] 1 100µH RF choke, SMD 12 x 12 x 8mm [Jaycar LF1402 or similar] 4 25mm-long M3 tapped spacers 4 9mm-long untapped spacers 4 6mm-long untapped spacers 4 M3 x 12mm panhead machine screws 4 M3 x 10mm panhead machine screws 4 M3 x 6mm panhead machine screws 8 M3 hex nuts 4 M2.5 x 16mm countersunk machine screws 4 M2.5 hex nuts 4 Nylon flat washers, 3mm inner diameter 2 4-pin SIL headers, 2.54mm pitch 1 3-pin SIL header, 2.54mm pitch 2 4-pin SIL header sockets, 2.54mm pitch 1 2-pin SIL header socket, 2.54mm pitch 1 jumper shunt/shorting block 2 100mm lengths of light-duty hookup wire (red & black) Semiconductors 1 LTC2400-CS8 24-bit ADC, SOIC-8 (IC1) [Digi-Key LTC2400CS8#PBF-ND] 1 LT1019ACS8-2.5 voltage reference (REF1) [Digi-Key LT1019ACS8-2.5#TRPBFCT-ND] Capacitors 2 100µF 10V X5R SMD ceramic, 3216/1206-size 2 10µF 16V X7R SMD ceramic, 3216/1206-size 7 100nF 50V X7R SMD ceramic, 3216/1206-size 2 1nF 50V C0G or NP0 SMD ceramic, 2012/0805-size Resistors (all SMD 1%, 3216/1206 size) 1 5.6Ω (code 5R6 or 5R60) 1 4.7Ω (code 4R7 or 4R70) Australia’s electronics magazine August 2020  71 Fig.8: this side profile view shows how it all goes together and fits into the case. If you don’t have untapped 6mm spacers, you could use tapped 6.3mm spacers instead. Note how the log detector module is spaced off the main PCB using nuts. The last step before dropping the whole thing into the case is to bend the 4-pin header on the LCD over to make contact with CON4 on the main board, then solder the pins together. rear of the main PCB. You should measure close to 5V on the adjacent TP5V pin, around 4.75V on the VCC pin of the socket plugged into CON2, and very close to 2.5V at TP2.5V. If you get all of these readings, remove the power and download the Meter’s Arduino sketch from the SILICON CHIP website. You will need the Arduino IDE (Integrated Development Environment) to compile and upload the sketch. If you don’t have it already installed, it’s a free download from www.arduino.cc/en/Main/Software Our sketch, “RF_Power_Meter_sketch.ino”, uses libraries: SPI.h, Wire.h and LiquidCrystal_I2C.h. The first two come as standard with the Arduino IDE, but you’ll probably have to install the last one via the Library Manager or download it from siliconchip.com.au/link/ab2k Once ready, plug the Meter’s USB cable into a free port of your PC. If you are running Windows 10, go into Settings -> Bluetooth & Other Devices and then go down to Other devices. You should find an entry like USB-SERIAL CH340 (COMxx), where the digits after “COM” indicate the virtual COM port that Windows has assigned the Meter’s Nano – or strictly, its CH340 USB-serial interface chip. Next, start up the Arduino IDE, and go into the Tools menu. Then click on Board, which will produce a list of possible Arduino modules; select Arduino Nano from that list. Then click on Processor and select “ATmega328P (old Bootloader)”, since this is the appropriate one to communicate with the Meter’s Nano MCU via its CH340 serial interface. After this, click on Port, which should give a listing of any virtual COM ports that IDE has found available. Select the COM port address that corresponds to the Meter. If you didn’t already load the LiquidCrystal_I2C library via the Library Manager, do so now. If you downloaded the ZIP file instead, add it via the “Add .ZIP Library” option near the top of the Sketch -> Included Library list. Now open the downloaded sketch file and click Sketch -> Verify/Compile, After 20 or 30 seconds, you should get the message “Done compiling” in the box near the bottom of the IDE window, plus some statistics regarding the compilation. If all has gone well, the final step is to go into the Sketch menu again and click on Upload. When this is completed, the Meter should spring into life. The LCD should first display the initial greeting: This photo is from the same direction as Fig.8 above . . . . . . while this shot is from the opposite direction. 72  Silicon Chip Silicon Chip RF Power Meter Then, after a few seconds, it should begin displaying the results of its RF input sampling and calculations. With nothing connected to the Meter’s RF input, you should get a display like this: RF Pwr= -68.5dBm =83.2uV At=00dB If the display on the LCD is not clear and well defined – perhaps just two lines of blocks – that indicates that the contrast trimpot on the back of the LCD module needs to be adjusted. Rotate the trimpot in one direction or the other using a small screwdriver. The trimpot is just above RFC1 and the TP5V and TPGND terminal pins. The last thing to test before fitting the Meter assembly into its box is to make sure it is sending the test readings back to the PC. Australia’s electronics magazine siliconchip.com.au An end-on photo (above) with a shot showing the display board and pushbuttons, obviously before they were wired in! Note how the standoffs are lengthened to make the required spacing between the main board and front panel. To do this, go to the Arduino IDE and open the Tools menu. Click on Serial Monitor and it will open up another window. This should show the Meter’s virtual COM port address at the top, and at the top of the centre area you should see: Silicon Chip Digital RF Power Meter Then, after a few seconds, you should see the results of the first reading on a single line: RF Pwr= -68.6dBm = 82.6uV At=00dB Further readings will appear every few seconds. If you don’t see this display in the Serial Monitor window, or if all you see is a string of weird graphic symbols, check at the bottom right of the window to make sure that the serial data rate is set to 115,200 baud (bits per second). This is the data rate at which the Meter’s Arduino Nano sends the reading data. If you click on the “Show timestamp” checkbox at bottom left of the same window, a timestamp will be added to the start of each line of readings to allow data logging. If you have access to the equipment necessary to finetune the Meter’s calibration, as described at the start of the section below, you may wish to do that now. Otherwise, you can accept the default calibration we have built into the firmware. In that case, unplug the USB cable and lower the Meter assembly it into the box, securing it with the four supplied mounting screws. Your Digital RF Power Meter is then ready for use. Calibration To fine-tune the Power Meter’s calibration, you’ll need a DMM able to measure DC voltages up to 2.5V with high accuracy, and a UHF signal generator which can be set to provide CW signals at 1GHz (1000MHz) with an accurate amplitude of between +5dBm and -65dBm. The first step is to remove the Meter assembly from its box (if you’ve already finished the assembly) and apply 5V power via the USB cable. After allowing a few minutes for it to stabilise, use the DMM to measure the reference voltage at TP2.5V, up near the right rear corner of the main PCB, relative to the TPGND pin. This should be very close to 2.5000V, but whatever the siliconchip.com.au reading you get, record it carefully as VREF. Next, transfer the positive test lead of the DMM to monitor the voltage at the TP VOUT terminal pin, just to the right of CON2 at the rear of the log detector module. Then connect the input of the Power Meter to the output of the signal generator via a short length (say 150mm) of SMA-SMA cable. The short length is to minimise cable losses. Set the generator to provide a CW (continuous wave, ie, unmodulated) signal at 1.000GHz, with an initial level of +5dBm (1.78V RMS). The DMM should show the log detector’s VOUT voltage to be around 0.5V. Record the actual value of this reading, this time with the label “Vo5dBm”. Next, reduce the generator output level to 0dBm (224mV RMS), and again record the DMM reading (it should be around 0.56V) with the label “Vo0dBm”. Repeat this exercise with the generator set to -55dBm (398µV), which should give a reading of around 1.9V, and -65dBm (126µV), which should give a reading of around 2.1V. These figures should be recorded as “Von55dBm” and Von65dBm” respectively. Now remove the DMM test leads and go back to the Arduino IDE, which presumably still has the RF Power Meter sketch open. Scroll down about 50 or so lines from the top, where you’ll find three lines reading: byte S1 = 0; byte S2 = 0; byte S3 = 0; then you’ll see a blank line, followed by a line reading: const float Von65dBm = 2.0451; In place of that figure of 2.0451, type in the reading you recorded for Von65dBm. Similarly, replace the values on the next four lines with the other readings that you noted earlier. Make sure that, in replacing these figures, you don’t remove the semicolons after each one. Otherwise, the sketch won’t compile. Save the modified sketch file and recompile it by going to the Sketch menu and clicking on Verify/Compile. Then Australia’s electronics magazine August 2020  73 +20 Even with a longer cable between the generator and the Meter (allowing for the cable losses), there was still a peak at 2.5GHz. But if you know the frequency of the signal you are measuring (as you usually would), you can use Fig.9 to make allowances for this behaviour. +10  +5 398mV 0 224mV –10 71mV Suitable attenuators To make the Meter truly useful, you should ideally also get a few inline attenuators. These can be used to extend its meas–30 7.1mV urement range above +5dBm. Banggood has a range of very compact SMA–40 SMA fixed coaxial attenuators, for the 2.24mV reasonable price of A$10.65 each or A$28.11 for three. They are rated at –50 2W and 0-6GHz, and are available with 710mV attenuation figures of 3dB, 6dB, 10dB, 20dB and 30dB. –60 224mV The 10dB attenuator could be used to extend the range of the RF Pow–70 er Meter to +15dBm (1.26V RMS, or 71mV 32mW), while the 20dB unit would extend its range to +25dBm (3.98V –80 RMS or 316mW). Similarly, the 30dB 5 5 2 2 500 1GHz 50 200 20 10 10 100 1 unit would extend its range to at least FREQUENCY +33dBm (10.0V RMS or 2W into 50Ω). Fig.9: the measured performance of the finished product for nine different I ordered the 10dB, 20dB and 30dB input levels over a range of frequencies from 1MHz to 4GHz. The readings are units, and thanks to the COVID-19 pangenerally within about ±1dB up to 1GHz, but a peak at around 2.5GHz makes demic they took about seven weeks to readings from higher frequencies less accurate. You can use this diagram to arrive. But they did turn up eventucompensate the readings, as long as you know the signal frequency. ally, and they seem to be well made. if it compiles correctly as before, click on Sketch→Upload They’re pictured in the photo below. to load the revised firmware to flash memory on the PowAs mentioned earlier, when you power up the Meter, er Meter’s Nano. the external attenuation figure is set to zero – displayed Your Power Meter should now be calibrated. Just to as “00dB” at the right-hand end of the second line of the verify that this has been achieved, you can set the signal LCD. When you change the attenuation figure to allow generator output to say -40dBm (2.24mV RMS), where- for any attenuator(s) you are using via buttons S1-S3, upon the Meter should give a reading very close to this the Meter will display this new figure on the LCD in the figure; within ±1dBm. same position. The calibration is then complete. You can remove the If at a later stage you remove the external attenuator(s) power from the Meter assembly and reinstall it in its box, and wish to reset the Meter’s attenuation figure to zero, so it’s ready for use. this can be done either by using the trio of pushbuttons again, or simply by removing power from the Meter for Typical response plot about 10 seconds and then reapplying it. SC After calibrating the prototype RF Power Meter shown in the photos, we measured its response over a range of signal levels and between 1MHz and 4.0GHz (the upper A selection of attenuators, in limit of the Gratten GA1484B Signal Generator). The results are shown in Fig.9. This shows that the this case 10, Meter response at most signal levels is within ±2dB up 20 and 30dB, to 1.0GHz, rising to a peak of around +6dB at 2.5GHz, which will rather significantly before falling away again. increase the The peak at 2.5GHz is presumably related to the com- power handling ponents (and possibly the PCB tracks) at the input of the of your RF meter. log detector module. We wondered whether the 51Ω in- These were also put load resistor was responsible, as the AD8318 data sheet sourced from suggests 52.3Ω intead. But swapping that resistor out with Banggood, at less some 52.3Ω samples we bought did not eliminate the peak. than $30 for the three. So it’s probably a PCB layout problem. RF INPUT LEVEL in dBm  –20 22.4mV 74  Silicon Chip Australia’s electronics magazine siliconchip.com.au