1、- I - 基于单片机的智能传感器设计基于单片机的智能传感器设计 摘要摘要 随着自动化技术的发展和微电子技术的进步,以及现场总线技术的日益成 熟,数控技术在生产过程中的应用越来越广泛,对现场信号的采集、传输和数 据处理提出更高的要求。 本论文阐述了现场信号通信的发展概况和智能变送器的现状,分析了智能 变送器的作用和工作原理,针对应用中使用的不同的传感器输出不同幅值的弱 直流电信号的要求,设计了智能变送器系统。它实现了弱直流电信号放大,并 能根据信号的幅值大小来自动改变放大系数,提高测量灵敏度,对采样数据处 理后,既能输出 420mA DC 标准电流信号,又能通过 RS485 总线与其他上 位机
2、或同位机进行数字通信。系统根据传感器输出的信号范围通过编程设定由 集成测量放大器 AD623 和非易失性数控电位器 X9241 组成的放大环节的增益, 将弱信号放大到 05V DC,通过多通道 12 位串行 A/D 转换器 TLC2543 进行 A/D 转换,将采集到的数据送给单片机 80C52,由单片机进行滤波、标度变换 等数据处理后,通过 8 位并行 D/A 转换器 DAC0832 将数据转换成 420mA DC 信号输出,或通过隔离后的 RS485 总线将数据传送给上位机。系统设计有独 立的看门狗电路和 EEPROM 存储器电路,提高了系统可靠性。系统软件采用 MCS51 单片机汇编语言
3、,模块化程序设计方法,设计了仪表监控主程序、放 大器增益设定程序、ADC 转换和处理子程序、DAC 转换等子模块,并设计了相 应的通信协议。 关键词关键词 智能变送器;通信;单片机;现场总线;测量信号 - II - Intelligent sensor based on single-chip design Abstract With the development of Automation and the progress of the micro electronics technology, and the mature of Field Bus, digital control te
4、chnology is widely used in production process, so collection, transition and treatment of signal should meet higher requirements. This thesis is about general development of field signal communication and status of intelligent transducer, analyzes function and operation principle of intelligent tran
5、sducer. The transducer is designed chiefly for different weak output signal of non- standard sensors. It can amplify the weak signal, alter the amplification factor according to the size of the weak signal and improve system sensitivity. After sample data processed, it not only can output 420mA stan
6、dard direct current, but also can communicate with other computers and single chip by mean of RS485 bus. According to the output signal range of the sensor, the system sets the gain of amplification link which is composed of AD623 and X9241 by way of program, amplifies the weak signal to DC 05V, then makes A/D transition through, multi passages and 12bit TLC2543, brings the sampled data to single chip 89C52, filtering the data, and transferring surveyor etc ,then transits the data t