登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 电子信息类 > 光电信息科学与工程 > 正文

基于Arduino开源平台的智能网络校时时钟的设计毕业论文

 2021-03-23 10:03  

摘 要

本文基于Arduino开源平台展开智能网络校时时钟系统的设计,与实际生活联系紧密。随着物联网技术得到发展,越来越多的相关应用出现乃至普及到生活的各个方面,这个研究课题也有了更加重要的现实意义。通过这个开源平台,能够对更多的芯片以及开发板进行开发使用,使更多软硬件相关的系统设计问题找到解决的办法。

本文主要研究了在使用Arduino Uno作为主控板的情况下,在Arduino IDE开发环境下编写程序,通过软件来控制硬件模块的使用与功能实现。整个智能网络校时时钟系统的搭建可分为三个模块:ESP8266负责实现NTP网络校时,Arduino Uno作为主控,而WS2812B则用来显示时间。当WiFi模块接收到网络时间后通过串口将这个时间数据传送给主控板,主控板单线驱动WS2812B显示出时间并在接收到时间数据后进行校时。

硬件调试结果表明:在Arduino Uno主控板未接收到时间数据的时候,时钟会按照程序设定的时间继续走下去,但是由于系统设置的原因,一段时间后时钟显示的时间会与网络时间存在偏差。ESP8266会不停地按照设定间隔获取网络时间,一旦接收到时间数据后就会将其传送到主控板,通过时间数值的读取与计算来完成网络校时功能,然后驱动WS2812B显示出校准后的时间值。

关键词:Arduino开源平台;WiFi模块;NTP校时;网络时钟

Abstract

The intelligent network clock system is designed based on Arduino open source platform, this system is close to our real life. With the development of Internet of Things technology, more and more related applications appear and even spread to all aspects of life, this research topic also has a more important practical significance. Through this open source platform, we can use more chips and boards for development, so that more hardware-related and software-related system design problems can easily find a solution.

The thesis mainly studies the use of Arduino Uno as the main control board, in the Arduino IDE development environment to write the program, through the software to control the use of hardware modules and functional implementation. The entire intelligent network clock system can be divided into three modules: ESP8266 is responsible for implementing the NTP network time, Arduino Uno as the master, WS2812B shows the time. When the WiFi module receives the network time through the serial port, it will send this data of time to the main control board at once, then the main control board will drive the WS2812B to display the time and timing after receive this data by single-line.

Hardware debugging results show that the clock will follow the program to set the time to continue until the Arduino Uno main control board receive the time data. However, due to the system settings, after a period of time the clock display time and the network time there is a deviation. ESP8266 will be kept in accordance with the set interval to obtain the network time, the time data will be sent to the master as soon as it is received, the network time function can be completed through the read and calculate of the time value, and then drive the WS2812B shows the time value after calibration.

Key Words:Arduino open source platform;WiFi module;NTP timekeeping;network clock

目 录

第1章 绪论 1

1.1 引言 1

1.2 研究背景及现状 1

1.2.1 研究背景 1

1.2.2 国内外研究现状 1

1.3 Arduino智能网络时钟研究的意义 2

1.3.1 主要研究内容与预期目标 2

1.3.2 研究目的与意义 2

第2章 Arduino开源平台 3

2.1 Arduino Uno R3开发板 3

2.1.1 基本结构 3

2.1.2 功能模块 4

2.2 Arduino IDE 4

2.2.1 Arduino语言 4

2.2.2 Arduino库 5

第3章 系统总体设计 6

3.1 智能网络校时时钟整体设计 6

3.1.1 基本功能要求 6

3.1.2 工作原理 6

3.2 系统硬件设计 7

3.2.1 硬件模块的选择 7

3.2.2 NodeMcu介绍 7

3.2.3 硬件电路的连接 9

3.3 系统软件设计 10

3.3.1 NTP校时 11

3.3.2 时间显示 11

3.3.3 软串口传输 12

第4章 系统总体调试 13

4.1 硬件基本功能测试 13

4.1.1 端口测试 13

