»ùÓÚ51µ¥Æ¬»úµÄÁ¸²ÖÎÂʪ¶È¼ì²âϵͳ±ÏÒµÉè¼Æ ÏÂÔØ±¾ÎÄ

»ùÓÚ51µ¥Æ¬»úµÄÁ¸²ÖÎÂʪ¶È¼ì²âϵͳ

[ÕªÒª]Á¸²ÖζÈʪ¶È¼à²â¿ØÖÆÏµÍ³ÊÇ»ùÓÚSTC12C52A60S2µÄÊý¾Ý²É¼¯¡¢¶Ô±È¡¢¿ØÖƵÄϵͳ¡£ÒÔSTC12C52A60S2µ¥Æ¬»úΪ¿ØÖÆÆ÷£¬¶Ôζȴ«¸ÐÆ÷DS18B20´«Ë͵ÄÊý×ÖÁ¿ÐźźͶÔʪ¶È´«¸ÐÆ÷HR202´«Ë͵ÄÄ£ÄâÁ¿ÐźŽøÐвɼ¯ºÍ´¦Àí£¬µ±Ç°ÖµºÍÉ趨ζÈÉÏÏÞÖµ½øÐжԱȣ¬½ø¶øÖ´ÐпØÖÆ×÷Óã¬Í¨¹ý¶Ô¼ÌµçÆ÷µÄ¿ØÖƽø¶ø¿ØÖÆÉ豸µÄÆôÍ££¬¶ÔÁ¸²ÖζÈʪ¶È½øÐе÷½Ú£¬Ê¹Æäά³ÖÔÚÊʵ±·¶Î§£¬Î¬»¤Á¸²ÖÕý³£ÔËÐС£ [¹Ø¼ü´Ê] µ¥Æ¬»ú¡¢ÎÂʪ¶È¡¢¼ì²â¡¢¿ØÖÆ

Abstract:The granary¡¯s temperature and humidity control and detect system

is based on the micro control unit of STC12C5A60S2,the system is used for date acquisition,comparison,and control.In this system,STC12C5A60S2 is the controller,the controller is designed to deal with temperature and humidity signal from the temperature sensor and humidity sensor.Then compare these data with limits the value of temperature and humidity.If the date is out of limits,then the controller send a control signal to warn people,besides,the controller will make the fan running to make the temperature and humidity lower.In this way,the granary can be working at usual status.

Key words: MCU¡¢temperature and humidity¡¢control

Ŀ¼

µÚÒ»Õ Ð÷ÂÛ ................................................................ 1

1.2Ïà¹ØÁìÓò¹úÄÚÍâÓ¦ÓõÄÏÖ×´¼°·¢Õ¹Ç÷ÊÆ ................................... 1 1.3 Á¸²ÖÎÂʪ¶È¼ì²â¿ØÖÆÏµÍ³Ô­Àí .......................................... 2 1.4 ±¾ÕÂС½á ............................................................. 2 µÚ¶þÕ£ºÏµÍ³·ÖÎö¡¢Éè¼ÆÒªÇó¼°Ä£¿éÑ¡Ôñ ......................................... 3

2.1 Éè¼ÆÒªÇó ............................................................ 3 2.2 µ¥Æ¬»úÐͺŵÄÑ¡Ôñ .................................................... 3

2.21 ²ÉÓÃSTC89C52µ¥Æ¬»ú ............................................ 3 2.22 ²ÉÓÃSTC12C5A60S2µ¥Æ¬»ú ........................................ 3 2.3 ÏÔʾϵͳģ¿éµÄÑ¡Ôñ .................................................. 3

2.31²ÉÓÃLEDÊýÂë¹ÜÏÔʾ .............................................. 3 2.32²ÉÓÃ1602Òº¾§ÏÔʾ ............................................... 3 2.4 ²âÎÂÄ£¿éµÄÑ¡Ôñ ...................................................... 4

2.41 ²ÉÓÃÄ£ÄâÁ¿Î¶ȴ«¸ÐÆ÷ ........................................... 4 2£®42 ²ÉÓÃÊý×ÖÁ¿Î¶ȴ«¸ÐÆ÷ ......................................... 4 2.5 ²âʪģ¿éµÄÑ¡Ôñ ...................................................... 4 2.6 ¿ØÖÆÄ£¿éµÄÑ¡Ôñ ...................................................... 4 2.7 ͨѶģ¿éµÄÑ¡Ôñ ...................................................... 4 2.8±¾ÕÂС½á ............................................................. 4 µÚÈýÕ ϵͳ×ÜÌå·½°¸¼°Ó²¼þµç·ģ¿éÉè¼Æ ...................................... 5

3.1 ϵͳ×ÜÌåÉè¼ÆË¼Â·£º .................................................. 5 3.2 ϵͳӲ¼þÉè¼Æ ........................................................ 5

3.2.1 µ¥Æ¬»ú×îСϵͳ ................................................ 5 3.2.2 ζÈÐźŲÉÑùµç·ģ¿é .......................................... 9 3.2.3 ʪ¶È²ÉÑùµç·ģ¿é ............................................. 12 3.3 ´®¿ÚÄ£¿é ........................................................... 14 3.4ÏÔʾģ¿é ............................................................ 15 3.5 ¿ØÖÆÄ£¿é ........................................................... 16 3.6 ¼ÌµçÆ÷Ä£¿é ......................................................... 17 3.7 ±¾ÕÂС½á .......................................................... 18 µÚËÄÕ ϵͳµÄÈí¼þÉè¼Æ ..................................................... 19

4.1 Á÷³ÌͼÉè¼Æ ........................................................ 19

4.1.1ϵͳ×ÜÌåÁ÷³Ìͼ ................................................ 19 4.1.2ζȼì²âÁ÷³Ìͼ ................................................ 19 4.1.3ʪ¶È¼ì²âÁ÷³Ì .................................................. 20 4.2ϵͳµÄ³ÌÐòÉè¼Æ ...................................................... 20

4.2.1 DS18B20²âγÌÐò ............................................. 20 4.2.2 A/Dת»»³ÌÐò ................................................ 25

4.2.3 1602ÏÔʾ³ÌÐò ................................................ 26 4.3 ±¾ÕÂС½á ........................................................... 29 µÚÎåÕ Ӳ¼þµ÷ÊÔ²¿·Ö ....................................................... 30 ½áÊøÓï ..................................................................... 31 ²Î¿¼ÎÄÏ×.................................................................... 32