Integral Design of Intelligent Home Equipment

The equipment is designed to household network monitoring and control. The WIFI module is used for wireless network communication to upload information of all connected smart home devices to the server, and it can be remotely controlled by the external network and monitoring of household equipment information. For simple household equipment, the control is directly taken by the built-in MCU’s WIFI module, and for the complex household equipment, it is through the external MCU and WIFI module for communication control. The Airkiss distribution mode is used to connect the WIFI master module to the network, and the other WIFI module devices to adopt the ad hoc network mode for wireless networking.


Introduction
With the rapid development of the times and the rise of the Internet of things, many of the traditional home appliances have gradually developed into smart home devices, such as the intelligent sockets, intelligent clock, intelligent closestool and so on 1 .
Compared to the traditional home appliances, intelligent home equipment added the function of monitoring and control equipment 2 .But each device needs to be controlled in different ways, so it is very difficult to realize the integrated control of the whole household equipment.Also, most of today's smart home equipment adopt the Bluetooth and other devices to control, or manually set the time to time control, and it cannot be achieved using the network remote control and monitoring.
Based on the above discussion, this design focuses on the integration of smart home equipment.The purpose of this design is to create a comfortable, fast and convenient intelligent home living environment, so that our smart home life can be further optimized and improved 3 .This design adopts the wireless ad hoc network mode of WIFI module.So that the local WIFI module can set up the local LAN network, and achieve the purpose of connecting all the smart home equipment 4 .The WIFI master module connects to the server through the MQTT protocol, which achieved the purpose of we control intelligent household device and monitor the information of intelligent household device.In the intelligent home life monitoring and control, the design has a very high practical value.

The hardware structure design
Intelligent devices are mainly responsible for the control of intelligent home appliances and data collection, so the size is better to be small.Therefore, in the design we have adopted a 10*10 PCB board to place the external MCU, P -148 WIFI main module and other modules, the rest of the WIFI submodule is directly placed inside the smart home devices.
First, the schematic is plotted using the Altium Designer software platform.Second, the PCB file is generated and the reasonable layout is designed.And finally, PCB is copper clad and sent to the factory to produce the system board 5 .
PCB board is designed to make the circuit mini, intuitive, and play an important role in the optimization of electrical layout.The design of the PCB board is shown in Fig. 1.The WIFI module is shown in Fig. 3.The design of the main control chip is shown in Fig. 4.

System circuit module design
In the circuit design, this design adopts a voltage stabilizing module, temperature and humidity data acquisition module and voice module.These modules greatly improve the function of the device.

Voltage stabilizing circuit design
The design adopts the AMS1117-5.0voltage stabilizing chip for stable 5V design.It is a linear voltage stabilizing chip, and the input voltage is (at least) greater than the output voltage 1.3V.It has four pins, two of which are output pins, one is the input pin, and the remaining pin is the ground (GND) 7 .In the voltage stabilizing circuit, the 10uf and 100nf capacitors are added as filter capacitors.

Design of connection circuit for temperature and humidity module
The design adopts the temperature and humidity compound sensor DHT11.It has humidity measurement elements to measure humidity and NTC temperature measurement elements to measure temperature, and its correction factor is stored in OTP memory by program.DHT11 has four pins, one pin is the temperature and humidity data output pin, the other three pins are connected to VCC, GND and floating 8 .The DHT11 is a temperature and humidity sensor, and its measurement accuracy is very high.The accuracy of temperature measurement is about 2 o C, and the accuracy of humidity measurement is about 5%.Its signal transmission distance can reach to 20 meters.

Hard-decoding circuit for speech chip
The VS1053 chip that used in this design is the Ogg Vorbis audio decoder.The chip contains not only a lowpower high-performance DSP processing core, it also has eight general-purpose IO ports, a serial port and a power amplifier interface.The device receives the digital audio data from the STM32 micro-controller by the SPI interface, and converts the data into an analog audio signal through the chip's built-in DAC.And finally, through the amplifier interface and external speaker connection, the analog audio signal playback function is achieved.

