When the single-chip microcomputer is used in industrial control, it is often necessary to convert the analog quantity such as current, voltage, temperature, displacement, and rotational speed into digital quantity, and then perform further calculation and processing in the single-chip microcomputer to complete the corresponding data storage, data transmission and data output. To achieve the purpose of analysis and control.
With the continuous development of large-scale integrated circuits, many single-chip microcomputers have built-in A/D modules. Therefore, A/D conversion of single-chip microcomputers can be completed by using built-in A/D modules or external A/D circuits. The working principle, advantages and disadvantages of A/D conversion, and analysis of methods to improve A/D conversion accuracy.
1 A / D conversion works and advantages and disadvantages
(1) A/D conversion in the on-chip A/D conversion The on-chip A/D conversion is to use the built-in A/D module of the single-chip microcomputer to perform A/D conversion by selecting different analog channels. The analog quantity can be directly input to the input pin corresponding to the single chip, and the peripheral circuit is simple. The converted data is directly saved in the on-chip registers for easy data extraction. However, most of the built-in A/D modules of the single-chip microcomputer have only 8 bits and 10 bits, and high-precision A/D conversion cannot be performed. The principle is shown in Figure 1.
(2) A/D conversion of external chip A/D conversion MCU external A/D conversion is a single-chip computer through a certain logic circuit to control the external A / D conversion circuit for A / D conversion, the peripheral circuit is relatively complex. The MCU reads the conversion result into the MCU through a certain timing, and can achieve high-precision A/D conversion (up to 14 bits, 16 bits, 22 bits or even higher) by selecting the A/D conversion circuit as required. as shown in picture 2.
2 Ways to improve A/D conversion accuracy To improve the accuracy of A/D conversion, it is of course possible to use high-precision external A/D converters. Is there any other method? The answer is yes. The following describes several ways to improve the conversion accuracy by using the on-chip A/D conversion module.
1 Take the acquisition voltage as an example. Suppose you need to collect 0.0~400.0 V DC voltage. The reference voltage VREF+ of the A/D module of the MCU is 5.0 V, and VREF- is 0 V. The voltage to be collected is attenuated and becomes 0.0-5.0 V. The connection circuit is shown in Figure 3. Obviously, if the accuracy is 0.1 V, the resolution of the A/D conversion must be less than 1/4000, while the on-chip A/D module is generally 10 bits, and the resolution is only 1/1 024, which is not up to the requirement. Since the analog (O ~ 400V voltage) input is mostly not stable, there will be fluctuations. In order to obtain more accurate data, the data collected multiple times can be accumulated and then averaged (in fact, even if the resolution reaches the required A/) The D conversion is also accumulated and averaged to obtain more stable data). If the 10-bit data collected every certain time interval is Di, taking 64 such data accumulated and then dividing by 16, you can get 12-bit data D, that is,
At this time, the resolution of D is 1/212=1/4 096. In this way, more accurate data is obtained.
However, if the input value of the analog quantity (0-400V voltage) is very stable, the 10-bit data Di collected every time interval is the same, the above method can not meet the requirements.
2 If local high-precision data is to be obtained during the A/D conversion process, for example, to detect the voltage during charging and discharging of the battery, the voltage range is 0 to 18 V, and the general accuracy is 0.02 V, but the user is more concerned about 8~ The voltage of 13 V has an accuracy of 0.01 V within 8 to 13 V. In order to solve this problem, a circuit with the principle shown in Fig. 4 was designed.
The MCU has a built-in 10-bit A/D module. The Ui (0~20 V) voltage is attenuated by R1, R2, and P1 to obtain a voltage of 0~5 V. This voltage is directly sent to the AN1 input port of the single-chip microcomputer, that is, VAN1=Ui/4. . U2A is connected to a subtraction circuit, that is, U2A terminal voltage VU2A1=VAN1-2 V=Ui/4-2 V=(Ui-8 V)/4. U2B is connected to a 4x amplifying circuit, and the voltage of U2B 7 is VU2B7=VU2A&TImes;4=Ui-8 V. The AN2 input is connected in parallel with a 5 V Zener diode to ensure that the microcontroller AN2 can get 0 to 5 V when the input voltage is greater than 8 V.
The MCU first collects the data of AN1, and judges whether the input voltage is between 8 and 13 V through the collected data. If it is not 8 to 13 V, the collected data is the digital quantity corresponding to the analog quantity (U) (D:000H~ 3FFH), the accuracy is 20 V/2010=20 V/1 024≈0.02 V, voltage data U=D&TImes; 0.02 V; if the collected data is between 8 and 13 V, the MCU collects the data of AN2 again, and the acquired data The data plus 8 V is the digital quantity corresponding to the analog quantity (U) (D: 000H ~ 3FFH), the precision is (13-8) V / 210 = 5 V / 1 024 ≈ 0.005 V, voltage data U = 8 V + D&TImes; 0.005 V. In this way, the A/D conversion accuracy between 8 and 13 V is greatly improved.
1, Smart app syncs with fitness apps. You can use the scale even without your phone nearby. The data will sync to the app once it is connected again.
2, 13 Body Composition Analysis. Uses Bioelectric Impedance Analysis technology to track Weight, BMI, Body Fat Percentage, Body Water, Skeletal Muscle, Fat Body Weight, Muscle Mass, Bone Mass, Protein, Basal Metabolism, Visceral Fat, Subcutaneous Fat and Body Age. Considering body composition, it can give you an overview of the indicators percentages and allow you to set easy weight and fat goals.
3, Rechargeable Internal Battery. USB rechargeable function with a built-in lithium battery, no need disposable batteries. A long-lasting and durable battery can be used for a long time.
4, Unlimited Users. One scale for whole family use. Allowing you to track information, record, store profile and make a chart to visualize your trend.
5, High precision sensors measure in increments of 0.2 lb with 396lbs capacity. 4 sensitive electrodes, 6mm tempered glass platform
Bluetooth Scale,Body Weight Scale,Bluetooth Body Fat Scale,Bluetooth Bathroom Scale
Axiswell Technology Co., Ltd , https://www.medhealthycare.com