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).
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.
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
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
- After cashing out 1.5 billion yuan, Mobike's post-80s founder left behind two unspoken rules for life
- RISC-V cross-compilation tool chain and the process of building a simulation environment
- 【New Year's Festival Competition】+ Characteristics of Southern Small Cities
- A flyback adapter reference design with a maximum output of 9V 5A
- Download Gift|ADI Flow Cytometer Solution
- EEWORLD University Hall----Application of TI DLP? Technology in 3D Machine Vision and Automated Optical Inspection
- DSP/BIOS Thread
- EEWORLD University Hall ---- Introduction to Microelectronics Technology
- EEWORLD University ---- Balance Car Tutorial Qianfeng Internet of Things
- [Serial] [Starlight Lightning STM32F407 Development Board] Chapter 14 Low Power Consumption Experiment