【正文】
Smart Home Introduction In order to improve the indoor daylighting, the Windows of the office and family is more and more big. When the height or width of the window exceeds a certain value, it will be difficult to pull the curtain manually which brings inconvenience to users[1]. Early dual channel remote control curtain machine can control opening and closing of the curtain. Motors drive the rotation of roller and pull the rope to close and open the curtain[2]. The opening and closing of the curtain still need people operate that it is not pletely in the sense of intelligent control. As part of the smart home, the intelligent curtain system improves the existing control problem of the curtain[3]. The system includes a automatic control curtain frame, a DC motor, a overwind detection, a light detection, a curtain position detection circuit and the corresponding program[4]. The system has three modes that are manual open and close the curtain, wireless remote control opening and closing the curtain and fully automatic light sensor opening and closing the curtain. This system has realized the intelligent control of opening and closing curtains. Design the framework of intelligent curtain The frame of automatic control curtain is made by aluminum alloy plate that the weight is light, the strength is high. The structure of automatic control curtain is as shown in figure 1 which is posed of a DC motor, a reducer, a rotating rod and fixed struts, and so on. In order to reduce noise and facilitate speed control, DC motor is selected to drive the lifting of the curtain. The speed of DC motor is 160 r/min. The output shaft DC motor drives the gear reducer which the number of gear teeth is 24 and modulus is mm, material is 45 steel. The curtain rod is linked to the driven gear which the number of gear teeth is 48, modulus is also mm. Reduction ratio of gear reducer is 1:2. The rod is driven by the DC motor, speed is 80 r/min. The weight of automatic curtain is 100 N, the rod radius is m, the rod torque is 4 Nm. Minimum output torque of DC motor is 2 Nm. Output power of DC motor is P =m *n /9549 ? (1) Where m is the output torque, N/m, n DC gear motor output speed, 160 r/min. Calculated by the formula (1), DC motor power should be greater than W. The power reserve coefficient is so motor power should be greater than 50 W. JWDHG60 DC motor is selected to drive the automatic curtain. The frame of automatic control curtainOverall design of hardware of intelligent curtain STC89C52RC is adopted to control the intelligent curtain. The hardware circuit is posed of LM393, photoconductive resistor, LED, motor drive chip, the infrared counting and the wireless remote control modules. The block diagram of system is shown in figure 2. The operation of curtain includes the manual button, the wireless remote control and automatic light sensor. The corresponding LED indicates the different work mode of the curtain. Intelligent curtain system adopts the single chip microputer to receive and send the corresponding control signals. L298N control DC motor which realizes the opening and closing of the automatic curtain. In the automatic light sensor model the curtain is opened and closed automatically according to the strength of the light. The positional control of curtain is realized by using infrared speed measuring module. Block diagram of automatic curtain Keyboard circuitDesign of hardware circuit of automatic curtain Manual control is the basic function of intelligent curtain. Manual control button can control the opening and closing of the curtain. Push button S3 to open the curtains. Push button S5 to close the curtains. Push button S2 to change the working pattern of the curtain. The key circuit is as shown in figure 3. In the automatic light control mode, when the outside light changes from strong to weak, automatic curtain will be opened. While When the outside light changes from weak to strong, the curtain will be closed automatically. The value of the strong and weak light is adjustable which control the opening and closing of the curtains. Automatic light sensor control circuit includes photo resistor and the dual voltage parator LM393. The LM393 parator can output the high and low level signal, automatic control the opening and closing of the curtain. Automatic light control circuit is as shown in figure 4. Photosensitive module circuit Keyboard circuitDC motor drives the rotation of the rod to open and close the curtain. When the system is in automatic light sensor mode, the position of the curtain needs to detect. The circuit of the overwind preventing module is as shown in figure 5. Digital tubes display the number of turns of the rod rotation. The control and display module circuit diagram are as shown in figure 6. Controller and display module circuitSpecial chip L298N is selected to drive DC motor. The forward, inversion and brake of DC motor is realized. The working current of DC motor will interfere with the singlechip microputer control circuit. The same power supply will affect the normal work of the single chip microputer. This system selects the double power supply, a source power the control circuit, another power a motor drive circuit. This system chooses the fast optical coupling to meet the requirements of the system segregation. The drive circuit of DC motor is shown in figure 7. In the optical coupling circuit, the resistor value of R5 ,R8 is calculated as follow. Io=Vce/R4=7mA (2) I f =Io/CTR≈ (3)R8=R5=()/IF =330? (4) DC drive module circuitCo