Design of constant temperature faucet based on STC12C5A08PWM

Publisher:心灵之舞Latest update time:2009-11-20 Keywords:STC12C5A08PWM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The faucet is the "conductor" of water and an indispensable water-using device in people's lives. The existing double-type faucet can connect two hot and cold pipes at the same time. The method of adjusting the water temperature is to manually adjust the mechanical position of the valve to control the water outlet ratio of the hot and cold water pipes. The adjustment is complicated, and a lot of water is wasted during the adjustment process. Even the adjusted water temperature will be affected by the change of water pressure, which reduces the comfort of use. There may even be extreme cases where the water temperature suddenly changes and the body is scalded. As an intelligent controller, the single-chip microcomputer has been widely used in various household appliances to provide users with better services. This article mainly introduces the method of using single-chip microcomputer control to achieve precise adjustment of the water outlet temperature of the faucet and avoid water waste. It is an intelligent transformation of the faucet based on the single-chip microcomputer.

1 Design and working principle

The system design and working principle are shown in Figure 1. Hot water and cold water flow in separately and mix in 0 to achieve temperature neutralization. When the mixed water temperature reaches the set value, 3 is turned on to supply water. When the water temperature does not reach the set value, 4 is turned on to discharge the water in the mixing water chamber 0 to the water inlet of the heating device (such as a gas water heater) for recycling and reducing unnecessary waste.

System design and working principle

The water inlets 1 and 2 are controlled by electric regulating butterfly valves, and the water outlets 3 and 4 are controlled by electric quick-cut butterfly valves. DS18820 temperature monitoring points are set in the hot water inlet 1, the cold water inlet 2 and the mixing water chamber 0. The microcontroller drives the electric actuator to control the opening of the electric regulating valve according to the collected field temperature, thereby controlling the water inlet of 1 and 2, and quickly opening or cutting off the water outlet of 3 and 4.

2 Hardware Circuit Design

The faucet control is based on the STC12C5A08PWM microcontroller of Hongjing Technology. It detects the field temperature signal collected by DS18820 and makes corresponding control processing after analysis. The setting and display of water temperature are respectively input by keyboard and displayed by digital tube. The adjustment of the cold and hot water inlet is realized by the output of the microcontroller through the relay driving the regulating valve. The pulse width modulation (PWM) frequency conversion technology is used to intelligently control the water flow size to achieve accurate ratio. The system design block diagram is shown in Figure 2.

System design block diagram

2.1 Single chip control module

It is implemented by STC12C5A08PWM single-chip microcomputer, which is a new generation of 8051 single-chip microcomputer with high speed, low power consumption and super anti-interference. The instruction code is fully compatible with the traditional 8051, but the speed is 8 to 12 times faster. It integrates MAX810 dedicated reset circuit, watchdog, two-way PWM, 8 KB FLASH ROM, 1 280 B RAM, and supports ISP.

2.2 Temperature sensor module

The single bus digital temperature sensor DS18820 produced by DALLAS is used to measure water temperature. It can directly output 9-12 bit (binary) temperature readings, which is convenient for single chip microcomputer processing. The DS18820 measurement temperature range is -55~+125℃, and the accuracy is ±0.5℃ within the range of -10~+85℃. The temperature can be converted into a 12-bit binary digital value within 750 ms (minimum value), and the temperature acquisition is accurate and timely. DS18820 adopts a single bus data transmission method. Multiple DS18820 can be connected to a bus to achieve multi-point temperature measurement and easily form a sensor network. In this system, the hot water inlet temperature T1, the cold water inlet temperature T2 and the faucet outlet temperature T3 are detected respectively.

2.3 Display module

The system is designed with two-digit eight-segment digital tubes, which are directly driven by the I/O port of the microcontroller and use a dynamic display method to display the temperature value set by the user.

2.4 Keyboard module

This system requires three buttons, using a three-button independent keyboard, directly connected to the microcontroller I/O port, and using software debounce. The functions of the three buttons are shown in Table 1.

The functions of the three buttons

2.5 Water flow control module

As shown in Figure 1, the hot water and cold water inlets 1 and 2 use electric regulating butterfly valves, and the microcontroller controls the amount of water inlet by controlling the opening of the regulating butterfly valve. The 2-way PWM logic inside the microcontroller is used to generate a high-frequency PWM signal, and the electric regulating butterfly valve is driven by the electric actuator, thereby reducing the work of the software and improving the efficiency of the software. The faucet outlet 3 and the circulating water outlet 4 use electric fast-cut butterfly valves to achieve fast water switching under the control of the microcontroller.

3 Software Design

This control system is a control system centered on a single-chip microcomputer. The single-chip microcomputer combines certain peripheral circuits to complete system data input, temperature acquisition, output control signals, and real-time display. It is a complete intelligent control system. Figure 3 is a system program flow chart that shows the control idea of ​​the entire process.

System program flow chart

The control algorithm of the electric butterfly valve according to temperature is as follows: first, the system set temperature T is compared with the cold water temperature T2 and the hot water temperature T1, which is divided into the following three cases:

The first type: If T-T2>T1-T, fully open the cold water inlet butterfly valve and half open the hot water inlet butterfly valve;

The second type: If T-T2 < T1-T, fully open the hot water inlet butterfly valve and half open the cold water inlet butterfly valve;

The third type: If T-T2=T1-T, fully open the hot water inlet butterfly valve and the cold water inlet butterfly valve;

The temperature T3 of the water outlet of the system tap gradually increases with the system working time. When T3

4 Conclusion

The system proposes a method to realize constant temperature control of faucet water outlet by using single chip microcomputer, temperature sensor, butterfly valve and other control circuits, which solves the inconvenience of traditional manual temperature adjustment and avoids water waste in the temperature adjustment process. It is convenient for users to use and realizes accurate setting of water temperature and constant temperature water use. It has high practical value.

Keywords:STC12C5A08PWM Reference address:Design of constant temperature faucet based on STC12C5A08PWM

Previous article:Design of Simulating Fully Automatic Washing Machine Based on Single Chip Microcomputer SPMC75
Next article:Design and implementation of handheld multimedia system based on ARM Linux QT

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号