基于单片机的便携式气象仪设计_第1页
基于单片机的便携式气象仪设计_第2页
基于单片机的便携式气象仪设计_第3页
基于单片机的便携式气象仪设计_第4页
基于单片机的便携式气象仪设计_第5页
已阅读5页,还剩58页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、-目录设计总说明IIntroductionV第1章绪论11.1 研究的背景11.2 国外研究现状11.3 课题研究的容和意义2第2章系统方案选择与论证32.1 设计要求32.2 总体设计方案32.3 各模块方案选择和论证3主控制器模块3风向风速测量模块4温度测量模块6气压测量模块9定位模块10无线通信模块112.4 系统各模块的最终方案确定11第3章系统硬件设计123.1 系统核心控制单元AT89C52123.2 系统电源的设计133.3 系统数据的采集133.3.1 测温模块电路设计133.3.2 湿度模块电路设计153.3.3 风向风速模块电路设计163.3.4 气压模块电路设计173.4

2、 单片机与传感器连接电路设计183.5 分频电路设计203.6 通信模块电路设计213.6.1 GPS简介213.6.2 GPRS模块简介223.7 显示单元的设计243.8 独立键盘模块设计26第4章系统软件设计274.1 软件设计概述274.2 温度传感器模块的软件设计274.2.1 DS18B20的的初始化274.2.2 单片机与DS18B20的通信284.2.3 DS18B20部构造294.2.4 读取温度值304.3 模数转换模块的软件设计314.4 通信模块的软件设计324.3.1 串口工作方式1介绍324.3.2 GPS模块软件设计334.3.3 GPRS模块软件设计344.5

3、显示模块的软件设计344.6 Proteus仿真36第5章总结38参考文献39附录A 原理图40附录B 程序及注释41致53. z-设计总说明气候对于人类的劳作、生活的影响是显而易见的,良好的气候能给人带来高效的工作效率、舒适的休闲环境,但是恶劣的气候却常常给人导致难以承担的后果。 众所周知,我国的气象灾害是十分频繁的,各种恶劣的气象灾害,如干旱、台风、寒潮等等,对个人来说,工作、生活甚至生命平安受到了严重影响;对国家来说,农业、渔牧业的生产活动乃至于经济开展都受到了威胁。由于一直遭受着恶劣气候带来的严重后果,我国对气象事业投入了大量的时间、金钱、人力物力,希望能够增强对恶劣气候的预知水平及防

4、能力。其中,气象仪的研究、开展、应用是必不可少的。目前,我国投入使用了大量的气象站,分布在全国各个省市,全面掌控着我国气象的变化,对我国的气象事业发挥了重要的作用。但是一些环境恶劣、偏僻的地点,比方沙漠、山区、海岛等人员难以驻扎的地方却成了我国气象监测的盲点。这时,能自动发送气象数据的便携式气象仪就应运而生。本文先简单说明了气侯检测的重要性、国外气象检测技术的研究成果以及本课题研究的主要容及其意义,其中分析了当前气象的检测所有的一些问题及开展方向,得出开展便携式、高性能的气象仪的迫切性。之后对各个测量模块的芯片使用或传感器进展选择与论证,分析各个芯片或传感器的优缺点,然后对便携式气象检测仪的设

5、计方案进展总体概述。本系统是以单片机为系统核心,控制各个测量气象的传感器,将传感器等测得的数据通过液晶显示,另外,本设计拥有无线通信模块,既可以通过GPS得到当前的地理位置和标准时间,也能通过GPRS发送所有的气象数据。关于系统的主控制器模块,最终采用单片机AT89C52作为系统的核心控制器,在各种各样的单片机中,AT89C52本身相当于一部微型的计算机,各种部件集成在一块芯片上。AT89C52具有高性能、低功耗的特点,有8K的可以编程的程序存储器。以上种种,使得AT89C52在大量嵌入式系统电路设计中被广泛的应用。电源模块是采用两节12V干电池为整个系统供电,但系统有的模块需要用到5V,4.

