基于DS18B20的温度采集显示系统的设计 - 百度文库 ÏÂÔر¾ÎÄ

Ŀ¼

1.ÒýÑÔ ......................................................... 1

1.1Ð÷ÂÛ .................................................................. 1 1.2¿Î³ÌÉè¼ÆÈÎÎñÊé ........................................................ 1

2.Éè¼Æ·½°¸ ..................................................... 4 3.Ó²¼þÉè¼Æ·½°¸ ................................................. 4

3.1×îСϵͳµÄÉè¼Æ ........................................................ 4 3.2 LED·¢¹â±¨¾¯µç· ...................................................... 6 3.3 DS18B20µÄ¼ò½é¼°ÔÚ±¾´ÎÉè¼ÆÖеÄÓ¦Óà .................................... 6 3.3.1 DS18B20µÄÍⲿ½á¹¹¼°¹Ü½ÅÅÅÁÐ ....................................... 6 3.3.2 DS18B20µÄ¹¤×÷Ô­Àí ................................................. 7 3.3.3 DS18B20µÄÖ÷ÒªÌØÐÔ ................................................. 8 3.3.4 DS18B20µÄ²âÎÂÁ÷³Ì ................................................. 9 3.3.5 DS18B20Ó뵥Ƭ»úµÄÁ¬½Ó ............................................. 9 3.4 ±¨¾¯Î¶ȵÄÉèÖà ........................................................ 9 3.5 ÊýÂë¹ÜÏÔʾ ........................................................... 10 3.5.1ÊýÂë¹Ü¹¤×÷Ô­Àí .................................................... 10 3.5.2ÊýÂë¹ÜÏÔʾµç· .................................................... 12 3.6 Ó²¼þµç·×ÜÌåÉè¼Æ ..................................................... 12

4.Èí¼þÉè¼Æ·½°¸ ................................................ 13

4.1Ö÷³ÌÐò½éÉÜ ........................................................... 13 4.1.1Ö÷³ÌÐòÁ÷³Ìͼ ...................................................... 13 4.1.2Ö÷Á÷³ÌµÄCÓïÑÔ³ÌÐò ................................................ 14 4.2²¿·Ö×Ó³ÌÐò ........................................................... 18 4.2.1 DS18B20¸´Î»×Ó³ÌÐò ................................................ 18 4.2.2 дDS18B20ÃüÁî×Ó³ÌÐò ............................................. 19

4.2.3¶ÁζÈ×Ó³ÌÐò ...................................................... 21 4.2.4¼ÆËãζÈ×Ó³ÌÐò .................................................... 23 4.2.5ÏÔʾɨÃè¹ý³Ì×Ó³ÌÐò ................................................ 24

5.»ùÓÚDS18B20µÄζȲɼ¯ÏÔʾϵͳµÄµ÷ÊÔ......................... 26 6.ÊÕ»ñºÍÌå»á .................................................. 28 7.²Î¿¼ÎÄÏ× .................................................... 29

¿Î³ÌÉè¼ÆÓÃÖ½

1.ÒýÑÔ

1.1Ð÷ÂÛ

Ëæ×Å¿Æѧ¼¼ÊõµÄ·¢Õ¹£¬Î¶ȵÄʵʱÏÔʾϵͳӦÓÃÔ½À´Ô½¹ã·º£¬±ÈÈç¿Õµ÷Ò£¿ØÆ÷Éϵ±Ç°ÊÒεÄÏÔʾ£¬ÈÈË®Æ÷ζȵÄÏÔʾµÈµÈ£¬Í¬Ê±Î¶ȵĿØÖÆÔÚ¸÷¸öÁìÓòÒ²¶¼Óлý¼«µÄÒâÒå¡£²ÉÓõ¥Æ¬»ú¶ÔζȽøÐпØÖƲ»½ö¾ßÓпØÖÆ·½±ã¡¢¼òµ¥¡¢Áé»îÐÔ´óµÈÌص㣬¶øÇÒ»¹¿ÉÒÔ´ó·ù¶ÈÌá¸ß±»¿Øζȵļ¼ÊõÖ¸±ê¡£

