Design of Self-service Car Washing Machine Control System Based on ARM

With the cars in our country’s rapid increase, the limited quantity of traditional car washing shop has been unable to satisfy people’s needs. Responding to this problem the author designed a set of self-service car washing machine control system based on ARM, and a set of remote monitoring system based on 4G mobile network. The terminal control system adopted high speed, low power microcontroller LPC4350 as the control core; adopted RFID read-write module to realize IC card consumption; adopted EM770W 4G module for the washing machine terminal could connect to 4G mobile network. Through MODBUS protocol, the remote monitoring system based on KINGVIEW6.55 could communicate with the terminal system, and realized the real-time monitoring and recording the washing machines’ working parameters regularly. Because the designed system realized the unattended self-service washing, so it greatly reduced the maintenance workload, and improved the work efficiency.


Microcontroller LPC4350
LPC4350 is the first asymmetric dual core digital signal controller that adopts ARM Cortex-M4 and Cortex-M0 processors in the world. It has a working frequency of up to 204MHZ, with the advantages of low power consumption, easy debugging, easy integration and other system enhancements. It is equipped with up to 1MB FLASH memory, 264 KB SRAM, and integrates high-speed USB, Ethernet, UART and C_CAN 2.0B, SSP, SPI, I 2 C and 164 GPIO, LCD controller, timer / counter, watchdog timer and other interfaces. In this control system, LPC4350 plays the role of control centre. It analyses and processes the peripheral signals collected in real time, and coordinates the actions of the whole control system.

Dual power supply circuit
In order to ensure the normal operation of the control system in the case of power failure, the double power supply circuit shown in Figure 2 is designed.

Fig2. Dual power supply circuit
The function of the circuit in Figure 2 is to automatically switch the power supply of the control system (or load) from the battery to the AC adapter and control an LTC4059A battery charger. When the AC adapter is not connected, LTC4413 connects the load to the lithium-ion battery, the stat pin is at high level, and the battery charger fails. If the AC adapter is connected, the load voltage will rise as the ideal diode is connected between the inb and outb pins. When the load voltage exceeds the battery voltage, the battery will be disconnected from the load immediately, and the voltage of stat pin will drop, so as to turn on the ltc4059a battery charger and start a charging cycle. When the AC adapter is removed, the load voltage will drop sharply. When the voltage drops below the battery voltage, the battery will resume to supply power to the load, and the voltage of stat pin will drop, resulting in the failure of battery charger. The switching time of the circuit is less than 0.1ms. It also has the function of limited current and thermal protection and slow shutdown to protect the device from voltage spikes. When the AC power supply to the load, the battery can be replaced without disturbing the power output. Therefore, the circuit realizes the uninterrupted power supply of the control system and greatly improves the reliability of the control system [1] .

Working principle of control system
The self-service car wash machine has two kinds of washing liquid, which are clear water and foam. When the user brushes the IC card, the microcontroller controls the card's radio frequency reading and writing operation, and deducts a certain fee first (the cost value can be set). The user selects the car wash liquid by pressing the clear water or foam key and sends out the start command. After receiving the start signal, the control system starts the car wash pump, and opens the corresponding outlet valve (the outlet pump or the high pressure water gun). During the car washing process, the control system receives the pulse signals emitted by the clear water and the foam flowmeter in real time, and calculates the dosage. In the process of car wash, users can stop or switch the car wash liquid through clear water and foam keys. After the car is washed, the user recharges the card. The system charges the amount according to the set water and foam price, and the remaining amount is returned to the user IC card.
The liquid level sensor transfers the liquid level signal of the clear water and the foam to the microcontroller in real time. When the actual liquid level is lower than the liquid level set by the system, the system cannot start the car washing process and send out the alarm signal. The em770w network module wirelessly transmits the working data of the car washing machine terminal to the remote monitoring computer. USB interface is used to read system data and update system program.
The terminal control system also has the functions of setting up the system time, consumption amount, water price and foam price, inquiring the total amount of the credit card, showing the functions of clear water and foam level.