6、3V电压驱动,所以为了整个系统的正常工作,必须对12V的电压进展DC-DC变换。本系统使用了芯片LM1084-5.0,输入端直接接上12V电压,在输出端即可得到5V的电压,然后再串联一个硅二极管即可得到4.3V的电压。测温模块本系统使用的是DS18B20,它是一种数字式温度传感器,只有3个引脚需要连接,其中两根分别接电源正极和负极,剩下的一个引脚可直接与单片机的I/O相连,事实上,它与单片机连接的只有一根线,单片机对它的所有操作,都是通过这根线来执行的,所以又说,DS18B20是一种单总线器件。单片机都是通过这根线向其写入指令,比方跳过ROM操作指令,温度转换指令,读取温度指令等等,之后就能通

7、过这根总线读取它的温度了。风向风速测量模块所用的是TF*系列风速风向一体传感器,它将风向与风速测量器件集成到了一起。大大缩减了体积,这是它其中的优势所在,其中风向测量局部是尾翼式设计,而风速测量局部则是经典的三杯式设计,当传感器感受到风时,它会将其中的风向及风速信息转换成电压或电流信号通过输出,经过AD芯片转换后接到单片机的I/O口上。 气压模块使用PTH501紧线螺母接头压力传感器/变送器,它的量程是01150MPa),由于本系统是气象仪,而一个标准大气压是101.325kPa,所以在此选用01MPa的量程即可到达要求。它能将检测到的气压输出为电信号,而且当外界气压变化,电信号也能随之线性变

8、化,同风向风速传感器一样,它也需要经过AD转换接到单片机的I/O口上。湿度模块本系统所使用的是RH10,它的部有一湿敏元件,这种元件的原理是湿敏电阻或湿敏电容的值会随着湿度变化而变化。RH10的湿敏元件是电容式,它使用了先进的半导体厚膜技术,整体附在一片非常小的玻纤板上,长13mm,宽7mm,厚度为0.2mm,由此可见它的体积非常小,当RH10的湿敏元件感受到空气中湿度的变化,它所输出的相应电压或电流信号也会随之线性变化。根据本系统的设计,所用的传感器除了DS18B20以外,其他传感器件输出的信号都是420mA电流信号。单片机与模拟输出型的传感器连接模块主要分为两局部,其中之一为电流电压转换模

9、块,这个模块的主要作用是将4-20mA的电流信号转换为电压信号再接到AD转换芯片的输入端。本系统所用的运放是LM324,通过电路设计,得到0.84.0V的电压信号。第二个局部则是AD/模数转换局部,本系统所使用的芯片是ADC0809,它允许8位模拟量分时间输入,使用同一个AD转换器转换。ADC0809有3位地址输入线,用于选通8位模拟输入中的一路,而本设计只有4个传感器需要进展AD转换,所以8位模拟输入完全够用。. z-分频模块使用的芯片是74HC74,为什么要分频.这是因为ADC0809在正常进展模数转换时,需要在它的CLOCK引脚,即时钟脉冲输入端输入时钟频率不高于640KHz时钟脉冲。则

10、从哪得到时钟脉冲.我注意到单片机在正常工作是在其ALE引脚会输出1/6晶振频率的脉冲信号,因为使用晶振的频率是12MHz,所以在单片机的ALE引脚输出的就是2MHz的时钟脉冲,如果能再对它四分频的话,就能得到500KHz的脉冲信号,这个信号完全能满足模数转换的要求。通信模块也分为两局部,第一局部的GPS模块,这一模块使用的器件是GR-87,它是一个完整的卫星定位接收器,用来接收一些定位信息,而本系统只需要接收有关经纬度以及标准时间的信息,具体实现方法会在软件局部详细介绍;第二局部则是GPRS模块,本系统使用的是SIM300C,SIM300C是SIM公司推出的一种三频/四频GSM/GPRS解决方

