2.1. Instrument Design
The equipment development mainly includes a detection probe, temperature acquisition circuit, live tree trunk moisture content signal detection circuit, keypad circuit, LCD display circuit, power supply, voltage regulator circuit, microcontroller minimum system, and software system; the system framework is shown in
Figure 2.
The two searching units of the detection probe are equated into a parallel pole plate capacitor [
12,
13]. The parallel pole plate capacitor consists of a probe, a shell, and a fixed block. The distance between the two probes is 10 mm. The probe is made of a purple copper rod (Carnation Copper Industry Copper Material Manufacturers, Wenzhou, China) with a diameter of 2 mm and a length of 40 mm. There are 10 mm left in the shell for fixing, and the outer shell is made of an industrial high polymer heat shrink tube (Okes Wire and Cable Company, Dongguan, China), which is fixed on the probe after hot processing. The fixed block is machined from a mold and glued to the sensor using a hot melt adhesive. Wood between the pole plates of the capacitor is used as the dielectric. Different dielectric water rates lead to different dielectric constants, which in turn cause changes in capacitance between the parallel pole plates of the capacitor. The capacitance is calculated as
where
C is capacitance,
is relative permittivity of the medium between the plates,
S is area of the parallel plates (unit: m2),
k is electrostatic constant (k = 8.9880 × 109, unit: Nm2/C2),
d is vertical distance between the two plates (unit: m).
The detection probe constituting the capacitor serves as detection input
Ci; the water content signal detection circuit uses a 555 multi-harmonic oscillation circuit (Limao Electronic Technology Company, Shenzhen, China), as shown in
Figure 3. In the non-stationary mode of operation, the 555 multi-harmonic oscillation circuit outputs a continuous, frequency-specific electromagnetic wave [
14]. The frequency of the output electromagnetic wave is determined by
R1,
R2, and
Ci. The formula for calculating electromagnetic wave frequency is as follows:
where
T is electromagnetic wave frequency (unit: Hz),
R1 and R2 are resistance of the circuit (unit: Ω),
Ci is changing capacitance between the parallel poles (unit: F). Duty cycle is determined by R1 and R2.
In the testing process, direct measurement of capacitance values is more complicated [
15,
16,
17]. A frequency of the output electromagnetic wave is used to indirectly characterize the change in capacitance due to the measurability of the electromagnetic wave frequency of the 555 multi-harmonic oscillation circuit. To facilitate calculation, the inverse of electromagnetic wave frequency, i.e., the electromagnetic wave period, is used to complete the entire test verification process. Changes in wood moisture content lead to variations in the dielectric constant and, consequently, alterations in the electromagnetic wave of the multi-harmonic oscillation circuit. The moisture content signal from the measured live wood trunk is collected by detection probe and converted into an electromagnetic wave periodic analog signal through a moisture content signal detection circuit. The analog signal is converted into a digital signal through the modular (A/D) converter of a minimum system of a single chip microcomputer. The STM32F103VET6 (Xintai Electronics, Shenzhen, China) is the microcomputer, and a series of functions, such as multi-resonant circuit output signal measurement, temperature signal processing, key selection measurement mode, calibration formula input and modification, zero calibration, and serial communication, are realized in the burning program using the 12-bit AD converter of STM32. A digital signal is put into the moisture content calculation formula to calculate real moisture content of the live wood trunk, and the final result is displayed on a Liquid Crystal Display (LCD) screen.
The uneven surface of the bark and different sizes of tree diameters directly influence the insertion process of two searching units’ detection probes. In order to ensure that the probe can be easily inserted into the live standing wood, and to reduce the interference of the magnetic field on the detection circuit, the material used for the detection probe was selected with a certain toughness and stiffness of purple copper T2. To prevent short circuiting during insertion, an insulation layer cover was used. The temperature detection circuit sensor utilizes a DS18B20 chip, externally powered, with advantages including high system accuracy, strong resolution, and good anti-interference performance [
18]. The key part uses three independent keys, RESET, Key0, and Key1, which occupy three IO ports, WK UP, KEY0, and KEY1 of the microcomputer, respectively, whereas RESET (WK UP) controls the reset of the microcomputer, and the other two (KEY0, KEY1) are mode selection keys, which can enter a selection state by long press.
Figure 4 shows key schematics of this design. For the modular design of the LCD display, a 2.4 inch TFT LCD display is integrated into the dedicated interface of the microcontroller minimum system board, with required registers configured and initialized.
Firstly, the main program design involves initializing internal resources, such as an analog to digital converter (ADC) conversion module and clock configuration of the microcontroller and peripheral modules, such as a keypad module and LCD display, and the user selects the appropriate mode according to the detected tree species. Each tree species corresponds to a specific fitting equation, and the fitting equation is written into the subroutine corresponding to each keypad. In each processing cycle, the detected signal is substituted into the fitting equation to derive the water content value, which is then displayed on the LCD screen.
Next is the interrupt program design. The moisture content signal is collected by detection probe and processed through detection circuit, resulting in a periodic electromagnetic wave signal. Secondly, frequency is determined by measuring the number of falling edges of the electromagnetic wave within a unit time, followed by the calculation of the electromagnetic wave period. When the falling edge of electromagnetic wave signal is generated, the external interrupt service is triggered, leading to the entry into the external interrupt program. Upon the occurrence of a falling edge in the electromagnetic wave, the variable of “times” is incremented. When the time “t” reaches 1 s, the timer’s interrupt service is triggered, initiating the entry into the timer interrupt program. The value of the variable “times” is then assigned to the variable of ”last times”, the variable of “times” is cleared to zero, and the total number of falling edges of the electromagnetic wave within a 1 s interval is recorded. Exiting the interrupt program, the system re-enters the main program to proceed with the next 1 s timer interrupt process. The value of “last times” can be used to calculate the frequency of the electromagnetic wave, and then calculate the period of the electromagnetic wave.
The experimental data obtained after A/D conversion will have certain errors, and data collected by the microcontroller need to be optimized to reduce errors brought by the experiment and outside world, and to improve detection accuracy. The data collected within 1 s are arranged from smallest to largest by comparing them one by one, and are stored in an array for easy recall, as follows:
remove the first four numbers and last four numbers of experimental data and rearrange the entire array as follows:
The error caused by the experimental interference can be eliminated by removing extreme values. In addition, noise inevitably interferes with the circuit during the testing process. In order reduce this unavoidable global error, the method of averaging data is used for filtering processing, and, finally, the data are stored in a defined variable.
2.3. Instrument Verification
To verify reliability of the measuring instrument, the instrument was first calibrated in a laboratory, including using the distilled water medium test and the wood medium test, and the experimentally fitted relationship equation of the electromagnetic wave period and water content was imported into the microcontroller of a detector. Then the instrument was field tested in an experimental forestry field in Liangshui, Yichun. The equipment measurement procedure is as follows: 30 basswood trees and 15 fir trees were randomly selected, and the bark was peeled at a height of 1 m from the ground. A small electric hand drill is used to drill two parallel small holes with a diameter of 3 mm and a depth of 4 cm in the vertical direction (1 cm apart). A small hole of the same size is drilled with a growth cone next to the lower hole, and the sapwood sample (wood core) is taken out and weighed with an electronic balance (to record the total weight of the wood core) and bagged for use. The device is inserted into the tree, with a wait time of 30 s to 1 min, until the data no longer fluctuate; reading and recording the input square wave period is obtained by the water content detector.
Figure 5 shows the physical diagram of the standing tree moisture content meter, which is divided into the following four parts: searching units, detection circuit, lithium battery, and minimum system board.
Figure 5a shows the front view of the instrument, and
Figure 5b displays the field measurement of the standing tree trunk moisture content meter. The measuring instrument is located 1 m above the ground (the area selected by the red line is the measuring instrument).
According to the principle of the measuring instrument, the period of electromagnetic wave output of the device is affected by moisture content of the wood; a distilled water medium test can be used as a pretest to observe the sensitivity of the test device to water and the degree of influence of the insertion depth change on the period signal, as a blank control for subsequent tests. The distilled water experiment is shown in
Figure 6, and test results are shown in
Figure 6b.
Figure 6b shows that the electromagnetic wave period becomes longer as insertion depth increases. Correlation coefficient R
2 of the fitted curve is as high as 0.99, indicating that the independent variable has a good linear relationship with the dependent variable when testing distilled water media, and the meter has good sensitivity to distilled water. The distilled water medium test can provide a good reference basis for the detection of water content of live tree trunks in the field.