基于单片机的电力数据采集系统设计

  • 格式:doc
  • 大小:831.74 KB
  • 文档页数:55

基于单片机的电力数据采集系统设计

摘 要

本文介绍了基于单片机的电力数据采集的硬件设计和软件设计,电力数据采集系统是电力模拟域与数字域之间必不可少的纽带,它的存在具有着非常重要的作用。本文介绍的重点是电力数据采集系统,而该系统硬件部分的重心在于单片机。数据采集与通信控制采用了单片机STC89C52来实现,硬件部分是以单片机为核心,还包括A/D模数转换模块,显示模块,USB接口和串行接口部分。该系统从机负责数据采集并应答主机的命令。8路被测电压通过模数转换器PCF8591进行模数转换,实现对采集到的数据进行模拟量到数字量的转换,并将转换后的数据通过USB-UART转换电路PL2303传输到上位机,由上位机负责数据的接受、处理和显示,并用LED数码显示器来显示所采集的结果。软件部分应用Keil Uvision3编写控制软件,对数据采集系统、模数转换系统、数据显示、数据通信等程序进行了设计。

关键词:单片机,数据采集,STC89C52,PCF8591

中北大学信息商务学院2014届毕业设计说明书

Based Microcontroller Of Data Acquisition System Design Power

Abstract

This article describes the hardware design and software design of the data on which

based on signal-chip microcomputer .The data collection system is the link between the

digital domain and analog domain. It has an very important function. The introductive point

of this text is a data to collect the system. The hardware of the system focuses on signal-chip

microcomputer .Data collection and communication control use modular design. The data

collected to control with correspondence to adopt a machine STC89C52 to carry out. The

part of hardware’s core is SCM, is also includes A/D conversion module, display module,

and the serial interface. Slave machine is responsible for data acquisition and answering the

host machine.8 roads were measured the electric voltage to pass the in general use mold-few

conversion of PCF8591,the realization carries on the conversion that imitates to measure the

numeral to measure towards the data that collect .Then send the data to the host machine

through PL2303 or RS-232.the host machine is responsible for data and display, LED digital

display is responsible display the data. The software is partly programmed with Keil

uvision3 The software can realize the function of monitoring and controlling the whole

system. It designs much program like data-acquisition treatment,data-display and

data-communication etc.

Key Words: SCM, Data acquisition, STC89C52,PCF8591

中北大学信息商务学院2014届毕业设计说明书

第 I 页 共 Ⅱ 页 目 录

1 绪论 ............................................... 错误!未定义书签。

1.1 研究背景及目的意义 ............................... 错误!未定义书签。

1.2 国内外研究现状 ................................................... 2

1.3 该课题研究的主要内容 ............................................. 3

1.4采用方法 .......................................... 错误!未定义书签。

1.5 实现步骤 ......................................................... 3

2 开发环境及开发工具 ................................................. 5

2.1 Protel99se介绍 ................................................... 5

2.2 KeilUvision3介绍 ................................................. 6

2.3 Microsoft Visual Studio 2005介绍 ................................. 7

3 数据采集 ........................................................... 8

3.1 数据采集系统 ..................................................... 8

3.2 方案论证 ......................................................... 8

3.2.1 单片机的选择 ................................................... 8

3.2.2 A/D模数转换的选择 .............................................. 9

3.2.3 串行口的选择 ................................................... 9

3.2.4 LED显示部分 ................................................... 10

3.2.5 按键 .......................................................... 10

3.2.6 通信方式 ...................................................... 10

4 硬件部分 .......................................................... 12

4.1 芯片选择及功能介绍 .............................................. 12

4.1.1 单片机的概述 .................................................. 12

4.1.2 简介STC89C52 .................................................. 13

4.1.3 74HC138简介 ................................................... 18

4.1.4 74HC245简介 ................................................... 19

4.1.5 PL2303简介 .................................................... 21

4.1.6 24C01简介 ..................................................... 23 中北大学信息商务学院2014届毕业设计说明书

第 II 页 共 II 页4.1.7 LED数码显示器的应用原理 ....................................... 24

4.1.8 模数转换器PCF8591 ............................................. 25

4.2 原理图设计 ...................................................... 28

4.3 PCB图设计 ....................................................... 29

5 软件部分 .......................................................... 30

5.1 单片机主程序设计 ................................................ 30

5.2 PC机显示界面程序设计 ............................................ 33

5.3 调试结果 ........................................................ 34

6 总结 .............................................................. 35

附录A:电路原理图 .................................................... 36

附录B:电路布线图 .................................................... 37