Design of automatic curtain control system

Publisher:MagicGardenLatest update time:2011-04-26 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the development of high-tech and electronic devices, light control, temperature control and remote control curtains have emerged, bringing a lot of convenience to people's lives. At the same time, it also provides a basis for people's living environment and the realization of smart home. For this reason, the research and design of intelligent curtain control system has far-reaching practical significance.
1 System overall design and working principle
This system consists of a single-chip microcomputer, infrared receiver, photosensitivity metering, motor drive, digital tube display and beeping prompt module. The selection of the main application modules includes the selection of motor drive module, PWM speed regulation mode, PWM pulse width modulation mode, and PWM software implementation mode. Among them, the motor drive module adopts an H-type PWM circuit composed of Darlington tubes; the PWM speed regulation working mode adopts a unipolar working system; the PWM pulse width modulation mode adopts a fixed frequency width modulation mode; the PWM software implementation mode adopts a software delay mode. The key chips and devices required for the design of intelligent curtains are: single-chip microcomputer AT89S52, DC motor, three-phase voltage regulator 78L05, storage chip CAT24WC02 and optocoupler 4N25 . The overall block diagram of the system is shown in Figure 1.

The curtain control system adopts the minimum system design of AT89S52 single-chip microcomputer, which can realize remote manual opening, manual closing and manual stop control using infrared remote control. The digital tube displays the opening and closing of the curtain, which can be expressed by setting the corresponding digital representation by yourself; it can also be controlled according to the opening time and closing time entered in advance. The digital tube displays the hour and minute time at that time, but it can only be displayed sequentially. After displaying once, wait for a while and then display the next time; it can also realize light control according to the brightness of the outdoor environment, that is, automatic control of the curtain, and the driving digital tube displays the current status. The default time when the infrared curtain remote control controller is powered on is 8 o'clock. In the three working modes, the digital tube displays the time, working mode and working status according to the time division method. Each set of data consists of 5 digits. The first 4 digits display the tens of the hour, the ones of the hour, the tens of the minute, and the ones of the minute in sequence. The fifth digit contains the working mode and working status: displaying "one" (1 horizontal) indicates manual mode; "two" (2 horizontal) indicates semi-manual mode; "three" (3 horizontal) indicates light control mode; no horizontal display indicates time control mode. The "vertical" on the upper left corner lights up when the motor is working, and not lights up when the motor is working without a prompt; the "vertical" on the upper right corner lights up when the hourly time is on, and not lights up when there is no hourly time. The "vertical" on the lower left corner lights up when the curtain is opening, and the "vertical" on the lower right corner lights up when the curtain is closing.
2 Hardware Circuit Design
The curtain control system circuit is divided into 8 parts: power supply, display, light control circuit light measurement, motor control execution, infrared reception, sound reminder, data storage, and single-chip microcomputer main control device. Among them, the power supply part inputs AC 12 V or DC 13 V~14 V voltage through an external socket, and outputs 5 V voltage after being stabilized by a three-terminal integrated voltage regulator to provide power for the sound circuit, infrared reception circuit, and display circuit. Two No. 5 ordinary batteries are used to provide DC power.
2.1 Light collection circuit design
The light measurement circuit is shown in Figure 2, which consists of GM1, C3, and V3. GM1 uses a photosensitive diode [1], and C3 and GM1 form an RC charging and discharging circuit. When P3.4 is at a high level, the high voltage of P3.4 charges C3 through the forward resistance of GM1; when P3.4 is pulled down to a low level by the microcontroller, C3 discharges through the photosensitive element. The photosensitive diode works in a reverse voltage state. At this time, the ambient brightness determines the photoresistance value of the photosensitive diode. The larger the photoresistance value, the slower the discharge speed of C3, and vice versa. Properly control the pull-down pulse width of P3.4 so that the discharge of C3 works in a relatively linear working section. P3.5 is used to detect the discharge voltage state of C3 during the period when P3.4 is pulled to a low level. When the voltage of C3 drops to less than 1/2VCC, P3.5 measures data "0", otherwise it measures data "1". In order to reduce the influence of P3.5 on the charge and discharge of C3, the charge and discharge voltage of C3 is connected to P3.5 through the emitter follower composed of the transistor V3. The high input impedance of the emitter follower reduces the influence of P3.5 on the RC charge and discharge circuit.

2.2 Design of infrared receiving circuit and data storage part
The infrared receiving circuit uses an integrated infrared receiver of model HS3008. When static, the output terminal outputs a high level. When receiving an infrared signal, it outputs a negative pulse data signal according to the data waveform of the infrared signal. The infrared signal is output to the P3.2 port of the microcontroller. The second function corresponding to this port is external interrupt 0 (INT0). With this function, once an infrared signal arrives, P3.2 is pulled to a low level, causing the microcontroller to stop the current work and switch to receiving and processing infrared signals. The purpose of enabling the interrupt function is to reduce the workload of the microcontroller and ensure the integrity of the received infrared signal. At the same time, in the manual working state, after the microcontroller enters sleep, the external interrupt function is used to wake up the microcontroller. The P3.3 and P3.7 ports of the microcontroller are used as the bus of the I2C memory. In this circuit, AT24C02 is used to store the setting status and setting data. The infrared receiving circuit and data storage circuit [2] are shown in Figure 3.

