Silicon ChipLC Meter Mk3 - November 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Close-up vision: use it or lose it / Competition resulting in innovation
  4. Feature: The Technology of Torches by Dr David Maddison
  5. Project: Christmas LED Icicle Decoration by Tim Blythman
  6. Project: LC Meter Mk3 by Charles Kosina
  7. Project: DC Supply Transient Filter by John Clarke
  8. Review: Raspberry Pi Pico W by Tim Blythman
  9. Project: Active Monitor Speakers, Part 1 by Phil Prosser
  10. Feature: WiFi-Synchronised Analog Clock by Geoff Graham
  11. Feature: Particulate Matter (PM) Sensors by Jim Rowe
  12. Vintage Radio: Philips Minstrel radios by Associate Professor Graham Parslow
  13. PartShop
  14. Project: 30V 2A Bench Supply, Part 2 by John Clarke
  15. Serviceman's Log: Toys with a serious purpose by Dave Thompson
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: isoundBar, August 2022; Motion-Sensing 12V Power Switch, February 2019
  19. Outer Back Cover

This is only a preview of the November 2022 issue of Silicon Chip.

You can view 43 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 "Christmas LED Icicle Decoration":
  • Tiny LED Icicle PCB [16111192] (AUD $2.50)
  • PIC12F1572-I/SN (or equivalent) programmed for the Tiny LED Christmas Ornaments (Programmed Microcontroller, AUD $10.00)
  • Tiny LED Christmas Ornament complete kit (Component, AUD $15.00)
  • Firmware for the LED Christmas Ornaments (Software, Free)
  • Eight Tiny LED Xmas Ornament PCB patterns (PDF download) [16111191-16111199] (Free)
Articles in this series:
  • Eight Small LED Christmas Ornaments (November 2020)
  • Eight Small LED Christmas Ornaments (November 2020)
  • Christmas LED Icicle Decoration (November 2022)
  • Christmas LED Icicle Decoration (November 2022)
Items relevant to "LC Meter Mk3":
  • LC Meter Mk3 PCB [CSE220503C] (AUD $7.50)
  • LC Meter Mk3 add-on PCB [CSE200603] (AUD $2.50)
  • 0.96in cyan OLED with SSD1306 controller (Component, AUD $10.00)
  • Short-form kit for the LC Meter Mk3 (Component, AUD $65.00)
  • Firmware for the LC Meter Mk3 (Software, Free)
  • LC Meter Mk3 PCB patterns (PDF download) [CSE220503C & CSE220603] (Free)
  • Lid panel label & drilling template for the LC Meter Mk3 (Panel Artwork, Free)
Items relevant to "DC Supply Transient Filter":
  • Transient DC Supply Filter PCB [08108221] (AUD $5.00)
  • Transient DC Supply Filter PCB pattern (PDF download) (08108221) (Free)
  • Lid panel label for the Transient DC Supply Filter (Panel Artwork, Free)
Items relevant to "Active Monitor Speakers, Part 1":
  • Active Monitor Speakers power supply PCB [01112221] (AUD $10.00)
  • Active Monitor Speakers cutting and assembly diagrams (Panel Artwork, Free)
  • Cutting diagrams for the Active Monitor Speakers (Panel Artwork, Free)
Articles in this series:
  • Active Monitor Speakers, Part 1 (November 2022)
  • Active Monitor Speakers, Part 1 (November 2022)
  • Active Monitor Speakers, Part 2 (December 2022)
  • Active Monitor Speakers, Part 2 (December 2022)
  • Active Subwoofer, Part 1 (January 2023)
  • Active Subwoofer, Part 1 (January 2023)
  • Active Subwoofer, Part 2 (February 2023)
  • Active Subwoofer, Part 2 (February 2023)
Items relevant to "WiFi-Synchronised Analog Clock":
  • Kit for the new GPS Analog Clock Driver (Component, AUD $55.00)
  • Kit for the new GPS Analog Clock Driver without GPS module (Component, AUD $35.00)
  • Revised firmware for the ESP8266 in the WiFi-Synchronised Analog Clock (Software, Free)
Articles in this series:
  • New GPS-Synchronised Analog Clock (September 2022)
  • New GPS-Synchronised Analog Clock (September 2022)
  • WiFi-Synchronised Analog Clock (November 2022)
  • WiFi-Synchronised Analog Clock (November 2022)
