Design of embedded smart home control system based on Arm-Linux

Publisher:MusicLover123Latest update time:2018-02-21 Source: eefocusKeywords:Arm-Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Embedded systems are widely used in mobile communications, industrial production, security monitoring and other fields due to their low resource consumption, strong specialization and low power consumption. In response to people's requirements for efficient, comfortable, safe, convenient and environmentally friendly living environments, the design of a smart home control system based on Arm-Linux is proposed.

1 Overall design of smart home controller
    Arm-Linux embedded systems are increasingly widely used in the field of smart homes due to their advantages in performance, size and power consumption. The system adopts an ARM-based embedded Linux solution. The system is divided into five layers: hardware layer, system boot layer, system layer, application support layer and application layer. As shown in Figure 1, the application layer completes applications such as telephone alarm, lighting control, security control, access control and web browsing with the support of Qtopia graphics system and SQLite database.

a.JPG



2 System Hardware Design
    The CPU processor is Samsung S3C2440A, which has a main frequency of 400 MHz, rich resources and powerful functions. The memory is 64M SDRAM, the data bus is 32bit, and the clock frequency is up to 100MHz. The memory is 128M power-off non-volatile NANDFLASH. The LCD display part is a 35-inch true color LCD screen with a 4-wire resistive touch screen interface. The network card chip is DM9000, which can adapt to 10/100M network. The controller can be connected to a router or switch through an RJ45 connector. The smart home control module communicates with the main controller through the RS485 bus. Its hardware structure diagram is shown in Figure 2.

b.JPG

3. Software Platform Construction
    The development environment selected is the virtual machine VMware6.5 + FED ora9 Linux system + arm-linux-g CC  4.3.2 compiler. The system and software are compiled in a cross-compilation manner. Table 1 shows some of the main software required for transplantation and development to build the control system.


c.JPG


    Uboot is an open source bootloader designed specifically for embedded Linux systems. Its task is to initialize the processor and peripheral hardware resources and boot the operating system. The kernel is linux2.6.3 2. This version provides more drivers and APIs, making it more convenient to call. Support for frame buffer frambuffer should be added in the kernel, as the graphics system needs it. The file system uses Yaffs2 to match the large page memory with 2K pages per page. The root file system uses Busvbox1.13.3. After configuration and compilation, bin and sbin directories and linuxrc files will be generated, so that the system has the relevant commands for system and file management. The porting of Boa server realizes the function of embedded server.
    SOLite is a database for embedded systems. After compilation, it is very small with only a few hundred k and supports 2T data records. It can effectively reduce the overhead of application management data in embedded systems. The following statements configure the compiler and compilation path and install it. Three folders, bin, include and lib, are generated in the installation directory, which are executable files, header files and library files respectively.
    d.JPG

    Qtopia is a set of application packages and development libraries developed specifically for embedded Linux system consumer electronic devices. Figure 3 is a diagram of the software hierarchy of Qtopia. Qtopia's signal and slot mechanism provides a communication mechanism between objects. The window will trigger a signal after an event occurs. The programmer creates a function (called a slot) and then calls the connect() function to connect the slot to a signal, thus completing the connection between an event and a response code. One signal can correspond to multiple slot functions, and one slot function can correspond to multiple signals.

e.JPG

4 Application Design
    An application is used as an example to explain how to combine the QT graphics system, embedded database SQLite , and serial communication program under Linux to complete the design of the application. The following statements are used to call the SQLite API in C and C++ programs to complete the creation, insertion and query of the database.
    f.JPG
    In the system, a lot of other information needs to be stored in the database system. Following the above steps, corresponding data tables are established to store the alarm phone number tel, working status setting set, equipment working information zt, alarm information bj, etc. The basic process of developing the graphical interface, SQLite and serial communication program is shown in Figure 4.


g.JPG

    First, use Qt Designer to design the graphical interface according to the system requirements, establish the slot function and establish the connection between the signal and the slot function through the statement connect(PushButton1, SIGNAL(clICked()), this, SLOT(set_userandphone())); The slot function needs to be written according to the design function requirements. Use UIC and MOC tools to generate files user.h, user.cpp and moc_user.cpp program that completes the signal and slot functions, and use PROGEN and TMAKE to generate project files user.pro and Makefile. There is SQLite database code in user.cpp. The library path should be added to the search path of the Makefile library file, otherwise the compilation will fail because the SQLite library file cannot be found.
    i.jpg
    j.jpg
    To store the user's username, password and other information in the user.db database created earlier, the code for creating the table and inserting data should be placed under the slot function. After clicking the set button, a signal will be generated to trigger the slot function to realize the creation of the database and the storage of data. To realize the function of serial communication, the set information is transmitted to each control module of the smart home. The baud rate, check bit, stop bit and other settings need to be realized by setting the member values ​​of the struct termios structure. After completion, the serial port operation can be read and written like ordinary files. The serial communication program code is also placed under the slot function.
    k.jpg
    l.jpg
    After completing the compilation in the X86 environment, the Makefile file needs to be modified to change the PC environment compiler g CC and g++ to arm-linux-gcc and arm-linux-g++ in the embedded environment. After the compilation is completed, it is downloaded to the corresponding directory of the file system and run the test. Other applications of the system, such as system working mode setting and status query, also follow the same development process.
    Figure 5 shows the first one as the overall interface of the system, which contains 12 application icons. The second one is the interface of the sample application. After entering the corresponding information, click the set button, and the user name, password and alarm phone number are saved in the namekey and tel tables respectively and sent to the phone alarm module. The design goal of setting user information has been achieved.


 

h.JPG

5 Conclusion
    This paper uses the embedded database SQLite to implement data management of the smart home control system, which greatly improves management efficiency and saves system resource overhead. The Qtopia graphics system is used to implement a more user-friendly visual interface and simpler and clearer operation. The system runs stably and meets the design requirements well.

Keywords:Arm-Linux Reference address:Design of embedded smart home control system based on Arm-Linux

Previous article:Design of bank assessor based on embedded system
Next article:Design of elevator online monitoring system based on GPRS

Recommended ReadingLatest update time:2024-11-23 08:11

Design of smart home monitoring prototype system
With the development of human science and technology, computer technology, communication technology, network technology, and control technology have achieved rapid development and improvement. People have put forward higher requirements for living environment. The concept of smart home has emerged. People hope to monit
[Microcontroller]
Design of smart home monitoring prototype system
[Primary Tutorial] Building an arm-linux bare metal development environment
1 Introduction In the previous article, I introduced how to set the chip boot mode. According to the IROM mode officially promoted by Samsung, I introduced how to boot from IROM mode and load our boot program from Nand. With some previous knowledge, this article will go deeper and teach you how to implement your boot
[Microcontroller]
Design of GPS Intelligent Terminal Based on Embedded ARM-Linux
GPS intelligent terminal is an important part of intelligent transportation system (ITS system), which integrates satellite positioning technology (GPS), geographic information system (GIS) and wireless communication technology. At present, satellite positioning terminal usually consists of 8-bit/16-bit single-chip
[Microcontroller]
Design of GPS Intelligent Terminal Based on Embedded ARM-Linux
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号