Silicon ChipAutomatic LQ Meter - July 2024 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Jamieson 'Jim' Rowe is retiring
  4. Feature: Repairable Electronics by Dr David Maddison, VK3DSM
  5. Project: Automatic LQ Meter by Charles Kosina
  6. Review: The Raspberry Pi 5 by Tim Blythman
  7. Project: 180-230V DC Motor Speed Controller by John Clarke
  8. Project: New use for Mains Sequencer by John Clarke
  9. Feature: Adding solar charging to a van by Roderick Boswell
  10. Project: Lava Lamp Display by Tim Blythman
  11. Project: Digital Compass by Tim Blythman
  12. Project: Workman 1kW Loudspeaker by Allan Linton-Smith
  13. Vintage Radio: One-valve superhet radio by Fred Lever
  14. Serviceman's Log: Computer abuse by Dave Thompson
  15. Subscriptions
  16. PartShop
  17. Market Centre
  18. Advertising Index
  19. Notes & Errata: DC Supply Protectors, June 2024; Fan Speed Controller Mk2, May 2024; Touchscreen Appliance Energy Meter, August-October 2016
  20. Outer Back Cover

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

You can view 42 of the 104 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 "Automatic LQ Meter":
  • Automatic LQ Meter main PCB (CSE240203A) (AUD $5.00)
  • 16x2 Alphanumeric module with blue backlight (Component, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • Automatic LQ Meter short-form kit (Component, AUD $100.00)
  • Automatic LQ Meter front panel (CSE240204A) (PCB, AUD $5.00)
  • Firmware for the Automatic LQ Meter (Software, Free)
  • Automatic LQ Meter drilling diagram (Panel Artwork, Free)
Items relevant to "180-230V DC Motor Speed Controller":
  • 180-230V DC Motor Speed Controller PCB [11104241] (AUD $15.00)
  • 180-230V DC Motor Speed Controller PCB pattern (PDF download) [11104241] (Free)
  • 180-230V DC Motor Speed Controller lid panel artwork and drilling templates (Free)
Articles in this series:
  • 180-230V DC Motor Speed Controller (July 2024)
  • 180-230V DC Motor Speed Controller (July 2024)
  • 180-230V DC Motor Speed Controller Part 2 (August 2024)
  • 180-230V DC Motor Speed Controller Part 2 (August 2024)
Items relevant to "New use for Mains Sequencer":
  • Mains Power-Up Sequencer PCB [10108231] (AUD $15.00)
  • Firmware (ASM and HEX) files for the Mains Power-Up Sequencer (Software, Free)
  • Mains Power-Up Sequencer PCB pattern (PDF download) [10108231] (Free)
  • Panel labels and cutting diagrams for the Mains Power-Up Sequencer (Panel Artwork, Free)
  • Mains Power-Up Sequencer PCB [10108231] (AUD $15.00)
  • PIC16F1459-I/P programmed for the Repurposed Mains Power-Up Sequencer (1010823M.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Mains Power-Up Sequencer (Software, Free)
Articles in this series:
  • Mains Power-Up Sequencer, Pt1 (February 2024)
  • Mains Power-Up Sequencer, Pt1 (February 2024)
  • Mains Power-Up Sequencer, Pt2 (March 2024)
  • Mains Power-Up Sequencer, Pt2 (March 2024)
  • New use for Mains Sequencer (July 2024)
  • New use for Mains Sequencer (July 2024)
  • Mains Power-Up Sequencer, part one (February 2025)
  • Mains Power-Up Sequencer, part one (February 2025)
  • Mains Power-Up Sequencer, part two (March 2025)
  • Mains Power-Up Sequencer, part two (March 2025)
Items relevant to "Lava Lamp Display":
  • Arduino firmware for JMP002 - Lava Lamp Display (Software, Free)
Articles in this series:
  • Wired Infrared Remote Extender (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Wired Infrared Remote Extender (May 2024)
  • Thermal Fan Controller (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Thermal Fan Controller (May 2024)
  • Self Toggling Relay (June 2024)
  • Self Toggling Relay (June 2024)
  • Arduino Clap Light (June 2024)
  • Arduino Clap Light (June 2024)
  • Lava Lamp Display (July 2024)
  • Digital Compass (July 2024)
  • Digital Compass (July 2024)
  • Lava Lamp Display (July 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • IR Helper (September 2024)
  • IR Helper (September 2024)
  • No-IC Colour Shifter (September 2024)
  • No-IC Colour Shifter (September 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • BIG LED clock (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • BIG LED clock (January 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
Items relevant to "Digital Compass":
  • Firmware for JMP008 - Digital Compass (Software, Free)
Articles in this series:
  • Wired Infrared Remote Extender (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Wired Infrared Remote Extender (May 2024)
  • Thermal Fan Controller (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Thermal Fan Controller (May 2024)
  • Self Toggling Relay (June 2024)
  • Self Toggling Relay (June 2024)
  • Arduino Clap Light (June 2024)
  • Arduino Clap Light (June 2024)
  • Lava Lamp Display (July 2024)
  • Digital Compass (July 2024)
  • Digital Compass (July 2024)
  • Lava Lamp Display (July 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • IR Helper (September 2024)
  • IR Helper (September 2024)
  • No-IC Colour Shifter (September 2024)
  • No-IC Colour Shifter (September 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • BIG LED clock (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • BIG LED clock (January 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
Items relevant to "Workman 1kW Loudspeaker":
  • 2-Way Passive Crossover PCB [01205141] (AUD $20.00)
  • 2-Way Passive Loudspeaker Crossover PCB pattern (PDF download) [01205141] (Free)

Purchase a printed copy of this issue for $12.50.

Project By Charles Kosina Automatic LQ Meter inductance / Quality Besides adding the ability to measure inductance, so you don’t need a separate LC meter, one of the big advantages of this new design is that it has an onboard signal generator, so you no longer need two instruments to make a Q measurement. Also, its operation is entirely automatic, whereas the previous design required fiddling with knobs and a specific procedure to make the measurement. Much of the circuitry is similar to the older Q-meter design. Still, while I was adding the new features, I took the opportunity to optimise and simplify it without sacrificing any performance. As I mentioned in my previous article, there appear to be no manufacturers of Q meters any more, and the scarce second-hand ones from the likes of Hewlett-Packard fetch quite large sums. I saw one recently selling on eBay for US$2400. This one costs a small fraction of that to build! Basic operation A Q Meter is an indispensable tool for anyone contemplating RF design. My previous design in the January 2023 issue (siliconchip.au/ Article/15613) works well but has limitations; it needs an external signal generator with a well-defined output level. This new design is two instruments in one, measuring inductance from 0.1 to 999μH and Q from 10 to 300 with a test frequency from 100kHz to 90MHz! Features & Specifications ● Measures inductance (L) and quality factor (Q) over five frequency ranges ● Inductance (L) range: 0.1-999μH with 100nH resolution ● Quality factor (Q) range: 10 to 300 ● Test frequency range: 100kHz to 90MHz ● Resonant capacitance options: 18pF, 51pF, 118pF, 238pF or 488pF ● Power supply: battery (3 x AA) or 5V DC <at> 200mA T he January 2023 article explains what an inductor’s quality factor (Q) means and goes into the theory of Q measurement. In brief, an inductor with a low Q has more inherent damping, so it forms a filter with a broader response and a lower peak. In 26 Silicon Chip contrast, a high-Q inductor will make a filter with a narrow (more selective) response and a higher peak. So you need to know the Q of the inductors in your filters, at the frequency they will operate, if you want to model their response accurately. Australia's electronics magazine Briefly, we can determine both the inductance and Q by exciting a resonant LC network containing the unknown inductor and a known capacitance at a controlled frequency. There will be a peak in the amplitude of the resonance at a particular frequency. The relevant formula is: f = 1 ÷ (2π × √LC) Since we know f and C, we can rearrange it to solve for L, giving us: L = 1 ÷ C(2πf )2 f is the resonant frequency, so we can sweep the oscillator and find the point at which the amplitude is at a maximum, then plug that into the formula. Changing C will shift the resonant frequency but should give us the same inductance result. That is necessary so that small and large inductance values can be measured at a reasonable frequency (within the device’s operating range). As for the Q factor, once we’ve found the peak, we can also measure the amplitude of resonance. The ratio between that and the excitation amplitude will give us our Q measurement, as we shall explain in a little more detail later. Design decisions My first decision was how to generate the test signal over the required range. My first idea was to use a DDS siliconchip.com.au chip such as the AD9851. However, with a clock frequency of 180MHz, the Nyquist limit is 90MHz, so 70MHz is about the highest frequency it can practically generate. Also, it’s a relatively expensive chip or module. Another regular contributor to Silicon Chip, Andrew Woodfield, suggested using the Silicon Labs Si5351 clock generator. I have used this chip in other applications, and it is extremely versatile, going up to 200MHz and beyond. These are available as readymade modules with 25MHz crystals at a very low cost from AliExpress and other suppliers. Its frequency is set by loading many registers over an I2C serial bus. That makes it easy for me to use a microcontroller to perform a continuous frequency scan. The output of the Si5351 chip is buffered by a high-speed op amp, the OPA2677, configured with a unity gain. This has a gain bandwidth (GBW) of over 200MHz, so it will have a reasonably flat output to at least 90MHz. As with the previous design, the output of the OPA2677 feeds a toroidal transformer with a 10:1 turns ratio, the secondary being a threaded standoff passing through the middle. This gives an extremely low source impedance to drive the series-tuned LC circuit, typically 0.02W. The voltage on the secondary is about 0.25V peak-to-peak. The catch is that the output is not a sinewave but more like a square wave. Instead of just one frequency, we have the Fourier expansion with an infinite number of odd harmonics: sin(ω) + sin(3ω)÷3 + sin(5ω)÷5 + sin(7ω)÷7 + sin(9ω)÷9 + sin(11ω)÷11 … Where ω is 2π times the frequency. It’s an infinite series, but in practice, the higher harmonics are filtered out by the bandwidth-limited circuitry. Consider that the resonant frequency of inductor and capacitor (LC) circuit may be 15MHz. If we drive it with a 5MHz square wave, the third harmonic will resonate and give us a false reading. Fortunately, this problem is easy to overcome. Instead of scanning upwards in frequency, we scan downwards from the highest frequency. As long as the highest frequency is above the resonant point of the tuned circuit, the scan will find the primary resonance frequency on the way down. siliconchip.com.au When starting up to Automatic LQ Meter, the screen should display a message similar to the one shown. The lead image (opposite) shows the Meter measuring an air coil. For example, say we have an airwound inductor of 6µH and a test capacitance of 118pF. The resonant frequency is 5.88MHz. If we set our starting frequency at 30MHz and scan down, no other resonances will be found until we reach 5.88MHz, as the first significant harmonic, the third, will only occur with a test signal of 1.96MHz (5.88MHz ÷ 3). Given a close-to-zero source impedance, the Q value is obtained from the equation Q = Vout ÷ Vin, where Vin is the voltage from the transformer, and Vout is the voltage at the junction of the inductor and capacitor. For a maximum Q reading of 300 and a test signal of 250mV peak-topeak, Vout would be 75V peak-topeak. We need to measure the input and output voltages accurately, but it’s impractical to measure Vin accurately on the transformer’s secondary. However, we know the voltage on the primary is ten times that. My testing shows that the voltage ratio is close to 10:1 over the entire frequency range. Accuracy Measuring Q accurately is not easy. The error budget includes several parameters, including the source impedance of the signal generator. While it is low, it is non-zero. RF voltage measurements are subject to errors and the peak frequency found may be slightly off. The stray capacitance on the circuit board may not exhibit a high enough Q, which will decrease the measured value slightly. Australia's electronics magazine I compared the readings with that of my Meguro Q meter, and they were generally within 10%. Inductance measurements are likely to be within 5%. However, even the HP 4342A laboratory instrument can’t guarantee a particularly high accuracy; it has a tolerance of ±7% on Q values up to 300. Circuit description The resulting circuit is shown in Fig.1. MOD1 is the test signal generator and its output is buffered by IC1a and AC-coupled to transformer T1. The DUT (inductor) is connected across CON3 & CON4. It forms a resonant circuit in combination with one of the 33pF, 100pF, 220pF and 470pF capacitors switched in or out of the circuit by relays RLY1-RLY4 plus the stray PCB capacitance of around 18pF (or just the stray capacitance if RLY1RLY4 are all off). A half-wave precision rectifier built around the other half of the OPA2677 (IC1b) measures the amplitude of the Vtest signal (at pin 1 of IC1a). The output of this rectifier is the DC peak and IC5b buffers that voltage. The gain of this buffer stage is set to 1.25, compensating for a slight amplitude reduction due to the rectifier. The DC voltage feeds the ADC7 input on the Arduino Nano module for measurement using its internal ADC (analog-­to-digital converter). At the same time, schottky diode D7 half-wave rectifies the voltage at the junction of the DUT and the July 2024  27 Fig.1: the test square wave is generated by MOD1, buffered by IC1a and transformed by T1 before being applied to the resonant circuit comprising the DUT and some combination of the 33pF, 100pF, 220pF & 470pF capacitors switched by RLY1-RLY4. The test and resonant voltages are rectified and measured by the Arduino Nano. By knowing the peak resonance frequency, capacitance and those voltages, both the inductance and Q factor can be calculated. 28 Silicon Chip Australia's electronics magazine siliconchip.com.au ADC7 inputs are converted to an integral number from 0 to 1023 (210 − 1). The firmware calculation is simple: multiply the ADC6 value by 11 to recover Vout and divide by the ADC7 value (Vin). But what if we have a coil with a Q of only 10? Vout ÷ 11 would be only 0.225V, or an ADC count of 46, and the broad resonance peak may not be picked up accurately. For low Q values, we increase the gain of IC5a from unity to four times by switching in a 33kW resistor from pin 2 to ground using N-channel Mosfet Q1. This will give an output voltage of 0.9V in this example, or 184 counts, which can be measured far more accurately. Resonant capacitance In my original Q meter, I had eight capacitors switched by relays to select a value from 40pF to about 290pF with 1pF steps to move the frequency of the resonance peak. That was overkill, so I reduced it to a choice of only five values in this design. The stray capacitance of the circuit is around 18pF, setting the minimum value. Why relays and not solid-state switching? To eliminate errors, the capacitance must have a very high Q, preferably ten times that of the highest Q coil. The relay contacts in series with the capacitors have very little effect on the overall Q. The capacitors must be RF types with a 1% tolerance; the values are 33pF, 100pF, 220pF and 470pF, adding to the 18pF of stray capacitance. Power supply and control capacitance (Vout), converting it to a DC voltage by charging a 100pF capacitor. A precision rectifier is unnecessary because the voltage here is much higher; a small voltage drop will not cause a significant error. Applying a maximum of 37.5V DC to an op amp would destroy it, so we have an 11:1 voltage divider made siliconchip.com.au from 10MW and 1MW resistors. This limits the output to 3.4V, which is a good safety margin. This divided voltage has a high source impedance, so IC5a buffers it before feeding it to the ADC6 (A6) analog input of the Nano. The Nano’s ADC has a resolution of ten bits, so the voltages at the ADC6 and Australia's electronics magazine Because op amp IC1a needs to drive the primary of T1 with a signal that swings above and below ground, its negative supply rail needs to be below 0V. We generate an approximately -4V supply rail from the +5V rail using IC7, a MAX660 switched capacitor voltage inverter in a fairly standard configuration. The +5V rail is generated from a three-cell battery (at least 3V) by an MCP1661 switch-mode boost converter (REG1), again in a configuration pretty much straight out of the data sheet. This allows us to power the circuit with three AA or AAA cells (depending on how long we want them to last). The Nano can monitor the raw battery voltage via its ADC3 (A3) analog input. Alternatively, 5V DC can be fed in from a USB supply, such as a phone July 2024  29 charger, via CON5. In this case, REG1 will only operate to overcome the forward voltage of diode D8. If you use rechargeable cells (eg, NiMH), they will also be trickle-charged when external DC power is applied via R1. The current drain in operation is about 200mA, so a decent set of AAs (alkaline or NiMH) should last for around ten hours of use. That might not seem very long, but this type of instrument is generally only used for a few minutes at a time, so the battery life should be OK unless you’re using it constantly. If battery operation is not needed, the MCP1661, the 4.7µH inductor and diode D8 may be omitted. Just put shorting links across the inductor and diode pads. The rest of the circuit is pretty standard. The Arduino Nano has just enough I/O pins for the task. The LCD module is the standard 2x16 alphanumeric type available from multiple sources; the version with a blue backlight is recommended. The four relays that switch the RF capacitors are selected by a 74AC139 multiplexer that will power the coil of just one relay at a time. The current sink capability of the 74AC139 is quite adequate for the relays used. Diodes across the relays absorb switching transients. Fig.2: this shows how voltage samples are taken at various widely-spaced frequencies until nearing the peak, at which point the unit switches to much smaller frequency steps. It’s important to accurately find the peak frequency for precise measurements. resonance, this will be zero or close to zero. There may be a bit of noise, so the algorithm ignores anything less than an ADC count of 5. The frequency steps far from resonance are at broad logarithmic intervals. That means that each step is the current frequency divided by a number. The logarithmic step size arrived at by experimentation is f ÷ 200. For example, at 10MHz, the next step size would be 50kHz (10MHz ÷ 200), making the next frequency 9.95MHz (10MHz − 50kHz). The next step size would be 49.75kHz (9.95MHz ÷ 200) and so on. When the measured voltage is 50 counts or greater on the ADC (about 250mV), we are on the rising side of the resonance curve, so we switch to a much smaller step size of f ÷ 4000. At each step, we measure the voltage and remember the highest voltage and the frequency at which it was found. If the voltage is lower than the highest seen so far, we increment a trailing-­ edge number instead. When the trailing-edge number reaches five, we have passed the peak, so scanning stops. The highest stored voltage and frequency are then used to calculate the Q factor and the inductance. This is illustrated in Fig.2, where each point on the resonance curve is shown. The peak will be sharp for high-Q circuits, so the sampling steps must be close together to avoid missing the peak. During scanning, we switch to the low-Q setting by turning on Mosfet Q1 to increase the op amp’s gain. This means that we will detect the rising slope sooner. If left on this setting, a high-Q coil could saturate the op amp output. To avoid that, we monitor the ADC count for Vout. If this exceeds 900, we switch Q1 off, reducing the measured Vout by a factor of four. As with the previous Q meter design, the brightness of LED1 is proportional to Vout. Because the algorithm takes the scan just past the peak, the LED will increase in brightness, dim slightly, then jump back to the highest brightness as we go back and re-measure the peak value. Measuring RF voltages with great accuracy is not easy. Once the peak frequency is reached, both Vout and Vin are sampled 16 times, and the readings are averaged. That helps to remove random noise. Australia's electronics magazine siliconchip.com.au 30 Silicon Chip Rotary encoder ENC1 is a standard type with a 20mm-long shaft; 27kW pull-up resistors are used for the three switch contacts, with 100nF capacitors for debouncing on two of them. Note that we have two capacitors on the INT0 line. One is located next to the encoder, but some noise spikes must have been getting into that line, making the frequency and capacitance settings erratic. A second capacitor right next to the Nano pin fixed the problem. Two starting parameters can be set. The first is the top frequency, which can be set from 2MHz to 90MHz, while the other is the capacitance value to resonate with the inductor. Three-­ position switch S2 selects the setup mode. Up sets the top frequency, down sets the capacitor value and middle waits for the start switch (S3). These additional switches also have pull-up resistors: 4.7kW for S3 and 27kW for S2. S2 feeds either 5V, 2.5V or 0V to the ADC2 (A2) pin of the Nano depending on its position, so an analog voltage measurement is used to determine its position. Finding the resonance peak To find the peak voltage of the tuned circuit, we start at a high frequency and, at each step down, measure the voltage Vout. When far from I originally had some concerns about the accuracy of meausrements due to the square wave shape. Is the rectified input voltage Vin different between a sinewave and a square wave? To test this, I used my previous Q meter and fed it with a sinewave and square wave generators. Over a frequency range of 1-10MHz, there was no significant difference in the measured Q. Construction Most components mount on a double-sided circuit board coded CSE240203A that measures 138 × 75.5mm. The two modules, the Arduino Nano and the Si5351a clock generator board, are on the back of the PCB; almost all the remaining components are on the front. Start by soldering in all the discrete resistors and capacitors in the locations shown in Fig.3, the PCB overlay diagram. As SMD capacitors do not have any markings, take care that the correct ones are soldered in. I use ceramic capacitors throughout, so like the resistors, their polarity does not matter. Fit the SMD diodes next, all of which are polarised; their cathode stripes must be orientated as shown in Fig.3. The polarity of the surface mount diodes can be hard to see, so if you are unsure, test them with a multimeter. Follow on by soldering the five integrated circuits, including REG4. None of them are particularly fine-pitch parts. Make sure that pin 1 is orientated correctly in each case, as fixing that after you’ve soldered all the pins is a chore! The relays and 1N5711 axial diodes should be mounted next. Like the ICs, the relays must be orientated correctly. After that, solder the sole transistor (Q1) in place. Fit the 4.7μH inductor next; the SMD type is preferable for slightly higher efficiency. It’s a good idea to clean the PCB to remove flux residue before mounting the through-hole components, as it’s easier at this stage. It’s also a good idea to inspect all the SMD solder joints, especially for the ICs, before moving on, as it will be easier to fix any problems now. Winding the transformer Wind ten turns of the specified enamelled copper wire onto the toroidal core (I used 0.4mm diameter wire but 0.25mm is OK), taking care that the turns are equally spaced around the circumference, to the extent possible, Fig.3: most components mount on the top side of the PCB, with just the Arduino Nano, the Si5350a clock generator module and one or two headers on the underside. A large proportion of the parts are SMDs although they are almost all quite large and easy enough to work with. During assembly, take care with the orientations of the diodes, ICs and relays. The top overlay diagram is the front of the PCB, while the bottom diagram is the back. The pads for one 100nF capacitor were accidentally left off the PCB, so it can be soldered like this (using a throughhole cap makes it easier). siliconchip.com.au Australia's electronics magazine July 2024  31 and that the ends line up with the two small pads on the PCB (one of which is attached to the large central hole). Scrape the enamel off the ends of the wires, and tin them so they can be soldered to the PCB. Make sure it is centred correctly so that the spacer can pass through the middle. Once it is in place, gently feed one of the brass spacers through the hole in the middle of the toroidal core and feed in a bright metal M3 machine screw through the back of the PCB to attach it firmly (it needs to make good electrical contact). Attach the other brass spacer similarly to the hole just below the toroidal core and to the right of diode D7. Now it’s time to mount the various through-hole parts except the LCD, LED and modules. When fitting pushbutton switch S3, ensure that the NC contact goes towards the bottom of the board. Check which outer pin is connected to the middle pin with a continuity meter when the button is not being pushed; that is the NC contact. Also take care that the switches and encoder are exactly at right angles to the board so that they fit through the front panel neatly. The best way to do this is to solder just one pin on each, then adjust their orientation so the front panel fits over them. Once you are happy with that, solder the remaining pins. For the LED, insert its leads through the 8mm spacer before soldering it to the board. Its longer (anode) lead goes to the left, next to the adjacent resistor. The flat side of the lens should face to the right. Before mounting the LCD screen, the Arduino Nano and Si5351 modules must be attached to the back. You could use socket strips to mount them, but it is not essential. In each case, if the module didn’t come with a header soldered to it, fit one now. Finally, attach the LCD module on the front with 10mm M3 screws, hex nuts and 3mm spacers. The Si5351 module is also held in place with M2/ M2.5 screws and 3mm spacers. After cleaning the circuit board again, inspect all soldered joints and touch up any problems. The photographs show a prototype version of the board; the revised one has a few changes. Several components were not required and were removed from the artwork, while others were added. Programming the Nano Before the LQ Meter can be tested, the ATmega238 microcontroller on the Arduino Nano module must be programmed. The modules generally come preprogrammed with a bootloader, with the correct fuse settings and a 16MHz onboard crystal, so you just need to load the LQ Meter specific firmware. How you do that depends on what equipment you have. The simplest way is to plug the Nano into your computer using a suitable USB cable and upload the HEX file using free Windows software called AVRDUDESS (download from siliconchip.au/link/ aaxh or use the command-line version, avrdude, if you’re running Linux or macOS). Download the firmware from our website at siliconchip.au/Shop/6/416 then unzip it and extract the HEX file. Run AVRDUDESS and set the programmer to Arduino, select the Nano’s USB serial port, a baud rate of 115,200 or 57,600 (depending on your Nano) and click “Detect”. If it doesn’t find the chip, adjust the settings and try again. Once it does, go to the Flash window, open the HEX file for this project and click the program button. You should get a confirmation message, and that’s it – the Nano is ready to go. Initial Testing Note that the LCD screen is soldered to the PCB, as there isn’t enough clearance to mount it on a socket. 32 Silicon Chip Australia's electronics magazine Don’t install the board in the enclosure yet. With the Nano programmed, a battery or external power supply can be connected to the board. Leave the power switch off and briefly connect a multimeter on its high current range across the power switch. Around 200mA should flow. A much higher current than that could indicate a short on the board. If all is well, proceed to the next stage. siliconchip.com.au Switch it on and adjust potentiometer VR1 until the LCD screen image is legible. Switch it off and on again; the splash screen will show the version number and the battery voltage. After a couple of seconds, the following screen shows the capacitor value and top frequency. To adjust these, use the centre toggle switch and set the values with the encoder. Once the values have been set, press the encoder switch to store the values in EEPROM, which are read on the next power-up. It’s possible that the encoder will work backwards. This depends on the specifics of your encoder and is quite unpredictable. If that happens, switch off the power, hold down the encoder switch and switch the power back on. The display will show “Toggling Direction”. The direction bit is stored in EEPROM and will give correct operation from then on. Parts List – Automatic LQ Meter Use the front panel PCB as a template for drilling holes in the front panel of the enclosure; Fig.4 shows the hole sizes. The panel is a snug fit in the detent, which makes for accurate drilling. Note that the spacers have clearance holes in the case so that they contact the pads on the back of the front panel. With the front panel in the enclosure slot, attach the red and black terminal posts. Two nuts are used on the posts, one on the outside of the panel to make good contact with the pad, the other on the inside with the washer. Tighten them well to maintain a low resistance. The circuit board can then be slotted in and attached by two black 8mm-long M3 machine screws and the nuts on the switches. Tighten the inside nuts on the switches right down for a correct fit. Push the knob onto the encoder shaft, and the unit is nearly complete. All that remains is to mount the battery holder and DC socket (for external power or battery charging) in the base of the case and wire them up. Drill a hole in the side for the DC socket (if you’re using it) and mount it. Make sure it won’t foul the PCB or battery holder once it has been installed. Attach the battery holder to the base using double-sided tape, then solder the 47W axial resistor between the DC socket’s positive terminal and the battery holder’s positive wire. Solder the 1 double-sided PCB coded CSE240203A, 138 × 75.5 × 1.6mm 1 double-sided front-panel PCB coded CSE240204A, black solder mask, 138.5 × 76 × 1mm 1 165 × 85 × 55mm IP65 sealed ABS enclosure with clear lid [Altronics H0326] 1 Si5351A clock generator module (MOD1) 1 Arduino Nano (MOD2) 1 16×2 alphanumeric LCD with blue backlight (LCD1) [Silicon Chip SC5759] 4 HFD4/5 subminiature DIP signal relays (RLY1-RLY4) [AliExpress] 1 Fair-rite 5943000301 ferrite toroid (T1) [element14 2948713] 1 30cm length of 0.25-0.4mm diameter enamelled copper wire (T1) 1 4.7μH M3216/1206 SMD inductor or axial RF inductor (L1) [Murata LQM31PN4R7M00L] 1 rotary encoder with integral switch and 20mm-long shaft (ENC1) [Silicon Chip SC5601] 1 knob to suit ENC1 1 SPDT miniature two-position toggle switch with solder tags (S1) [Altronics S1310] 1 SPDT miniature centre-off latching toggle switch with solder tags (S2) [Altronics S1330] 1 SPDT miniature momentary pushbutton switch with solder tags (S3) [Altronics S1391] 1 10kW top-adjust multi-turn trimpot (VR1) 1 3 × AA side-by-side battery holder with flying leads (BAT1) 1 2-pin vertical polarised header with matching plug and pins (CON1) [Jaycar HM3412 + HM3402; Altronics P5492 + P5472 + 2 × P5470A] 1 4mm red binding post (CON3) 1 4mm black binding post (CON4) 1 panel-mount DC barrel socket (CON5) [Jaycar PS0522] Semiconductors 1 OPA2677 dual 250MHz op amp, SOIC-8 (IC1) 1 MAX660M switched capacitor voltage inverter, SOIC-8 (IC2) 1 74AC139 dual two-to-four decoder/multiplexer, SOIC-16 (IC3) 1 MCP1661T-E/OT boost regulator, SOT-23-5 (REG1) 1 TSV912(A)ID dual rail-to-rail output op amp, SOIC-8 (IC5) 1 2N7002 N-channel Mosfet, SOT-23 (Q1) 1 3mm red LED (LED1) 3 1N5711 RF schottky diodes, DO-35 (D1, D2, D7) 4 1N4148WS SMD signal diodes, SOD-323 (D3-D6) 1 MBR0540 50V 0.5A SMD schottky diode, SOD-123 (D8) Capacitors (all SMD M2012/0805 50V X7R 10% ceramic unless noted) 2 100μF M3216/1206 6.3V X5R 3 10μF 6.3V X5R 1 330nF 10 100nF 1 470pF NP0/C0G RF (high-Q) 1% 1 220pF NP0/C0G RF (high-Q) 1% 2 100pF NP0/C0G 100V RF (high-Q) 1% [DigiKey KGQ21HCG2D101FT; Mouser 581-KGQ21HCG2A101FT; element14 1856269] 1 33pF NP0/C0G 250V RF (high-Q) 1% [Johanson 251R14S330JV4T] Resistors (all SMD M2012/0805 1% unless noted) 1 10MW 1 120kW 5 27kW 2 1kW 1 220W 1 1MW 2 100kW 1 470W 1 180W 2 390kW 1 33kW 1 4.7kW 1 270W 1 47W 1/4W axial (R1) Hardware 2 M3 × 16mm brass hex spacers 6 3mm ID 3mm-long untapped spacers 4 M3 × 10mm blackened panhead machine screws and hex nuts 2 M3 × 8mm blackened panhead machine screws 2 M3 × 8mm nickel-plated or stainless steel panhead machine screws 2 M2 × 10mm panhead machine screws and hex nuts 1 8mm-long LED spacer 1 double-sided foam-core tape pad approximately 40 × 60mm (for battery holder) 2 100mm lengths of light-duty or medium-duty hookup wire (red & black) Extra parts for optional debugging interface 1 3-pin polarised header (CON2) 2 2N7002 N-channel Mosfets, SOT-23 (Q2 & Q3) 2 4.7kW SMD resistors, M2012/0805 1% 1 1kW SMD resistor, M2012/0805 1% siliconchip.com.au Australia's electronics Automatic LQ Metermagazine Kits (SC6939, $100 + postage) July 2024  33 Final assembly Includes everything in the parts list except the case & optional debugging parts. The Automatic LQ Meter measuring a moulded inductor. You can rerun the test with different resonant capacitance values to get measurements at various frequencies. battery negative wire to the DC socket’s ground tab. You can find the positive tab on the DC socket using a continuity tester touching the central pin in the socket. It will make a sound when the other lead touches the correct tab. The ground tab is trickier since many sockets incorporate a ground switch; make sure a plug is inserted in the socket (but no power is applied) and check for continuity with the outer barrel of the plug and one of the tabs. All that remains is to crimp (and possibly solder) two lengths of lightduty hookup wire into the polarised header plug and solder them in parallel with the battery leads. Make sure that when it’s plugged into the polarised header (CON1) on the PCB, ground goes to the bottom terminal and the positive supply to the upper terminal that connects to switch S1. There is no reverse polarity protection on the PCB, so if you get this wrong, smoke will escape! Double-­ check that you got it right when the wires are connected by the PCB by verifying continuity from the battery’s ground lead to one of the screw holes on the PCB and the outer barrel of the DC socket. Using it Using the LQ meter is straightforward. Just connect the unknown inductor and press START. If you have no idea what the inductance is, set the frequency to the highest (90MHz) and the capacitor value to 51pF. It will take a few seconds to run its scan and display the Q and inductance values. If you have a rough idea of the inductance, a lower top frequency will make the scanning faster. The calculation is according to the equation: f = √25330 ÷ LC ... where f is the frequency in MHz, L is the inductance in µH and C is the capacitance in pF. The constant 25330 takes into account those units, plus the various gain or attenuation factors in the circuitry, as well as the ADC range. The inductance of air-cored inductors will not vary much with frequency. However, the permeability of ferrite or iron cores varies with frequency, so you will get different values over the frequency range. The five-capacitance range of this unit is comparable to the variable capacitor in Q meters of the past. SC Fig.4: use the front panel PCB as a template to drill holes in the front panel; they should be close to the positions shown here. Once they have been located with a pilot drill, enlarge them to the sizes shown here. 34 Silicon Chip Australia's electronics magazine siliconchip.com.au