The whole system in the scheme can be powered by a 9V battery, achieving low power consumption and portability. AC measurement is measured by converting AC signals into DC voltage using the AD637 true RMS conversion chip; input voltage conversion is performed using a reverse amplifier with clamp protection, achieving 10MΩ input impedance and high safety. The key components in the circuit use TI's precision operational amplifier OPA07 and instrumentation amplifier INA128 to achieve high-precision measurement; the ADC uses the 12-bit AD built into the STM32f103ZET6 chip to achieve low power consumption and automatic range switching.
0 Introduction
In intelligent instruments, automatic range conversion technology is often used, which enables the instrument to automatically select the most appropriate range in a very short time to achieve high-precision measurement. Automatic range is generally achieved by controlling the attenuation magnification of the input signal. For a voltmeter, its input measurement voltage will be greater than the input range of its AD converter, so its range switching is basically a process of switching the signal attenuation multiple.
1. System overall plan and working principle
The system functional block diagram is shown in Figure 1. The STM32F103ZET6 processor is the core device of this system, which is responsible for controlling the normal operation of the entire system, including reading the results of AD conversion and controlling the 200mV and 2V gears; responding to key input actions; driving the segment LCD; and controlling the automatic range conversion.
The input voltage signal passes through the range conversion module and becomes a voltage that can be normally sampled by the ADC analog input terminal. The function of the AC voltage measurement module is to convert the measured AC voltage into the corresponding RMS value. The function of the key input is to switch between various measurement modes and input values when calculating relative errors.
2. System hardware structure
(1) Power management hardware circuit
This system has a low power consumption mode, that is, if there is no operation for a certain period of time, the system will automatically cut off the working power of a part of the circuit under the control of the single chip microcomputer. The schematic diagram of the power management circuit is shown in Figure 2.
The positive pole of the battery is divided into two paths. The first path is directly connected to the input end of SPX1117. SPX1117 is a three-terminal integrated voltage regulator chip. Its output end outputs a constant 3.3V, which is used as the power supply of the single-chip microcomputer system. The other path is through the transistor 9012, which can be switched on and off. In this design, when the system is in normal working state, the single-chip microcomputer control port outputs a high level, 9011 is in a saturated state, and the base voltage of 9012 is close to the ground voltage. 9012 is saturated, that is, it is in a conducting state. The positive pole voltage of the 9V stacked battery reaches the input end of the 78L05 three-terminal integrated voltage regulator chip, and its output end outputs a stable +5V voltage. -5V is generated by the negative charge pump 7660S. When the system is in a "low power" state, the single-chip microcomputer control port outputs a low level. 9011 is in a cut-off state, the base voltage of 9012 is 9V, and it is also in a cut-off state. The power supply voltage of the analog part is zero. The single-chip microcomputer will always be in different working modes.
(2) AC voltage conversion circuit
The conversion circuit of the true effective value of AC voltage measurement is the key part of measuring AC voltage. The quality of its design directly affects the measurement accuracy of AC voltage signal. In this design, we choose to use AD637 to realize the conversion of AC signal to DC quantity through comparison. The circuit is shown in Figure 3.
AC_IN is the AC voltage input terminal, and DC_OUT outputs a DC voltage signal. The output DC voltage value is the true effective value of the input AC voltage. This circuit completes the conversion from AC to DC. During the experimental test, it was found that the conversion effect for 5000Hz AC signal is still good.
(3) Range conversion circuit
The range conversion of this system is realized by using a single chip microcomputer to control analog switches and relays. The principle block diagram is shown in Figure 4.
After the DC/AC (0-20V) voltage is input, the double-throw switch SW_1 plays the role of voltage range conversion selection. The fixed resistors R1 and R3 form a 10-fold resistance attenuation network with the cooperation of the precision variable resistor R2, and its input resistance is greater than 10M ohms, which meets the input resistance requirements in the question. The maximum input voltage can reach 20V. The microcontroller controls SW-1 to select whether to attenuate. R1 and two IN4001s form a clamping protection circuit to keep the circuit in a safe state when high voltage is input. OP07 forms a voltage follower to isolate the front and rear channels. Its lower output resistance can also improve the load capacity. The output end is connected to the ADC.[page]
(4) Implementation of automatic range switching
The automatic range switching in this system is effective for measuring both DC voltage and AC voltage. The key to automatic range switching is to determine whether the current range is over-range or under-range by reading ADC data. Reasonable hardware design is an important guarantee for automatic range switching. The automatic range conversion flow chart is shown in Figure 5.
Automatic range conversion starts with the initial range setting, and compares step by step until the most suitable range is selected. The operation flow of automatic range conversion is shown in the figure above. There is a short process for the relay or other control switch to change from closed to open, or from open to closed, so a certain time should be delayed after each range change before formal measurement and judgment. In order to avoid possible jumps at the intersection of two ranges, it should also be considered that there is a certain overlap range between the over-range comparison value of the low range and the under-range comparison value of the high range.
3. Software Design
During the data acquisition process, an eighth-order average filter and a first-order lag filter were used to effectively filter out the pulse interference of the sampled data. The program flow chart is shown in Figure 6.
4. System testing and error analysis
(1) System testing method
DC test method: Use a DC regulated power supply to generate a DC voltage signal, observe the actual output DC voltage value through a high-precision multimeter, pass the signal into this system instrument to measure and compare it with the standard voltage value.
AC test method: Use an AC digital signal generator to generate a sinusoidal AC signal with a voltage range of 40~5000HZ and a voltage range of 0~20V. Observe the actual output frequency through an oscilloscope, observe the actual output voltage value through a high-precision digital multimeter, and pass the signal through a DC test method: Use a DC regulated power supply to generate a DC voltage signal, observe the actual output DC voltage value through a high-precision multimeter, and pass the signal through the system instrument to measure and compare with the standard voltage value.
(2) Error analysis
The errors of this system are mainly caused by the constant current source, AD true effective value conversion, dual-integral ADC devices, etc. AD true effective value conversion can convert the measured AC voltage into the corresponding true effective value within the allowable error range, but it is inevitably affected by the ambient temperature, which may cause errors during conversion. When the range is automatically switched, the original micro relay is replaced with a high-voltage analog switch. This can further reduce the power consumption of the system during normal operation, and can also improve the stability, reliability and response speed of the system.
5. Conclusion
This design achieves high-precision measurement of DC voltage and AC voltage, and has the function of automatic range conversion. It uses LCD display and has strong readability. STM32F103ZET6 has excellent performance in speed and power consumption, and its rich peripherals are more convenient for design. In addition, its price is low, and it also has cost advantages, which is suitable for the design of control electronic products. The 12-bit ADC inside STM32F103ZET6 is used in the solution, which not only meets the measurement accuracy, but also eliminates the need for external AD, making the hardware circuit simpler, saving costs and improving reliability.
Previous article:Ten years of experience teach you how to learn embedded systems (based on ARM platform)
Next article:Design of an embedded solar drying real-time monitoring system
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Zibee transparent transmission program development
- June 14th prize live broadcast | TI takes you to experience the interconnected and efficient smart home solutions
- Download the 150,000+ word "RF and Microwave Technology Practical Handbook" for free here! (Internal Gift)
- World clock controlled by NXP LPC845
- EEWORLD University Hall----Live Replay: TI's low-power wireless technology for building automation sensor applications
- What is the difference between TVCC and VCC in ST-LINK V2, with pictures
- Download the NI Practical Guide to Maximizing DC Measurement Performance
- PSRR Measurement of LDO
- [ESP32-Korvo Review] Part 2: Demo Experience + ESP-IDF Compilation Environment Installation
- quartusii official tutorial