Flow sensor
The water and foam flow sensor uses the SEN-HZW3WA pulse signal flow sensor. The sensor is connected with the load resistor in the positive part of the Holzer component, and at the same time, it connects the DC voltage of 5V and makes the current direction perpendicular to the magnetic field direction. When the water pushes the magnetic rotor to rotate through the turbine switch housing, the rotating magnetic field of different poles is generated, the magnetic induction line is cut, and the high and low pulse levels are generated. The output pulse signal frequency of Hall element is proportional to the rotating speed of magnetic rotor, and the rotating speed of rotor is proportional to the water flow [2] . The formula of pulse signal and water instantaneous flow is: F = 8.1q-3 ± 10%, where: F is pulse signal frequency, q is water flow. After conversion, when the sensor emits 477 (± 10%) pulses accumulatively, it is equivalent to flow through 1L water. In this system, LPC4350 microcontroller captures the number of pulses sent by two sensors to calculate the cumulative flow of car wash fluid.

4G network connection
The control system uses EM770W module to connect the terminal of self-service car washer to 4G network. EM770W is a 4G wireless communication module produced by Huawei. It supports WCDMA and is widely used in terminal equipment and industrial fields. Under HSPA, the maximum uplink download rate is 5.76Mbps and the downlink download rate is 7.2Mbps. It has low power consumption, good compatibility, fast transmission speed and strong stability [3] . EM770W has two UART interfaces, among which uart1 supports flow control function, PPP dialing and at command sending. The uart1 interface of the microcontroller LPC4350 in this control system is connected with the UART1 to realize the data transmission with the remote monitoring computer.
Using 4G network module, the terminal of self-service car washing machine can communicate with remote monitoring computer transparently. In other words, there is no communication protocol  [4] . For example, if the MCU of car washing terminal sends a byte of data as 0xff, the software running on the remote computer will receive a byte of data 0xFF. The communication from the remote computer to the terminal of the car washing machine is the same.

Transplantation of uC/OS-II
In order to improve the stability and real-time of the terminal control system of car washing machine and shorten the development cycle of software, uC/OS-II operating system is transplanted on MCU LPC4350. uC/OS-II is a real-time, multitask operating system, which adopts the preemptive scheduling method based on fixed priority. It has many advantages such as small kernel, high realtime performance and so on. Each task in the system has a task control block OS ﹐ TCB, which records the environment of task execution, including task priority, task stack pointer, task related event control block pointer, etc. When uC/OS-II is ported to LPC4350, OS_CPU. H, OS_CPU A.S and OS _CPU C.C files need to be written. Although such files are complex, the system design is relatively simple because all the source codes of uC/OS-II are open [5] .
The uC/OS-II kernel schedules all tasks according to the priority of each task. The priority assignment is designed according to the system requirements. The higher the real-time requirements, the higher the priority. The system creates a task through the OS task create( ) function. Os task suspend( ) suspends a task and OS task resume( ) recovers a task. The main task design of the system is shown in Table 1.

Software design of remote monitoring computer
The design of the monitoring network composed of the remote monitoring computer and each selfservice car washing machine terminal is shown in Figure 4. The terminal control system of car washing machine uploads the working data to the end server through 4G mobile communication network, and the server receives the remote data and saves it to the database.  [7] 。 The remote computer real-time monitoring screen is shown in Figure 5, and the monitoring software functions are as follows: Parameter setting and status display. You can check the communication status of the self-service car washing machine terminals, the level of clear water (foam), the amount of accumulated water (foam), the total amount of credit card, and set up parameters such as system time, unit price, low liquid level and so on.
Real time alarm. The monitoring system monitors the liquid level, communication status and other alarm variables of each car washing machine terminal in real time. When there are alarm events, the system will display them in the alarm window and record them in the alarm information database for the management personnel to check and reference during maintenance.
Database storage system can complete real-time data processing, historical data storage and data reports. The computer regularly records the working data of each car washing machine terminal. By using the embedded report system and rich report functions, various operations, data conversion, statistical analysis and report printing are realized, which overcomes the complexity and randomness of previous manual data recording.

Conclusion
The self-service car washing control system based on arm has three advantages. First, it can control water consumption independently and save cost. According to the operation statistics, the water consumption of each car wash is about 20 liters, only one third of the water consumption of the car wash shop, roughly estimated to save about 100 million cubic meters of water every year. Second, water washing and foam cleaning are the same, convenient switching and low cost. The average price of a car wash is around 5 yuan, which is welcomed by the majority of car owners. Third, the system can work 24 hours, without the need for special personnel on duty.
The remote computer monitoring system based on 4G network enables the administrator to view the working status of each car washer terminal in real time on the computer connected to the Internet. Since the system has been put into operation, it has stable performance, good real-time data transmission, fast speed, and no regional restrictions on the monitoring range, which greatly reduces the workload of car washing machine managers and improves the work efficiency.