±¾ÎĽéÉÜÁË»ùÓÚDS18B20µÄζÈʵʱ²É¼¯ÓëÏÔʾϵͳµÄÉè¼ÆÓëʵÏÖ¡£Éè¼ÆÖÐÑ¡È¡µ¥Æ¬»úAT89C51×÷Ϊϵͳ¿ØÖÆÖÐÐÄ£¬Êý×Öζȴ«¸ÐÆ÷DS18B20×÷Ϊµ¥Æ¬»úÍⲿÐźÅÔ´£¬ÊµÏÖζȵÄʵʱ²É¼¯¡£²¢ÇÒÓþ«¶È½ÏºÃµÄÊýÂë¹Ü×÷ΪζȵÄʵʱÏÔʾģ¿é¡£ÀûÓõ¥Æ¬»ú³ÌÐòÀ´Íê³É¶ÔDS18B20ÓëAT89C51µÄ¿ØÖÆ£¬×îÖÕʵÏÖζȵÄʵʱ²É¼¯ÓëÏÔʾ¡£²ÉÓõ¥Æ¬»ú¶ÔζȽøÐпØÖƲ»½ö¾ßÓпØÖÆ·½±ã¡¢¼òµ¥¡¢Áé»îÐÔ´óµÈÌص㣬¶øÇÒ»¹¿ÉÒÔ´ó·ù¶ÈÌá¸ß±»¿Øζȵļ¼ÊõÖ¸±ê¡£

1.2¿Î³ÌÉè¼ÆÈÎÎñÊé

¡¶Î¢»úÔ­ÀíÓë½Ó¿Ú¼¼Êõ¡·¿Î³ÌÉè¼ÆÈÎÎñÊé(¶þ)

ÌâÄ¿£º»ùÓÚDS18B20µÄζȲɼ¯ÏÔʾϵͳµÄÉè¼Æ

Ò»¡¢¿Î³ÌÉè¼ÆÈÎÎñ

´«Í³µÄζȴ«¸ÐÆ÷£¬ÈçÈȵçżÎ¶ȴ«¸ÐÆ÷£¬¾ßÓо«¶È¸ß£¬²âÁ¿·¶Î§´ó£¬ÏìÓ¦¿ìµÈÓŵ㡣µ«ÓÉÓÚÆäÊä³öµÄÊÇÄ£ÄâÁ¿£¬¶øÏÖÔÚµÄÖÇÄÜÒDZíÐèҪʹÓÃÊý×ÖÁ¿£¬ÓÐЩʱºò»¹Òª½«²âÁ¿½á¹ûÒÔÊý×ÖÁ¿ÊäÈë¼ÆËã»ú£¬ÓÉÓÚÒª½«Ä£ÄâÁ¿×ª»»ÎªÊý×ÖÁ¿£¬ÆäʵÏÖ»·½Ú¾Í±äµÃ·Ç³£¸´ÔÓ¡£Ó²¼þÉÏÐèҪģÄ⿪¹Ø¡¢ºãÁ÷Ô´¡¢D/Aת»»Æ÷£¬·Å´óÆ÷µÈ£¬½á¹¹ÅӴ󣬰²×°À§ÄÑ£¬Ôì¼Û°º¹ó¡£ÐÂÐ˵ÄICζȴ«¸ÐÆ÷ÈçDS18B20£¬ÓÉÓÚ¿ÉÒÔÖ±½ÓÊä³öζÈת»»ºóµÄÊý×ÖÁ¿£¬¿ÉÒÔÔÚ±£Ö¤²âÁ¿¾«¶ÈµÄÇé¿öÏ£¬´ó´ó¼ò»¯ÏµÍ³ÈíÓ²¼þÉè¼Æ¡£ÕâÖÖ´«¸ÐÆ÷µÄ²âη¶Î§ÓÐÒ»¶¨ÏÞÖÆ£¨´ó¶àÔÚ£­50¡æ¡«120¡æ£©£¬¶àÊÊÓÃÓÚ»·¾³Î¶ȵIJâÁ¿¡£DS18B20¿ÉÒÔÔÚÒ»¸ùÊý¾ÝÏßÉϹҽӶà¸ö´«¸ÐÆ÷£¬Ö»ÐèÒªÈý¸ùÏ߾ͿÉÒÔʵÏÖÔ¶¾àÀë¶àµãζȲâÁ¿¡£

±¾¿ÎÌâÒªÇóÉè¼ÆÒ»»ùÓÚDS18B20µÄζȲɼ¯ÏÔʾϵͳ£¬¸ÃϵͳҪÇó°üº¬Î¶Ȳɼ¯Ä£¿é¡¢Î¶ÈÏÔʾģ¿é£¨¿ÉÓÃÊýÂë¹Ü»òÒº¾§ÏÔʾ£©ºÍ¼üÅÌÊäÈëÄ£¿é¼°±¨¾¯Ä£¿é¡£ËùÉè¼ÆµÄϵͳ¿ÉÒÔ´Ó¼üÅÌÊäÈëÉ趨ζÈÖµ£¬µ±Ëù²É¼¯µÄζȸßÓÚÉ趨ζÈʱ£¬½øÐб¨¾¯£¬Í¬Ê±ÄÜʵʱÏÔʾζÈÖµ¡£

