基于STM8L的门禁信息采集终端机-毕设 - 图文 下载本文

北京工业大学毕业设计(论文)

基于STM8L处理器的 智能门禁信息采集终端机的研究

姓 名: 周 尚 学 号: 08521127 专 业: 电子信息工程 指导教师: 王 铁 流

2012 年 5 月 28 日

北京工业大学毕业设计(论文)

摘要

传统的基于RS232/RS485的门禁系统具有控制范围小和布线繁琐等局限性,已经不能满足社会的快速发展。本文设计了一种基于GPRS(General Packet Radio Service)网络的智能门禁信息采集终端机,该系统具有监控范围广、无需布线等特点,对于需要远程、大范围的门禁信息采集和监控,例如大型房屋租赁的全城、甚至全国房屋信息管理,具有迫切需求。

本系统以STM8L系列微控制器作为核心,应用RFID(Radio Frequency Identification)读写器对用户刷卡信息进行认证,并通过GPRS模块将数据上传。

本文重点研究了用户信息的采集和数据的传输功能,重点包括RFID读卡芯片和射频卡的功能开发、GPRS模块与单片机的通信控制接口的开发。论述了其实现方法,包括系统设计、硬件电路设计、软件设计及系统测试。

该系统的主要功能是:使用STM8L处理器通过SPI(Serial Peripheral Interface)总线接口与RFID读写器进行通信,当有用户使用射频卡时读写器采集信息,处理器对采集到的信息进行认证,并将用户的信息和门禁系统的状态存储到存储器中。随后STM8L通过通用串口发送AT指令控制SIM900A GPRS模块,将数据以SMS(Short Messaging Service)或TCP/IP的方式发送到用户的监控设备上。

本文最终完成了智能门禁信息采集终端机的设计,实现了数据采集和传输功能,最后给出了实验样机的测试结果。

关键词: 智能门禁、STM8L、RFID、GPRS

北京工业大学毕业设计(论文)

ABSTRACT

The traditional RS232/RS485-based access control system cannot satisfy the rapid development of society, just because of its limited control scale and multifarious circuitry. This paper introduces a design of intelligent access information collection terminal that based on GPRS (General Packet Radio Service).The system has wide monitoring scope and wiring convenience. For those who need a remote, a wide range of access control information collection and monitoring, such as large-scale rental of the whole city, and even the national housing information management, has the urgent needs.

This system uses the STM8L family microcontroller as the core, RFID (Radio Frequency Identification) reader to authenticate the user information of card, and upload data through GPRS module.

This paper focuses on the user information acquisition and data teansfer function. Highlights include the functional development of the RFID reader chip and RF card, and the development of GPRS module communication with the MCU control interface. And its realization methods are discussed, including the system design, hardware circuit design, and software design and system test.

The system’s main functions are: use STM8L processor through the SPI bus interface to communicate with the RFID reader;Gather information when a user uses the RF card. P、the processor for authentication of the information collected and save the user information and access control system state. Subsequently STM8L processor controls the SIM900A GPRS module by AT commands, and send data by SMS (Short Messaging Service) or TCP/IP to the user’s monitoring equipment.

The article completes the design of intelligent access information collection terminal with data acquisition and transmission functions. Finally, the test results of the experimental prototype are also showed.

Key words:Intelligent door monitor, STM8L, RFID, GPRS

北京工业大学毕业设计(论文)

目录

1 绪论 .................................................................... 1

1.1 课题背景 .......................................................... 1

1.1.1 网络型智能门禁系统 ........................................... 1 1.1.2 STM8L简介 ................................................... 1 1.2 本文的研究内容及方法 .............................................. 3

1.2.1 本文研究内容 ................................................. 3 1.2.2 本文研究方法 ................................................. 3 2 系统设计与硬件电路实现 .................................................. 5 2.1 系统设计 .......................................................... 5

2.1.1 系统设计要求 ................................................. 5 2.1.2 系统组成 ..................................................... 5

2.2 单片机系统模块设计 ................................................ 6 2.2.1单片机电路设计 ............................................... 6 2.3 GPRS数据传输模块设计 .............................................. 8

2.3.1 SIM900A模块介绍 ............................................. 8 2.3.2 数据传输的电路设计 .......................................... 10 2.4 RFID数据采集模块设计 ............................................. 12 2.4.1 MFRC522介绍 ................................................ 12

2.4.2 数据采集的电路设计 .......................................... 13 2.5 辅助部分模块设计 ................................................. 14

2.5.1 存储器电路设计 .............................................. 14 2.5.2 执行机构驱动电路设计 ........................................ 14 2.5.3 时钟显示电路设计 ............................................ 14

3 系统软件设计 ........................................................... 16

3.1 系统主程序设计 ................................................... 16 3.2 数据传输部分程序设计 ............................................. 17 3.3 数据采集部分程序设计 ............................................. 19 4 系统测试 ............................................................... 22 4.1 测试对象 ......................................................... 22 4.2 测试环境搭建 ..................................................... 22 4.3 测试内容 ......................................................... 22 4.4 测试流程 ......................................................... 23 4.5 测试结果 ......................................................... 24 结论 ..................................................................... 26 致谢 ..................................................................... 26