Design of low-power wireless access control system based on STC15 microcontroller and nRF2401

Publisher:QianfengLatest update time:2014-11-23 Source: 互联网Keywords:nRF2401 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  introduction

  The access control system is a modern security method used to protect the property and personal safety of the people. With the development of society and the advancement of science and technology, the access control system has developed from mechanical locks to electronic access control, from a separate access control system to alarm integration, and from a single access control to network interconnection. At present, the market is still dominated by wired access control systems, but according to market demand analysis and prospect forecasts, wireless access control systems are undoubtedly more suitable for the security industry with increasingly higher requirements. Compared with wired access control systems, wireless access control systems have the characteristics of simple installation, convenient maintenance and low cost.

  The wireless access control system designed in this paper based on STC15 microcontroller and nRF2401 can detect and identify the identity of visitors in real time through the face recognition host system. If the database contains the visitor information, the access control execution terminal will open the door lock and display the visitor information on the LCD; otherwise, the alarm will sound.

  1 Overall design of wireless access control system

  The system structure is mainly composed of PC software system, access control master terminal and access control execution terminal. The overall structure of the system is shown in Figure 1. The PC host software is mainly responsible for identifying the visitor's identity information, converting the information into the corresponding data frame format, and sending it to the access control master terminal through the serial port. The access control master terminal is mainly responsible for data encryption, initialization of the RF module and information transmission. The access control execution terminal is mainly responsible for data decryption, and performs corresponding operations based on the decrypted information, thereby achieving the function of controlling the access control system.

 

  2 System Hardware Design

  2.1 Introduction to STC15L2K61S2

  STC15L2K61S2 is a single clock/machine cycle (1T) microcontroller produced by STC. It is a new generation of 8051 microcontroller with high speed/high reliability/low power consumption/super interference. It adopts the 8th generation encryption technology, has strong encryption, and the instruction code is fully compatible with the traditional 8051 microcontroller, but the speed is 8 to 12 times faster than the traditional 8051 microcontroller. The STC15 series microcontroller has an internal integrated high-precision R/C clock, and the configurable clock range is 5 to 35 MHz. At the same time, the STC15 series microcontroller has an internal integrated high-reliability reset circuit, so the STC15L2K61S2 minimum system does not require an external crystal oscillator and clock circuit.

  STC15L2K61S2 has 3-channel CCP/PWM/PCA, 8-channel 10-bit high-speed A/D converter, built-in 2K large-capacity SRAM, 2 sets of ultra-high-speed asynchronous serial communication ports and 1 set of high-speed synchronous serial communication port SPI. In addition, for the 5TC15L2K61S2 microcontroller, its power supply voltage only needs 3.3V, so its power consumption is much lower than that of the traditional 8051 microcontroller.

  2.2 Power Module

  The operating voltage of nRF2401 is between 1.9 and 3.6 V, and the power supply voltage of the microcontroller is 3.3 V. In order for nRF2401 to work normally and stably, a DC power supply module must be connected to nRF2401. After testing, nRF2401 works relatively stably at 3.3 V, and the power supply voltage of the STC15L2K61S2 microcontroller is also 3.3 V. The system is powered by USB, and the voltage is about 5 V, so the 5 V voltage needs to be converted into 3.3 V. The power module uses a linear regulated power supply to form an analog power supply, and adjusts the sliding rheostat to make the output voltage 3.3 V. The schematic diagram of the 3.3 V power module is shown in Figure 2.

 

  2.3 nRF2401 RF module interface circuit design

  nRF2401 is a single-chip wireless transceiver chip produced by Nordic Corporation, which operates at the 2.4-2.5 GHz global ISM frequency. The chip has built-in address decoder, first-in-last-out stack area, demodulation processor, clock processor, GFSK filter, low noise amplifier, frequency synthesizer, power amplifier and other functional modules, and requires very few peripheral components, so it is very convenient to use.

  There are four working modes of nRF2401: transceiver mode, configuration mode, idle mode and shutdown mode. The working mode of nRF2401 is determined by three pins: PWR_UP, CE and TX_EN. The transceiver mode of nRF2401 includes Enhanced ShocKBurstTM transceiver mode, ShocKBurstTM transceiver mode and direct transceiver mode. In order to save energy, this system chooses to use Enhanced Shock BurstTM transceiver mode for wireless transmission. The connection circuit between nRF2401 RF module and STC15L2K61S2 is shown in Figure 3. CSN is the chip select line of the chip. When CSN is low, the chip works. SCK is the clock line (SPI clock) controlled by the chip. MISO and MOSI are the chip control data lines. IRQ is an interrupt signal. During wireless communication, MCU mainly communicates with nRF24L01 through IRQ. CE is the mode control line of the chip. When CSN is low, CE and the CONFIG register of nRF24L01 jointly determine the state of nRF24L01.

 

  2.4 LCD display module interface circuit design

  Nokia5110 is a liquid crystal display produced by Nokia. It can display both characters and graphics. When powered by low voltage, the normal display current is below 200 μA, and the price is cheap. A Nokia5110 module with a driver chip costs only 15 yuan, while a 1602 liquid crystal display costs 20 yuan, and a 12864 liquid crystal display costs 50 to 70 yuan. In addition, the interface of Nokia5110 has only 8 pins including backlight, which is much less than 1602 and 12864, and is more convenient in hardware design. The 8 pins of Nokia5110 are RST, CE, D/C, SDIN, SCLK, VCC, BL and GND, among which RST is the reset pin, CE is the chip enable pin, D/C is the mode selection pin, SDIN is the serial data line, SCLK is the serial clock, VCC is the 3.3 V working voltage, BL is the backlight pin, and GND is the power ground. The Nokia5110 interface circuit is shown in Figure 4.

 

  2.5 Stepper Motor Drive Circuit Design

  This article uses L298N to form a motor drive circuit. L298N is a high-voltage, high-current motor driver chip produced by ST. The chip uses a 15-pin package. The main features are: high operating voltage, the maximum operating voltage can reach 46V; large output current, instantaneous peak current can reach 3A, continuous working current is 2A; rated power is 25W. Use L298N chip to drive the motor. This chip can drive a two-phase stepper motor or a four-phase stepper motor, which just meets the design needs of this system. The stepper motor drive circuit is shown in Figure 5.

 

  3 System Software Design

  3.1 nRF2401 Software Design

  The nRF24L01 data transmission or reception is mainly realized through the SPI interface. The STC15L2K61S2 microcontroller I/O port is used to simulate the working timing of the SPI interface. The SPI read and write timing is shown in Figures 6 and 7. 

 

  After completing the basic functions of the chip, the chip needs to be initialized to ensure that the address width, channel operating frequency, transmission and reception rate and power of the transmitter and receiver are consistent. The RF initialization function is as follows:

 

  3.2 Stepper Motor Software Design

  Four-phase stepper motors can be divided into three working modes according to the power-on sequence: single 4-beat, double 4-beat, and 8-beat. The step angles of single 4-beat and double 4-beat are equal, but the torque of single 4-beat is small. The step angle of 8-beat working mode is half of that of single 4-beat and double 4-beat. Because the 8-beat working mode can maintain a high torque and improve control accuracy, this article adopts the 4-phase 8-beat working mode.

 

  The power-on timing and waveform of the single 4-beat, double 4-beat and 8-beat working modes are shown in Figure 8 respectively.

 

  Conclusion

  Through many experimental tests, the wireless access control system designed in this paper has good real-time performance and accuracy. In the presence of obstacles, data transmission can also meet practical requirements and achieve the expected design goals.

Keywords:nRF2401 Reference address:Design of low-power wireless access control system based on STC15 microcontroller and nRF2401

Previous article:Fingerprint recognition access control system based on Linux system
Next article:Using the inverter PSPICE simulation model to simulate transient dynamic response

Latest Power Management Articles
Change More Related Popular Components
Guess you like

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号