4.1.2 单线驱动测试 14

4.2 软件功能调试 14

4.2.1 时钟显示及自动走时 14

4.2.2 NTP校时 16

4.2.3 串口传输 18

4.3 整体调试 19

第5章 结论 20

参考文献 21

附录A 22

附录B 26

致 谢 28

第1章 绪论

1.1 引言

随着时代的发展,人们对于生活质量的要求也提高了,因此,在日常的生活当中,产生了各种各样的需求,其中对于信息的及时获取占了很大的比重。为了满足这些需要,信息技术的发展成为必然趋势。其中物联网相关技术也得到了更多学者的关注,其被重视程度的提高所带来的不止是各种硬件开发板的更新换代,还有与硬件相匹配的软件开发平台的繁荣发展。在众多基于该技术的实际应用系统的设计中,硬件开发与软件开发都属于不可或缺的部分,两者结合往往能够更高效快速地实现设计要求。

信息时代的到来预示着人们对于信息的需求增大,可以说,通过网络获取想要的信息已经成为现代生活质量得到保证的诸多基本条件之一。智能网络校时时钟对于我们的日常生活来说,也是一个相当有用的设计。它的自动网络校时功能相当受欢迎,相比机械时钟有着更加低廉的成本以及实时通信获取时间、减小误差的优势。当用户请求时间信息时,时钟能够自动连接网络,显示网络时间。在这个过程中,NTP校时等技术的使用能够保证所获得的时间与网络时间基本一致,满足人们对于时钟精确度的要求。

1.2 研究背景及现状

1.2.1 研究背景

Arduino是由David Cuartielles 和Massimo Banzi两位学者共同合作,于2005年1月创建,之后被延续并发展至今[1]。总体来说,它是一个基于单片机系统开发的电子互动平台。不仅具有功能多样、价格低廉等诸多优点,还拥有相当丰富且易于使用的功能模块,目前正被广泛应用于电子系统和一些互动产品的创新设计等领域。在一定程度上,由于物联网技术日渐重要起来,越来越多的人开始以该平台为核心来尝试进行交互系统的设计与搭建[2]。需求的扩大带动了技术的发展,如今,市场上已经出现了很多围绕Arduino开发的硬件模块,如LED灯控制、LCD控制、触摸屏控制以及WiFi模块、扬声器模块等。这些模块的开发与应用又使得Arduino开源平台的适用范围得到了相当大的扩展,其中智能网络时钟的研究正是一个方面。

1.2.2 国内外研究现状

Arduino具有一个基于Eclipse的IDE软件开发环境,其开发语言因类似java和C语言而易于被掌握[3]。该开源平台包括硬件和软件两个部分,可用性极强,但是也有一些硬件工程师会觉得Arduino开发太过简单、显得不够专业。利用Arduino开源平台,开发者可以很好地完成一些当下热门的课题,比如物联网采集器的设计与实现,电子艺术品的开发,智能家居监控系统的设计等等[4]。目前,由于日常生活对于智能时钟的需求持续上升,关于这个课题的研究一直热度不减。在众多时钟系统中,单片机在智能时钟设计上的应用相当普遍,很多时钟系统都以AT89C51单片机为核心,通过数码管实现数字时钟的显示。另外,因为Arduino开源平台的扩展性强,且开发方便、成本较低,所以一些被专门设计出来用于时钟系统计时的芯片也不在少数。如DS1307以及DS3231等芯片,就是一类专门用于时钟显示以及时钟同步等方面的时钟芯片。基于此芯片,可直接获取时间并按位存放在其寄存器内,通过模拟信号传输给Arduino,然后驱动显示器显示时间。

1.3 Arduino智能网络时钟研究的意义

1.3.1 主要研究内容与预期目标

以Arduino平台为核心设计一个可以自动校时的智能时钟,该系统除主控板外还需要用到ESP8266模块以及WS2812B模块。会使用这个开源平台,掌握NTP校时原理以及串口传输方法,理解LED灯的驱动原理。

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

企业微信

Copyright © 2010-2022 毕业论文网 站点地图