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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- [GD32L233C-START Review] - 8. Driving a 1.5-inch OLED screen using ordinary GPIO
- High-speed acquisition module
- What does USB_OTG_FS and USB_OTG_HS mean?
- I2C Master Mode for TI BLE CC2541
- Where can I find the PHI EVM Controller information for the TI ADC acquisition board?
- Loto Practical Tips (8) Application of Loto Oscilloscope in Repairing LED Desk Lamp Dimming Problems
- [NXP Rapid IoT Review] W2-Sensor Data Collection Test
- Today at 10:00 AM, live broadcast with prizes: [Introduction to the Industrial Open Source Platform based on TI Sitara AM5708]
- A complete collection of commonly used electronic components, including graphic symbols/nomenclature/technical parameters
- [15th Anniversary Celebration] Let your strength speak for you, and prove that you are an EEWorlder in one sentence!