This design uses the STM32F103 microcontroller as the control core, and uses the capacitance sensor FDC2214 to detect the capacitance of the capacitor composed of two electrode plates in real time. The fitting algorithm is used to calculate the number of papers corresponding to the capacitance value in sections. At the same time, the paper quantity test results are displayed on the OLED LCD screen has the characteristics of high accuracy, simple structure and low production cost. The STM32C8T6 microcontroller is selected as the microprocessor for control. The STM32 microcontroller has fast data processing speed, rich functions, and a relatively simple interface. Using TI's FDC2214. The FDC2214 capacitive sensing is suitable for applications ranging from proximity detection. It has high resolution and is suitable for the detection of small signals and high-frequency signals. It is a low-power, low-cost non-contact sensing technology. OLED is used as the display module. OLED is self-luminous, does not require a backlight, has high contrast, is thin, has a wide viewing angle, and has fast response speed. It is suitable for IIC and SPI communication methods.
The frequency of the FDC2214 sensor is expressed as: Connect an inductor and capacitor to the input end of each detection channel of the chip to form an LC circuit. A typical choice is a 18uH shielded SMD inductor in parallel with a 33pF capacitor. The measured capacitance sensing end is connected to the LC circuit, which will generate an oscillation frequency, and the measured capacitance value can be calculated based on the frequency value. The FDC2214 sensor frequency is expressed as: where: DATAx: the conversion result of the DATA_CHx register; fREFX: the reference frequency of channel x; the data output (DATAx) of FDC2214 is expressed as: The sensing capacitance measured by the FDC2214 sensor is expressed as: changing the plate spacing, resulting in The capacitance value between the plates changes, which causes the LC circuit oscillation frequency to change. According to the frequency value, the raw data of the sensor between the parallel plates can be known. We measured the corresponding capacitance values of 40 pieces of paper and used matlab curve fitting to generate a curve. However, in the actual process, we found that many values were not on this curve, so we used piecewise fitting, 1-10 is an interval, 11-20 is an interval, 21 to 30 is an interval, and 31 to 40 is an interval. It is found that using this method can make the points all on this fitting curve, and the accuracy rate is 100%. 0-40 direct fitting result curves:
The result curve after our piecewise fitting: 0-10
11-20
21-30
31-40
Continuously sample N times (N =30), find the maximum and minimum values of the N sample values, and sum the N sample values. Subtract the maximum and minimum values from the summation result and average it. This method can effectively overcome fluctuation interference caused by accidental factors, and has a good filtering effect on measured parameters when measuring paper thickness is subject to greater external interference.
We perform curve fitting by measuring the corresponding capacitance value and the corresponding number of sheets multiple times, and taking the average value as the benchmark value.
1. Interference from the external environment to the LC oscillation frequency. External electromagnetic waves, static electricity, etc. will cause interference to the sensor frequency, causing the theoretically analyzed frequency to be different from the actual frequency. There is an error in the read data, and a shielding device needs to be added to reduce the error.
2. The quality factor of the inductor is too low. The inductor produces different self-resonant signals at different frequencies. If the quality factor is too low, it will affect the value of the inductor and cause errors. Using an inductor with a high quality factor can reduce this error.
3. The parallel plates are not pressed tightly, or the weight is not in the middle, causing one side to tilt up. As a result, there is too much air gap between the parallel plates, which will affect the dielectric constant between the two plates, causing the capacitance value to be affected by the medium. The influence of electrical constants produces errors.
Video link
https://www.bilibili.com/video/BV15p4y1b7NF?share_source=copy_web
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet