Anda di halaman 1dari 4

The Research of Qt_Embedded and Embedded Linux Application in the Intelligent

Monitoring System Control

Liu-Yang, Kun-Yue, Heming- Pang, Linying-Jiang


Software College
Northeastern University
Shenyang 110004, China
yangliuneu@qq.com

Abstract—This paper probes into the design of the intelligent architecture is shown in Figure 1. Embedded linux operating
monitoring system based on S3C2440 ARM microprocessor. It system runs on the main controller and manages following
focuses on the difficult points of developing the GUI four types of equipments.
applications based on Qt/Embedded and the Linux drivers for
various types of sensors in the Lab Intelligent Monitoring
System project, achieving the combination of Qt/Embedded
and the linux system programming.

Keywords-embedded linux; Qt / Embedded; S3C2440 ARM


microprocessor; Intelligent Monitoring System

I. INTRODUCTION
The embedded systems which use micro-controller such
as 8-bit microcontroller as the main controller has been
widely used in various fields, but most of these applications
are still in the low-level stag 1 e of stand-alone use of the
embedded system. It is feasible and forward-looking to apply
the high-performance 32-bit microprocessors such as
S3C2440, embedded linux system and Qt / embedded GUI
application to practical industrial control in certain occasion.
Nowadays the management of the domestic laboratories in
the research institute and universities has issues of poor real
time, high cost and low precision .It is difficult to determine
the quality of the environment of the laboratory. So the
Laboratory Intelligent Monitoring System should be Figure 1. System hardware architecture
developed to implement early warning, remote control, real-
time monitoring and other functions. This paper focuses on x The sensor networks include a variety of
the process and difficult points in the application of environmental monitoring sensors such as DS18B20
embedded GUI based on Qt / Embedded and linux device temperature sensor, HSll01 humidity sensor,
driver in the laboratory environment intelligent monitoring TGS822 alcohol sensors, E200B infrared sensors,
system. TGS4161 carbon dioxide sensors. These sensors
automatically monitor the temperature, humidity,
II. THE SYSTEM TOPOLOGY carbon dioxide and other gas concentrations as well
The general framework of the Laboratory Intelligent as the availability of external material intrusion in
Monitoring System is divided into three levels from low to the laboratory. The microprocessor collects the data
high which are ARM front-end machine and its peripheral for the environment of the lab and uses the TCP / IP
equipment, PC intelligent monitoring center and remote or serial port or other means to send it to the
client terminal. monitoring center for processing.
x Most of the current securities monitoring system are
A. Embedded front-end machine based on PC with cameras, which is costly and
Embedded front-end machine use Samsung's S3C2440 troublesome to implement. This system uses an
ARM processor as the main controller, the performance and embedded host to connect camera, which handles the
frequency of which are suitable for real-time video image real-time image acquisition and image capture of
capture and processing applications. The system hardware laboratory environment. Through image processing
and special algorithm, the images can be used to
978-1-4244-5848-6/10/$26.00 ©2010 IEEE determine whether an exception illegal invasion