11、案,通过它,可以将测得的气象数据发送到手机上。SIM300C与单片机之间也是通过串口通信的,单片机主要通过AT指令对其进展控制。现在,又出现了一个问题,那就是AT89C52单片机只有一个串行口,而GR-87与SIM300C与单片机都是使用串口通信,所以,本系统使用了芯片CD4053来完成串口的复用,CD4053是数字控制模拟开关,它极低的导通阻抗和极低的截止漏电流。显示模块使用的是LCD1602液晶显示器,它的体积很适宜,不会显得大而臃肿,但能满足系统的显示要求。另外,它的耗电量很低,显示的字符也很清晰,不会出现闪烁的问题。LCD1602通过8位数据口与单片机的I/O连接,单片机就是通过这8位

12、数据口对LCD1602进展一系列的读写操作,最终可以将气象仪所测除的数据显示到液晶显示屏上。独立键盘模块,本系统总共用到4个开关,S3是系统的电源开关,控制气象仪是否工作,直接接在12V干电池的负极。S4是单片机的复位按键。S1,S2是用来控制LCD1602的整屏移动按键。由于本系统测量的气象数据较多,32个字节的屏幕并不能全部显示测得的气象数据,所以要把局部数据写在1602不显示的地址,然后按一下S1,LCD1602整屏左移16位,显示未按开关之前不会显示的气象数据;再按一下S2,LCD1602整屏右移16位,恢复原状。最后,设计本系统相应的软件程序,流程如下:先对LCD进展初始化,然后程序

13、进入一个循环,在这个循环中,气象仪的各个模块开场工作,首先是DS18B20开场读取温度,将读取到的温度值显示在1602液晶显示器上,然后ADC0809地址锁存端选中风向传感器输入端,将测得的气象信息通过软件处理. z-后显示到液晶上,之后,分别对湿度,风速,气压传感器等测得的数据进展AD转换,处理并显示,之后翻开串口中断,单片机的R*D口承受大GR-87传输的数据,这些数据再被显示到液晶显示屏上,之后在软有一个键盘检测程序,当S1按下,LCD1602会整屏左移,当S2按下,LCD1602会整屏右移。只要没有关闭掉气象仪的总电源,程序就会一直执行下去,也就是说,气象仪会实时的检测当前的气象数据。

14、本系统完全可以通过仿真,所设计的便携式气象检测仪可以百分之百实现系统的技术要求,并到达所要求的性能指标,具有高精度、全天候和低本钱的特点。另外,该便携式气象仪能够很好的完成一般的气象测量要求,而且还可以在各种恶劣环境下工作。拥有了这些优势,该便携式测量仪能够广泛应用于各种场景的气象测量。关键词:气象仪;AT89C52;ADC0809;GPS;GPRS. z-IntroductionClimate for human labor, life is obvious, good weather can bring efficient work efficiency, fortable leisure

15、 environment, but bad weather often to lead to difficult to bear the consequences. As is known to all, Chinas meteorological disaster is very frequent, all kinds of bad meteorological disasters, such as drought, typhoons, cold wave and so on, to individuals, work, life and even life safety by seriou

16、sly affected; for the country, agriculture, fishery and animal husbandry production activities but as for economic development are under threat.Because it has been subjected to Portable meteorological input to the harsh climate brings serious consequences, China Meteorological cause a lot of time, m

17、oney, manpower and material resources, hope to be able to enhance the harsh climate of anticipation and prevention ability. Among them, the meteorological instrument research, development and application is essential. At present, our country put into use a large number of meteorological station, loc

18、ated in the national various provinces and municipalities, the full control of the weather changes, the China Meteorological institutions play an important role. But some harsh environment, remote locations, such as desert, mountains, islands and other personnel to stationed, but the China Meteorolo

19、gical Monitoring blind spot. At this time, can automatically send data The meteorological instrument was born.The paper briefly describes the importance of Hou and gas detection, research achievements at home and abroad meteorological detection technology and the main content of this research and it

20、s significance, which analyzes the current weather detection all of some of the problems and development direction, draws the development of portable, the urgency of the high performance of the meteorological instrument. After measurement of each module of chip use or sensor were selection and demon

