The Internet of Things refers to the combination of various information sensing devices, such as radio frequency identification devices, infrared sensors, global positioning systems, laser scanners, etc., with the Internet to form a huge network. Then, all objects in life are included in this network for easy identification and management. In layman's terms, the terminal of the Internet is a person, while the terminal of the "Internet of Things" is an object. Each object has a CPU, a network address and a sensor. Information and instructions can also be transmitted between objects. Its main purpose is to connect all objects to the network. The system can automatically and in real time monitor, identify, locate, track objects and trigger corresponding events.
The rise of the Internet of Things has provided conditions for smart homes. How to simplify the IoT terminal devices and eventually develop an economical and practical smart home IoT platform that supports multi-terminal applications is a very meaningful and valuable task. Based on the Linux operating system, this system has developed a smart home control system that integrates wireless mobile networks and radio frequency identification devices. This system has functions such as smart meter reading, remote opening of electrical appliances, and radio frequency identification remote control.
1 System Overview
This system uses S3C2440 chip as the main controller, and the operation interface is a 4.3-inch touch screen. After power on, the display screen shows the devices in the entire home system network, and each device corresponds to an icon, including lighting control, fan, refrigerator, rice cooker, gas flow collection, etc. Click the icon to enter the corresponding detailed information column of the device. Entering the lighting control interface, you can easily check the lighting status of each room in the home, and you can also remotely control the lighting of each room through text messages; gas usage can be easily sent to the relevant collection department; sitting in the office, a text message can turn on the power of the rice cooker. The 2.4 GHz wireless RF transceiver chip nRF24L01 is selected between each device in the home and the main control platform, through which wireless communication between each home device and the main control platform can be achieved. The communication between the main control platform and the external network uses the MC39i GSM/GPRS terminal wireless module of Siemens of Germany. The gas flow measurement uses the MF4000 series gas flow meter gas flow meter of Silicon Micro Electromechanical Systems (Shanghai) Co., Ltd. of the United States. The block diagram of the smart home control system is shown in Figure 1.
Figure 1 Smart home control system structure diagram
The embedded ARM2440 system development platform is the monitoring and management center of the entire smart home system. It mainly integrates wireless communication module, radio frequency identification module, infrared sensing module, and touch screen. On the one hand, the master control platform can receive external commands (such as mobile phone text messages) through the wireless module, and control the corresponding home appliances to work according to instructions through radio frequency identification, such as turning on the rice cooker, air conditioner or washing machine. On the other hand, the operation information of each home appliance can be received and collected through the radio frequency module (such as collecting gas meter readings, water meter readings, electric meter readings, etc.). After processing, the data can be sent to the embedded ARM2440 system development platform. After the platform classifies the data, it can select useful data and send it to the corresponding company server (such as gas company, power supply bureau, water plant, etc.) to realize automatic meter reading.
Each home appliance in the smart home control system needs to be installed with a radio frequency identification module, through which short-range wireless communication can be achieved with the embedded ARM2440 system development platform.
2 RFID module
nRF24L01 is a single-chip RF transceiver device that works in the world-wide ISM band of 2.4 to 2.5 GHz. The RFID module can realize multi-machine communication. Multi-machine communication adopts the frequency division multiple access method. It only needs to configure addresses for different channels at the receiving end. The transmitting end uses the corresponding address as the local address. When receiving data, you can know which channel the data is received by reading the relevant bits in STATUS. The RFID module includes: frequency generator, enhanced SchockBurstTM mode controller, power amplifier, crystal oscillator, modulator and demodulator. The selection and protocol of the output power channel can be set through the corresponding SPI interface. The RFID module has low power consumption. When working in the transmitting mode, the transmitting power is -6 dBm, and the current consumption is 9.0 mA; when in the receiving mode, it is 12.3 mA, and the current consumption is lower in the power-down mode and standby mode.
nRF24L01 can receive data from 6 different channels in receiving mode. The structure of nRF24L01 in star network is shown in Figure 2. Each data channel uses a different address, but shares the same channel. That is to say, 6 different nRF24L01s set to transmit mode can communicate with the same nRF24L01 set to receive mode, and the nRF24L01 set to receive mode can identify these 6 transmitters. At the same time, all data channels are searched, but only
Figure 2 Structure of nRF24L01 in a star network
Receive data from one data channel. After confirming the data is received, nRF24L01 records the address and sends a response signal with this address as the target address. At the sending end, data channel 0 is used to receive the response signal, so the receiving address of data channel 0 must be equal to the sending end address to ensure that the correct response signal is received. [page]
3. Gas flow detection
The gas flow measurement uses the MF4000 series gas flow meter. The MF4000 series mass flow meter is designed by Silicon Microelectronics for the flow measurement of low-speed airflow in gas pipelines with a diameter of 3 to 8 mm. The bayonet design provides users with easy installation and meets the needs of users to measure multiple gas pipelines. The plastic bayonet can easily convert the mechanical interface and be applied to different low-cost environments. The built-in safety plug-in can be applied to a wider range of applications. The technical parameters of the MF4000 series gas flow meter are listed in Table 1.
Table 1 Technical parameters of MF4000 series gas flow meter
The control chip of smart home appliances is a traditional 8051 series single-chip microcomputer. The single-chip microcomputer and the gas flow sensor communicate through RS232. The single-chip microcomputer is the host and the sensor is the slave in the whole communication process. They adopt the half-duplex asynchronous transmission mode of the point-to-point (or point-to-multipoint) master-slave industrial control network. The host and the slave communicate in a polling manner. Only the host can start the communication. Without receiving the host request, the slave cannot actively send information. The host sends a task message to the slave. After receiving the task command from the host, the slave returns a response message and performs the corresponding operation. In addition to sending the response message, the slave can only be in the receiving state. Each query of the host is transmitted to the slave in the form of a message (frame). The communication process is shown in Figure 3.
Figure 3 RS232 serial communication process between MCU and sensor/flow meter
For the RS232 protocol, a fixed character 0x9D is used to mark the beginning of a frame of data. During data transmission and communication, the identification of the frame header (address) is very critical and important. The general solution to this problem is to find the characteristic data that is impossible to appear in the data to be transmitted, and then send this characteristic data as the frame header. However, in this communication method, on the one hand, the characteristic data is generally difficult to find, and in most cases, several special characters are required to form the characteristic data as the frame header; on the other hand, due to the addition of more useless characters (relative to useful data), the slave has to decode the characteristic data, which prolongs the communication time and wastes the slave's time. This protocol uses a 1-bit frame header (address) flag to solve the frame header (address) identification problem. [page]
The specific method is as follows: the host first disables the parity check, and sets the parity check bit to the Mark flag (equivalent to setting the frame header flag DS to 1), and then sends the frame header (address) to the slave. At this time, after the slave in the frame header (address) listening state receives the frame header (address) sent by the host, it enters the interrupt service routine to read whether the frame header (address) sent by the host is correct. When it is confirmed to be correct, the slave enters the data receiving state and waits for the host to send data; otherwise, it remains in the frame header (address) listening state and waits for the host to send the next frame header (address). The host then disables the parity check, and sets the parity check bit to the Space flag (equivalent to setting the frame header (address) flag DS to 0), and then sends data. The slave in the data receiving state will receive all data normally, and then send a response message to the host, and finally release the bus and re-enter the frame header (address) listening state.
The single chip microcomputer communicates with the sensor through the serial port, and can easily collect the instantaneous flow and cumulative flow. It can record the maximum and minimum values of the instantaneous flow since power-on, and has an over-range indication function.
4 Linux porting and Qt application development
This system transplanted the Linux operating system on the TQ2440 development board, and developed a simple home intelligent control platform on this embedded operating system platform. The Linux transplantation and Qt application development steps are shown in Figure 4.
Figure 4 Linux porting and Qt application development steps
The first step is to configure the environment software required by the development board. When setting up the development board environment, it should be noted that for machines without serial ports, the USB to serial port driver must be installed first, and when installing, it is important to set the baud rate of the computer and the onboard serial port to be consistent. If this is not set properly, there will be problems with serial port communication. In addition, the serial port debugging tool and program burning and downloading tool must also be installed.
The second step is to build a Linux cross-compilation environment. Most computers are Windows operating systems. To develop a Linux embedded operating system, you need to install a virtual machine (such as VMware, etc.), a related operating system based on the Linux kernel (such as Fedora), and a cross-compiler. The virtual machine is used to host the Linux operating system and run on a Windows machine, just like a virtual CD. The cross-compiler is used to compile and generate various image files during the system development process.
Then enter the migration process. The general order of migration is: compile Uboot → compile kernel → build file system.
Finally, it is Qt application development. This system is developed based on a graphical interface. Qt program development requires the establishment of the Qtopia development platform first, then entering the compilation directory, executing the compilation script, and compiling the application after exiting without error. When compiling an application, just 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.
Conclusion
This article describes a simple and feasible smart home networking solution, which has the advantages of low cost, easy implementation, and easy networking, but it still has some shortcomings for more complex interactive functions. However, based on the above-mentioned main control platform, only the internal local communication network of the smart home can be adjusted to achieve more complete smart home functions. For example, the home device network can be re-established using WiFi or ZigBee network without modifying the main control circuit.
Previous article:Micro rapid urine analyzer system based on LPC2148
Next article:Real-time monitoring system for ocean-going vessels based on IDP satellite communication module
Recommended ReadingLatest update time:2024-11-16 21:32
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Oscilloscope testing applications in medical equipment
- Award-winning live broadcast: ams projection lighting (MLA) enhances the communication between cars and roads
- Why can’t 28335 output 4 PWM channels at the same time?
- EEWORLD University ---- ADI Application Tour - Industrial Large Machine Health Edition
- MSP430F5529 USB Experimenter Board
- 【AT-START-F425 Review】No.03 Debugging serial port, timer and main system frequency
- Consulting circuit!!!
- Annoying Technology 3
- Xianji official engineer's dry goods: quickly familiar with the use of HPM6750 PWM and HPM_SDK Driver API (lighting)
- Check it out: Things that ST New Chinese official forum doesn’t want to tell netizens