智慧门锁系统研究与设计

 2022-05-02 10:05

论文总字数:31449字

摘 要

随着智能时代的到来和物联网技术的飞速发展,人们渐渐发现使用智能家具是更为便捷安全的生活方式,而家中安全的第一道保护线就是门锁,几乎天天都要用。国内智能门锁的应用主要以高端场所为主,因此便捷实用的智能门锁具有广阔的市场前景和现实意义。目前在售的智能门锁产品是在本地嵌入式设备中判断是否开锁,由于芯片的局限性,无权开锁者很容易让芯片进行干扰,产生错误的信号,而无线通信的智能锁只做数据采集以及数据传输,更为安全可靠,而且使用较为方便,不需要大量布线,可以和智能家居控制系统相结合。

本文设计了一种无线通讯,低功耗,可靠简单的智慧门锁系统。系统包括嵌入式软硬件设计,云服务器设计,手机APP设计三部分。硬件以STM32为处理器,通过NB-IoT模块或WiFi模块将数据传输至远程服务器,服务器作为信息中转及用户信息存储,实现手机端远程开锁及查询开锁信息。此外,STM32外接键盘实现本地密码解锁,外接OLED显示系统状态等信息。首先在对目前市场上智能家居采用的五种智能终端联网方式进行比较后,选择窄带物联网(NB-IoT)技术以及WiFi技术进行组网,进行终端嵌入式控制器开发,设计矩阵键盘,OLED电路实现人机交互,以及门锁动作模拟电路。之后进行了远程服务器程序设计,建立与服务器的通讯,设计数据库存放用户账号密码及开锁记录等信息。接着对手机端APP界面进行开发,选择HTTP协议与服务器进行交互。在此基础上进行了硬件终端,远程服务器后台,手机APP三端联调,测试结果表明:系统实现手机APP远程开锁,远程查看开锁记录,终端OLED可实时显示门锁状态,操作简单,显示明了。

关键词:智慧门锁,STM32,NB-IoT,云平台,手机APP,WiFi

Abstract

With the advent of the intelligent era and the popularity of the IoT technology, smart furniture is becoming an increasingly fashionable and fast way of life, and the door lock is the first safety shelter for home, which can almost be used every day. Domestic smart door locks are mainly concentrated in some high-end markets. The convenient and practical smart door locks have broad market prospects and practical significance. Nowadays, some smart door lock devices on the market have processing functions, which is difficult to resist the theft of criminals. Therefore, the smart door lock controlled by wireless communication mode has emerged. This kind of door lock only performs data acquisition and data transmission. It is safer and more reliable, and it is easy to use. It does not require a lot of wiring and can be combined with a smart home control system.

A reliable and simple smart door lock system, which has low power consumption and uses wireless communication, is designed by author. The system includes embedded software and hardware design, cloud server design and mobile APP design. The system uses STM32 as the processor to transmit data to the remote server through the NB-IOT module to realize remote unlocking and query unlocking information on the mobile terminal. In addition, STM32 has keyboard to achieve local password unlock, it also has external OLED to display some status and information of the system. After the comparison of the five networking methods of intelligent terminal devices adopted in smart home in the current market, NB-IoT and WiFi are selected for networking. Then the terminal embedded controller, matrix keyboard, OLED circuit and the door lock action simulation circuit are designed. After that, the remote server program is designed and the communication with the server is established. Then the mobile APP interface is developed and the HTTP protocol is selected to interact the APP with the server. On this basis, the hardware terminal, cloud platform and mobile APP are jointly adjusted. Finally, the system brings out the remote unlocking by mobile APP, remote viewing the unlocking record on APP, and the OLED terminal can show the status of the door lock in real time, with simple operation and clear display.

KEY WORDS: smart door lock, SYM32, NB-IoT, cloud platform, APP,WiFi

目 录

摘 要 I

Abstract II

第一章 绪论 1

1.1智慧门锁的研究背景与意义 1

1.2现有智慧门锁通讯技术分析 1

1.2.1 蓝牙技术 1

1.2.2 WiFi技术 1

1.2.3 GPRS技术 2

1.2.4 ZigBee技术 2

1.2.5 NB-IoT技术 2

1.3论文章节安排 3

第二章 智慧门锁总体方案设计 5

2.1系统总体方案设计 5

2.2硬件芯片选型 5

2.3开发工具与开发环境 7

2.4本章小结 8

第三章 嵌入式控制器硬件设计 9

3.1主控电路设计 9

3.2通讯电路设计 11

3.2.1 NB-IoT电路设计 12

3.2.2 WiFi电路设计 15

3.3显示电路设计 16

3.4键盘电路设计 17

3.5执行电路设计 17

3.6 外部存储电路设计 18

3.7电源电路设计 18

3.8本章小结 19

第四章 嵌入式控制器软件设计 20

4.1 软件总体设计 20

4.2 通讯程序设计 20

4.2.1 NB-IoT程序设计 20

4.2.2 WiFi程序设计 21

4.3 显示程序设计 23

4.4 键盘输入程序设计 24

4.5 存储程序 24

4.6 本章小结 25

第五章 手机APP开发 26

5.1总体设计 26

5.2 HTTP协议 26

5.3登陆、注册与忘记密码 28

5.4用户中心 29

5.4.1修改密码 29

5.4.2开锁 29

5.4.3查询开锁记录 29

5.5本章小结 30

第六章 云平台程序设计 31

6.1 云平台介绍 31

6.2 服务器与嵌入式硬件通讯设计 31

6.2.1 TCP/IP协议与Socket 31

6.2.2 Socket程序设计 32

6.3 服务器与手机端通讯设计 33

6.3.2 PHP简介 33

6.3.3 后台程序设计 33

6.4 本章小结 33

第七章 测试结果与分析 34

7.1手机端测试结果 34

7.2服务器端测试结果 36

7.3嵌入式终端测试结果 37

7.4测试结果分析 39

第八章 总结与展望 41

参考文献 43

致谢 45

附录A 软件流程图 46

绪论

1.1智慧门锁的研究背景与意义

随着智能时代的到来和物联网技术的发展,人们渐渐发现使用智能家具是更为便捷安全的生活方式,而进入家庭首先就要通过门锁,一款智慧便捷的门锁带来的良好用户体验,将会成为智能家居环境的一个好的开始[1]。传统的开锁方式是用钥匙来开,尽管机械制造的钥匙在设计与制作过程中进行了多方面的安全性考虑,但是如果被不法分子捡到,复制一把的难度并不高,甚至用一些巧妙地工具就可以代替钥匙进行开锁。并且回家时翻包找钥匙、忘记带钥匙等情况使得用户多有不便,智能电子锁可以解决生活中经常发生的忘记带钥匙的问题,并且电子密匙不易复制与盗取,大大提高了安全性与便捷性。国内智能门锁应用并不普遍,以一些高端市场为主,如高端小区,写字楼,高档酒店等,普通家庭中使用智能门锁的用户不多。据统计,我国居民家庭中,经济条件允许的家庭里,想要安装使用新技术智能门锁的占到八成,按照目前在售的产品价格来算, 这就是上千亿的市场额[2],由此来看,便捷实用的智能门锁具有很高的市场潜能和实际意义。

剩余内容已隐藏,请支付后下载全文,论文总字数:31449字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;