21、stration and analysis of the advantages and disadvantages of each chip or sensor, and then outline the design scheme of portable meteorological instrument.This system is based on single-chip microputer as the core of the system, control the various sensors to measure the weather Sensors and other me

22、asured data through the liquid crystal display, in addition, this design has a wireless munication module, both through the GPS to get the current location and the standard time, but also through the GPRS to send all the meteorological data.A system of main controller module, in the end, the AT89C52

23、 microcontroller as the core controller of the system, in a variety of single chip microputer, AT89C52 itself is in a miniature puter, various ponents integrated in a chip.AT89C52 with high performance and the characteristics of low power consumption, with 8K can programming memory. Above all, the a

24、t8 9C52 is widely used in a large number of embedded system circuit design.Power supply module uses two 12V batteries power supply for the entire system, but some modules of the system need to use 5V, driving voltage 4.3v, so in order to normal operation of the whole system must the 12V voltage DC-D

25、C converter. This system uses the chip LM1084-5.0, input is directly connected to the 12V voltage, in the output terminal can get 5V voltage, and then is connected in series with a silicon diode can get 4.3v voltage.The temperature measurement module used in this system is DS18B20, which is a number

26、 Digital temperature sensor, only three pins need to be connected, two of which are connected to the power supply of the cathode and the anode, remaining a pin can be directly connected with the microcontroller I / O, in fact, it connected with the single chip microputer of has only a single line, S

27、CM of all operations are through the thread to perform the, so said, DS18B20 is a 1-wire devices. MCU is through the wire to the write instruction, such as skip ROM operating instructions, temperature conversion instruction, read temperature instruction and so on could be through the root bus read i

28、ts temperature.Wind direction and wind speed measurement module is used in TF* series of wind Speed and direction of various sensors, it will wind direction and wind speed measuring devices are integrated into together. Greatly reduced the volume, this is it the advantage, in which direction measure

29、ment part is fin design and wind speed measuring part is the classic three cup design, when the sensor to the wind, it will the wind direction and wind speed information is converted into a voltage or current signal through the output, through the AD conversion chip connected to the MCU I / O port.T

30、he pressure module uses the PTH501 fastening nut joint pressure transducer / transmitter, which is 01150 (MPa), and the system is a meteorological instrument. Standard atmospheric pressure is 101.325kPa, so in this selection 01MPa range can meet the requirements. It can detected the output pressure

31、into electrical signals and the pressure change of the outside world, electrical signals can also followed a linear change with wind speed and direction sensor as, it also needs after AD converter connected to the MCU I / O port.Humidity module of this system uses the rh10 and inside of it with a hu

32、midity sensitive element, the principle of this kind of element is hygristor or humidity sensitive capacitance value with the humidity change and change.RH10 wet sensitive element is capacitive, it uses advanced semiconductor thick film technology. Overall attached on a piece of very small glass fib

33、er board, 13 mm long, 7mm thickness is 0.2mm, which shows the volume is very small, when rh10 humidity sensitive element to feel the change of moisture in the air, the output of the corresponding voltage or current signals will with a consequent change in linear.According to the design of the system

34、, the sensor used in addition to DS18B20, the output signal of the other sensors are 420mA current signal.Single chip and analog output type of sensor connection module is divided into two parts, one of which is the current and voltage conversion module, the main function of this module will be 4- 2

35、0mA current signal is converted into a voltage signal and then received ad conversion chip input end. The op amp is a LM324, through the circuit design, 0.84.0V voltage signal of the. The second part is AD/ analog to digital converter, the system used in the chip ADC0809, it allows many 8-bit analog

36、 input time, using the same ad converter.ADC0809 3 bit address input lines, for gated 8-bit analog input in the way, and this design only four sensors need for AD conversion, so 8 bit analog input quite enough.Frequency divider Chip is sn74hc74, why to divide? This is because ADC0809 in normal analo

