±ÏÒµÉè¼Æ(ÂÛÎÄ)--»ùÓÚµ¥Æ¬»úµÄζȿØÖÆÏµÍ³µÄÉè¼ÆÓëʵÏÖ ÏÂÔØ±¾ÎÄ

ºÓÄϿƼ¼Ñ§Ôº

2010 ½ì±¾¿Æ±ÏÒµÉè¼Æ

Éè¼ÆÌâÄ¿£º»ùÓÚµ¥Æ¬»úµÄζȿØÖÆÏµÍ³µÄÉè¼ÆÓëʵÏÖ

ѧÉúÐÕÃû£º

ËùÔÚԺϵ£º

Ëùѧרҵ£º

µ¼Ê¦ÐÕÃû£º

Íê³Éʱ¼ä£º 2011-05-25

ÕªÒª

±¾ÂÛÎĽéÉÜÁËÒ»ÖÖÒÔAT¹«Ë¾µÄ89S52 µ¥Æ¬»úΪÖ÷Òª¿ØÖÆÔª¼þ£¬Í¨¹ýDALLAS¹«Ë¾µÄDS18S20 ζȴ«¸ÐÆ÷²âεÄÐÂÐÍÊý×Öζȼơ£Ö÷Òª°üÀ¨Ó²¼þµç·µÄÉè¼ÆºÍϵͳ³ÌÐòµÄÉè¼Æ¡£Ó²¼þµç·Ö÷Òª°üÀ¨Ö÷¿ØÖÆÆ÷£¬²âε緺ÍÏÔʾµç·µÈ£¬Ö÷¿ØÖÆÆ÷²ÉÓõ¥Æ¬»úAT89S52£¬Î¶ȴ«¸ÐÆ÷²ÉÓÃÃÀ¹úDALLAS °ëµ¼Ì幫˾Éú²úµÄDS18S20£¬ÏÔʾµç·²ÉÓÃ4λ¹²Ñô¼«LED ÊýÂë¹ÜÒÔ¶¯Ì¬É¨Ãè·¨Ö±¶ÁÏÔʾ¡£ÏµÍ³³ÌÐòÖ÷Òª°üÀ¨Ö÷³ÌÐò£¬¶Á³öζÈ×Ó³ÌÐò£¬Î¶ȴ¦Àí×Ó³ÌÐò£¬±¨¾¯×Ó³ÌÐò£¬±¨¾¯Î¶ÈÖµÉ趨×Ó³ÌÐò£¬LED ÏÔʾ×Ó³ÌÐòµÈ¡£´ËÍ⣬»¹½éÉÜÁËϵͳµÄ²âÊÔ¡£

±¾Êý×ÖζȼÆÉè¼Æ²ÉÓÃÃÀ¹úDALLAS °ëµ¼Ìå¹«Ë¾ÍÆ³öµÄÒ»ÖÖÖÇÄÜζȴ«¸ÐÆ÷DS18S20×÷Ϊ¼ì²âÔª¼þ£¬²âη¶Î§Îª-55¡«125¡æ£¬×î´ó·Ö±æÂʿɴï0.0625¡æ¡£ Ö÷¿ØÖÆÆ÷²ÉÓõ¥Æ¬»úAT89S52£¬Æä¼¯³É¶È¸ß£¬Æ¬ÄÚ×ÊÔ´·á¸»£¬½Ó¿ÚÄ£¿é°üÀ¨SPI¡¢SCI¡¢A/D¡¢PWM µÈ¡£ÏÔʾµç·²ÉÓÃ4 λ¹²Ñô¼«LED ÊýÂë¹Ü£¬´ÓP0¿ÚÊä³ö¶ÎÂ룬ÁÐɨÃèÓÃP2¿ÚÀ´ÊµÏÖ¡£

ÓÉÓÚ²ÉÓÃÁ˸ĽøÐÍÖÇÄÜζȴ«¸ÐÆ÷DS18S20 ×÷Ϊ¼ì²âÔª¼þ£¬Ó봫ͳµÄζȼÆÏà±È£¬±¾Êý×ÖζȼƼõÉÙÁËÍⲿµÄÓ²¼þµç·£¬¾ßÓеͳɱ¾ºÍÒ×ʹÓõÄÌØµã¡£DS18S20 ζȼƻ¹¿ÉÒÔÔÚ¸ßα¨¾¯¡¢Ô¶¾àÀë¶àµã²âοØÖƵȷ½Ãæ½øÐÐÓ¦Óÿª·¢£¬¾ßÓкܺõķ¢Õ¹Ç°¾°¡£

¹Ø¼ü´Ê µ¥Æ¬»ú Ö÷¿ØÖÆÆ÷ ζȴ«¸ÐÆ÷ ÏÔʾµç· Êý×ÖζȼÆ

