0 Introduction
The peak value of AC voltage refers to the maximum value (positive peak value) or minimum value (negative peak value) of AC voltage, which is a very important parameter in the industrial production process. In order to ensure the safety of electrical equipment, it is of great significance to detect the peak value of the power supply voltage. The main methods for measuring the peak value are oscilloscope method, indirect calculation method, and special peak meter method. Although the oscilloscope can intuitively display the waveform and peak value of the voltage, the oscilloscope cannot be used as a field monitoring device in terms of cost and portability; the indirect calculation method is only applicable to standard sine waves and is not very practical; most special peak meters have the disadvantages of being large in size, inconvenient to carry, and inconvenient to connect to computers or control devices. In view of the above shortcomings, the MSP430 series microcontroller, MAX1270 analog/digital converter, and Modbus-RTU protocol are used to successfully develop a low-cost, portable, and intelligent peak meter device.
1 Measurement principle
Due to the fluctuation of the power supply grid and the fact that the voltage waveform of the grid is a non-standard sine wave, its peak value cannot be indirectly calculated by the average value or effective value. The system adopts multiple sampling of the non-standard sine wave in one cycle, and compares the sampling values by the bubble method to obtain the maximum or minimum value of the voltage as its positive peak value and negative peak value. Obviously, as long as the sampling density is appropriate, the true voltage peak value can be obtained. The frequency of alternating current in my country is 50 Hz, and the sampling frequency is set to 10 kHz in the design, that is, 200 samples are sampled in each AC waveform cycle, which is enough to correctly reflect the voltage change and thus determine the voltage peak value.
2 Hardware Design
In the design, MSP430F449 single-chip microcomputer and MAX1270 analog/digital converter are the main components. The front-end A/D input uses a resistor voltage divider to reduce the voltage of the AC power; RS 485 chip is used as the communication interface chip. The hardware block diagram is shown in Figure 1.
2.1 A/D input conditioning protection circuit design
Taking 220 V AC as an example, its theoretical peak voltage is 311 V, but considering the fluctuation of the power grid, sine wave distortion, etc., the voltage peak is likely to exceed 311 V. At this time, a voltage value can be selected as the maximum value that the voltage may reach based on work experience and actual measurement conditions, assuming it is 500 V. If the input range of MAX1270 is set to ±5 V, the voltage divider ratio of the voltage divider resistor should be set to 100:1. The divided voltage is buffered by the op amp and used as the input of the A/D chip. In order to protect the subsequent A/D conversion chip, two voltage regulator diodes are set to form a limiting circuit. The input conditioning circuit is shown in Figure 2.
2.2 A/D conversion circuit
The A/D conversion circuit uses the MAX1270 chip, which is an 8-channel, multi-range bipolar input, serial output, successive approximation 12-bit A/D converter with a maximum sampling rate of 110 kS/s. Under a single +5 V power supply, it can be programmed to achieve ±5 V, ±10 V, 5 V, and 10 V ranges. Among them, the bipolar input is very suitable for AC voltage measurement.
The MAX1270 conversion circuit is shown in Figure 2. The serial interface of the MAX1270 is controlled by the I/O port line of the MSP430F449. Since the MAX1270 outputs a high level of more than 4.5 V under a 5 V voltage supply, and the I/O port level of the MSP430F449 is 3.3 V, an interface chip must be added to achieve a 5-3.3 V level conversion. Here, the MAX3001 bidirectional level conversion chip is used. The A/D conversion circuit is shown in Figure 3.
2.3 RS 485 interface circuit
This design uses RS 485 bus, which can effectively transmit signals thousands of meters through cables or optical fibers. With Modbus-RTU protocol, it can be easily connected to control devices that comply with Modbus-RTU protocol. The design uses MAX3485 chip as RS 485 interface chip, and the circuit is shown in Figure 4.
[page]
3 Software Design
In the design, the main software modules include A/D conversion, Modbus-RTU protocol and serial port programming. Serial port programming is not described in detail, and the main focus is on MAX1270 and Modbus-RTU protocol.
3.1 MAX1270 Programming
The control word format of MAX1270 is shown in Table 1. The highest START is the start bit, which is kept as "1"; SEL2~SEL0 are input channel selection bits; RNG and BIP are range and polarity selection bits respectively; PD1 and PD0 are power-down and clock mode selection bits. Please refer to the MAX1270 data sheet for the specific meaning of each bit. In this design, MAX1270 is set to: range 10 V, bipolar input (i.e., ±5 V measurement), external clock 25 CLK/s normal operation mode, channel CH0 is used as the input channel, and the control word format is 10000101.
3.2 Modbus-RTU protocol
Modbus protocol is a universal language used in electronic controllers. Through this protocol, controllers can communicate with each other, controllers via networks (such as Ethernet) and other devices. Modbus-RTU is a transmission mode of Modbus protocol. In this mode, each 8-bit in the message contains 2 4-bit hexadecimal characters. The core program of Modbus protocol is the writing of CRC check program. The CRC-16 check method is used in this system, and the specific program implementation is as follows: [page]
3.3 Other important subroutines
The program uses a timer interrupt to trigger each sampling to ensure the accuracy of the acquisition cycle. At the same time, the zero point is used as the start of data acquisition each time. Both of these points are conducive to improving system accuracy.
4 Test Results
By applying standard sine wave, non-standard sine wave and triangle wave test, the peak measurement accuracy of the meter can be higher than level 1, which fully meets the needs of industrial field equipment power supply detection. The meter works well with the industrial control configuration software MCGS. In addition, in addition to measuring the peak value, the meter also expands the calculation of the voltage average value and effective value, and is designed as a multi-functional intelligent meter.
5 Conclusion
The design uses MSP430F449 microcontroller and MAX1270 as the core, and writes Modbus-RTU protocol. At the same time, the RS 485 interface can be used to easily transmit data remotely or connect to devices that comply with the Modbus_RTU protocol. The meter is small in size and low in power consumption. It can be powered by batteries or storage batteries. It is very suitable as a portable device that can be carried around. It can also be directly installed as a functional module in industrial field equipment to monitor parameters such as the peak value and effective value of the power supply voltage of the power grid.
References:
[1]. MSP430F449 datasheet http://www.dzsc.com/datasheet/MSP430F449_3.html.
[2]. MAX1270 datasheet http://www.dzsc.com/datasheet/MAX1270+_719122.html.
[3]. MSP430 datasheet http://www.dzsc.com/datasheet/MSP430_490166.html.
[4]. MAX3485 datasheet http://www.dzsc.com/datasheet/MAX3485_858685.html.
Previous article:Low-power design and testing of handheld RFID readers
Next article:Key application issues and solutions for micro energy harvesting technology
Recommended ReadingLatest update time:2024-11-23 08:14
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Phase compensation of op amps
- Who are the talented people who are leading the industry research in various fields of electrical engineering?
- Internals of the BME280 sensor
- Amplifier Circuit
- Static Timing Analysis and Logic
- I would like to ask if there is a PDF of the fourth edition of "The Definitive Guide to Operational Amplifiers"
- I need help from you guys, I need a chip that can boost 5V to 36V, thank you
- [Flower carving DIY] Interesting and fun music visualization series of small projects (15) - horizontal LED square tube lights
- TI - Improving the design of smart speakers
- Analysis of typical problems in the development of ARM+DSP dual-core architecture