Current location - Education and Training Encyclopedia - Graduation thesis - How to adjust the clock on the thermostat
How to adjust the clock on the thermostat
Sharing: Recommend the design scheme of Collection 1 This design takes the clock and room temperature meter commonly used in the family as the object, and the control system adopts the common 8-bit single chip microcomputer AT89C52 which is easy to buy. The intelligent temperature sensor DS18B20 is used as the temperature measurement and control element; The data display adopts four * * * positive L E D digital tubes, and adopts dynamic scanning display; Through programming design, the key can realize clock adjustment, timing, time and temperature switching, lighting switching and so on. White light emitting diode is used as lighting to realize the function of wall lamp at night. 2 system hardware circuit design The hardware circuit diagram of the clock thermostat is shown in figure 1. In this circuit, AT89C52 single chip microcomputer is used as the system control device, 12M crystal oscillator is selected, and reset key is set. The four ports of P2.0-P2.3 are connected with four 8550PNP triodes, and the strobe drives the display of the digital tube. P 1.7 drives a buzzer through the 8550PNP tube, and the alarm clock will ring at that time. 3 system programming 3. 1 main program This design mainly realizes the functions of clock and room temperature display. The clock is clocked by timer T0, and the main program is called circularly between the display subroutine and the key subroutine. When the corresponding key is pressed, it will be transferred to the corresponding function subroutine. 3.2 the display subroutine nixie tube displays the decimal B C D code, and defines that the storage units 70H-73H respectively store the number of clock minutes and the number of clock hours; 74H-77H respectively store the minutes and ten digits, hours and ten digits of the alarm clock; 78H-7B respectively store the temperature above zero or below zero and the temperature.