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.
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.
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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What is wireless charging? What are the benefits of a wireless charging setup?
- PCB panelization skills
- A masterpiece by a senior Python programmer, helping you quickly master efficient Python programming
- MicroPython Hands-on (08) - Learn Color Recognition with MicroPython from Scratch
- Optical modules and 5G bearer networks
- Analysis of the switch input circuit composed of four diodes
- The power consumption evaluation data of a Bluetooth headset using Qualcomm CRS8635 is shared for discussion!
- Questions about TEC control chip ADN8834
- Amplifier input and output voltage range and rail-to-rail misunderstanding
- msp430f5529 simple uart source program (use the serial port assistant to send and receive replies)