Design and Implementation of STM32 Based Smart Home System

Smart Home (also known as Smart Home) is a safe, efficient, comfortable, convenient and environmentally friendly living environment that combines architecture, network communication, information appliances and equipment automation with a combination of architecture, structure, service and management. Utilize integrated wiring technology, network communication technology, smart home system design security technology, automatic control technology, audio and video technology to integrate home life related facilities, and build efficient management system for residential facilities and family schedules. Compared with ordinary home systems, smart home not only meets the basic requirements of people's living environment, but also provides comfortable, safe and pleasant family living space. It is also able to proactively provide a full range of information services, combined with external resources to make intelligent responses. However, such systems are often expensive, have a single control, and are susceptible to interference. Therefore, while designing and implementing intelligent control, it is an inevitable trend to develop a smart home system that is low in cost, practical and can spread the homes of ordinary people.

This equipment enables users to easily grasp all aspects of the home from a thousand miles away. It is convenient to remotely control all kinds of household appliances, improve the safety, convenience and comfort of the home and realize the environment. Protect and save energy, making it easier for people to enjoy home life.

1 system overall structure

The overall structure of the system is shown in Figure 1. It is mainly composed of a microcontroller and multiple sub-modules. The microcontroller is mainly used to analyze and process user operation information, sensor information, control the receiving and sending of the mobile phone module, and perform corresponding according to priority. Task. The sub-module part includes: access control/security, human-machine interface, CAN-BUS communication network, wireless communication network, video monitoring module, voice recognition, window motor drive controller, multi-channel sensor interface, Switching Power Supply circuit, and so on.

Design and Implementation of STM32 Based Smart Home System

Figure 1 system composition block diagram

The system host connects to the Internet through a router running OpenWRT. Set the network port. When accessing through the Internet, the system provides a user-friendly interface. Users only need to enter the domain name to log in to the server running at home to access the device at home. Perform remote control.

2 smart home system hardware platform

The smart home system is mainly composed of a main control chip and a function peripheral. The main control chip STM32F103RBT6 is a processor with ARM 32 Cortex-M3 as the core. The maximum operating frequency is up to 72 MHz. The built-in high-capacity high-speed memory can easily accommodate the space required for smart home systems. It has FSMC flexible static memory controller. It is used to drive the LCD screen to greatly improve the refresh rate. At the same time, it has a controller supporting CAN 2.0B embedded in it, which can form a CAN network without external expansion of the dedicated chip.

The LD3320 is a speech recognition and synthesis chip that integrates high-precision A/D and D/A interfaces. It does not require any external auxiliary chip, such as flash memory, RAM, decoding, power amplifier chip, etc., and can directly realize speech recognition/voice. / Interactive function of speech recognition. The main control chip transmits the appropriate data to the corresponding register of the chip through the four-wire SPI digital interface, and after setting the identification keyword, the recognition time length, the microphone gain, etc., the voice recognition function starts running. When the system generates a condition that requires a voice response, the MCU can send the data encoded in mp3 to the chip, configure the volume and other parameters, and then run the voice synthesis function, and the on-chip power amplifier pushes the speaker to sound.

The nRF24L01 is a new monolithic, highly integrated RF transceiver that operates between the 2.4 to 2.5 GHz ISM bands. Functional modules such as a frequency synthesizer, power amplifier, crystal oscillator, and modulator are integrated, and the enhanced ShockBurst technology is integrated, in which the output power and communication channel can be configured through the program. Its multiple low-power modes and 40-bit ultra-long device address ensure its communication security and high transmission rate, which is suitable for application in this system.

CAN bus communication has the advantages of high communication speed, high reliability, easy connection and high cost performance, and it is popularized for high-speed networks and various networks as lower costs. Since the communication of the smart home system is in the complex electromagnetic interference of the household Power Supply line, the system adopts a CAN twisted pair converter to form a home appliance communication network, which is sufficiently reliable to be applied in a harsh environment with strong interference.

3 smart home system software design

One of the important purposes of smart home is to achieve a comfortable and convenient home life. Therefore, it is necessary to design a set of user interface with good user experience, including detailed settings of smart appliances on the computer side, and basic control of home appliances that can reflect the convenience of mobile phones. Demand for Android client applications. The main software design process is shown in Figure 2. The implementation of system tasks is implemented by two different threads: the NetStream program for network communication and the local data processing program.

Design and Implementation of STM32 Based Smart Home System

Figure 2 PC software design process

The local data processing program is further divided into the following two parts according to the task: the user operation response part, and the video stream data processing part. The user operation response part is mainly responsible for collecting data such as buttons pressed by the host computer software, input commands, and the like, and computing and processing the collected data, obtaining the result, encrypting and encoding, and finally loading onto the network stream. , automatically sent to the lower computer through the network. The video stream data processing part is the bearer of the smart home security monitoring function. After the software timer of the host computer generates an overflow interrupt for a certain time interval, it can connect to the router through TCP, and after verifying the account and password, the surveillance camera can be obtained. The image information in the frame JPEG format can be processed and combined to display 24 frames per second on the host computer interface. Due to the Persistence of Vision of the human eye, these continuous images can be regarded as It is a smooth video effect.

The NetStream part mainly solves the problem of communication between the upper computer and the lower computer. The security of smart home systems is an important issue, and it is especially important to establish a stable and secure connection. This system uses a TCP/IP protocol encrypted by SSL. SSL, also known as the "Secure Sockets Layer" protocol, is a protocol for establishing a secure channel between the client and the server, which fully guarantees the security of the system communication process.

POE is useful in situations when we want to connect network devices that are far away from a power source, and applying a voltage across terminals not dimensioned for that, may damage the network device. To avoid this, the best way is to make a POE power suply, separating the two input signals, via two simple circuits, an injector and a splitter.


Yidashun can offer POE Power Adapter with wall type with different plugs like EU, US, UK and AUS, and desk type with C8 and C6 prong, and the output has 12V 1A, 12V 1.5A, 12V 2A, 15V 0.8A, 18V 1A, 24V 0.5A, 24V 1A, 24V 1.5A, 24V 2A, 48V 0.5A and 48V 1A and so on. And the network interface are +4/5 pins and - 7/8 pins. 

poe adapter power supply

poe adapter with EU UK AUS US PLUG


POE Adapter

POE Adapter,POE Power Adapter,POE AC Adapter,POE Injector Adapter

Shenzhen Yidashun Technology Co., Ltd. , https://www.ydsadapter.com

Posted on