Natural water usually contains calcium and magnesium ions, commonly known as hard water. In boiler water, calcium and magnesium ions need to be removed to form soft water to prevent boiler scaling. Boiler water softening treatment is an important safety indicator in production, so the technical requirements for boiler water treatment are getting higher and higher. Single-chip microcomputers 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 paper controls the water inlet valve switch by high and low water levels, uses a single-chip microcomputer as the core, and uses C language programming to realize cycle time circuit control. The device has been successfully used in Chengdu Fuhua Water Treatment Company.
1 Soft water production process and requirements for automatic control system
1.1 Production process
The working principle of softening water equipment is based on the principle of cation exchange. Water flows down from the exchange column and fully contacts the salt ions in the exchange resin to remove impurities and heavy metal cations that are easy to scale in the raw water. Its production process is roughly divided into the following steps: ① Operation after the conditions are met; ② Loose bed: mainly to fully flush the exchange resin compressed in the exchange column so that it can fully contact with the water to be treated; ③ Regeneration: After a period of water treatment, the salt ions in the exchanger resin will be lost, resulting in exchange failure. The exchange resin must be backwashed and then treated with acid (or alkaline) solution to restore its exchange capacity; ④ Replacement: During the replacement process, softened water flows from top to bottom through the exchange column to wash away the sodium ions in the resin and realize the exchange of sodium ions for calcium and magnesium ions; ⑤ Cleaning: Wash the residual chloride ions in the resin. In actual operation, there are two sets of completely identical structures A and B to form a system, with a total of four stations, each working in a different work process, alternating, and each station is replaced by a motor. 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).
[page]
1.2 Requirements of the process for the automatic system
The operating time length of each station is different according to the needs. The control system is required to be able to set, modify, and store the operating time length of each station, and automatically switch the work process according to the set time length of each station, and control the opening and closing of each valve. And it can manually intervene in the current station at any time to quickly enter the next station.
With the water level detector, the system should be able to automatically detect the water level of the softened 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 and restart. No matter how the water treatment is stopped, the set data cannot be lost, and the operating status before stopping should be saved, and the original state should be continued when it is restarted. The panel displays the current system status: shutdown or running; which of the four stations is running, the corresponding indicator light is on; the remaining time length of the current station, etc. The panel design is shown in Figure 2.
2 System Hardware Design
2.1 Selection of Single Chip Microcomputer
This control system adopts C8051F2xx series mixed signal system-level MCU chip, which is compatible with 8051 core, has 8 KB FLASH memory and hardware-implemented UART and SPI serial interfaces. VDD monitor, watchdog WDT and clock oscillator are also integrated in the chip. The chip is powerful, simplifies the hardware part and eliminates unnecessary peripheral chip design.
2.2 Display and key function design
According to the requirements, this system displays the column number, workstation number and minute content. These contents are all digital. Therefore, LED digital tubes can be used as displays. In order to simplify the display, the running time of each workstation is accurate to minutes, and the maximum time is set to hundreds. Therefore, three digital tubes are used to display the time. Another one is used to display the workstation number and column number, a total of four digits. When running, the current running column number and the remaining time of the current workstation are displayed; when setting, the current workstation number to be set and the set hours and minutes are displayed. The current running workstation time is displayed in countdown. In addition to the digital tube display, there are also 7 light-emitting diodes on the panel to indicate the current working status.
To set (modify) the running time of each station, the system needs to have buttons. This system has a total of 5 buttons. These buttons are organically combined to realize powerful functions such as position selection, shifting, setting time and position number, and resetting. During the setting period, the entire softening water system operates as usual. It’s just that the display temporarily does not display the current running station number and the remaining time, but instead displays the set value.
2.3 Time acquisition and storage of set values
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 length of the station time set by the button can be saved and stored by the data storage. These functions are combined on a chip to reduce the number of chips, simplify the hardware design, and improve the anti-interference performance of the system.
[page]
3 System software design
3.1 Main program
The main program of the system software is written in basic C language. The software first initializes the hardware system, 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 program -
clock minute update and key press are detected by timed scanning. In the interrupt service program, first access the clock time register area, read the minute update register, and determine whether there is a minute update. If there is, set the minute update flag for use by the main program. Then read the input interface value of the display driver and key control chip to the microcontroller to determine whether a key is pressed. When the port is low level, it means that a key is pressed, and high level means that no key 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 the normal operation of the system.
3.3 Control processing subroutine
The control processing subroutine is a program that directly controls the softening water equipment. When there is a minute update, the current running time is reduced by 1, and it is determined whether the remaining time of the current process is 0. If it is 0, it means that the current process running time has expired, the motor rotates and changes positions, and the process number increases by 1 until it reaches the last station, and then circulates to the first position and continues to run.
3.4 Key processing subroutine
Keys are used to input and control the operating parameters of the system. The key processing subroutine implements the key functions defined during hardware design. This system uses fewer keys, but the key functions implemented are relatively complete, including function keys, circular shift keys, increment keys, increment keys that automatically limit the input value range according to different contents, and reset keys to make the system run from the initial state. Some keys work alone, and some work together.
4 Conclusion
This paper designs a control system for softening water equipment. Compared with similar control systems, the single-chip 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.
Previous article:Design of intelligent lighting control system based on 51 single chip microcomputer
Next article:Design of digital capacitance meter based on 51 single chip microcomputer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- 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
- Synopsys IP Resources: A look at the complete Ethernet PHY IP for high-performance computing SoCs
- [National Technology N32 MCU Development Package] --N32G4FR Series
- CC3220 Wireless MCU LaunchPad Development Kit Design
- 422 Driver Output Level
- NB-IoT application classification and technical characteristics analysis
- "Operational Amplifier Parameter Analysis and LTspice Application Simulation" 2. Chapter 2 Bias Current
- I2C Timing
- CUBEMX configures six-step square wave drive BLDC
- Resource Download: IoT technology is everywhere in the home
- [GD32307E-START] Development practice->K2 button + USART to achieve user interaction control + USRT print output status