Professional Documents
Culture Documents
Classroom Raspberry Pi
Classroom Raspberry Pi
E-mail: 1050149428@qq.com
E-mail: 1298212264@qq.com
Abstract: For solving the wasting problem of daily electricity effectively,this paper mainly introduced a project about
an intelligent electronic control system to manage electric equipment of colleges and universities,such as lamps and
air conditioners in the classroom.It has effectively solved the problems of classroom management system.Raspberry
Pi, the core of the design, transmits remote data through the TCP/IP protocol and achieves external network access to
and the power load is also added gradually[1].At developed by The Raspberry Pi Foundation which is a
present,the use of classroom electrical equipment is in a small charity in the United Kingdom.Its processor uses an
form of manual control by personnel entering the ARM controller and its operating system is Linux.The
classroom,which has poor real-time performance and lacks credit-card-sized Raspberry Pi is cheap and owns a wide
of scientific and reasonable control and range of community,and it has the functions same as the
equipment in the classroom is not effective,and results in a which can achieve powerful features [4].
978-1-5386-1243-9/18/$31.00 2018
c IEEE 6699
to the controller could achieve the communication with the in real time,and feedback the collected data to the
cloud server.By this means the server will obtain the server-side,so the administrator looks on the client and
real-time data collection on the scene via building makes the corresponding measure in the control area at
webpage; once;
In addition,the client-side is divided into visual interface 2) Fixed-time control settings of the circuit
and smart phone APP,which possess the ability of viewing
Taking into account that the working environment of the
real-time data and operating the corresponding relay
electronic control system is aiming at the classroom(of
control module to control its on-off,consequently it can
which the schedule for work and rest is regular),to ensure
achieve the goal of remoting monitoring and controlling
the normal use of classrooms and to avoid electricity
the status of the use of electrical
safety accidents,the system has been set up for the
equipment."Concentration","one-to-many" control is the
corresponding time control to turn off the circuit
design philosophy of the system.
automatically,which set the classroom of all circuits in the
non-teaching hours of implementation of automatic
open-circuit operation and in non-class time such as 22
o'clock later in the evening all devices are in an open
state.Besides,during the morning class the system opens
multimedia devices uniformly.Moreover,several special
needs of the segmental classroom can be meet with
human-based presets according to the actual situation;
The use and management of each electrical equipment in emergency measures rapidly and timely in a fire hazard.
the classroom is managed by the client-side,which can Design and function of the system
realize the management functions such as room
3.1 Communication achievement of the Client-side
temperature monitoring,intelligent control of electrical
and Raspberry Pi server-side
equipment switches,setting of circuit timing control,safety
alarm and emergency manual settings and so on. 3.1.1 Startup and settings for the Raspberry Pi server
1) Intelligent control for the switch of the electrical To start the Raspberry Pi,the following devices are
equipment needed:1) a Raspberry Pi (In this article is a 2-generation
model); 2) a wireless mouse and and a keyboard; 3) a
The controlled devices consist of lighting,multimedia
display device; 4) an SD card with 16 gigabytes of
equipment,fans and so on.The human body infrared sensor
capacity ;5) 5V direct-current power supply [5].
can judge whether there are people in the room accurately
6700 The 30th Chinese Control and Decision Conference (2018 CCDC)
The Raspbian must be installed before starting Raspberry 3.2 Design for remoting client-side
Pi.From the official website you can obtain the Raspberry
3.2.1 Multithread programming of Android
Pi,then burn the mirror image file to TF card.The
operating system files are copied to the SD card and then The top-down design of Android operating system is
the SD card is inserted into the Raspberry Pi.The divided into 4 layers ,each of these is not only application
Raspberry Pi will automatically start the installation of the layer,application framework layer,a library of components
operating system Program after the power and other and virtual machine layer,but also Linux kernel layer.
devices are connected successfully.After the installation is
When the system starts,a UI execution thread is
completed,start Raspberry Pi.On account of Raspberry Pi
created.Then all of the components that run in the same
server is based on the Linux operating system and its
process are instantiated in the UI thread,and the system
client computer is Windows operating system,so it uses
which calls for each component are dispatched by that
TCP/IP protocol which can realize interconnection among
thread.For the sake of preventing heavy application tasks
different hardware structures,operating systems and
in response to users’ interaction,the single-threaded mode
network systems[6].
may obstruct the UI.Therefore,the system adopts
3.1.2 Features of Raspberry Pi server-side multi-threaded work mode,which is used to achieve the
Runnable interface to define multiple sub-threads.And
1) The Raspberry Pi server can monitor the signal from
then create Thread(an object that implements the
the client momentarily after it starts successfully;
Runnable Interface)object,directly passes into the Thread's
2) The server starts a thread for processing timely while constructor function,then the code which are called the
receiving a command or request from the client,meanwhile start ( ) method and run ( ) method will run in the
it continues to listen for new requests; sub-thread,in order to parse asynchronous message
processing system(which include
3) As the command "real-time monitoring" is received,the
Message,Handler,MessageQueue,and Looper)to complete
sensor data acquisition module that connected to the
the UI updates operation in the sub-thread.The APP’s
Raspberry Pi will start to monitor the current temperature
working block diagram of the system is shown in figure 2:
and the status of each electric device continuously and
save the data in the database,then send the data to the
client-side.Such and such,it continues to work circularly;
The 30th Chinese Control and Decision Conference (2018 CCDC) 6701
3.2.3 Functionality of Client-side
1) Not only can the user visit the relevant webpage in the
browser,but also can download and install the APP for
intelligent electric control system which supports for
jumping to the webpage interface for accessing and
browsing;
6702 The 30th Chinese Control and Decision Conference (2018 CCDC)
The L298N motor drive module is used to cooperated with
the system.Four GPIO Pins are provided by the Raspberry
Pi as the input source of the PWM wave (Two circuits are
responsible for grounding and the other two are used to the
PWM wave input).The PWM wave outputs a sinusoidal
square wave of 3.3V peak and sets the waveform
frequency of the corresponding output channel by using
the Python statement which is GPIO.PWM (40,50).After
fig 4.Control area for users the waveform setting is completed,adjust the duty cycle
and the fan’s speed regulation can be completed.
3.3.1 Realization of motor control module exit,the output of the IO port is also at a high
The 30th Chinese Control and Decision Conference (2018 CCDC) 6703
level,nonetheless the number of persons is reduced by and control of all the electric equipment in the classroom
1.Combined with the use of LCD module,statistics show without distance restriction,which saves energy and
the number of indoor persons.In view of the module itself environmental protection as well.
has a blocking time (the default setting is 3 to 4
Contemporaneously,the system set up interactive functions
seconds),so while it detects a high level,it has a time delay
in the feedback area in order for users to submit
for 3 seconds,and the count variable will increase by 1 or
experience comments.So later on,the system will feed
minus by 1 accordingly.
back information to the server-side,which is convenient
Experiment result and analysis of the system for facilitating the late improvement and follow-up.The
simulation scene model of intelligent electronic control
Firstly start the client-side,then complete the registration
system and debugging are shown in figure 7.
of real-name system,the new user will accomplish the
login work after obtaining the management authority of
the smart phone APP.
6704 The 30th Chinese Control and Decision Conference (2018 CCDC)
[1] Zhang LiPing,Xue Shigao,Zhang Yaqing,et al.An intelligent [6] Technology tomorrow.Java from entry to master
classroom system based on Raspberry Pi [J] .Electronic [M].Tsinghua University Press,2012.[7] Zhang Huazhu,Yao
Technology,Beijing University Students Science Research Linlin,Shen Yang,et al.Design of Crop Low Altitude
and Entrepreneurship Action Program,2017.06: 145. Observation System Based on Raspberry Pi [J].Journal of
energy-saving control system for teaching buildings [7] Yu Zhiqiang,Wen Zhiyu,Xie Ying Ke,et al.Multi-parameter
[J].Application of Electronic Technology,2017,43 (6): water quality detector control system based on Raspberry
79-82,86. Pi [J].Instrumentation Technology and Sensor,2015 (6):
control system [J].China Science and Technology [8] Liu Jia Christmas,Zhou Qi.Use Raspberry Pi remote host to
Information,2016.21: 18-32,33,35. achieve power failure restart [J].Jiangsu Electrical
[4] Guo Liang,Ye Aiming,Lin Tao,etal.Design of remote real-time Engineering,2014,33 (6): 70-72.
temperature and humidity measurement system based on [9] Guan Jingli,Ai Hong,Chen Wenbo.Design of open laboratory
Raspberry Pi and language [A] .Computer Measurement monitoring system based on Raspberry Pi and Yeelink
and Control,2017,25 (6). [A] .Automation College of Beijing University of Information
[5] PhilbinCA.Zero-based learning RaspberryPi [M].Beijing: Science and Technology,Beijing 10019; 2017,36 (3):
The 30th Chinese Control and Decision Conference (2018 CCDC) 6705