83
event occurs. In conjunction with infrared detectors consumption of which is relatively large and take up more
for functional complementation, the system has CPU time, is not suitable for embedded systems. The lab
better implementation of security features. intelligent monitoring system studied in this paper uses Qt /
x The electrical equipment switches control various Embedded under embedded Linux as its GUI development
electrical equipment in the laboratory. When the platform, which can fully satisfy the restriction of embedded
laboratory environmental data is abnormal, such as system resources. The application development framework
the temperature is too high, the system will cut off of Qt / Embedded is shown in Figure 2.
the large-scale power equipment, open the air-
Qt application
conditioning for cooling; When an illegal invasion
Handle
occurs, the burglar alarm will ring to notify the Initialize
event
End
administrators; Users can also use SMS / MMS or
wireless network to achieve the remote control
Qt library
functions of laboratory equipments.
x ARM front-end machine is equipped with a touch
LCD monitor, which enables us to develop friendly Request queue event
GUI with QT under embedded linux system to
provide functions such as querying and setting the
laboratory environment parameters.
B. the intelligent monitoring host Insert the event
Read the request X Server
into queue
In the middle level, the monitoring host is a computer
that has a fixed IP and connected to Internet through the
Ethernet card. The monitoring software real-time receives Device level
data of all monitored points, so as to pursue data statistics
and analysis as well as responding to and dealing with CPU
abnormal condition. It can be very intuitive to monitor
Figure 2. The application development framework of Qt / Embedded
environmental conditions of each laboratory and graphically
display the temperature, humidity, carbon dioxide As QT uses C + + as its programming language, it can
concentration and other state information of the lab. Bolt implement hybrid programming with linux-C. The header
values can be set up so the monitoring host always monitors files include both QT-API library and linux system calls
the information such as temperature, humidity, real-time libraries. Write the linux system calls as parts of the slots
image to determine abnormal circumstances. functions which can respond to specific signals in order to
C. Remote terminals achieve the combination of Qt / Embedded and linux-C.
Remote monitoring terminals include mobile phones, Of course, to achieve reading and writing of a specific
fixed phones, regular PC or mobile PC. They are connected device file, there must be device drivers which provide
with the monitoring center through the GSM network, PSTN, reading and writing operation interface functions. Therefore,
and TCP / IP. Administrators can log on the monitoring we need to complete the preparing, configuring and
center through any remote terminal to operate monitoring modifying of the drivers of sensors, cameras and other
software, view the data of monitoring center and examine the external expansion device of S3C2440 microprocessor.
lab environment. The Laboratory Intelligent Monitoring System uses QT
The system which uses the above three-tier architecture to complete GUI on the ARM head-end machine to achieve
is easy-to-modular and decomposition of a complex the graphical display of data collected by a variety of sensors.
framework at the same time. Because each layer only This article focuses on elaborating the design of the linux
interacts with the adjacent upper and lower layers, the drivers of various types of sensors and qtopia application in
maximum impact of the change of a layer is tiny. And as the system.
long as the definitions of the interfaces between different A. Initialization
layers are of the same, every layer has different methods to In the Qt application, firstly a QApplication object is
implement. created in main.cpp which is in charge of the main settings
III. THE DESIGN OF GUI AND DEVICE DRIVER OF THE LAB and flow controlling of the graphical user interface. Similarly,
ENVIRONMENT INTELLIGENT MONITORING SYSTEM
in the Qtopia a QPEApplication object is created to handle
and schedule the events from the system and other source
The design of GUI for embedded systems is different files, including the initialization and the end of the
from that of traditional data computing class software, which application.
often handles mouse or keyboard events to complete a
specific calculation, while the former mostly handle events B. Create components
caused by touch screen and other kinds of external devices. With the help of QT designer ,the programmer can
Because the embedded systems is resource-constrained, the quickly develop relevant GUI components and adjust the
design mode of the GUI of the traditional PC ,the memory size and position, including functions such as displaying the

