Silicon ChipUsing a capacitive soil moisture meter - February 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Be wary of devices that require apps to work
  4. Mailbag
  5. Subscriptions
  6. Review: Radio Girl by Nicholas Vinen
  7. Feature: All About Batteries – Part 2 by Dr David Maddison
  8. Project: Dual Hybrid Power Supply – Pt1 by Phil Prosser
  9. Feature: Low-noise HF-UHF Amplifiers by Jim Rowe
  10. Project: Fan Controller & Loudspeaker Protector by John Clarke
  11. Product Showcase
  12. Project: Solid-State Tesla Coil by Flavio Spedalieri
  13. Review: TL866II Universal Programmer by Tim Blythman
  14. Project: Remote Gate Controller by Dr Hugo Holden
  15. Serviceman's Log: The accordion job by Dave Thompson
  16. Vintage Radio: Tasma 305 'rat radio' by Fred Lever
  17. PartShop
  18. Circuit Notebook: Resistor-Mite auto-ranging ohmmeter by Gianni Pallotti
  19. Circuit Notebook: Using a capacitive soil moisture meter by Kenneth Horton
  20. Circuit Notebook: Musical bicycle horn by Jotham Gates
  21. Ask Silicon Chip
  22. Market Centre
  23. Advertising Index
  24. Outer Back Cover

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

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

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • All About Batteries - Part 1 (January 2022)
  • All About Batteries – Part 2 (February 2022)
  • All About Batteries, part three (March 2022)
