Design of boiler water treatment control device based on C8051F2xx series MCU chip

Publisher:温馨如家Latest update time:2024-02-23 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Natural water usually contains calcium and magnesium ions, commonly known as hard water. In boiler water, calcium and magnesium ions need to be removed from the water to form soft water to prevent boiler scaling. The softening treatment of boiler water is an important safety indicator in production. Therefore, the technical requirements for boiler water treatment are getting higher and higher. Microcontrollers are widely used in the field of automatic control due to their high flexibility and stability. The boiler water treatment control device designed in this article controls the water inlet valve switch by high and low water levels. It uses a single-chip microcomputer as the core and uses C language programming to realize cycle time circuit control. This device has been successfully used in Chengdu Fuhua Water Treatment Company.


1 Soft water production process and requirements for automatic control systems

1.1 Production process

The working principle of softened water equipment is based on the principle of cation exchange. The water flows down from the exchange column and fully contacts with the salt ions in the exchange resin to remove impurities and heavy metal cations that are easy to scale in the raw water. The production process is roughly divided into the following steps: ① Run after the conditions are met; ② Pine bed: mainly flush the exchange resin compacted in the exchange column to fully contact with the water to be treated; ③ Regeneration: water treatment after a period of After a period of time, the salt ions in the exchanger resin will be lost, causing exchange failure. The exchange resin must be backwashed, and then treated with an acid (or alkali) solution to restore the exchange capacity; ④ Replacement: During the replacement process , the softened water flows through the exchange column from top to bottom, flushing away the sodium ions in the resin, and realizing the exchange of sodium ions for calcium and magnesium ions; ⑤ Cleaning: Wash the remaining chloride ions in the resin. In actual operation, there are two identical structures, A and B, forming a system. There are four stations in total, each working in a different work process, alternately, and the positions of each station are rotated by motors. When R (E) is in the regeneration and replacement process, E (R) should be in the exchange process to provide the required softened water for the boiler. The process flow chart is shown in 1 (1# is the water inlet valve, 3# is the regeneration valve).

Design of boiler water treatment control device based on C8051F2xx series MCU chip

1.2 Process requirements for automatic systems

The length of running time of each station varies according to needs. It is required that the control system should be able to set, modify, and store the running time length of each station, and can automatically switch the work process and control the opening and closing of each valve according to the set time length of each station. And it can manually intervene in the current work station at any time to quickly enter the next work station.

In conjunction with the water level detector, the system should be able to automatically detect the water level of the demineralized water storage container. When the upper limit is reached, the system should be able to automatically stop running, and when the lower limit is reached, the system should be able to automatically start again. No matter under what circumstances the water treatment is stopped, the set data cannot be lost. The running status before stopping should be saved, and the original status can be continued when the water treatment is restarted. The panel displays the current status of the system: shut down or running; which of the four stations is running and the corresponding indicator light is on; the length of time remaining at the current station, etc. The panel design is shown in Figure 2.

2 System hardware design

2.1 Selection of microcontroller

This control system uses the C8051F2xx series of mixed-signal system-level MCU chips, which are compatible with the 8051 core and have 8 KB of FLASH memory and hardware-implemented UART and SPI serial interfaces. The VDD monitor, watchdog WDT and clock oscillator are also integrated on-chip. The chip has powerful functions, simplifies the hardware part, and eliminates unnecessary peripheral chip design.

2.2 Display and button function design

The system displays the column number, station number and minute content as required. These contents are all numbers. Therefore, it is enough to use LED digital tube as the display. In order to simplify the display, the running time of each station is accurate to minutes, and the maximum time is set to the hundredth place. Therefore, a three-digit digital tube is used to display the time. Another digit is used to display the station number and column number, a total of four digits. When running, it displays the current running column number and the remaining time of the current station; when setting, it displays the current station number to be set and the set hours and minutes. The current operating station time is displayed as a countdown. In addition to the digital tube display, there are also 7 light-emitting diodes on the panel to indicate various current working states.

To set (modify) the running time of each station, the system needs buttons. This system is designed with a total of 5 buttons. These keys are organically combined to realize powerful functions such as position selection, shifting, setting time and position number, and reset. During setup, the entire softened water system operates as normal. It's just that the display temporarily does not display the current operating station number and remaining time, but instead displays the set value.

2.3 Time acquisition and setting value storage

The entire workflow of the system controls the rotation of each station according to the set time interval, which is provided by the internal clock as a reference time. The working station time length set by pressing the button can be saved and stored in the data memory. These functions are combined and implemented on one chip to reduce the number of chips, simplify hardware design, and improve the system's anti-interference performance.

3 System software design

3.1 Main program

The main program of the system software is written in basic C language. The software first performs hardware system initialization, including port initialization, flag initialization, timer initialization, interrupt setting, etc. The detailed workflow of the main program is shown in Figure 3.

3.2 Interrupt service routine

Clock updates and button presses are detected using scheduled scanning. In the interrupt service program, first access the time register area of ​​the clock, read the minute update register, determine whether there is a minute update, and if so, set the minute update flag for use by the main program. Then read the input interface value of the display driver and button control chip to the microcontroller to determine whether a button is pressed. When the port is low level, it means there is a button pressed, and when it is high level, it means no button is pressed.

The system integrates WDT timer reset to prevent software/hardware errors in the system. Once an error occurs, WDT overflows and the system alarms to ensure normal operation of the system.

3.3 Control processing subroutine

The control processing subroutine is a program that directly controls the softened water equipment. When there is a score update, the current running time is decremented by 1 to determine whether the remaining time of the current process is 0. If it is 0, it means that the running time of the current process is up, the motor rotates and the process number is increased by 1, until it reaches the last station, then it cycles to the first position and continues to run.

3.4 Key processing subroutine

The buttons are used for input and control of system operating parameters, and the button processing subroutine implements the button functions defined during hardware design. This system uses fewer keys, but the key functions are relatively complete, including function keys, cycle shift keys, increment 1 keys, increment 1 keys that automatically limit the input value range according to different contents, and a reset key to make the system run from the initial state. There are those that work with a single key, and there are those that work with two keys.


4 Conclusion

This article designs a control system for softened water equipment. Compared with similar control systems, the single-chip microcomputer system is minimized, the entire circuit structure is simple, the cost is low, and the system reliability is high. After actual operation, the system is stable and reliable.


Reference address:Design of boiler water treatment control device based on C8051F2xx series MCU chip

Previous article:System design of admittance measuring instrument based on C8051 microcontroller and FPGA
Next article:Design of network measurement and control system using C8051F060 microcontroller and fieldbus CAN

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号