37、g to digital conversion and need it at the clock pin, real-time clock pulse input end of the input clock frequency is not higher than 640KHz clock pulse. Then from where did you get the clock pulse? My attention to the MCU in normal work is in the ale pin will output 1 / 6 of the oscillator frequenc

38、y pulse signal, because is 12Mhz crystal oscillator frequency, so the ale pin of the microcontroller output is 2MHz clock pulse. If any of its four frequency, can get 500 kHz pulse signal , this signal can meet the requirements of analog digital conversion.munication module is divided into two parts

39、, the first part of the GPS module, this module uses the device is gr-87, it is a plete satellite positioning receiver, for receiving location information, and the system only need to receive information on longitude, latitude, and the standard time, the concrete realization method will be discussed

40、 in detail in the part of the software; the second part is the GPRS module. The system uses is SIM300c, SIM300c is sim pany launched a triple / Quad Band GSM / GPRS solutions, through it, can will be measured The weather data was sent to the phone.SIM300C is also through the serial munication with t

41、he microcontroller, the microcontroller is mainly controlled by the AT mand.Now, a problem has emerged, that is AT89C52 single chip puter has only one serial port, and gr-87 and SIM300c and MCU are the use of serial munication, so the system used chip CD4053 to plete serial port multiple*ing, the CD

42、4053 is digitally controlled analog switch and guide it low pass impedance and very low cut-off leakage current.The display module uses the LCD1602 LCD monitor, which Volume is appropriate, do not look big and fat, but can meet the system requirements. In addition, its power consumption is very low,

43、 the characters of the show is also very clear, does not appear flicker problem.LCD1602 connected by 8-bit I / O data interface with SCM, SCM is through the 8-bit data port on the LCD1602 were a series of read and write operations can eventually will meteorological instrument measured data in additi

44、on to the display to LCD.Independent keyboard module, the system used a total of 4 switches, S3 is the systems power switch, control the weather meter is working, directly connected to the negative 12V.S4 dry battery is a single Tablet press the reset button.S1, S2 is used to control the LCD1602 scr

45、een the whole movement keys. Due to the meteorological data measured by the system is more, 32 bytes of the screen does not show all the measured meteorological data, so to write data in 1602 does not display the address, and then click the S1, LCD1602 the whole screen left shift 16 bit, show not ac

46、cording to the switch does not appear until the meteorological data; click the S2, LCD1602 the entire screen right shifted 16 bit, restore to the original state.Finally, the design of the corresponding software program, the process is as follows:First LCD initialization, and then the program Enter a

47、 cycle, in this cycle, the various modules of the meteorological instrument began to work, the first is the DS18B20 will begin to read temperature, will read the temperature value is displayed in the 1602 liquid crystal display, and then ADC0809 address lock save end selected wind direction sensor i

48、nput end will be measured the meteorological information by processing software after the show on the LCD, respectively to humidity, wind speed and air pressure sensor measured data for AD conversion, processing and display, open the serial port interrupt, MCU R*D accept gr-87 transmission of data,

49、the data to be displayed to the LCD screen, then in the soft A keyboard detection program, when you press the S1, LCD1602 will the whole screen left shift, when you press the S2, LCD1602 will the whole screen is shifted to the right. As long as there is no shut off the total power of meteorological

50、instrument, the program will continue, that is, the meteorological instrument can real-time detection of the current meteorological data.The system can pletely through the simulation, the design of a portable weather detection instrument can achieve absolutely system technical requirements, and achi

51、eve the required performance inde*, which has the advantages of high precision, all-weather and low cost characteristics. In addition, the portable meteorological instrument can very good plete meteorological measurements of the general requirements, but also in the In a variety of harsh environment

52、 work, with these advantages, the portable measuring instrument can be widely used in various scenarios of meteorological measurements.Keywords:meteorological instrument;AT89C52; ADC0809;GPS;GPRS. z-1 绪论1.1 研究的背景 天气预报对现代社会的重要性是不言而喻的。为了获得准确的天气预报,很重要的环节就是测量和搜集大量的气象数据、气象资料。在这个过程中,气象仪是必不可少的。气象仪能够实现对测量点温

