How to realize the smart socket access linux operating system

Linux operating system based on the design of the smart home

Smart home is a novel topic in the current society, but also aspects of the development of electronic technology, the full application of electronic technology in life. However, so far, the smart home has only made it to the point of smart neighborhoods, because the cost of realizing a smart home is relatively high. Smart home is also a branch of the Internet of Things, the relevant home in the family through a control platform, connected to the network, under the condition of networking, you can always view the situation at home and control.

The rise of the Internet of Things (IoT) has provided the conditions for smart homes. How to simplify the IoT terminal equipment, and ultimately develop a set of economical and practical support for multi-terminal applications of the smart home IoT platform is very meaningful and valuable work. Based on Linux operating system, this system develops a set of smart home control system integrating wireless mobile network and radio frequency identification device. This system has the functions of intelligent meter reading, remote turning on appliances, radio frequency identification and remote remote control.

1 System Overview

This system adopts S3C2410 chip as the main controller, and the operation interface is a 3.2-inch TFT touch screen. After power on, the display shows the devices within the entire home system network, each device corresponds to an icon respectively, including light control, fan, refrigerator, air conditioning, temperature, rice cooker, smoke, gas flow collection and so on. Click the icon to enter the corresponding detailed information column of the device. Entering the lighting control interface, you can conveniently check the lighting situation of each room in your home, and also remotely control the lights on and off in each room by SMS; gas usage can be conveniently sent to the relevant collection department; sitting in the office, a text message can turn on the power supply of the rice cooker. Home equipment and the main control platform selected between the 2.4 GHz wireless radio frequency transceiver chip nRF2401, through which it can realize the wireless communication between the home equipment and the main control platform. The communication between the main control platform and the external network uses the ATK-SIM900A GSM/GPRS terminal wireless module. The smoke sensor adopts MQ-2 sensor to collect the indoor smoke condition.

The embedded ARM2410 system development platform is the monitoring and management center of the whole smart home system, which mainly integrates the wireless communication module, RFID module, infrared sensing module, and touch display. On the one hand, the total control platform can receive external commands (e.g. cell phone SMS) through the wireless module and control the corresponding home equipments to work according to the instructions through RFID, e.g. turn on the rice cooker, air conditioner or washing machine. On the other hand, the running information of each home equipment can be received and collected through RF module (e.g. meter reading, etc.), and after processing, the data can be sent to the embedded ARM2410 system development platform, which classifies the data and processes them, and then selects the useful data and sends them to the server of the corresponding company (e.g. power supply bureau, water plant, etc.) to realize automatic meter reading.

Each home device in the smart home control system needs to be installed with an RFID module, which can realize short-distance wireless communication with the embedded ARM2410 system development platform.

2 RFID module

nRF2401 is a monolithic RF transceiver device working in the world's general ISM band at 2.4 ~ 2.5 GHz. The RF identification module can realize multi-computer communication, multi-computer communication using the method of frequency division multiple access, only need to configure the address of different channels on the receiving end. The transmitter uses the corresponding address as the local address. When receiving data by reading the relevant bits in the STATUS to know which channel is receiving the data. The RFID module includes: frequency generator, enhanced SchockBurstTM mode controller, power amplifier, crystal oscillator, modulator and demodulator. The output power channel selection and protocol can be set via the corresponding SPI interface. The RFID module has a low power consumption of 9.0 mA when operating at a transmit power of -6 dBm in transmit mode, 12.3 mA in receive mode, and even lower current consumption in power-down and standby modes.

The nRF2401 can receive data from six different channels in receive mode. The structure of the nRF2401 in a star network is shown. Each data channel uses a different address, but *** uses the same channel, which means that 6 different nRF2401s set to transmit mode can communicate with the same nRF2401 set to receive mode, and the nRF2401 set to receive mode can recognize these 6 transmitters. At the same moment, all data channels are searched but can only receive ?

Receiving data from one data channel. nRF2401 records the address after confirming receipt of the data and sends an answer signal with this address as the target address. data channel 0 is used as the receive answer signal at the transmitter end, so the receive address of data channel 0 should be equal to the transmitter address to ensure that the correct answer signal is received.

3 Smoke detection

Smoke detection using the MQ-2 sensor module, the module can detect a variety of gases, when the gas concentration exceeds the set value in the program, the module detects and generates a signal on the corresponding pin for the microcontroller to read. Module has the following parameters:

1, can be used for home and factory gas leakage monitoring devices, suitable for liquefied petroleum gas, butane, propane,

methane, alcohol, smoke and other detection;

2, adjustable sensitivity;

3, operating voltage 5V Before use, the power supply at least warm-up for more than 2 minutes, the sensor is slightly hot belonging to

4, output form: a) analog voltage output b) digital switching output (0 and 1)

5, serial communication

The main control chip adopts the 8051 series microcontroller chip, the microcontroller through the serial port communication with the sensor, can be easily collected to the instantaneous flow rate and the cumulative flow rate can be recorded since the power on the flow rate since the maximum and minimum values, with an over-range indication, and can also be used as an indicator of the flow rate. Minimum value, with over-range indication function, the program simulates SPI interface to achieve communication with NRF2401.

4 Linux porting and Qt application development

This system has ported the Linux operating system on the Friednly2410 development board, and has carried out the development of a simple home intelligent control platform on this embedded operating system platform. the steps of Linux porting and Qt application development are as shown.

The first step is to configure the environment software required by the development board. In the development of the board environment to establish, it is important to note that for machines without a serial port, be sure to first install the USB to serial port driver, and in the installation must pay attention to the computer and the onboard serial port baud rate is set to the same. This is not set up, the serial port communication will have problems. In addition, you also need to install the serial debugging tools and program burning and downloading tools.

The next step is to build a Linux cross-compilation environment. The general computer on the Windows operating system, to develop Linux embedded operating system, you need to install a virtual machine (such as VMware, etc.), based on the Linux kernel of the relevant operating system (such as Fedora) and cross-compiler. The virtual machine is set up to host the Linux operating system running on a Windows machine, just like a virtual CD-ROM. Cross-compiler, is used to compile and generate a variety of image files in the system development process. Shenzhen, Guangzhou, Zhengzhou want to systematically learn embedded friends can contact Mr. Fu QQ1841388306

Then enter the porting process. The general order of transplantation is: compile Uboot → compile kernel → build file system.

Finally, Qt application development. This system is based on the graphical interface development. Qt program development needs to establish the Qtopia development platform, and then enter the compilation directory, execute the compilation script, exit without error, and then compile the application. To compile an application, simply enter each program directory and execute the make command. Then, copy the executable file of the compiled program to the image directory of the file system, and finally burn the compiled .bin file to the development board.