Items relevant to "Particulate Matter (PM) Sensors":
  • Sample code for El Cheapo Modules - PM2.5 Sensors (Software, Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "30V 2A Bench Supply, Part 2":
  • 30V 2A Bench Supply front panel control PCB [04105222] (AUD $2.50)
  • 30V 2A Bench Supply main PCB [04105221] (AUD $5.00)
  • INA282AIDR shunt monitor IC and 20mΩ 1W shunt resistor for 30V 2A Bench Supply (Component, AUD $10.00)
  • 30V 2A Bench Supply PCB patterns (PDF download) [04105221/2] (Free)
  • 30V 2A Bench Supply front panel artwork (PDF download) (Free)
Articles in this series:
  • 30V 2A Bench Supply, Part 1 (October 2022)
  • 30V 2A Bench Supply, Part 1 (October 2022)
  • 30V 2A Bench Supply, Part 2 (November 2022)
  • 30V 2A Bench Supply, Part 2 (November 2022)

Purchase a printed copy of this issue for $11.50.

LC Capacitance Range: 1pF to 1200pF+ with 0.1pF resolution Inductance Range: 100nH to 2500μH+ with 10nH resolution below 10μH Accuracy: typically better than 2% Power supply: 3 × AA cells, draws ~35mA during operation Battery Life: around 72 hours with fresh alkaline AAs; operates down to 0.6V per cell Display: 0.96-inch (24mm diagonal) OLED screen 3 Meter Mk This new LC (inductance/capacitance) Meter is a modernised version of a very old design - the Tektronix T130 from the 1950s. It can measure a wide range of capacitances and inductances, from less than 1pF to more than 1.2nF, and from less than 100nH to more than 2.5mH. It displays the results on an OLED screen. inspired to design this modIthewas ern LC Meter when I read about 1954 Tektronix Type 130 LC Meter in the series of Vintage Workbench articles by Alan Hampel from June to August 2020 (siliconchip.au/ Series/346). It was an impressive feat of engineering at the time, using all analog techniques. While there are many cheap LC meters available today, their main drawback is not being able to measure low values. RF filters often require accurate values less than 10µH or 10pF. The Tektronix design had a reference oscillator at 140kHz (Fref). The measurement oscillator (Ftest) was initially tuned to the same frequency. Then, by placing a capacitor across the tuned circuit, or an inductor in series with the inductor in the oscillator, the test oscillator frequency dropped. Mixing the two signals gave signal components at frequencies Fref + Ftest and Fref − Ftest. Selecting the latter using a low-pass filter, the T-130 used clever analog techniques to convert this to a capacitance or inductance value shown on a moving coil meter. Their design gave accurate measurements from 1–300pF or 1-300µH. It was all done using valves; transistors were not available back then. siliconchip.com.au My first LC Meter design emulated much of this principle and worked reasonably well, but that version had some deficiencies. It used two variable capacitors, a coarse and fine adjustment, to set the test frequency to the exact value before a capacitor or inductor was measured. This was time-­consuming and fiddly, so I added an ‘automatic zero’ on power-up. Also, its construction was complicated, using a large LCD, so I changed it to use the same OLED screen that I used for my AM-FM DDS Signal Generator (May 2022; siliconchip. au/Article/15306) and 0-110dB RF Attenuator (July 2022; siliconchip.au/ Article/15385). The OLED screen is cheaper and also consumes a lot less power. That allows the Meter to run for many hours on three AA cells and operate down to a total battery voltage of 1.8V (0.6V per cell) thanks to the use of a step-up regulator. That will save on battery costs. After making those changes, I had a Meter that worked well, but I felt it was still too complicated and used too many parts, some difficult to source. The auto-zero function took far too long, and the accuracy and resolution were worse than I would like. By Charles Kosina Australia's electronics magazine Calibration was problematic as well. I solved all those problems in my final design. It somewhat moves away from the original Tektronix concept in that it does not start at a particular frequency. The operating frequency is now of secondary importance as it gets cancelled out in the calculations. It is also self-calibrating, resulting in an accuracy of about 2% over the whole capacitance range. The capacitance range is now 1pF to more than 1200pF with a resolution of 0.1pF, while the inductance range is 100nH to more than 2500μH with a resolution of 10nH below 10µH. You might notice that this new auto-calibrating concept makes it somewhat similar in operation to our June 2017 Arduino-based Digital LC Meter (siliconchip.au/Article/10676), which was based on the earlier High-accuracy Digital LC Meter (May 2008; siliconchip.au/Article/1822). However, those designs use a comparator in the oscillator and that causes some problems and has limitations. As you will see when we get to the circuit, the implementation of this Meter is somewhat different. It uses a separate inverter-based oscillator and has self-calibration features to provide better accuracy over a wide range of component values. November 2022  41 Parts availability Sourcing components is always a problem these days, but I went to quite a bit of effort to ensure that everything was available from element14 at the time of writing. There are a few parts that are available from multiple AliExpress sellers at very low prices. However, for some of these, you may have to buy multiple quantities. Still, as the prices are so low, you will end up with plenty of spares. Of course, Murphy isn’t resting, and before this article was published, some of the critical parts ran out of stock. The good news is that we realised what was happening and snapped some up, so an almost complete kit is available (see the bottom of the parts list). So if you can’t source all the parts yourself or don’t want to, that’s an easy option. Performance One primary object of this design was to produce accurate readings for low-value inductors. VHF filters generally require inductors in the sub-1µH (ie, nanohenry) range. I possess an ancient Q-Meter, a Meguro MQ-160. The design dates Table 1 – inductance accuracy Meguro inductor Measured value 1.0μH 0.98μH Circuit details 2.5μH 2.53μH The circuit of the LC Meter is shown in Fig.1. It is based on a Franklin oscillator comprising two 74HC04 inverters, IC2a and IC2b. The 1MW resistor across the first inverter puts it into a linear mode, making it act like a very high gain inverting amplifier. The second inverter provides the phase shift, which feeds back into the tuned circuit. With the nominal onboard 330µH inductor (L1) and 220pF capacitor, the oscillation frequency is about 630kHz. It has a large operating range and will still oscillate reliably with more than 1200pF added across the tuned circuit or up to 2.5mH in series. One advantage of this arrangement is that the output of IC2b swings between the supply rails. This means that it does not need an additional fast op-amp to boost the signal into a range that a microcontroller can easily measure. Four transistors, Q1-Q4, switch additional capacitors across the tuned circuit. These capacitors are 1% tolerance types, and by using parallel 5.0μH 4.88μH  7.5μH 7.35μH 10μH 9.94μH  15μH 14.2μH 25μH 24.4μH  35μH 34.6μH 50μH 49.8μH  75μH 75.1μH 100μH 99.8μH  150μH 148μH 250μH 254μH  350μH 357μH 500μH 492μH  750μH  1000μH 750μH 1009μH 1250μH 1250μH 1500μH 1484μH 2500μH 2498μH made by connecting two coils in series (eg, 150μH = 100μH in series with 50μH)  42 back to the 1940s; the one I have was made in 1969. It still works quite well, as long as the valves inside keep functioning. The MQ-160 came with a box of 14 calibration inductors from 1µH to 25mH. They are all large air-cored coils and are really works of art. Their accuracy would not drift with time, so they continue to be a good standard. Using individual and series combinations of my standard Meguro inductors, I obtained the accuracy figures shown in Table 1. These assume that my test coils are accurate, as there is no specific information in the Meguro manual about their accuracy. The accuracy for capacitor values depends on how close the 1% calibration capacitors are, and can therefore be assumed to be no worse than ±2% (and probably closer to ±1%). At the measurement frequency of 600kHz or less, ferrite-cored inductors all read low as the ferrite permeability is reduced at lower frequencies. For example, a nominal 68µH inductor measured 58.5µH at 572kHz, but a 1µH inductor fared much better and measured 0.89µH at 630kHz. Air-cored inductor measurements will not vary significantly with frequency. Silicon Chip Australia's electronics magazine combinations, we get ten calibration points. The BFR92P transistors used here have very low collector-to-base and collector-to-emitter capacitances, typically 0.4pF and 0.23pF, respectively, so they will not detract from the accuracy. The base resistors for these transistors are 3.3kW, and with 5V applied, they drive the transistors well into saturation, providing low-impedance ground connections for the capacitors. We need to provide a ‘zero reference’ point for inductance measurement. This is done by connecting L1 to ground and measuring the oscillator frequency. My initial design used an NPN transistor for this, but once the inductance under test got close to 1000µH, the voltage across the switched-off transistor was such that its reverse-biased junction conducted and clipped the waveform. The solution was to substitute a small relay (RLY1). That allows the Meter to measure up to at least 2.5mH. DPDT switch S2 selects between capacitance (up) and inductance (down) measurements. For capacitance measurements, the DUT is placed across the tuned circuit, while the DUT is placed in series for inductance measurements. In both cases, the oscillation frequency will be reduced. The oscillation frequency is too high for the microcontroller to measure accurately, so a 74HC161 binary counter is used to reduce it to less than 100kHz. In the initial design stages, I was not sure how much division would be needed, so header JP1 gives the option to divide by 2, 4, 8 or 16. In the final design, a division ratio of eight is used. Microcontroller and display The processor used is the ATMega328P on the Arduino Nano module (MOD1). I chose it as it is cheap and readily available from multiple sources, including eBay and AliExpress. It also simplifies the construction substantially. Its INT0 interrupt pin (pin 20) is used to count the frequency from the oscillator. For capacitance measurements, a 250ms window is used to count pulses. However, this is increased to two seconds for inductance measurements to obtain enough resolution down to 10nH. The OLED screen is controlled over a two-wire I2C (inter-integrated circuit) siliconchip.com.au Fig.1: the primary oscillator is built from inverters IC2a & IC2b. Its frequency is affected by an external capacitor/ inductor at CON1, or onboard calibration capacitors switched by transistors Q1-Q4. Inductor L1 is used for measuring inductances, switched to ground by RLY1. The Arduino Nano controls and monitors the oscillator, computes the values and displays them on a small OLED screen. siliconchip.com.au Australia's electronics magazine November 2022  43 I always have a simplified RS-232 serial connection on my boards for debugging the firmware. In this case, the three unused 74HC04 inverters are used, with two in parallel for the TX pin to provide sufficient drive strength. The serial interface format is 38400,8,1,n and lots of debug information is transmitted, which I have left in, as it does not slow down the operation. Power supply The prototype lacks the relay and associated components at lower left, but otherwise is very similar to the final design. serial interface. Because this uses open-drain style signalling, no voltage translation is needed, just 15kW pull-up resistors to +3.3V. These values are higher than the usual 4.7kW to reduce power consumption further. With the short tracks, there is no problem with noise despite the lower bias current. One analog input on the micro is used to measure the battery voltage, while the other is used to sense the three-position function switch, S1. Momentary switch S3 is used for starting capacitance calibration or for inductance measurement. There is an optional output for a buzzer at CON4. This gives a beep when calibration is completed. As this is its only function, it may be safely omitted. The series diode is a safety feature as the connector is the same as for the battery input. Without the diode, if the battery was connected to the wrong socket, it could destroy the microcontroller! Fig.2: a plot of the oscillator frequency shift against external capacitance. Reading a frequency shift off this plot will tell you the connected capacitor value. This can be accurately approximated with a third-order polynomial, but linear interpolation between the points shown is close enough for our needs. Fig.3: the inductance vs frequency shift curve is similar to the capacitance curve shown in Fig.2, but it needs second-order curves over most of its segments to give a good enough approximation. The exception is the 0-10μH section, which is close enough to being linear. 44 Silicon Chip Australia's electronics magazine REG1 is an MCP1661 or MP1541 step-up voltage converter. It can operate with an input voltage below 2V and still provide the required 5V output. While two cells will provide enough voltage, by using 3 AA cells, the minimum voltage is less than 0.7V per cell. You can use up all those cells which no longer work in a mouse or other equipment to power the LC Meter, saving money. REG1 works by pulling its switch pin (pin 1) low, in pulses at 500kHz. When this pin goes low, current flows from the battery through inductor L2, to ground and back to the battery, charging up L2’s magnetic field. When the transistor pulling pin 1 low is switched off, current flows from the battery through L2 and schottky diode D4 into the 5V supply rail, powering the circuit and charging up the filter and bypass capacitors. As L2’s magnetic field collapses, the voltage at the anode of D4 rises above the battery voltage. Fig.4: a close-up of the 0-10μH section of Fig.3, comparing the actual curve to a linear approximation. The resulting errors are minor in comparison to other sources of uncertainty. siliconchip.com.au By controlling the duty cycle of the pulses, REG1 maintains the voltage at its Vfb (feedback) pin close to 1.227V. The division ratio of the 390kW and 120kW resistors causes this to be effectively multiplied at the top of the divider. This results in an output of 1.227V × (390kW + 120kW) ÷ 120kW = 5.215V. Measurement calculations The frequency of a tuned circuit is given by C = 1 ÷ ω2L and L = 1 ÷ ω2C, where ω = 2πf. For C in pF, L in µH and f in MHz, this simplifies to the useful equations C = 25330 ÷ f2L and L = 25330 ÷ f2C. If we know the inductance value by measuring the frequency, we can calculate the capacitance, but this method has two problems. Firstly, an accurate inductor is not available; the best we can get is ±5%. Secondly, suitable inductors are on a ferrite core and, as mentioned earlier, permeability varies substantially with frequency. It is impractical to use an air-cored inductor as it would be too large. This is where the calibration technique results in accurate measurement. On power-up, the oscillator frequency is measured first with transistors Q1 to Q4 off. This gives the frequency with no external capacitance. Then by switching on the transistors in different combinations, we get calibration points of 100pF, 220pF, 320pF, 470pF, 690pF, 790pF, 940pF, 1040pF, 1160pF and 1260pF. Fig.2 shows the curve derived from these calibration points with the frequency offset from 0pF. It is possible to describe this curve with a polynomial equation, but a third-order polynomial is needed to get good accuracy. This is of the form C(pF) = af3 + bf2 + cf + d (d = 0). The first cubed term (f3) results in huge numbers, well beyond 32-bit integer calculations. There are ways of getting around this by cleverly sequencing the calculations, but I chose a simpler method. There is not much of a curve between individual calibration points, and a linear interpolation gives acceptable accuracy. Capacitance readings are taken continuously at about half-second intervals. The resolution is 0.1pF for values below 200pF. Above this, only the integral part of the value is shown, as siliconchip.com.au the fraction is unlikely to have significant accuracy. Inductance measurements Inductance measurements are made a bit differently. We don’t have the privilege of built-in calibration inductors, as any accurate types would have to be air-cored and far too large. I measured the oscillator frequency with each of the calibration inductors that came with my Meguro Q-Meter, up to 2500µH, which is close to the practical limit of the Meter. This gave me a calibration curve similar to the one used for capacitance. This curve may also be approximated by a third-­ order polynomial L = 20-12 f3 − 50-8 f2 + 0.0045 f. With C in pF, L in µH and f in MHz Again, this makes 32-bit integer computation difficult, so I split it into several segments, some approximated by quadratics, as shown in Fig.3. I’ve included a spreadsheet in the download package for this project with the relevant calculations. The 0-10µH section of the curve is so close to a straight line that a linear equation is very accurate (Fig.4). From this, we can estimate the likely resolution for low inductance values. To get the required resolution, the oscillator must be stable in the measurement period of four seconds. The measurement readout is stable in practice, with the 10nH digit remaining constant between measurements. Note that this calibration curve depends on the actual inductance value of inductor L1, so we have to correct the difference. This requires a measure of the value of L1, which is performed as described in the “Onboard inductor value calculation” panel. By comparing the measured value with the one I used in my prototype, the offset frequency readings are modified for better accuracy. Firmware The firmware is written in BASCOM (BASIC for AVRs), which is easy to implement and easy to follow. It occupies just over half of the 32KB flash memory on the ATmega328 processor. If you want to know more about it, download and check out the source code. Case preparation The recommended enclosure is from Ritec (Altronics Cat H0324) and includes a clear lid. It has a slightly indented clear window measuring 98 × 76 mm. The drilling measurements shown in Fig.5 relate to this window. The transparent top is relatively brittle, so be careful if using a centre punch as it can crack the plastic. Likewise, use a low-speed drill to prevent damage to the top. A step drill gives the cleanest and most accurate results. As these holes have to be very Fig.5: the locations of the holes in the clear lid of the H0324 plastic box. You could copy this (or download it from the Silicon Chip website and print it out at actual size) and use it as a template. See the comment at the end of the body text explaining that one hole and switch could be omitted. Australia's electronics magazine November 2022  45 Onboard inductor value calculation As the value of inductor L1 will vary with the test frequency due to the permeability of the ferrite core varying, we cannot rely on its nominal value. To get a good estimate of the inductance in the oscillator circuit, we need to make some calculations. The capacitance across it is the 220pF plus the stray capacitance; call this C1. We know that L = 1 ÷ (ω12 × C1), where ω = 2πf (f = oscillator frequency). The resonant frequency will change if we add a capacitance C2 in parallel with C1. As long as it is not too different from the original frequency, the inductance value will be close enough to the same. The new equation becomes: L = 1 ÷ (ω22 × [C1 + C2]) Combining the above two equations, we get: ω22 × (C1 + C2) = ω12 × C1 This can be rearranged to: (C1 + C2) ÷ C1 = ω12 ÷ ω22 Further manipulation gives us: C1 = C2 ÷ (ω12 ÷ ω22 – 1) As the 2π factors in ω1 and ω2 cancel out, this becomes: C1 = C2 ÷ ([f1 ÷ f2]2 – 1) To more easily calculate this using 32-bit integer arithmetic, we multiply the numerator and denominator on the right-hand side by f22 to give the equivalent equation: C1 = f22 × C2 ÷ (f12 – f22) In our case, we know the added capacitance C2, and measuring f1 and f2 gives us the value of C1. From this, we can calculate L according to the first equation above, or the simpler version, L = 25330 ÷ f2 × C mentioned in the body text. This calculation is done during the calibration on power-up, with C2 being the 100pF calibration capacitor. The fact that the frequencies measured are divisions of the actual frequencies does not matter as the ratio remains constant. accurate, first locate the bottom-left hole 16mm from the window edges. Drill this to 3mm and attach the blank PCB with an M3 screw and nut. Position the PCB to be precisely square, then drill the other holes in the middle of the switches. Alternatively, use Fig.5 as a template to mark the four holes that need to be drilled, then enlarge the holes to 6.35mm (1/4in) or 6.5mm. The window has a moulding ‘bump’ in the centre that interferes with the OLED behind it. Drill this out as well, to 6.35mm or 6.5mm. Construction The LC Meter is built on a 91.5 × 63.5mm double-sided PCB coded CSE220503C. Components are mounted on both sides of the board, with the connectors and Arduino Nano module on the back, as shown in the overlay diagrams, Figs.6 & 7. The only fine-pitch SMD is the MPC1661 up-converter. As it is a fivepin device, the orientation is obvious. Solder it first, followed by the other ICs. Add a thin layer of flux paste onto its pads before placing it, tack one pin and then check carefully that the other pins are correctly aligned, ideally using a magnifier. If necessary, re-heat the tacked joint and nudge it into position. Then solder the other pins. Clean the flux off the board and inspect REG1 to verify that all its pins are soldered properly and none are bridged. If there are bridges, add a bit of flux paste and then remove them with a piece of solder wick. The remaining 14-pin and 16-pin chips are relatively easy to solder but make sure they are orientated correctly! Follow with the five transistors, four BJTs (Q1-Q4) and one Mosfet (Q5). They are all in three-pin SOT-23 packages, so don’t get them mixed up. The diodes are in two different package types: plastic SOT-123 (ZD1 & D4) and cylindrical glass Mini-MELF (D2, D5). In each case, start by identifying the striped (cathode) end. You might need a magnifier to see the stripe on ZD1 and D4. Then solder them in place, as shown in Fig.6. Now fit all the discrete resistors and capacitors. They are all M2012/0805 (2 × 1.2mm) or M3216/1206 (3.2 × 1.6mm) size, and none are polarised, but the resistors should have their codes marked on top. After that, solder the small SMD relay, taking care to orientate it correctly. That’s the last surface-mounting part. Now add the through-hole components, starting with the lowest-­profile axial devices and working your way up. The OLED screen plugs into a 4-pin socket strip. Carefully slide off the plastic on the OLED pins to reduce Figs.6 & 7: all the SMDs and most of the other parts are on the front of the board. The only one that’s a bit tricky to solder is REG1; make sure you scrutinise its solder joints before powering the board up. Also watch the orientations of the ICs, the Arduino Nano module (once it’s plugged in), the relay and the diodes. 46 Silicon Chip Australia's electronics magazine siliconchip.com.au the height above the board. It is then secured by two M2.5 or M2 screws with 8mm untapped spacers. The Arduino Nano and connectors are on the opposite side of the board. I also used socket strips for the Nano, but that is optional. The Nano has 15 pins on each side, so ideally, you’d use 15-pin strips, but they are not easy to find. You can use 14-pin headers inserted towards the top edge of the board, as the lowest pin on each side is not electrically connected, or cut down longer sockets. The other components on the back of the board are headers CON2 & CON4, the optional debugging header (CON3) and the BNC socket (CON1). All the switches mount on the front, and are best fitted last. We’ve specified solder-lug switches rather than PCB-mounting types, and provided sufficiently large slots to solder in the lugs. This is because the solder lug style switches are more widely available, especially in the wide variety needed here. Make sure they’re perpendicular to the board before soldering all the lugs. Clean the board with circuit board cleaner and inspect all the soldered joints for any that may have been missed, and check for shorts between pins. Finally, place the jumper on JP1 in the position shown in Fig.6. Assembling it into the case Presumably, you followed the earlier instructions to prepare the lid with the aid of the blank PCB. If not, you’ll have to go back and use a template made from Fig.5 instead. Then you can print and prepare the front panel label, shown in Fig.8. Print this label on photographic paper. I placed a transparent 1mm thick sheet of polycarbonate on top of the label to protect it, although you could laminate it instead. Although the PCB has mounting holes, the toggle switches are adequate to bolt the unit onto the panel. The battery holder for the three AA cells (BAT1) should be attached to the bottom of the case with double-sided adhesive tape. While you could solder its leads directly to the PCB pads for CON2, that would make disassembly somewhat tricky. So we’ve specified a polarised header for CON2 and a matching plug. Crimp and/or solder the plug to the battery leads, ensuring they are not reversed. siliconchip.com.au Parts List – LC Meter Mk3 1 double-sided PCB coded CSE220503C, 91.5 × 63.5mm 1 125 × 85 × 55mm IP65 sealed ABS enclosure (clear lid) [Altronics H0324] 1 panel label, 98 × 76mm 1 Arduino Nano microcontroller board (MOD1) 1 0.96-inch OLED display module with I2C interface and SSD1306 controller (OLED1) [SC6176 (cyan)] 1 Omron G6K-2F-Y-DC5V SMD relay (RLY1) 1 330μH axial RF inductor (L1) 1 3.3μH axial RF inductor (L2) 1 PCB-mount miniature SPDT centre-off toggle switch (S1) [Altronics S1330; S1332 is PCB-mounting equivalent] 1 PCB-mount miniature DPDT on-on toggle switch (S2) [Altronics S1345; S1350 is PCB-mounting equivalent] 1 PCB-mount miniature SPDT centre-off momentary toggle switch (S3) [Altronics S1340; S1333 is PCB-mounting equivalent] 1 PCB-mount miniature SPDT on-on toggle switch (S4) [Altronics S1310; S1315 is PCB-mounting equivalent] 1 PCB-mount right-angle BNC connector (CON1) [Altronics P0529] 2 2-way polarised vertical pin headers with matching plugs (CON2, CON4) 1 3-way polarised vertical pin header (CON3; optional, for debugging) 1 4-way header socket (for OLED) 2 14-pin or 15-pin header sockets (optional, for mounting Nano) 1 2×4-pin header, 2.54mm pitch (JP1) 1 jumper shunt (JP1) 2 8mm untapped spacers (for mounting OLED) 2 M2 × 12-16mm panhead machine screws and nuts (for mounting OLED) 1 3 x AA battery holder with flying leads (BAT1) 3 AA cells (ideally alkaline) 1 200mm length of foam-core double-sided tape (to attach battery holder) 1 BNC to screw terminal adaptor (optional, to measure components) 1 chassis-mount piezo buzzer (optional) [Altronics S6109, Jaycar AB3462] Semiconductors 1 74HC161D or 74AC161D synchronous binary counter, SOIC-16 (IC1) 1 74HC04D or 74AC04D hex inverter, SOIC-14 (IC2) 1 MCP1661T-E/OT integrated high-voltage boost regulator (or MP1541DJ-LF-P boost converter), SOT-23-5 (REG1) 4 BFR92P low-capacitance NPN transistors, SOT-23 (Q1-Q4) 1 2N7002 60V 115mA N-channel Mosfet, SOT-23 (Q5) 1 BZT52C4V7 4.7V 500mW zener diode, SOD-123 (ZD1; optional) 2 LL4148 75V 500mA small signal diodes, SOD-80 (D2, D5) 1 MBR0540 50V 500mA schottky diode, SOD-123 (D4) Capacitors (all SMD M2012/0805 ceramic) 2 10μF 16V X5R 3 100nF 50V X7R 1 470pF 50V NP0/C0G 1% 1 330pF 50V NP0/C0G 1% 2 220pF 50V NP0/C0G 1% 2 120pF 50V NP0/C0G 5% 1 100pF 50V NP0/C0G 1% Resistors (all SMD M2012/0805 1%) 1 1MW 1 390kW 1 120kW 6 15kW 2 10kW 4 3.3kW Optional Adaptor Board 1 double-sided PCB coded CSE200603, 33 × 20.5mm This optional adaptor 1 SMA edge connector board makes it easier 1 6-pin header socket to test components. 1 short SMA to BNC cable KIT (SC6544 SC6544) – $65 + P&P: includes everything in the parts list above that isn't optional except for the case, AA cells and front panel label. Australia's electronics magazine November 2022  47 The battery holder and piezo buzzer are located in the case so that they don't interfere with the PCB when the lid is attached. Note the position of the hole in the side for the BNC socket. Before plugging the battery in, very carefully check that polarity as the PCB does not have reverse polarity protection. Using it The BNC connector by itself is not ideal for connecting to separate components. The simplest solution is to use a BNC plug with screw terminals and a couple of clip leads to connect to leaded components. You can connect some parts directly to the screw terminal. With care, the clip leads may also connect to M3216/1206 and M2012/0805 size SMDs. Depending on the length of leads, these will add about 100nH to measured inductances. This can be measured by shorting the leads together; then, you can subtract this from the inductance reading. That will only be necessary for values below about 5µH. An alternative is a small PCB I designed (coded CSE200603) connected by a short coax cable, BNC to SMA – see the end of the parts list. This allows more device options and includes pads for SMD capacitors. M3216 and M2012 chip capacitors can be accurately measured by carefully holding them down on the pads with a non-conducting stylus. The added capacitance of the coax cable is about 15pF, so it is necessary to run calibration with the adaptor connected, cancelling it out. Calibration runs automatically at power-up, but it can also be triggered manually by pressing the CAL/START switch. This requires the L/C switch to be in 48 Silicon Chip Some example screengrabs when operating the LC Meter Mk3. the C position and no external component connected. To make inductance measurements, switch to the L position, connect the unknown coil and press CAL/START. This will power relay RLY1 for two seconds to give a reference zero offset. After that, RLY1 is switched off, placing the unknown in series with L1. A lower frequency will be measured and subtracted from the “zero” point to give an offset frequency. The inductance is then calculated from this offset. The inductance will continue to be measured from then on, each reading taking about four seconds. If no inductor is connected, the display will show “Reading Error”. In any case, it’s best to take several readings to get a consistent result. The calibration is accurate up to 2,500µH (2.5mH). It will measure values higher than that, but the precision of such readings is unknown. Future enhancements The onboard three-position toggle switch (S1) provides Option 1 and Option 2 for possible enhancements in the future. One option I tried was to double the measurement window for improved resolution but, in practice, there was no significant difference, so I discarded it. That switch may be omitted to reduce the construction cost slightly, and the label modified to remove the options. Finally, I would like to acknowledge another regular contributor to Silicon Chip, Andrew Woodfield, for his helpful suggestions. It was largely his desire for measuring sub-1µH inductors that I was pressed to improve my SC earlier designs. LC METER MK3 CAL / START OPTION 1 C L NORMAL OPTION 2 Australia's electronics magazine ON Fig.8: the front panel label can be downloaded from the Silicon Chip website and printed on photo paper. There are two versions available, one with the OPTION switch at lower left (shown here) and one without it. siliconchip.com.au