53、度、湿度、风向、风速、气压等气象参数的实时测量,它有助于我们了解环境的变化情况,对工业、农业、渔业等都起着非常重要的作用。便携式气象仪除了能够实时测量和传输气象信息外,还具有方便携带,能够满足小围气候监测的要求等特点。可以预知,未来的气象仪将向着小型化、实时化、便携化的方向开展,便携式气象仪是其开展的大势所趋。目前,应用于工业、农业、渔业、气象等方面的便携式温度、气压、湿度数 据采集系统根本上是采用有线式的,其便携式性能主要表达在移动和架设的方便 程度等方面,在实际使用过程中仍然需要系统布线、建立连接等,并且体积较大, 携带不便,不能满足便携式设备的要求。运用气象仪器进展大气测量,是分析研究大

54、气活动和正确预报天气的必要 手段。因此,气象仪器和测量方法的提高和改进,是大气科学研究正常开展和天 气预报的关键。微控制技术的开展,已使传统的气象仪器仪表是“精细机械的 概念发生了深刻的变革,气象仪器也朝着智能化、网络化开展,高性能的单片机 在自动化气象仪中起着重要的作用。1.2 国外研究现状以前,人们设立气象站,在荒无人烟的地方设立气象站本钱很大,而且供电、人员驻站、数据传输等都是问题。为了彻底解决这些问题,世界各国都在研制自动气象仪或者便携式气象仪。我国从20世纪80年代中期始研制便携式气象站。目前,很多地方还在继续使用国外的进口产品,在采集的精度,抗干扰能力,可测参数以及数据的传输速度和

55、可靠性上都已经大幅落后于如今的主流气象仪技术。目前国外最新型的便携式数字气象仪可测风向、风速、风标、侧风、顺风、温度、大气压、相对湿度、雨量,读数并带数字罗盘功能,测量精度更高,外壳符合复杂环境的使用要求。所有可测的参数及功能有:以度为单位、顺风读数、温度、风寒指数,显示到小数点后一位、背光功能,可配三脚架、防水是一个一体化设计。太阳能供电的自动气象站,可靠耐用,在无太阳情况下,正常运. z-行60天;无需电力线,防止雷击;可直接测量风速风向,通过计算可得出露点,风寒等参数,性能非常优异。缺点是价格非常昂贵,不容易普及。1.3 课题研究的容和意义本文研究一种基于无线传输的便携式气象仪系统。系统

56、是以单片机AT89C52芯片为主要部件,利用各种传感器检测天气数据,实现了风向、风速、温度、湿度和地理位置等要素的测量与显示,并通过无线网络传输气象数据。便携式气象仪就是针对上述市场需求,为适应小区域气候监测而设计的产 品,可以广泛用于局域气候参数变化的及时测量,为各种生产生活活动提供及时 的气象信息。该系统集成了温度、湿度、气压、风向、风速、标准时间等气象参 数的测量,其精度已经到达标准气象测量的要求,并可以实时的将各种气象参数通过GPRS通信网络发送至各种地方,为未来气象测量的小型化、实时化、便捷化,专业化提供了坚实保证,具有很强实用价值。. z-2 系统方案选择与论证本设计以便携式移动气象仪为研发目标,针对环境参数测量与传输的特殊要求,采用各种先进技术,提高系统的集成度,实现移动监测气象参数、准确定位、 移动通信传输、气象信息管理等功能,到达数据可靠稳定、实时便捷的设计理念和目的。2.1 设计要求设计一个便携式气象检测仪包括测量装置和接收装置,通过无线方式通信。测量并显示风向、风速、温度、湿度、气压等根本气象要素。提供测试点的位置经纬度、海拔高度,时间参数。使用单片机控制,要具有键盘电路、显示电路,无线通信接口电路,电源电路。主要技术指标:温度围:-4060测量精度在20时为0.2;相对湿度:0100%测量精度在20时

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论