Introduction of functional module
With the functional modules, we can easily control and monitor the smart home equipment.

Wireless Ad Hoc Network Design
This design uses a wireless Mesh network for ad hoc network communication.The Mesh network has a mesh network structure, and the number of it can be determined by the number of nodes.The relationship between the number (L) and node (N) can be expressed as: By this way, each node can transmit data quickly and efficiently.But it is actually very difficult to achieve because it requires a large number of links to connect, which is not possible in reality.Therefore, most of the network layout is part of the Mesh network layout.For example, the internet is a part of the Mesh network layout.Therefore, most of the network layout adopt the partial Mesh network Layout mode.The paper also adopt partial Mesh network Layout mode.
This design adopts two kinds of modes for equipment connections.One is that the device node and the router is connected, and is not in the cloud server activation.The device of this connection is called the local device.
The other mode is in the cloud server activate, which is known as the network equipment.The WIFI master module is activated in the cloud server, and the other modules are locally connected through the router.
This design uses the automatic networking mode.As soon as the firmware is downloaded to the module, the WIFI master module will connect to the router, and then the routing is connected to the WAN.Other sub-modules will automatically scan around the WIFI access point (AP).The WIFI master module has the capability to receive, transmit and forward data packets, while the P -150 other sub-modules only have the capability to receive and send data packets.

Airkiss distribution network
With the mobile-phone APP WeChat, the WIFI module of this design can be carried out Airkiss distribution network, which makes WIFI module access to the Internet.
The principle of the Airkiss distribution network is through the LAN discovery and promiscuous mode to capture the way to achieve the purpose of smart configuration.Since the SDK programming and the firmware is burned to the WIFI module, the WIFI module can access to the network through the phone.
The Airkiss smart config network steps are as follows: Scan the two-dimensional code by WeChat.Fill in the SSID and password according to the popup window.WIFI master module receives the SSID and password, automatically connects to the router.

Testing and conclusion
By the test of the smart home devices, the following data are obtained: The Mesh network allows up to 5 hops, each mesh-non-leaf node can allow up to 4 direct child nodes to access the network, the transmission distance between nodes is best within 100 meters, the router can mount a Mesh network with a network size of 80 nodes.
The above data shows that the device can basically meet the needs of smart home equipment integration.By using DHT11 module, the indoor temperature and humidity data can be real-time transmitted to the remote client.
By using voice modules, the voice is used as the failure alarm when the touch screen is operated.
The test includes the sensitivity of the touch screen, the stability of the data transfer between the WIFI modules, and the speed and stability of the Airkiss distribution network.The test results show that the device can basically meet the user's control and monitoring of intelligent home equipment.

Fig. 1
Fig.1 The design of the PCB board 2.1.ILI9341 with resistance touch screen ILI9341 is a 320*240 resolution TFT screen, with a full color display function.It can use the 8080 timing and it can also work during -40 o C to 80 o C.This design adopts the STM32 and ILI9341 to communicate through SPI timing.A series of device data information are displayed on the resistive screen and the smart home device can be manipulated by touch.ILI9341 touch screen is shown in the Fig.2.

Fig. 3 .
Fig.3.WIFI module2.3.Main control chipIn this design, the external MCU is the STM32F103ZET6, which is the Cortex-M3 ARM core and has a 144-pin.The chip has 512KB flash memory and 64KB RAM6 .It can through SWD or JTAG with KEIL 4 to download the program and online debugging.And it has more than 80 general-purpose IO ports, multiple timers and serial ports, which fully meet the design of the required pin and memory requirements.It has the following characteristics: On-chip dual RC crystal, providing 8M and 32K frequency.Supported peripherals: Timer, ADC, DAC, SDIO, I2S, SPI, I2C and USART.Operating Voltage 2.0V ~ 3.6V.Operating temperature range: -40 o C ~ 105 o C.