通信电源威达蓄电池温度的监测方法:
议题内容:
威达蓄电池温度监测系统的系统组成
威达蓄电池温度监测系统的软硬件设计
解决方案:
电压、温湿度采集、温度采集
模块之间的通信
数据显示
系统组成
威达蓄电池温度监测系统的原理框图如图1所示。主要由电压、温湿度采集、温度采集、89S51单片机、键盘控制模块、显示电路模块、通信模块组成。该系统能完成6组或6组以上通信电池的温度测量、1路机房环境测量(温度、湿度测量)、2路直流电压和2路交流电压测量,传输数据距离大于200m。
硬件设计
1单片机选择
该系统单片机选用89S51,该单片机采用0.35新工艺。成本降低,功能提升,与传统的89C51单片机相比主要具有以下特点:
(1)功能增多,性能有了较大提升,价格基本不变;
(2)ISP在线编程功能;
(3)更高工作频率为33MHz,计算速度更快;
(4)具有双工UART串行通道;
(5)内部集成看门狗计时器;
(6)双数据指示器;
(7)兼容性强,向下完全兼容51全部子系列产品。
2温度传感器的选择及其与单片机的连接
温度采集选用DS18B20,DS18B20具有独特的单总线接口方式,通过串行通信接口(I/O)直接输出被测温度值接口方式,CPU只需一根端口线就可与DS18820实现双向通信;在使用中不需要任何外围元件;内含寄生电源,既可采用寄生电源,也可由VDD直接供电;允许电压范围是3.0~5.5V,进行温度/数字转换时的工作电流约为1.5mA,待机电流仅为1μA,典型功耗为5mW;温度测量范围为-55~125℃,在0~85℃之间,误差小于0.5℃;支持多点组网功能,多个DS18B20可以挂接在一根总线上,可实现多点测温;具有负压特性,当电源极性接反时,温度计不会因发热而烧毁,但不能正常工作。
DS18B20和单片机的连接如图2所示,由VCC直接供电,连接一个4.7kΩ左右的上拉电阻,DQ直接连到单片机的P1.0口上。
CPU对DS18B20的访问流程是:对DS18B20初始化即ROM操作命令、存储器(包括便笺式RAM和E2PROM)操作命令即数据处理。单总线上所有处理都从初始化开始,初始化时序由主机发出的复位脉冲和一个或多个从机发出的应答脉冲组成。主机接收到从机的应答脉冲后,说明有单总线器件在线,主机就可以开始对从机进行ROM命令和存储器操作命令,使DS18B20完成温度测量并将测量结果存人高速暂存储器中,然后读出此结果。
3交、直流电压以及机房温湿度的测量
直流电压、交流电压以及机房温湿度的测量选用TLC1543,TLC1543为10位11通道的A/D转换器,与单片机的连接如图3所示。机房环境测量(温度、湿度)采用JWS温湿度变送器,输出信号为标准0~5V直流电压信号;直流电压的数据采集经电阻分压后直接送至A/D转换器,交流电压的采集经分压整流后也直接送至A/D转换器。
4显示电路设计
温度显示采用6位LED,与单片机的连接如图4所示。显示模块由8279键盘、显示接口芯片和相应的驱动电路组成。8279的扫描线SLA~SLC在扫描过程中,可将芯片内部显示单元的内容送到输出数据线OA0~OA3和OB0~OB3扫描线经74HC138译码,作为多位LED数码管的位选线,通过74LS04反相后,再经过位驱动芯片,用于对不同的数码管进行位驱动。同时,用OA0~OA3和OB0~OB3送出的数据对应地驱动每个数码管的8个显示段,使6个数码管轮流驱动发光。驱动芯片采用SN75491和SN75492,分别驱动数码管的段和位显示,保证6位数码管都被点亮时需要的更大电流。
5通信模块设计
为了满足数据传输距离大于200m,通信采用75LBC180全双工485芯片,单片机通信电平和计算机电平的转换采用MAX232完成,如图5所示。MAX232芯片是专为电脑的RS232标准串口设计的接口电路,使用+5V单电源供电。另外。RS232到RS485的转换可采用专用的转换器,如BOK-60或ATC-160A无源转换器。
软件设计
蓄电池温度监测系统的软件设计主要包括主程序、外部中断子程序、显示子程序等。图6是该系统的主程序流程图。用于完成对DS18B20的调用、中断管理、测量温度值的计算及温度值的显示等功能。主机89S51首先复位脉冲使信号线上所有的DS18B20芯片都被复位,接着发送跳过ROM操作命令,激活在线的所有DS18B20,然后系统转人中断处理流程,完成温度转换,读取等工作。外部中断子程序完成对温度测量数据的读取,显示子程序完成液晶显示器的初始化及显示温度值。
基于89S51和DS18B20的通信电源蓄电池温度监测系统,接口简单,占用微处理器的端口较少,可节省大量的引线和逻辑电路,与传统装置相比,具有结构简单,成本低,可靠性和测温精度高,功耗低,应用面广等优点。
Communication power supply Vida battery temperature monitoring method:
Topic:
The system composition of VIada battery temperature monitoring system
Design of hardware and software for temperature monitoring system of VIada battery
Solution:
Voltage, temperature and humidity collection, temperature collection
Communication between modules
Data display
System composition
The schematic diagram of the temperature monitoring system of VIada battery is shown in Figure 1. It is mainly composed of voltage, temperature and humidity acquisition, temperature acquisition, 89S51 MCU, keyboard control module, display circuit module and communication module. The system can measure the temperature of six or more groups of communication batteries, measure the environment of the equipment room (temperature and humidity), measure the DC voltage and AC voltage of two channels, and transmit data at a distance of more than 200m.
Hardware design
1 SCM selection
The system uses 89S51 single chip microcomputer, which adopts 0.35 new technology. Cost reduction, function improvement, compared with the traditional 89C51 microcontroller mainly has the following characteristics:
(1) The function is increased, the performance is greatly improved, and the price is basically unchanged;
(2)ISP online programming function;
(3) Higher operating frequency of 33MHz, faster calculation speed;
(4) with duplex UART serial channel;
(5) Internal integrated watchdog timer;
(6) Dual data indicator;
(7) Strong compatibility, down fully compatible with all 51 sub-series products.
2. Selection of temperature sensor and connection with MCU
Temperature acquisition DS18B20 is selected, DS18B20 has a unique single-bus interface mode, through the serial communication interface (I/O) directly output the measured temperature value interface mode, the CPU only needs one port line to achieve two-way communication with DS18820; No peripheral components are required in use; Contains parasitic power supply, can use parasitic power supply, can also be directly powered by VDD; The allowable voltage range is 3.0 to 5.5 V, the operating current for temperature/digital conversion is about 1.5 mA, the standby current is only 1μA, and the typical power consumption is 5mW. The temperature measurement range is -55 ~ 125℃, between 0 ~ 85℃, the error is less than 0.5 ℃; Support multi-point networking function, multiple DS18B20 can be connected to a bus, can achieve multi-point temperature measurement; With negative pressure characteristics, when the power supply polarity is reversed, the thermometer will not burn due to heat, but it can not work normally.
The connection between DS18B20 and the MCU is shown in Figure 2. It is directly powered by VCC, connected with a pull-up resistor of about 4.7 kΩ, and DQ is directly connected to the P1.0 port of the MCU.
The process of CPU access to DS18B20 is: DS18B20 initialization, that is, ROM operation command, memory (including notepad RAM and E2PROM) operation command, that is, data processing. All processing on a single bus begins with initialization, which consists of a reset pulse from the host and a response pulse from one or more slaves. After the host receives the slave's response pulse, it indicates that there is a single bus device online, the host can start to carry out ROM commands and memory operation commands to the slave, so that the DS18B20 completes the temperature measurement and stores the measurement results in the high-speed temporary memory, and then reads the result.
3 Measure AC and DC voltage and temperature and humidity in the equipment room
Dc voltage, AC voltage and temperature and humidity in the equipment room are measured by TLC1543. TLC1543 is A 10-bit and 11-channel A/D converter. The connection with the single chip microcomputer is shown in Figure 3. The JWS temperature and humidity transmitter is used to measure the environment (temperature and humidity) in the equipment room. The output signal is the standard 0 ~ 5V DC voltage signal. Dc voltage data acquisition is directly sent to A/D converter after the resistance voltage division, and AC voltage acquisition is also directly sent to A/D converter after the voltage division rectification.
4 Display circuit design
The temperature display adopts 6-bit LED, and the connection with the MCU is shown in Figure 4. The display module is composed of 8279 keyboard, display interface chip and corresponding drive circuit. 8279 scan line SLA ~ SLC In the scanning process, the content of the internal display unit of the chip can be sent to the output data line OA0 ~ OA3 and OB0 ~ OB3 scan line through 74HC138 decoding, as a bit selection line of the multi-digit LED nidiget, through 74LS04 reverse phase, and then through the bit driver chip, Used for bit drive of different nixie tubes. At the same time, the data sent by OA0 ~ OA3 and OB0 ~ OB3 are used to drive the 8 display segments of each digital tube correspondingly, so that the 6 digital tubes drive the light in turn. The driver chip adopts SN75491 and SN75492, respectively, to drive the segment and bit display of the digital tube, ensuring the higher current required when all 6 bits of the digital tube are lit.
5 Communication module design
In order to meet the data transmission distance greater than 200m, 75LBC180 full-duplex 485 chip is used for communication, and MAX232 is used to complete the conversion of communication level between single-chip microcomputer and computer level, as shown in Figure 5. The MAX232 chip is an interface circuit designed for the RS232 standard serial port of the computer, using a +5V single power supply. Plus. The conversion from RS232 to RS485 can be done using a dedicated converter, such as a BOK-60 or ATC-160A passive converter.
Software design
The software design of battery temperature monitoring system mainly includes main program, external interrupt subroutine, display subroutine and so on. Figure 6 is the main program flow chart of the system. It is used to complete the functions of calling DS18B20, interrupt management, calculation of measured temperature and display of temperature value. Host 89S51 first reset pulse to reset all DS18B20 chips on the signal line, and then send skip ROM operation command to activate all DS18B20 online, and then the system switch to interrupt the processing process, complete the temperature conversion, reading and other work. The external interrupt subroutine completes the reading of the temperature measurement data, and the display subroutine completes the initialization of the LCD and displays the temperature value.
The communication power battery temperature monitoring system based on 89S51 and DS18B20 has the advantages of simple interface, less port of microprocessor, saving a lot of leads and logic circuits. Compared with traditional devices, it has the advantages of simple structure, low cost, high reliability and temperature measurement accuracy, low power consumption and wide application.
Copyright © 2022-2024 厦门雄霸电子商务有限公司 版权所有 备案号:闽ICP备14012685号-33