Design of intelligent system for classroom occupancy monitoring based on Bluetooth 4.0

Publisher:cannon928Latest update time:2016-03-17 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

Intelligent crowd counting, environmental monitoring and other systems have always received great attention from the wireless communication and electronics industries, and are widely used in environmental resources with large traffic and limited space, such as airports, stations, and theaters. As the most familiar learning place for college students today, the quality of the classroom environment is directly related to the students' learning efficiency. As an auxiliary system for attendance statistics, the classroom crowd counting system, on the one hand, serves teachers, allowing them to focus on teaching activities rather than attendance considerations (roll call or sign-in); on the other hand, it facilitates the school teacher management department to obtain real-time transmission and feedback of information such as classroom utilization, so as to reasonably arrange classroom resources, and also helps students quickly understand the classroom usage.

Bluetooth wireless technology is one of the most widely used global short-range wireless standards. The Bluetooth Special Interest Group (SIG) released the Bluetooth 4.0 core specification in July 2010, and Bluetooth has entered the 4.0 era since then. The core of the Bluetooth 4.0 specification is low-power technology, namely Bluetooth 4.0 BLE. The biggest feature of this technology is its ultra-low operating power consumption and standby power consumption. Bluetooth low-power devices can continue to work for several years using a button battery. At the same time, this device can be applied to wireless solutions with strict requirements on cost and power consumption, and is widely used in many fields such as healthcare, sports and fitness, home entertainment, sensor Internet of Things, etc.

Therefore, this paper designs a classroom population counting system based on the latest Bluetooth 4.0 technology. Compared with the existing population counting systems, it has low cost, low power consumption and better general performance, and expands the application of wireless sensor networks on mobile terminals such as smartphones and tablets. It has high practical value and reference value.

1 System Architecture

The system is mainly composed of CC2540 RF microcontroller, LCD display, infrared photoelectric sensor, temperature and humidity sensor and WiFi module. It is divided into two subsystems: front door and back door. The front door Bluetooth module is used as the master node (Central), while the back door Bluetooth module is used as the slave node (Peripheral). Compared with the back door system, the front door system has an additional WiFi module, which is mainly used to provide connection between the mobile terminal and the host computer. The system composition block diagram is shown in Figure 1.

 

a.jpg

The temperature and humidity sensors and photoelectric sensors of the front and back door subsystems are responsible for collecting the temperature, humidity and number of people in the classroom. The front door (back door) subsystem sends the collected data to the back door (front door) subsystem via the Bluetooth 4.0 protocol. The received data will be displayed at the door through the LCD display and can also be sent to the host monitoring terminal and mobile phone terminal via WiFi.

2 System Hardware Design

2.1 Processor Unit

The main control unit is based on the CC2540 RF microcontroller, which is a wireless RF microcontroller launched by TI that integrates a 2.4 GHz RF transceiver and is fully compatible with the 8051 core. Together with the Bluetooth low-power protocol stack, it forms a cost-effective, low-power system-on-chip (SoC) solution, which is very suitable for Bluetooth low-power applications. It also contains rich hardware resources, including 21 general-purpose I/O ports, 8-channel 12-bit ADC, 3 general-purpose timers, 2 serial ports, 5-channel DMA, and supports SPI, USB, etc.

The peripheral circuit of CC2540 is simple. The network node can be constructed by connecting a filter circuit composed of several resistors and capacitors and a PCB antenna. The minimum CC2540 system mainly consists of a 32 MHz off-chip crystal oscillator, a 32 kHz sleep crystal oscillator, a reset circuit, a +5 V power supply and decoupling capacitors, a RF impedance matching circuit and a unipolar PCB antenna. If the chip does not need to sleep, the 32kHz crystal oscillator can be omitted. The external interface circuit of the CC2540 chip is shown in Figure 2.

 

b.jpg

Among them, L1 is a magnetic bead, model BLM15HG102SN1D, and its impedance is 1 kΩ at 100 MHz.

2.2 WiFi Module

The people counting module and the server realize data transmission through the WiFi module. Generally, the wireless network on campus uses WiFi coverage and covers every classroom. In order to save costs, the existing resources can be reasonably used to realize wireless communication between each data statistics module and the server.

The chip used in the WiFi module is the low-cost module HLK-RM04 launched by Hailingke Electronics. This module is an embedded module based on a universal serial interface that complies with network standards. It has a built-in TCP/IP protocol stack and can realize the conversion between the three interfaces of user serial port, Ethernet, and wireless network (WiFi). Through the HLK-RM04 module, traditional serial port devices can transmit their data through the Internet network without changing any configuration. The HLK-RM04 module is connected to CC2540 through the serial port.

2.3 Sensor Module

The temperature and humidity sensor uses a digital temperature and humidity sensor chip SHT11 launched by Swiss company Scnsirion. Its main features are as follows: integrating temperature sensing, humidity sensing, signal conversion, A/D conversion and heater functions into one chip; providing a two-wire digital string serial interface, simple interface, high transmission reliability, programmable measurement accuracy, high measurement accuracy, ultra-small package size, and automatically switching to low power consumption mode after measurement and communication. Connect a pull-up resistor to its data line interface and add a 100nF decoupling capacitor between the power supply and the ground, and CC2540 can use it to collect temperature and humidity information.

The photoelectric sensor used is the photoelectric sensor model E3F-DS304C of Shanghai Taiwu Electric Co., Ltd., which has integrated the amplifier LM324, resistors and other peripheral devices in the module, and leads out three wires, namely the ground wire, data wire and power wire. As long as the data wire is directly connected to the external interrupt interface of CC2540 and the power and ground wires are connected, the counting function can be realized. Two photoelectric sensors are installed in each front and rear door system, side by side, one in front and one in the back.

3 System software design

The system software design is based on the Bluetooth 4.0 BLE protocol, and the node application is built on the Bluetooth 4.0 BLE protocol stack to achieve the interconnection of Bluetooth devices and the transmission of wireless data. This protocol stack not only fully supports the single-mode mode of the CC2540 chip, but also has the advantages of simple and clear structure, high compatibility and free download, which greatly saves the cost of system development.

The protocol stack code is based on C language and is very easy to read. Developers only need to modify part of the code to implement the corresponding specific functions, saving time and cost of software development. The implementation of the protocol stack adopts a layered approach, with a total of 8 layers from bottom to top, namely the physical layer, link layer, control interface layer, logical link control and adaptive protocol layer, security management layer, attribute protocol layer, generic access profile layer (GAP), and generic attribute profile layer (GATT). Mastering the layers closely associated with applications (GAP and GATT) can meet most design needs.

Reference address:Design of intelligent system for classroom occupancy monitoring based on Bluetooth 4.0

Previous article:A fast code generation method based on single chip microcomputer
Next article:Design of long-distance wireless data transmission protocol based on CC1101

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号