¶þ¡¢¿Î³ÌÉè¼ÆÄ¿µÄ

ͨ¹ý±¾´Î¿Î³ÌÉè¼ÆʹѧÉúÕÆÎÕ£º1£©µ¥×ÜÏßζȴ«¸ÐÆ÷DS18B20Ó뵥Ƭ»úµÄ½Ó¿Ú¼°DS18B20µÄ

µÚ 1 Ò³

¿Î³ÌÉè¼ÆÓÃÖ½

±à³Ì£»2£©¾ØÕóʽ¼üÅ̵ÄÉè¼ÆÓë±à³Ì£»3£©¾­µ¥Æ¬»úΪºËÐĵÄϵͳµÄʵ¼Êµ÷ÊÔ¼¼ÇÉ¡£´Ó¶øÌá¸ßѧÉú¶Ô΢»úʵʱ¿ØÖÆϵͳµÄÉè¼ÆºÍµ÷ÊÔÄÜÁ¦¡£

Èý¡¢¿Î³ÌÉè¼ÆÒªÇó

1¡¢ÒªÇó¿ÉÒÔ´Ó¼üÅÌÉϽÓÊÕζÈÉ趨ֵ£¬µ±Ëù²É¼¯µÄζȸßÓÚÉ趨ֵʱ£¬½øÐб¨¾¯£¨¿ÉÒÔÊÇÉùÒô±¨¾¯£¬Ò²¿ÉÊǹⱨ¾¯£©

2¡¢ÄÜʵʱÏÔʾζÈÖµ£¬ÒªÇó±£ÁôһλСÊý£»

ËÄ¡¢¿Î³ÌÉè¼ÆÄÚÈÝ

1¡¢ÈË»ú¡°½çÃ桱Éè¼Æ£» 2¡¢µ¥Æ¬»ú¶Ë¿Ú¼°ÍâÉèµÄÉè¼Æ£» 3¡¢Ó²¼þµç·ԭÀíͼ¡¢Èí¼þÇåµ¥¡£

Îå¡¢¿Î³ÌÉè¼Æ±¨¸æÒªÇó

±¨¸æÖÐÌṩÈçÏÂÄÚÈÝ£º 1¡¢Ä¿Â¼

2¡¢ÕýÎÄ

£¨1£©¿Î³ÌÉè¼ÆÈÎÎñÊ飻 £¨2£©×ÜÌåÉè¼Æ·½°¸

£¨3£©Õë¶ÔÈË»ú¶Ô»°¡°½çÃ桱ҪÓвÙ×÷ʹÓÃ˵Ã÷£¬ÒÔ±ãÓû§Äܹ»ÕýȷʹÓñ¾²úÆ·£» £¨4£©Ó²¼þÔ­Àíͼ£¬ÒԱ㳧¼ÒÉú³É²ú£¨¿ÉÊÖ»­Ò²¿ÉÓÃprotelÈí¼þ£©£»

£¨5£©³ÌÐòÁ÷³Ìͼ¼°Çåµ¥£¨×Ó³ÌÐò²»ÌṩÇåµ¥£¬µ«Ó¦ÁÐ±í·´Ó³Ã¿Ò»¸ö×Ó³ÌÐòµÄÃû³Æ¼°Æ书ÄÜ£©£» £¨6£©µ÷ÊÔ¡¢ÔËÐм°Æä½á¹û£» 3¡¢ÊÕ»ñ¡¢Ìå»á 4¡¢²Î¿¼ÎÄÏ×

Áù¡¢¿Î³ÌÉè¼Æ½ø¶È°²ÅÅ

ÖÜ´Î ¹¤×÷ÈÕ 1 µÚ Ò» ÖÜ 2 3 4 5 µÚ ¶þ 1 2 ¹¤×÷ÄÚÈÝ ²¼ÖÿγÌÉè¼ÆÈÎÎñ£¬²éÕÒÏà¹Ø×ÊÁÏ ÊìϤÏà¹ØоƬ¼°Ê¹Ó÷½·¨ Íê³É×ÜÌåÉè¼Æ·½°¸ »­³öÓ²¼þÔ­Àíͼ¼°³ÌÐòÁ÷³Ìͼ Íê³ÉÓ²¼þ½ÓÏߣ¬±àд³ÌÐò²¢µ÷ÊÔ ±àд³ÌÐò²¢µ÷ÊÔ ±àд³ÌÐò²¢µ÷ÊÔ µÚ 2 Ò³