84
current temperature, humidity, concentrations of carbon The statement QTimer timer creates an object and then
dioxide and harmful gases concentration in the laboratory call start () method in the constructor to specify the time-out
environment and showing whether the infrared sensors open period. When the timeout event occurs, all kinds of data
or not. And then define the signals and slots functions, save updating functions handleSensor () will be automatically
it as Ui file. The final GUI of lab environment intelligent called.
monitoring system is shown in Figure 3. void ILMS::ILMS()
{
connect(&timer,SIGNAL(timeout()),this,
SLOT(handleSensor () ) );
timer.start(180*1000);
/ / the other parts of the constructor definition are not
listed
}
handleSensor () will update the current environmental
monitoring data of the sensors, which requires the driven
interface functions of sensors.
D. The design of Linux device driver for sensors
Figure 3. System Interface Components Various types of sensors have their own specific device
drivers due to the different working principles. Take Digital
temperature sensor as an example to elaborate the design
C. Event handling
method of Linux device driver for sensors. Function
First of all, device driver modules for sensors, camera handleTemperature () mainly uses the digital temperature
and so on need to be dynamically loaded into embedded sensor driver function read (), which is renamed form the
linux operating system kernel which runs on the front-end function BYTE DS18b20_read_byte (void) .
machines ,providing interface functions of initializing , static struct file_operations s3c2440_18b20_fops =
reading and writing for linux device file so that event {
handling based on the system time and key can be . owner = THIS_MODULE,
accomplished in embedded GUI . . read = s3c2440_18b20_read,
As to the display of the data collected by a variety of };
sensors through the embedded GUI, QTimer function can be
called to automatically update the environmental monitoring The prototype of this function is DS18b20_read_byte,
value in constant time interval. The process of event providing a reading method for DS18b20 device file.
handling of various types of sensors is shown in Figure 4. BYTE DS18b20_read_byte (void)
Begin {
BYTE i = 0;
Initialize Qtimer BYTE byte = 0;
object
for (i = 0; i < 8; i++)
{
Time out event
s3c2440_gpio_cfgpin(DS18B20_PIN,
N Set the threshold value
happens DS18B20_PIN_OUTP);
s3c2440_gpio_setpin(DS18B20_PIN, LOW);
Y Y
udelay(1);
Update the
Open sensor device file
threshold value byte >>= 1;
N s3c2440_gpio_setpin(DS18B20_PIN, HIGH);
Read device file s3c2440_gpio_cfgpin(DS18B20_PIN,
Transfer the
Monitoring DS18B20_PIN_INP);
value>threshold
monitoring value
value if(s3c2440_gpio_getpin(DS18B20_PIN)) byte |=
Update the display
0x80;
Y
udelay(60);
Control the
Close the device file
device in the lab }
N N
return byte;
}
Close the
monitoring system

Y
The read () function returns the byte stream buf which
contains the LS byte and MS byte corresponding to buf [0]
End
and buf [1]. The value of former four bits of buf [0] is 2-4 ~
Figure 4 . The process of event handling of various types of sensors 2-1.In the laboratory environment, the general accuracy of
temperature measurement can be negligible. The former four

85
bits of buf [1] are sign flags, while we just use bit11 as the components of it. This paper focuses on solving the issues of
sign flag. Move buf [0] to the right four bits and then add it poor real time, high cost, low precision and incapability of
with the value of buf [1] ,we will get the current temperature determining whether the lab environment is in line with the
of the laboratory environment. body’s health indicators in the laboratory management of
In addition, system drivers also provide reset(), write(), domestic institutions of higher learning. It develops a
proc() functions for DS18B20 which is available for the calls laboratory intelligent monitoring system with S3C2440
of other applications microprocessor as its main controller, elaborating the
difficult points of the development of the GUI applications
IV. THE EXPERIMENTAL RESULTS based on Qt / Embedded and Linux drivers for various types
Firstly compile the project as x86 version and make it of sensors in the project. With a perfect support of the
run on PC as a simulation with the help of qvfb. Then embedded system technology, we believe that the intelligent
replace the compiler with arm-linux-g++ and recompile the monitoring system will have better performance and broader
program to generate a version that is suitable for S3C2440 market prospect.
ARM development board. The final result that running on
the embedded front-end machine is shown in Figure 5. REFERENCES
[1] Samsung Electronics Co Ltd. Users' Manual S3C2440A V0.12 [M] .
March,2004.
[2] Yun Sin-quan, Lu Qiang, Qian Pei-del. One implementation of Linux
application based on Qt / Embedded [J]. Computer Application and
Software, 2006,23 (2): 105-107.
[3] Trolltech. Online Reference Documentation [EB / OL]. Http://doc.
Trolltech. Com /.
[4] Chen Kun, Chen Yun-qiu, Liu Xin. Application design based on Qt /
Embedded and embedded Linux [J]. Computer and Digital
Engineering, 2009,37 (1): 156-161

Author introduction: Liu Yang, male, born in Jinzhou ,Hubei


Figure 5. The final result that running on the embedded front-end machine province. He comes from Software College of Northeastern
University, the main research direction is embedded systems.
V. CONCLUSION
In the post-PC era, the embedded system technology Acknowledgement: National Ministry of Education College
develops rapidly and the design of embedded GUI and the Students Innovative Experiment funded projects (090164)
linux device drivers are important and indispensable

86

Anda mungkin juga menyukai