Design and Implementation of Temperature Control System Based on Single Chip Microcontroller

Abstract

This thesis introduces a sort of controller bases on the principle of MCU, a new typeof digital thermometer bases on temperature sensor DS18S20. This thesis mainly containshardware circuit design and system program design. Hardware circuit mainly contains mastercontroller, temperature detection circuit and display circuit, etc. master controller usesAT89S52,temperature sensor uses DS18S20, which is produced by DALLASsemiconductor company ,USA. Display circuit uses 4 bit common cathode LED nixietube, it candirectly read the result by dynamic scanning. System program mainly contains main program,read temperature subprogram, temperature treatment subprogram, LED display subprogram, etc.In addition, it also introduces system test. This digital thermometer design uses a sort of intelligent temperature sensor DS18S20,which is produced by DALLAS semiconductor company, USA ,as a detecting element,temperature measuring range is-55¡æ¡«125¡æ£¬the maximum resolution is 0.0625¡æ.Master controller usesAT89S52 MCU, it is highly integrated, it¡¯s internal resource isplentiful, it¡¯s interface module contains SPI¡¢SCI ¡¢A/D¡¢ PWM ,etc.Display circuit uses 4 bit common cathode LED nixietube, it¡¯s segment code output fromP0, It¡¯s column scan is realized by P2.

By reason of using second generation intelligent temperature sensor DS18S20 as detectingelement, compared with traditional thermometer, this digital thermometer decreased externalhardware circuit, has the feature of low cost and inaccessible. DS18S20 thermometer can also be used in high temperature alert, distant multipoint temperature detection, etc, and has a bright future development.

Key words: MCU Master controller Temperature sensor Display circuit

Digital thermometer

Ŀ ¼

1Ð÷ÂÛ ........................................................................ 1 1.1 ·½°¸Ò» ÈÈÃôµç×è ............................................... 1 1.2 ·½°¸¶þ¿ØÖÆÄں˲»Óõ¥Æ¬»ú ÓÃDSP ................................ 1 1.3 ·½°¸Èý ζȴ«¸ÐÆ÷18B20 ........................................ 1 2ϵͳÉè¼Æ .......................................................... 1 2.1 ϵͳ¹¦ÄÜ ...................................................... 1 2.2 ϵͳ¿òͼ ...................................................... 1 2.3 µ¥Æ¬»úµÄ½éÉÜ .................................................. 2 2.4 DS18B20µÄ½éÉÜ ................................................. 6 2.4.1 DS18B20µÄ½éÉÜ ............................................ 7 2.4.2 DS18B20ζȴ«¸ÐÆ÷Ó뵥Ƭ»úµÄ½Ó¿Úµç· ...................... 9 2.4.3 DS18B20µÄ¿ØÖÆ·½·¨ ............................................... 10 2.5 LEDÊýÂë¹Ü .................................................... 12 2.5.1 LEDÊýÂë¹ÜµÄÖ÷Òª¼¼Êõ²ÎÊý ................................. 12 2.5.2 LEDÊýÂë¹ÜµÄÒý½Å˵Ã÷ ..................................... 12 2.5.3 LEDÊýÂë¹Ü±àÂë˵Ã÷ ............................................... 14

3Ó²¼þÉè¼Æ ......................................................... 14 3.1µ¥Æ¬»ú×îСϵͳµç· ........................................... 14 3.2 DS18B20²âÎµç· ............................................. 15 3.3 ±¨¾¯µç· ..................................................... 16 3.4ËÄλÊýÂë¹ÜÏÔʾµç· ........................................... 16 3.5 ±¨¾¯Î¶ÈÉ趨°´¼üµç· ......................................... 17 3.6 ISP³ÌÐòÏÂÔØ½Ó¿Úµç· ......................................... 18 3.7¿ØÖƵç·Éè¼Æ ................................................. 18 3.8µç·ԭ²ÄÁÏÇåµ¥ ......................................................... 19 3.9ʹÓù¤¾ß¼°ÒDZíÇåµ¥ .................................................... 20

4Èí¼þÉè¼Æ ......................................................... 20 4.1³ÌÐòÁ÷³Ìͼ ................................................... 20 4.2¿ª»úÊýÂë¹ÜÏÔʾÉèÖà ........................................... 21 4.3 DS18B20²É¼¯Î¶ȳÌÐò ......................................... 21 4.4¶ÁȡζȳÌÐò ................................................. 25 4.5ÏÔʾζȳÌÐò ................................................. 25 5µ÷ÊÔ¹ý³Ì ......................................................... 25 5.1 ÊýÂë¹ÜÏÔʾÂÒÂë ............................................... 25 5.3 °´¼ü´¦ÀíÎÊÌâ .......................................................... 25