Design and implementation of DC ripple tester based on STC89C52 single chip microcomputer

Publisher:博雅之士Latest update time:2012-11-08 Source: 21ic Keywords:STC89C52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
In some actual industrial sites, DC voltages with high voltage stability requirements are often used, such as the intelligent charging power supply of the DC battery of the car, etc. However, due to the complex loads in the industrial site, there are many unstable factors that cause the voltage to fluctuate up and down, that is, ripple. In theory, ripple is the AC component in the DC voltage. Its components are relatively complex and pose a certain threat to the power grid system. In order not to affect the normal operation of the load, it is necessary to accurately measure the voltage in real time.
The DC voltage ripple test system designed in this paper has a maximum range of 600 V and an accuracy of 1%. It can meet the application of most DC power occasions and has a certain monitoring effect on some DC power-consuming equipment with higher requirements.

1 System Principle
The overall block diagram of the system is shown in Figure 1.

a.jpg


The test system mainly includes range selection, voltage separation, A/D sampling, data processing and display circuit. The system is divided into six ranges. The main feature is that the range used is automatically switched according to the size of the sampled voltage; secondly, the voltage separation circuit, the system uses an optical coupler to isolate the power supply voltage from the test system to ensure the safety of the measurement.
The working principle is as follows: first, the voltage data must be measured, and the range is automatically selected according to the voltage size. Then, the voltage and ripple are measured separately. For the ripple, it is necessary to collect multiple times to take its average value, and then send it to the single-chip microcomputer for data processing after sampling and conversion through the A/D circuit, and output through the LCD and printer.

2 Hardware Design
The system mainly adopts single-chip microcomputer technology, and the hardware structure includes: data acquisition module, data processing control module (CPU), data output (printer) module, data display (LCD) module, and auxiliary circuit module. The basic structure diagram is shown in Figure 2.

b.jpg [page]

2.1 Measurement of DC voltage and ripple
2.1.1 Voltage measurement
The voltage terminal to be measured and the voltage sensor LV25 are connected to the control system, and the microcontroller controls the voltage measurement through the relay. When the relay is turned on, the measurement starts. The sensor converts the voltage to be measured and sends it to the A/D chip for conversion and then to the microcontroller for processing, and finally outputs it to the display system, as shown in Figure 3.

c.jpg


2.1.2 Ripple measurement
The system uses PKD01 and PKD02 chips to collect the peak-to-peak value of the ripple. Since the ripple voltage is at the mV level, the signal is very weak and must be sent to OP07 for amplification before being sent to the A/D chip for conversion, as shown in Figure 4.

d.jpg


In order to ensure the accuracy of the measurement, the system uses the method of multiple measurements to find the average value to filter out some erroneous values ​​and ensure the accuracy of the measurement.

[page]

2.2 Data Collection
The data collection uses TI's 12-bit switched capacitor successive approximation analog/digital converter. This A/D conversion chip is small in size, fast in conversion speed, and has an operating temperature of 0-70°C, which can adapt to indoor or outdoor working environments.
The connection circuit between the microcontroller and the A/D chip is shown in Figure 5. A 104 capacitor is connected in series to the power supply end in the figure to ensure signal stability.

e.jpg


2.3 Data output
The system uses LCD display, including date, time, DC voltage value, ripple value; the data that needs to be saved is output by printer. The system output is controlled by three 74HC 573 expansions of CPU P0. 74HC573 is an octal three-state non-inverting transparent latch. When its latch enable terminal is high, the latch of these devices is transparent to the data (that is, the output is synchronized); when the latch enable terminal is low, the data that meets the setup time and hold time will be latched. 74HC573 has a protection circuit to prevent damage by high static voltage or electric field. The system uses 74HC573_00, 74HC573_01, and 74HC573_02 to control the LCD control interface, data interface, and printer interface respectively.

3 Software Design
The system uses STC89C52 as the core to control the entire system. STC89C52 is a low-voltage, high-performance CMOS 8-bit microprocessor with 8 KB flash programmable and erasable read-only memory (FPEROM). The device is manufactured using STC's high-density non-volatile memory manufacturing technology and is compatible with the industrial standard MCS-51 instruction set and output pins. STC89C52 can be programmed in a conventional way. It combines a general-purpose microprocessor and FLASH memory. In particular, the repeatedly erasable FLASH memory can effectively reduce development costs.
During program design, 5 ms timed interrupt acquisition is used to collect field voltage signals each time an interrupt arrives. When the obtained voltage signal meets the specified conditions, the valid data is retained, sent to the microcontroller for processing, and then output for display. The main control module program is written in C language, and the specific flow chart is shown in Figure 6.

f.jpg


The system must first initialize the CPU, mainly to reset the initial value and working mode of the timer according to actual needs. After the initialization is completed, it enters the working cycle program. First, the key pressing flag is judged. If it is true, it will be transferred to the key setting processing program module. By calling the key processing program, the upper and lower limits of the voltage and ripple values ​​are set, the date and time are set, and the stored voltage and ripple values ​​are queried. If the key pressing flag is otherwise, the data acquisition module is called to send the collected values ​​to the CPU. The CPU processes the collected data to remove the false and retain the true, discard the false data, and send the true data to the data processing module for display and storage.

4 Conclusion
The ripple measurement system uses a voltage sensor, a peak detector and a single-chip microcomputer to realize the measurement of high-voltage DC voltage and ripple. It has the advantages of intelligence and simple operation. This system has been applied to actual industrial sites and has achieved good economic benefits.

Keywords:STC89C52 Reference address:Design and implementation of DC ripple tester based on STC89C52 single chip microcomputer

Previous article:Design and implementation of three-dimensional rotating LED based on STC11F02E
Next article:Introduction to the method of programming the ISP protocol of STC microcontroller

Recommended ReadingLatest update time:2024-11-16 14:42

51 single chip microcomputer (STC89C52RC) small comprehensive experiment (continued 2)
  After the last experiment, the circuit was tested in practice and found that there were still problems. The main reason was that the voltage drop time became very slow. After careful inspection of the circuit, it was found that the main reason was that the capacitance of the capacitor was changed. The original filte
[Microcontroller]
Design of digital clock based on stc89c52rc microcontroller (digital tube display)
Things always look simple, but they are not so easy to do. I wrote this program according to the tutorial at the beginning. I skipped some parts that I didn't understand... It turned out that this was not advisable... After writing a hundred lines, I compiled it and got an error! I couldn't solve it. O
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号