Items relevant to "Dual Hybrid Power Supply – Pt1":
  • Intelligent Dual Hybrid Power Supply PCB set (AUD $25.00)
  • Intelligent Dual Hybrid Power Supply regulator PCB [18107211] (AUD $7.50)
  • Intelligent Dual Hybrid Power Supply front panel control PCB [18107212] (AUD $2.50)
  • PIC32MZ2048EFH064-250I/PT programmed for the Intelligent Dual Hybrid Power Supply [0110619A.HEX] (Programmed Microcontroller, AUD $30.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • Hard-to-get parts for the Intelligent Dual Hybrid Power Supply regulator board (Component, AUD $125.00)
  • Hard-to-get parts for the Intelligent Dual Hybrid Power Supply CPU board (Component, AUD $60.00)
  • LCD panel bezel for the Dual Intelligent Hybrid Power Supply (PCB, AUD $5.00)
  • Intelligent Dual Hybrid Power Supply firmware [0110619A.HEX] (Software, Free)
  • Intelligent Dual Hybrid Power Supply PCB patterns [18107211/2] (Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (AUD $3.00)
Articles in this series:
  • Dual Hybrid Power Supply – Pt1 (February 2022)
  • Dual Hybrid Power Supply, part two (March 2022)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 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 4 (February 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 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 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 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 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: 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, Part 2 (June 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: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
Items relevant to "Fan Controller & Loudspeaker Protector":
  • 500W Amplifier Module PCB [01107021 RevD] (AUD $25.00)
  • Hard-to-get parts for the 500W Amplifier (Component, AUD $200.00)
  • 500W Amplifier Module PCB pattern (PDF download) [01107021] (Free)
  • Cooling Fan Controller & Loudspeaker Protector PCB [01102221] (AUD $5.00)
  • PIC16F1459-I/P programmed for the Cooling Fan Controller & Loudspeaker Protector [0110222A.HEX] (Programmed Microcontroller, AUD $10.00)
  • 4-pin PWM fan header (Component, AUD $1.00)
  • Cooling Fan Controller & Loudspeaker Protector firmware [0110222A.HEX] (Software, Free)
  • Cooling Fan Controller & Loudspeaker Protector PCB pattern (PDF download) [01111211] (Free)
Articles in this series:
  • Fan Controller & Loudspeaker Protector (February 2022)
  • Amplifier Clipping Indicator (March 2022)
  • 500W Power Amplifier, Part 1 (April 2022)
  • 500W Power Amplifier, Part Two (May 2022)
Items relevant to "Solid-State Tesla Coil":
  • Solid State Tesla Coil driver PCBs [26102221-2] (AUD $7.50)
  • Solid State Tesla Coil driver PCB patterns (PDF download) [26102221-2] (Free)
  • Solid State Tesla Coil main driver PCB [26102221] (Source component, AUD $5.00)
Items relevant to "Remote Gate Controller":
  • Driveway Gate Controller PCB [11009121] (AUD $20.00)
  • Remote Gate Controller PCB pattern (PDF download) [11009121] (Free)
Items relevant to "Resistor-Mite auto-ranging ohmmeter":
  • Firmware and Gerber files for the Resistor-Mite ohmmeter (Software, Free)
Items relevant to "Using a capacitive soil moisture meter":
  • Firmware and 3D models for the capacitive soil moisture meter (Software, Free)
Items relevant to "Musical bicycle horn":
  • Firmware, PCB design and 3D models for the musical bike horn (Software, Free)
Videos relevant to "Musical bicycle horn":
  • Bike Horn

Purchase a printed copy of this issue for $11.50.

Using a capacitive soil moisture meter There are several types of lowcost soil moisture meters available from eBay and similar outlets. These measure the voltage created between two electrodes of different materials when the probe is inserted into wet soil. Unfortunately, these electrodes quickly oxidise, giving false readings. This design uses a capacitive moisture probe which is shielded from the environment with a protective coating. It does not suffer from the disadvantage of the cheap probes. These probes are readily available on eBay. They are advertised as containing a 3.3V onboard regulator, but I found that on mine, it was replaced with a wire link. They seem to work fine regardless of that. The probe is connected to a PIC32MX170F256B-50I/SP microprocessor programmed with the Micromite software. The micro drives a 1.8-inch (45mm) diagonal TFT ST7735S-based LCD module with 128 x 160 pixels. 104 Silicon Chip A pushbutton activates the moisture meter which capacitively measures the proportion of water in the soil, from 0% (bone dry) to 100% (saturated). The result is displayed on the LCD screen. The unit switches off automatically eight seconds later. It’s powered from a standard 9V battery, and the battery voltage is monitored and a warning displayed when the battery level gets low. So that the battery lasts a long time, the unit is completely powered down when off. Pressing the button attached via CON3 forward biases the base-emitter junction of NPN transistor Q1, which sinks current from PNP transistor Q2. Q2 supplies current from the 9V battery to the inputs of regulators REG1 (3.3V, powering IC1) and REG2 (5V, powering the LCD screen & sensor). When IC1 boots up, it brings its RA0 digital output (pin 2) high, holding Q1 and thus Q2 on, so power continues to flow after the pushbutton is Australia's electronics magazine released. After displaying the reading for eight seconds, IC1 brings its pin 2 low, switching off Q1 & Q2 and thus powering the whole unit down. Getting a reading from the sensor is simple. It produces a voltage at its Vout terminal that’s proportional to the soil moisture content. The 100kW resistor to ground ensures this voltage stays within the 0-3.3V range that IC1 can handle. This is converted to a digital value by IC1 using its internal analog-to-digital converter and the pin 4 analog input (AN2). Analog input AN3 at pin 5 is used to sense the 5V supply rail voltage to determine when the battery is low. That’s because the battery can power the circuit as long as the 5V rail can be regulated. Once this rail starts to drop compared to the 3.3V rail (which will not sag as readily), the unit determines that the battery is exhausted. The display is connected using the SPI interface of the microprocessor and the backlight is powered via a siliconchip.com.au 100-120W resistor. The backlight takes a significant proportion of the overall current, thus this range of values is a compromise between display readability and battery life. In an indoor setting, this value could be increased significantly. To fit the probe into the 3D printed case, I desoldered the plug and soldered wires directly to the probe. I then fixed it to the case using hot melt glue. On the first prototype (pictured), the probe was mounted component side down, but the case is now designed for the opposite orientation. On the two prototypes, the start pushbutton was protected from moisture by repurposing a section of the rubber overlay from a multi-button keypad. Software & calibration The ST7735 LCD display driver was written and is maintained by Peter Mather on The Back Shed forum. This must be loaded into the Micromite first, then saved as a library. To do this, load “moisturelib.bas” into Musical bicycle horn Human powered vehicle racing in Australia generally requires an “electronic warning device” to be fitted to each vehicle to be used when overtaking. Usually, a piezo siren is used, but those are boring! This design uses a piezo siren to play simple tunes, and with the right software, it can also act as a very loud MIDI synthesiser. The horn is powered by two AAA cells and is controlled by an Arduino Nano. Its circuit is shown in Fig.1. Sound is generated by a piezo transducer salvaged from an old smoke alarm. In general, the older the smoke alarm, the larger the piezo diameter siliconchip.com.au the Micromite and then type “library save”. Next, load “moisture.bas”. The Micromite will need to be reset before the first time it is run so the display driver is initialised. After that, the software will run automatically. Calibration is straightforward. Short the pins of CON5, then press the start button until the display says “Reset”, then release it. Remove the short from CON5, then power the unit up with a completely dry probe. Wait until the display switches off, then submerge the probe in water and power it back up again. Keep it submerged until it switches off. The prototype is housed in a custom 3D-printed case. The STL files and Micromite BASIC software code are available to download: siliconchip. com.au/Shop/6/6232 Editor’s note: a BC547 can be used for Q1 and a BC639 for Q2 if you have trouble finding the recommended ones. Kenneth Horton, Woolston, UK. ($120) The moisture meter in its 3D-printed case. Once calibrated, the unit displays the moisture content of the soil that the probe is inserted into as soon as the start button (on top) is pressed. It will then automatically switch off after eight seconds. and thus lower the resonant frequency, hence better performance for lower notes. The best transducers are separate from the smoke alarm case so that a separate resonance chamber does not need to be created. To generate a high voltage for the piezo to be loud enough, a two-stage system is used. One stage boosts the battery voltage to an intermediate level, and the second stage drives the transducer. This is inspired by but implemented differently from the Hornit bike horn. The first stage uses a PWM signal generated by the Arduino to switch Q1 on and off at 62.5kHz, drawing current through L1 so that when Q1 is switched off, the voltage across Q1 rises above the supply voltage. This forward-biases diode D1 and charges the 47μF capacitor. As there is no feedback, zener diode ZD1 clamps the maximum voltage to 22V for safety. The second stage consists of autotransformer L2, designed for piezo sirens and some smoke alarms, pulsed by Q2 to generate each note. The autotransformer has an approximate inductance of 3mH on the primary and 90mH on the secondary, and produces over 100V peak-to-peak for driving the transducer depending on the frequency. The autotransformer is the hardest part to source. I found the easiest Australia's electronics magazine February 2022  105