Start planning my 2024 micro:bit basic programming guide Input Function Set (Special Analysis)12
FiveAnalysis of the inconsistency between the analog reference voltage and the supply voltage
In the analog input function of the micro:bit motherboard, we designed an analog output simulator powered by the power supply of the micro:bit motherboard, and the power supply voltage standard is 33v。That is, the simulator output voltage is 0 32v. Connect it to the collection port of the micro:bit motherboard, and the measured maximum is 3The digital value of the 2V voltage is 1017. The ADC conversion standard for micro:bit motherboards is 0 1024 digital values. This illustrates 3A 2V supply voltage is not the maximum sample voltage for an ADC analog-to-digital converter. Why is this happening?
AD conversion, also known as analog-to-digital conversion, refers to the process of converting a continuously varying analog signal into a discrete digital signal. Specifically, it converts an analog voltage signal within a certain range into a discrete digital numerical signal with a stepped gradient level within a certain range. We can use the relationship between the length on the scale and the scale to describe the conversion relationship between analog and digital quantities.
Take a distance of 10 centimeters as an example, and describe each point on the scale in terms of analog quantities, which can be 1cm, 2cm, 3cm, 15cm,1.15cm and other values. If there are 10 scale marks on the scale, then these 10 marks represent 1cm, 2cm, 3cm and 10cm. The concept of numeric values is numeric values such as 0, 1, 2, 3 to 10. The distance between each number is equally divided, and the meaning of each number is 1 for 1 cm and 10 for 10 cm. A number is something that a computer system can recognize. In this way, the process of converting analog information in the real world to digital information in the computer system is completed. The other lengths between each number cannot be expressed and described by a computer in the form of a numerical value.
If you want to describe the length between numbers in a more granular way, you need to mark more and more specific scales in the same length distance. For example, if 100 scales are marked in a length of 10cm, then in the scale expression of digital values, 1 represents 1mm, 2 represents 2mm, and 100 represents 100mm, which is 10cm. The length represented between two adjacent numbers is 1 mm.
If there are 1000 ticks, 1 means 01mm, 1000 for 10cm. The scale mark on the scale can be understood as the digital discrete value of the analog length after the digitization conversion. The length represented between two discrete values, that is, the minimum distance length that can be expressed after the length information is digitized by the computer, that is, the digitized numerical accuracy of the length.
As mentioned above, in a computer system, the voltage range of analog measurement is equivalent to the length of the scale. The digital quantity is the "scale" in the analog voltage range. As for how many ticks are needed, that is, how many equal quantities are divided. The voltage range represented by each of these is the accuracy of the digital value of that voltage after digitization. Take the analog voltage 5V as an example, divide it into 5 parts, and the digital content is 0, 1, 2, 3, 4, five values. The "distance" between two adjacent values is 1V, so the voltage accuracy expressed by the digital value is 1V.
If it is divided into 50 parts, the numerical content is 0, 1, 2, 3 ,..., 49,50 values. The difference between adjacent terms is 01V, that is, the accuracy is 01v。Converted to a percentage, that's two percent accuracy. If it is divided into 1,000 parts, then the accuracy is 1 thousandth.
So, according to our normal understanding of AD conversion, the analog-to-digital relationship of the micro:bit motherboard, the analog voltage range is 0 32V, the digital value is between 0 1023. The accuracy is about 1 in 1,000 (actually 1 in 1024). In the actual test, the analog voltage reached 3When the 2V supply voltage is standard, the digital value is 1017, which does not reach the maximum digital value. This illustrates the power supply of 3The 2V voltage is not the analog voltage range for AD conversion. The value standard of the analog voltage is not determined by the voltage of the power supply.
Shown in the figure is a schematic diagram of the analog-to-digital conversion of an AD converter. It mainly shows how the reference voltage of the AD module is selected. The reference voltage is a standard one, which represents the range of analog voltages in AD converters, i.e., the 0 VREF voltage range. Therefore, in the ADC circuit, the voltage value of VREF must be a standard voltage source with high accuracy and stability.
During the operation of the ADC module, the VREF value should always be consistent and stable, and there should be no repeated changes. Therefore, it is particularly important for VREF to select which part of the voltage value in the circuit is used as the reference voltage value. Because the fluctuation of VREF voltage will inevitably bring about changes in the analog voltage range, and the stability of VREF directly determines the stability and accuracy of digital values after AD conversion.
The choice of VREF voltage must be the part of the circuit where the relative voltage is stable and changes the least. Therefore, the power supply part of the circuit is usually selected as the VREF reference voltage. The design of modern regulated power supply technology is relatively mature, and in terms of circuit power supply, the stability of the power supply voltage is very good, and the fluctuation change is also very small. In general applications, the requirements for use can be basically met. Therefore, in many designs, we usually equate the supply voltage with the VREF reference voltage of the ADC converter.
The disadvantage is that when the original power supply terminal voltage of the power supply is insufficient (does not meet the use specifications), it will also lead to the instability of the output power supply voltage of the regulated power supply, which will affect the stability of VREF. Especially when the original power supply is powered by the battery, with the fluctuation of battery power consumption, it has an increasing impact on the stable voltage of VREF, which affects the accuracy of AD conversion and the acquisition accuracy of various analog data information.
The best way to solve these problems is to use a stand-alone reference module. A voltage reference is a hardware module designed to provide a stable reference voltage. Therefore, its output voltage has the characteristics of high precision, good stability and strong anti-interference ability. Even in the case of unstable supply voltage, a stable reference voltage value can still be provided. This ensures the accuracy of the data of the ADC converter during AD conversion under various conditions.
At the same time, the voltage standard selection of VREF is not necessarily related to the voltage standard of the power supply. It also breaks down our habitual and general understanding that the VREF must be the mains voltage or not higher than the mains voltage. In the test of the micro:bit motherboard, you can see that the voltage of the VREF (335v) should be slightly higher than (3.).2v) Motherboard supply voltage. And in other circuit design, it is also useful3A 3V power supply device is used to measure and collect analog information over the 5V range.
Therefore, whether it is a stand-alone ADC module or a variety of CPU on-chip ADC modules, the voltage standard of VREF is not necessarily related to the supply voltage. You can choose a standard that is lower than the supply voltage, or it can be equal to or higher than the supply voltage. The AD conversion of the ADC module is aimed at the digital conversion of the VREF voltage, which has nothing to do with the communication voltage specification of the output digital signal information, that is, it has nothing to do with the working voltage standard of the ADC module.