2.3 Curtain frame structure design
The curtain frame structure design includes the curtain micro switch connection circuit design and the production and design of the curtain frame. The micro switch in this design is connected to the reset pin of the single-chip microcomputer through a reset circuit composed of capacitors and resistors. The micro switch is installed on the curtain slide rod. When the curtain moves to the predetermined position, the micro switch is triggered to reset the single-chip microcomputer. At this time, the motor stops and the curtain stops at the specified position. The production method of the curtain frame is as follows: first process two pulleys as the driving wheel and the driven wheel. The wheel is similar to a pulley, with a bottom diameter of about 25 mm, a groove width and groove depth of about 4 mm; 1 clothesline with a diameter of about 4 mm; glue a circle of thin rubber at the bottom of the groove of the driving wheel to increase friction; fix the driving wheel on the motor shaft, and fix the motor at one end of the curtain box, and fix the driven wheel at the other end of the curtain box. It is best to adjust the device when fixing to tighten the drawstring. The curtain rod uses a 19 mm stainless steel tube. The purpose of using two rods is to allow the left and right curtains to overlap. The joint of the pull rope is connected to the first ring of the left and right curtains, and an iron sheet is fixed to trigger the micro switch [3]. The structure of the curtain rack and the arrangement of the curtains are shown in Figure 4.

3 System software design
The main task of the single-chip microprocessor in this system is to complete the control and processing of the infrared signal received by HS3008, thereby completing the control of the corresponding control unit. The main program first completes the initialization, then starts HS3008 to wait for receiving control instructions and perform corresponding output operations [4]. The system flow chart is shown in Figure 5.

The microcontroller completes the received infrared signal control instructions through the P3.2 port, which corresponds to the external interrupt 0 (INT0) when the second function is received, and the corresponding operation is realized by receiving different infrared signal pulses. The important subroutines in the program are: serial port initialization, serial port receiving interruption, and infrared signal processing subroutines. After the serial port is set up and the program is initialized, the program performs real-time detection on the P3.2 port. Once a low pulse is detected, it is decoded and the corresponding subroutine is extracted to realize the control of the motor. When a manual control signal is received, the motor is directly controlled to realize the opening, closing or stopping of the curtain; when a semi-automatic control signal is received, the operator only needs to press the open or close button to execute the program, thereby realizing the opening or closing of the curtain. As for how to stop the motor, this design installs a micro switch on the curtain slide rod. Once the curtain is pulled to the specified position, the micro switch will be touched, thus sending a low pulse to the single-chip microcomputer. After receiving the low pulse, the single-chip microcomputer believes that the curtain has been completely opened or closed, and calls the program to stop the motor. When receiving the light control signal, the single-chip microcomputer calls the corresponding program to drive the photosensitive diode to detect the ambient brightness, and according to the detection result, the curtain is opened or closed. The stop of the motor is also like semi-automatic control, so as to realize the automatic control of the curtain.
The working status of the motor can also be displayed through the digital tube. The program is very simple to write, and different numbers are used to represent the corresponding working status. At the same time, the ringing prompt circuit can also be used to prompt that the motor is working, so as to avoid multiple presses of the button to cause the single-chip microcomputer to make an error operation and cause a crash.
The design of intelligent remote control curtains based on single-chip microcomputers has a good development prospect and application value in the application of measurement, control and acquisition systems with low real-time requirements. At home and abroad, automatic dimming curtains have become the first choice for people's home life. The automatic dimming curtain introduced in this paper uses infrared remote control to achieve its control function. Some typical problems were encountered during the design process, but corresponding measures were taken:
(1) Motor drive problem. The motor drive voltage is 5 V, but after the voltage is reduced by the transistor, the motor drive ability is significantly reduced. In order to increase the motor drive ability, a 4N25 optical coupler is added between the control part and the motor execution part to isolate the two parts and connect an external 12 V voltage to increase the motor drive ability. (2) Motor shutdown problem. Relying solely on the program to achieve motor shutdown has very high requirements for time control and is not easy to achieve. If the shutdown is achieved through a relay, it is also possible, but because the relay has a slow response time, the mechanical structure is easily damaged, the life is short, and the reliability is not high, a micro switch is used to send a low pulse to the microcontroller to achieve motor shutdown, and the real-time performance is also very good [5]. References [1] He Xicai, Xue Yongyi. Sensors and their application examples [M]. Beijing: Machinery Industry Press, 2004. [2] Qu Guirong. Infrared remote control circuit of electric curtains [J]. Home Electronics, 2005(2):2-3. [3] Guo Chenglin. Design of intelligent remote control curtain system [J]. Shanxi Electronic Technology, 2006(6):32-33. [4] Hu Hancai. Principle of single chip microcomputer and its interface technology [M]. Beijing: Tsinghua University Press, 1996. [5] Wu Aiping, Huang Zhenxing. Intelligent curtain group control system based on AT89S52 [J]. Science and Technology Information, 2007, 25(2).





Reference address:Design of automatic curtain control system

Previous article:Research on the application of fuzzy sliding mode control in seesaw system
Next article:Design of underwater laser imaging range gating synchronization control circuit

Latest Industrial Control Articles
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号