- Home >> News >> Blog articles >> Internet of things
Voice recognition intelligent curtain system design
With the rapid development of Internet of Things technology, intelligent buildings are quietly rising. Traditional curtains are inconvenient to operate. Smart curtains provide people with a comfortable home environment. In the field of smart home, electric smart curtains overcome the disadvantages of inconvenient operation of traditional curtains, and can automatically open and close curtains under the set light and temperature, providing people with a more convenient and comfortable living environment. Therefore, the research and design of intelligent curtain control system has far-reaching practical significance. The existing smart curtain controllers on the market are more expensive and do not have voice functions, while the voice smart curtain controllers based on single-chip microcomputers have better stability, more moderate prices, lower power consumption, and are more practical. It also provides market value for the research and development of intelligent curtain systems.
1. Hardware block diagram design of intelligent curtain system
As the core chip of the system, the single-chip microcomputer STC89C52 is composed of a light control module, a key module, a stepper motor driver module, a voice recognition module, and an LCD display module. The light control module uses the illuminance sensor to detect the change of outdoor illuminance in real time, so as to control the automatic opening and closing of the curtains, so as to maintain constant illuminance control indoors. When the single-chip microcomputer receives the manual control, automatic control, and remote control signals, it drives the stepping motor drive module to control the positive and negative rotation of the stepping motor, thereby realizing the opening and closing of the curtains. The voice recognition module has a language memory function, and the voice "open and close window" command is pre-written into the program, and the program is embedded in the voice recognition module. When someone sends out a corresponding voice command, it is compared with the original command in the program, and the curtain is controlled if it matches. switch.
The system hardware is modular design, including voice recognition module, light control module, button module, stepper motor drive module, LCD liquid crystal display module. The hardware block diagram of the whole system is shown in Figure 1. The temperature detection module and the illuminance detection module mainly complete the collection of temperature and illuminance data, and display them on the LCD screen; the key module mainly completes the manual control function; the stepper motor drive module simulates the curtain by controlling the positive and negative rotation of the stepper motor The opening and closing of the curtains; the single-chip microcomputer STC89C52 is used as the main control chip to complete the processing of the received data such as illuminance, voice, key input, etc., and realize the opening and closing of the curtains through the driving module.
2. Smart curtain hardware circuit design
2.1 Speech Recognition Module
The core chip of the voice recognition module adopts LD3320 chip, which is a special chip for "voice recognition" of non-specific people. The voice signal is an analog signal, which needs to be embedded in the A/D and D/A interface of the chip to convert the voice analog signal into a digital signal. The operator does not need to undergo voice training in advance. The form is stored in the chip, and the recognition process is to compare the operator's voice with key sentences, and if they match, execute the corresponding control function.
2.2 Light control module
With the light control module, the user can set the indoor illuminance according to daily needs, monitor the outdoor illuminance in real time through the photoresistor, and the single-chip microcomputer controls the opening and closing of the curtains to achieve indoor constant illuminance control. The curtain realizes the automatic control of light intensity, the curtain is automatically opened at dawn, the outdoor light intensity exceeds 3000lx, it is automatically closed, and the curtain is automatically closed at night. The illuminance data monitored by the photoresistor is a 4-20mA current analog signal, which needs to be converted by A/D to output a digital signal to the microcontroller.
The function of the A/D converter is to perform analog-to-digital conversion, convert the analog signal received by the LD3320 voice chip into a digital signal and output it to ST89C52. In order to ensure the accuracy and speed of A/D conversion, the number of A/D conversion bits is related to the range and accuracy of the measurement control of the entire intelligent curtain control system. Adopt 8 A/D converter ADC0832 chip in this system.
2.3 Stepper Motor Driver Module
The system adopts 28BYJ-48 four-phase eight-beat stepping motor to control the opening and closing of curtains, which has large torque, strong load capacity and high control precision. The single-chip microcomputer controls the stepper motor drive module to input a series of pulse signals to the motor, controls the motor to rotate continuously, and drives the curtain to move on the track. The speed and stop position of the stepper motor depend on the frequency and number of pulses of the input pulse signal. The microcontroller sends a series of pulses to the stepper motor drive module. When the stepper driver receives a pulse signal, it drives the stepper motor. Rotate a "step angle" of 0.62° in the set direction, and control the continuous movement of the curtain by outputting continuous pulse signals.
The working peak current of the stepping motor ranges from 2.6 to 7A. If the torque generated by the pull-down resistor or triode drive is small, it is difficult to drive the curtains to open and close. Usually, a dedicated driver chip is required to drive it to work normally. This system uses a ULN2003 dedicated driver chip to drive stepper motor.
2.4 LCD display module
LCD display module adopts LCD1602 chip, which is used to display outdoor illuminance data and curtain working status in real time. Because the STC89C52 single-chip P0 port has a poor load capacity, it is necessary to connect the 10K pull-up resistor row first, and then connect the DB1-DB7 ports of the chip LCD1602 as the data input and output ports to transmit the illuminance data and the curtain opening and closing status commands. The P2.7 data port of the single chip microcomputer is connected to the enable terminal EN of the display chip LCD1602, the P2.5 port is connected to the RS data command gate of the liquid crystal display, and the 5-pin R/W read and write gate of the LCD1602 is connected to the single chip microcomputer P2.6. And use potentiometer RV2 to adjust the brightness of LCD1602.
3. Software Design of Intelligent Voice Curtain System
3.1 Process design of main control module
The software program is written in C language. In order to facilitate modification and debugging, a modular design is adopted. The development tool of the programming language uses Keil C programming software. The flow chart of the main program of the system is shown in Figure 6. The system first powers on and resets to complete the initialization of the single-chip microcomputer, sensor, and each port module, and the Y value and the priority setting of the Y value, where the priority of Y=3 is lower than that of Y=1 or Y=2.
Then the single-chip microcomputer performs corresponding data analysis and processing according to the type of external information received, and controls the stepping motor through the motor controller to complete the control of the curtain.
If Y=2, there is a voice signal input for opening and closing the curtains, the subroutine drives the LD3320 non-specific person "speech recognition" dedicated chip, executes the speech recognition subroutine, and waits for the input of the words that control the opening and closing of the curtains. When LD3320 receives the voice signal of "switch window", it first analyzes the voice signal to extract the voice feature value, and compares it with the switch window control key characters pre-stored in the chip. If it matches, it drives the stepping motor to control the opening and closing of the curtain.
If Y=3, the light control subroutine needs to be executed, and the photoresistor will monitor whether the outdoor light intensity is greater than 3000lx in real time. If the condition is met, the stepping motor will rotate forward to control the opening of the curtain until it reaches the limit switch and stops rotating. When the condition requirement is not met, return to the subroutine entry and re-initialize. Detect the opening and closing state of the curtain. In the open state, when the photoresistor detects that the outdoor light intensity is less than 500lx, the stepper motor is controlled to reverse to close the curtain.
Display subroutine, when the read-write strobe terminal RW of the LCD1602 chip is at low level, execute the write operation; when the data command strobe terminal RS is at high level, select the instruction register; the enable terminal EN is a falling edge signal , the display data is sent to the P2.0-P2.7 port of the ST89C52 single-chip microcomputer, and the LCD executes the data command to judge whether the data command has been executed. Otherwise, return to the data command selection register and continue to execute the previous steps in a loop.
3.2 System simulation
Use Proteus software to simulate the system, find out the corresponding components in the library editor according to the schematic diagram of the intelligent curtain control system, and then draw them. After the circuit picture is finished, select the *.hex file that has been compiled in KEIL, and click the run button.
Summarize
In the whole system design process, the light control module detects the outdoor illuminance data in real time and transmits them to the single chip microcomputer. Displays illuminance and temperature. On the basis of automatic control of illuminance, voice control and key control functions are added at the same time, which makes the control of intelligent curtains more perfect and more humanized.
The above is the example of Bluetooth headset development introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have bluetooth headset solution development needs, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, microcontroller development, Bluetooth solutions, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.
Proposal recommendation
- TOP