Abstract: The system design of a simple AC digital voltmeter is described. The system takes MSP430F448 as the core. The microcontroller integrates a 12-bit A/D converter. The converter has the characteristics of internal reference source, sample and hold, and automatic scanning, which greatly simplifies the hardware design. Because the internal interrupt resources of the single-chip microcomputer are abundant, the voltage conversion and timing are all triggered by interrupts, which reduces the system response time and improves the software execution efficiency. In addition, the liquid crystal driving capability of the single-chip microcomputer can reach 160 segments, and the A/D conversion data can be directly displayed on the LCD.
The MSP430F44x series is an ultra-low power consumption 16-bit single-chip microcomputer introduced by TI, with fast operation speed and small size. The chip integrates 8-channel 12-bit A/D, serial communication interface, watchdog timer, comparator, hardware multiplier and other peripheral equipment modules, thereby reducing the complexity of the application Circuit and improving the reliability of the system. The chip can work under two voltages, 2.5 V and 3.3 V, and can be in a dormant state. At this time, the frequency is only 32768 Hz, the power consumption is very low, and the ambient temperature range is -40~+125 ℃. These advantages are very suitable for the design of portable intelligent instrumentation equipment that requires continuous work for a long time and wide environmental temperature changes. MSP430F44x series single-chip microcomputer has the incomparable advantages of other single-chip microcomputers, and it is a good design scheme to use it to measure the AC voltage.
1 Overall design of the system
The system is mainly composed of the following four modules: central processing unit, power supply circuit, voltage polarity conversion circuit and Display circuit.
In order to ensure the versatility of hardware circuit design, the method of single-stage voltage measurement is adopted, and the input bipolar voltage is converted into a single-stage voltage for measurement. Then the converted voltage is sent to the A/D analog channel of the single-chip microcomputer for analog-to-digital conversion, and finally the converted digital signal is displayed on the LCD liquid crystal. System design block diagram shown in Figure 1.
Figure 1 System design block diagram
2 System hardware design
2.1 Voltage polarity conversion circuit
It can be obtained from the circuit in Figure 2 that first, the 220 V AC voltage is reduced to 8 V AC voltage through the transformer, and then the bipolar AC voltage is converted into a unipolar AC voltage through the polarity conversion circuit. The R405 potentiometer in the circuit is mainly used to adjust the reference voltage, and the R404 potentiometer is used to adjust the amplitude of the AC input voltage. After the processing of the above circuit, the input AC voltage can be converted into a single-stage AC voltage of 0~3 V, so that it is easy to use the A/D conversion channel that comes with the MSP430 single-chip microcomputer for analog quantity acquisition, so as to realize the measurement of AC voltage. . Among them, the polarity conversion circuit is mainly realized by the amplifying circuit, and here I use the MCP601 amplifying chip.
Figure 2 Voltage polarity conversion circuit
2.2 Power circuit
Use battery to supply power to the system. Since MSP430 series has built-in analog power supply and analog ground, it is necessary to convert analog power supply and digital power supply to supply power to the chip. Then the battery power is converted into a power supply of about 3V to power the system. The specific circuit is shown in Figure 3.
Figure 3 Power supply circuit
2.3 A/D conversion, output Display circuit and JTAG interface circuit
A/D conversion uses analog input channel A0, LCD display uses S0 to S20, and uses 4MUX mode. The analog signal required by the liquid crystal is generated by an external equivalent resistor. The specific circuit is shown in Figure 4.
Figure 4 A/D, LCD, JTAG circuit
3 System software design
For AC acquisition, 40 points need to be acquired in one working cycle, that is, the time interval is 500 μs, and the time interval is realized by a timer.
Figure 5 Program flow chart
3.1 Sampling, A/D conversion subroutine
3.2 Display subroutine
4 Analysis of test results
The circuit test results are shown in Table 1.
Table 1 Circuit test results
Through the analysis of the above results, the measurement accuracy is a bit low and the error is large when measuring higher values. However, when the value is small, the measurement accuracy is very high. The disadvantage is that the peripheral voltage divider circuit of this design achieves the voltage divider effect by adjusting the potentiometer. The actual circuit is greatly affected by factors such as the voltage source, and the effect will be changed due to the difference in the voltage value. .
The program in the text is compiled and run through MSP430 development tool IAR EmbeddedWorkbench. A simple circuit was made in the laboratory, and the program was downloaded to the circuit board for operation. It was found that this circuit could achieve the function of measuring AC voltage, but further improvement was needed in terms of accuracy.