RCL detection device based on 52 single-chip microcomputer
1 Introduction
For the measurement of relevant parameter values of unknown electronic components, people often use various instruments and build various corresponding circuits to perform corresponding test conversions [1], so as to measure the specific values of the components.
In the process of circuit design and troubleshooting, it is often necessary to measure the values of components such as resistance, capacitance, and inductance [2]. Generally, instruments such as multimeters and oscilloscopes are used for measurement, or some external circuits are designed for auxiliary measurement [3]. The component values measured by these methods often have large errors and poor stability, and the process may be cumbersome, expensive, time-consuming and labor-intensive. Based on such an application background, it is of great practical value to design a more accurate, stable and inexpensive intelligent detection device for capacitance and inductance.
2 System Design and Analysis
2.1 Hardware Circuit Design
(1) RC Oscillator Circuit
This design is a circuit constructed with a 555 timer to realize the conversion of the resistance and capacitance values. The construction rules of the multivibrator circuit are certain [8]. We only need to replace the positions of R2 and C with the resistance and capacitance to be measured, respectively. In this way, we can find the calculation formula of the resistance and capacitance to be measured according to a certain calculation formula. Using the resonant circuit shown in the figure below, replace the position of Rx with the R to be measured. The R to be measured and the related devices form a new multivibrator circuit. This circuit can output a square wave signal sequence with a certain frequency at the output port of the 555 chip. After the signal conversion, the pulse sequence is used as the input of the microcontroller T1 counter to enter the microcontroller. In this way, the counter can obtain the value of the measured resistance after a certain calculation.

For the measurement of capacitance, the positions of the capacitor and resistor in the resonant circuit remain unchanged. Therefore, we only need to replace the capacitor to be measured with the position of Cx to form a new resonant circuit. This resonant circuit will also output a square wave signal with a certain frequency at the output end.
In this resonant circuit, the relevant formula of the resonant circuit can also output a square wave signal sequence with a certain frequency at the output port of the 555 chip. After the signal is processed and converted, it enters the single-chip microcomputer through the input port of T1. After the corresponding software algorithm is calculated, the corresponding capacitance value to be measured can be obtained.
(2) Capacitor three-point oscillation circuit
For inductance, a three-point oscillation circuit composed of inductor, capacitor and transistor can be used to convert the inductance parameter to be measured into an oscillation frequency f2, and then sent to the single-chip microcomputer after processing. After a certain calculation function of the software program, it is converted into the value of the inductance to be measured, and then output on the display screen. The specific principle is shown in the figure below:

replace the position of the inductor L with the inductor we need to measure. After the conversion of this circuit, only the relevant parameters are changed, so after the replacement, it is still a capacitor three-point oscillation circuit. At the output end of this circuit, a sequence of signals with a certain frequency will be obtained. The sequence is first input into 74132 for logical conversion. Because the signal output by the LC oscillation circuit is an irregular signal that is approximately sinusoidal, it cannot be accurately identified and calculated directly into the single-chip microcomputer, so it is necessary to use the 74132 chip to perform logical superposition and convert it into a square wave signal. The processed signal is then input into the T1 timer/counter of the single-chip microcomputer after the data selector. After the corresponding software calculation, the measured inductance value is obtained.