Issuu on Google+

Çþ¨¹ ¡ÃᡌÇÇѲ¹¡ØÅ ªÑÂÇѲ¹ ÅÔÁ é ¾Ã¨ÔµÃÇÔäÅ

Copyright 2004 Innovative Experiment Co.,Ltd.


.


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

1

àÃÕ¹ÃٌáÅз´ÅͧÇÔ·ÂÒÈÒʵÏ ¡Ñº¡Å‹Í§ÊÁͧ¡Å SCi-B X Microcontroller in Science experiment

Çþ¨¹ ¡ÃᡌÇÇѲ¹¡ØÅ ªÑÂÇѲ¹ ÅÔÁé ¾Ã¨ÔµÃÇÔäÅ

(C) Innovative Experiment Co.,Ltd.

˹Öè § ã¹Ë¹Ñ § Ê× Í ªØ ´ »¯ÔºµÑ ¡Ô ÒÃäÁâ¤Ã¤Í¹â·ÃÅàÅÍϏ


2

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

Microcontroller in Science experiment

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X ISBN 974 - 92023 - 0 -9

Çþ¨¹ ¡ÃᡌÇÇѲ¹¡ØÅ ªÑÂÇѲ¹ ÅÔÁé ¾Ã¨ÔµÃÇÔäŠʧǹÅÔ¢ÊÔ·¸Ôµì ÒÁ ¾.Ã.º. ÅÔ¢ÊÔ·¸Ôì ¾.È. 2521 ˌÒÁ¡ÒÃÅÍ¡àÅÕ¹äÁ‹Çҋ ʋǹ˹֧è ʋǹ㴢ͧ˹ѧÊ×ÍàŋÁ¹Õé ¹Í¡¨Ò¡¨Ðä´ŒÃºÑ Í¹Ø­Òµ ã¤Ã¤ÇÃ㪌˹ѧÊ×ÍàŋÁ¹Õé 1. ¹Ñ¡àÃÕ¹ ¹ÔÊµÔ ¹Ñ¡ÈÖ¡ÉÒ áÅкؤ¤Å·ÑÇè ä»·ÕÁè ¤Õ ÇÒÁʹã¨ã¹¡ÒùíÒäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ任ÃÐÂØ¡µãªŒã¹¡Òà ·´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏ ËÃ×Íʹã¨ã¹¡ÒÃàÃÕ¹ÃٌáÅз´ÅͧÇÔÂÒÈÒʵÏã¹á¹Ç·Ò§ãËÁ‹·Õè㪌¡Ô¨¡ÃÃÁ໚¹Ê×èÍ â´ÂÁÕäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ໚¹Ê‹Ç¹»ÃСͺ 2. ʶҺѹ¡ÒÃÈÖ¡ÉÒ âçàÃÕ¹ ÇÔ·ÂÒÅÑ ÁËÒÇÔ·ÂÒÅÑ ·ÕÁè ¡Õ ÒÃແ´¡ÒÃàÃÕ¹¡ÒÃÊ͹ÇÔªÒÍÔàÅç¡·Ã͹ԡʏËÃ×Í ÀÒ¤ÇÔªÒÇÔÈÇ¡ÃÃÁÍÔàÅç¡·Ã͹ԡʏáÅФÍÁ¾ÔÇàµÍÏ 3. ¤³Ò¨ÒÏ·ÁÕè ¤Õ ÇÒÁµŒÍ§¡ÒÃÈÖ¡ÉÒ áÅÐàµÃÕÂÁ¡ÒÃàÃÕ¹¡ÒÃÊ͹ÇÔªÒäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ÃÇÁ¶Ö§ÇÔ·ÂÒÈÒʵÏ »ÃÐÂØ¡µ·µÕè ͌ §¡ÒúÙóҡÒäÇÒÁÃÙ·Œ Ò§ÍÔàÅç¡·Ã͹ԡʏ-äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ--¡ÒÃà¢Õ¹â»Ãá¡ÃÁ¤ÍÁ¾ÔÇàµÍÏ¡Ò÷´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏ ã¹ÃдѺÁѸÂÁÈÖ¡ÉÒ ÍÒªÕÇÈÖ¡ÉÒ áÅлÃÔ­­ÒµÃÕ ´íÒà¹Ô¹¡ÒèѴ¾ÔÁ¾áÅШíÒ˹‹ÒÂâ´Â ºÃÔÉ·Ñ ÍÔ¹â¹àǵտ àÍç¡à¾ÍÃÔàÁ¹µ ¨íÒ¡Ñ´ 3133/53 «.ÊØ¢ÁØ ÇÔ· 101/2 ¶.ÊØ¢ÁØ ÇÔ· á¢Ç§ºÒ§¹Ò ࢵºÒ§¹Ò ¡ÃØ§à·¾Ï 10260 â·ÃÈѾ· 0-2747-7001-4 â·ÃÊÒà 0-2747-7005 ÃÒÂÅÐàÍÕ´·Õè»ÃÒ¡¯ã¹Ë¹Ñ§Ê×ÍàÃÕ¹ÃٌáÅз´ÅͧÇÔ·ÂÒÈÒʵÏ´ŒÇ¡ŋͧÊÁͧ¡Å SCi-BOX ¼‹Ò¹¡ÒõÃǨ ·Ò¹Í‹ҧÅÐàÍÕ´áÅжŒÇ¹¶Õè à¾×Íè ãˌÁ¤Õ ÇÒÁÊÁºÙóáÅж١µŒÍ§ÁÒ¡·ÕÊè ´Ø ÀÒÂ㵌à§×Íè ¹ä¢áÅÐàÇÅÒ·Õ¾è §Ö Áա͋ ¹¡Òà ¨Ñ´¾ÔÁ¾à¼Âá¾Ã‹ ¤ÇÒÁàÊÕÂËÒÂÍѹÍÒ¨à¡Ô´¨Ò¡ ¡ÒùíÒ¢ŒÍÁÙÅã¹Ë¹Ñ§Ê×ÍàŋÁ¹Õäé »ãªŒ ·Ò§ºÃÔÉ·Ñ ÍÔ¹â¹àǵտ àÍç¡ à¾ÍÃÔàÁ¹µ ¨íÒ¡Ñ´ ÁÔ䴌ÁÀÕ ÒÃÐ㹡ÒÃÃѺ¼Ô´ªÍºáµ‹»ÃСÒÃã´ ¤ÇÒÁ¼Ô´¾ÅÒ´¤ÅÒ´à¤Å×Íè ¹·ÕÍè Ò¨ÁÕáÅÐä´ŒÃºÑ ¡Òà ¨Ñ´¾ÔÁ¾à¼Âá¾Ã‹ÍÍ¡ä»¹Ñ¹é ·Ò§ºÃÔÉ·Ñ Ï ¨Ð¾ÂÒÂÒÁªÕáé ¨§áÅÐᡌä¢ã¹¡ÒèѴ¾ÔÁ¾¤ÃÑ§é µ‹Íä»


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

3

¤íÒ¹íÒ ã¹¡ÒÃàÃÕ¹ÃÙጠÅз´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏ·¼Õè ҋ ¹ÁÒ ÀÒ¾¢Í§¤ÃÙ-ÍÒ¨ÒÏ·¶Õè ¡Ù ËŒÍÁŌÍÁ´ŒÇ¹ѡàÃÕ¹ ã¹ ¢³Ð·íÒ¡Ò÷´Åͧ áÅÐÀÒ¾¢Í§¹Ñ¡àÃÕ¹·Õ¤è ͨŒÍ§Áͧ¡ÒÃà»ÅÕÂè ¹á»Å§áÅмšÒ÷´Åͧ·Õàè ¡Ô´¢Ö¹é áŌǹíҼŠàËŋҹѹé ÁҺѹ·Ö¡Å§ã¹¡ÃдÒÉ ¹íÒ¢ŒÍÁÙÅÁÒÊÌҧ໚¹¡ÃÒ¿à¾×Íè ÊÃØ»¼Å¡Ò÷´Åͧ ໚¹ÀÒ¾·Õªè ¹Ô µÒ¢Í§¼Ù·Œ àÕè ¡ÕÂè Ç ¢ŒÍ§ã¹¡ÒÃàÃÕ¹ÃÙ·Œ Ò§ÇÔ·ÂÒÈÒʵÏÁҹѺÊÔº»‚ ¾ÃŒÍÁ¡Ñº¢ŒÍ¨íÒ¡Ñ´·ÕÇè ҋ ¡Ò÷´ÅͧÇÔ·ÂÒÈÒʵϨÒí ໚¹µŒÍ§¾Ö§è ¾Ò à¤Ã×Íè §Á×ÍáÅÐÍØ»¡Ã³ã¹ËŒÍ§·´ÅͧÇÔ·ÂÒÈÒʵÏ ¨Ö§·íÒãˌ¡ÒÃàÃÕ¹ÃÙጠÅз´Åͧ¶Ù¡¨íÒ¡Ñ´ÍÂÙ㋠¹ºÃÔàdz੾ÒÐ ÀÒ 㵌¡ÒôÙáÅ໚¹¾ÔàÈÉ à¹×Íè §¨Ò¡ÇÑÊ´Ø ÍØ»¡Ã³ à¤Ã×Íè §Á×Í㹡Ò÷´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏÊNj ¹ãË­‹ÁÃÕ Ò¤ÒÊÙ§¾ÍÊÁ¤Çà Çѹ¹Õàé Á×Íè ¤ÇÒÁ¡ŒÒÇ˹ŒÒ·Ò§à·¤â¹âÅÂÕࢌÒÁÒÁÕº·ºÒ·ÁÒ¡¢Ö¹é ¶Ö§ÂؤÊÁÑ·ÕÁè ¡Õ ÒÃ㪌§Ò¹ÍØ»¡Ã³µÇÑ ¨ÔÇë ᵋ ÁÕÈ¡Ñ ÂÀÒ¾ÊÙ§ «Ö§è ¶Ù¡àÃÕÂ¡Ç‹Ò “äÁâ¤ÃªÔ»” à¡Ô´¢Ö¹é «Ö§è ¡‹Íãˌà¡Ô´»ÃдÔÉ°¡ÃÃÁµ‹Ò§æ ÁÒ¡ÁÒ ÃÇÁ·Ñ§é ã¹Ç§¡ÒÃÈÖ¡ÉÒ ´ŒÒ¹ÇÔ·ÂÒÈÒʵÏáÅÐà·¤â¹âÅÂÕ à¤Ã×èͧ¤íҹdzÊØ´ÍѨ©ÃÔÂзÕèàÃÕÂ¡Ç‹Ò ¤ÍÁ¾ÔÇàµÍÏ 䴌ÁÕº·ºÒ·Í‹ҧÁÒ¡ áÅÐ à»ÅÕÂè ¹á»Å§ÇÔ¸¡Õ ÒÃàÃÕ¹¡ÒÃÊ͹Í‹ҧ¢¹Ò¹ãË­‹ ÁÕ¡ÒùíÒ«Í¿µáÇÏࢌÒÁÒª‹Ç ·íÒãˌÊÒÁÒöáÊ´§¼Å¡Ò÷íÒ§Ò¹ 䴌Í‹ҧªÑ´à¨¹ áÅÐÃѺÃÙäŒ ´ŒÍ‹ҧ¡ÇŒÒ§¢ÇÒ§ÁÒ¡¢Ö¹é ·ÕÊè Òí ¤Ñ­ ¤ÍÁ¾ÔÇàµÍÏ䴌ࢌÒä»ÍÂÙ㋠¹á·º·Ø¡¤ÃÑÇàÃ×͹·Õãè ˌ¤ÇÒÁ ʹ㨵‹Í¡ÒÃàÃÕ¹ÃÙ·Œ Ò§ÇÔ·ÂÒÈÒʵÏáÅÐà·¤â¹âÅÂÕ Çѹ¹Õé¹Ñ¡àÃÕ¹ã¹ÃдѺ»ÃжÁ»ÅÒÂáÅÐÁѸÂÁÈÖ¡ÉÒÊÒÁÒöÊÌҧáÅÐà¢Õ¹â»Ãá¡ÃÁÊÑ觡ÒÃË؋¹Â¹µ Íѵâ¹Áѵ¢Ô ¹Ò´àÅç¡ä´Œâ´Â㪌äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ໚¹µÑǤǺ¤ØÁ ¼ÙàŒ ÃÕÂ¹ä´ŒÃºÑ ¡Òýƒ¡½¹¤ÇÒÁÅÐàÍÕ´Ãͺ¤Íºã¹ ¡ÒþԨÒóÒáÅзíÒ¤ÇÒÁࢌÒ㨡Ò÷íÒ§Ò¹¢Í§ªÔ¹é ʋǹ·Ò§¡ÅáÅÐÍÔàÅç¡·Ã͹ԡʏ ä´ŒÃºÑ ¡Òýƒ¡ãªŒ¡Ãкǹ¡ÒäԴ Í‹ҧÁÕà˵ؼÅ㹡ÒÃà¢Õ¹â»Ãá¡ÃÁ Ãٌ¨Ñ¡¾Ô¨ÒóÒᡌ䢻˜­ËÒáÅÐÍØ»ÊÃä·ÕèÍÒ¨à¡Ô´¢Öé¹ã¹¡Ò÷´Åͧ áÅзÕè ÊíҤѭ«Ö§è ÍÒ¨Áͧ¢ŒÒÁ令×Í ½ƒ¡¡ÒäǺ¤ØÁÍÒÃÁ³ã¹ÀÒÇÐ·Õ¾è º»˜­ËÒ·Õäè Á‹¤Ò´ËÁÒÂ㹡ÒÃÊÌҧáÅз´Åͧ ·Ñ§é ËÁ´¤×Íͧ¤»ÃСͺ·ÕÊè Òí ¤Ñ­ã¹¡ÒùíÒÁҾѲ¹ÒÊ×Íè àÃÕ¹ÃÙnj ·Ô ÂÒÈÒʵÏã¹á¹ÇãËÁ‹ ·Õ¼è ÊÁ¼ÊÒ¹·ÄÉ®Õ ¤ÇÒÁÃٌ·Ò§ÇÔ·ÂÒÈÒʵÏࢌҡѺà¤Ã×èͧÁ×ÍáÅÐÍØ»¡Ã³ÊÁÑÂãËÁ‹ à¾×èÍÊÌҧªØ´àÃÕ¹ÃٌáÅз´ÅͧÇÔ·ÂÒÈÒʵÏ´ŒÇ ¡Å‹Í§ÊÁͧ¡Å ã¹Ë¹Ñ§Ê×ÍàŋÁ¹Õé¹íÒàʹ͢ŒÍÁÙÅ·Õè¤Ãº¶ŒÇ¹Ãͺ´ŒÒ¹ã¹¡ÒÃàÃÕ¹Ãٌà¾×èÍ·´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏ¢Ñé¹¾×é¹°Ò¹ â´Â์¹Ë¹Ñ¡ä»·Õè¡ÒÃàÃÕ¹ÃٌÍØ»¡Ã³µÃǨ¨ÑºÊÑ­­Ò³ä¿¿‡ÒáÅлÃÔÁÒ³·Ò§¿Êԡʏ äÁ‹Ç‹Ò¨Ð໚¹áʧ ÍسËÀÙÁÔ Ê¹ÒÁáÁ‹àËÅç¡ áç´Ñ¹ä¿¿‡Ò ËÃ×ÍáÁŒ¡Ãзѧè ÊÑ­­Ò³àÊÕ§ ¼¹Ç¡¡Ñº¡ÒÃà¢Õ¹â»Ãá¡ÃÁãˌᡋ¡Å‹Í§ÊÁͧ¡Åà¾×Íè ¹íÒ¢ŒÍÁÙÅËÃ×ͼšÒÒ÷´Åͧ·Õàè ¡Ô´¢Ö¹é ä»ãªŒ»ÃÐ⪹ä´Œ â´Âẋ§à»š¹ 2 ÃٻẺ¤×Í àÃÕ¹ÃÙ´Œ nj ¡Ԩ¡ÃÃÁ ã¹áºº ¹Õ¨é ÐÁÕ ªØ´«Í¿µáÇÏ SCi-BOX Activity àµÃÕÂÁ¡Ò÷´ÅͧáÅÐáÊ´§¼Åänjãˌ à¾Õ§µ‹ÍÍØ»¡Ã³µÒÁ·ÕÃè кØänj¡¨ç Ð ÊÒÁÒö·´Åͧ䴌â´ÂäÁ‹µÍŒ §à¢Õ¹â»Ãá¡ÃÁ ʋǹÃٻẺ·ÕÊè ͧ¤×Í àÃÕ¹ÃÙ´Œ nj ¡ÒÃà¢Õ¹â»Ãá¡ÃÁ ã¹áºº¹Õ¨é Ð àµÃÕÂÁ«Í¿µáÇÏÊÒí ËÃѺà¢Õ¹â»Ãá¡ÃÁ¾ÃŒÍÁ·Ñ§é µÑÇÍ‹ҧâ»Ãá¡ÃÁ à¾×Íè ãˌ¼àٌ ÃÕ¹ÊÒÁÒöÊÌҧ¡Ò÷´Åͧ¢Ö¹é àͧ ÃÇÁ¶Ö§ÊÒÁÒöàÃÕ¹ÃÙŌ §ä»ãËŒÅ¡Ö ¡Ñºâ»Ãá¡ÃÁ·Õàè ¢Õ¹¢Ö¹é à¾×Íè ¤Çº¤ØÁãˌ¡Å‹Í§ÊÁͧ¡ÅËÃ×ÍäÁâ¤Ã¤Í¹â·ÃÅàÅÍϹ¹Ñé ·íÒ§Ò¹µÒÁ·Õµè ͌ §¡Òà «Ö§è ¹íÒä»ÊÙ¡‹ ÒÃÊÌҧâ¤Ã§§Ò¹ÇÔ·ÂÒÈÒʵϵ͋ ä»ä´Œã¹·ÕÊè ´Ø ¨Ö§ËÇѧ໚¹Í‹ҧÂÔ§è Ç‹Ò Ê×Íè ¡ÒÃàÃÕ¹ÃÙ¹Œ ¨Õé Ð໚¹»ÃÐ⪹µÍ‹ ¡ÒÃàÃÕ¹ÃÙ·Œ Ò§ÇÔ·ÂÒÈÒʵϢͧ¤¹ä·Â Çþ¨¹ ¡ÃᡌÇÇѲ¹¡ØÅ ªÑÂÇѲ¹ ÅÔÁé ¾Ã¨ÔµÃÇÔäÅ


4

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÊÒúѭ º··Õè 1 á¹Ð¹íÒ SCi-BOX ªØ´¡Å‹Í§ÊÁͧ¡ÅÊíÒËÃѺàÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵϴnj  äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ .........................................................................................7 º··Õè 2 ÍØ»¡Ã³àÍÒµ¾ØµÊíÒËÃѺ¡ÒÃàÃÕ¹ÃٌáÅз´ÅͧÇÔ·ÂÒÈÒʵÏ´ŒÇ äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ .......................................................................................17 º··Õè 3 ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³·Ò§´Ô¨ÔµÍÅÊíÒËÃѺ¡ÒÃàÃÕ¹ÃٌáÅз´Åͧ ÇÔ·ÂÒÈÒʵϴnj ÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ............................................................25 º··Õè 4 ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡ÊíÒËÃѺ¡ÒÃàÃÕ¹ÃٌáÅз´Åͧ ÇÔ·ÂÒÈÒʵϴnj ÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ............................................................29 º··Õè 5 ʹء¡Ñº¡Ô¨¡ÃÃÁà¾×Íè ¡ÒÃàÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵϴnj  äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ¡ºÑ ªØ´«Í¿µáÇÏ SCi-BOX Activity .....................................41 ¡Ô¨¡ÃÃÁ·Õè 1

ʹء¡Ñºàʌ¹áçáÁ‹àËÅç¡â´Â㪌ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇÑ´ ʹÒÁáÁ‹àËÅç¡........................................................................46

¡Ô¨¡ÃÃÁ·Õè 2

ʹء¡Ñº¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Òâ´Â㪌ἧǧ¨Ã ÇÑ´¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò..........................................................49

¡Ô¨¡ÃÃÁ·Õè 3

ÇÑ´¤‹ÒµÑÇà¡çº»ÃШØâ´Â㪌ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò...........54

¡Ô¨¡ÃÃÁ·Õè 4

ÇÑ´¡ÃÐáÊ俵çã¹Ç§¨Ãâ´Â㪌ἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò......57

¡Ô¨¡ÃÃÁ·Õè 5

ÇÑ´áç´Ñ¹ä¿µÃ§â´Â㪌ἧǧ¨ÃÅ´·Í¹áç´Ñ¹.................. 60

¡Ô¨¡ÃÃÁ·Õè 6

àŋ¹¡Ñº¤Ø³ÊÁºÑµ¢Ô ͧáʧâ´Â㪌ἧǧ¨ÃµÃǨ¨Ñºáʧ.........63

¡Ô¨¡ÃÃÁ·Õè 7

ÊÇÔµª¤Çº¤ØÁä¿ 4 ´Ç§ â´Â㪌ἧǧ¨ÃÊÇÔµª ..................... 66

¡Ô¨¡ÃÃÁ·Õè 8

µÃǨ¨ÑºÇѵ¶ØẺµÑ´ÅíÒáʧ â´Â㪌ἧǧ¨ÃµÃǨ¨Ñº µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô ....................................................... 69

¡Ô¨¡ÃÃÁ·Õè 9

µÃǨ¨ÑºÇѵ¶ØẺÊзŒÍ¹áʧ â´Â㪌ἧǧ¨ÃµÃǨ¨Ñº µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô ....................................................... 72

¡Ô¨¡ÃÃÁ·Õè 10

µÃǨ¨ÑºÇѵ¶ØẺ¡ÃÐà¨Ô§áʧ â´Â㪌ἧǧ¨ÃµÃǨ¨Ñº µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô ....................................................... 75


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 11

ÇÑ´ÍسËÀÙÁâÔ ´Â㪌à·ÍÏÁÊÔ àµÍÏ............................................ 78

¡Ô¨¡ÃÃÁ·Õè 12

µÃǨÇÑ´¤ÇÒÁࢌÁÊմnj ÂËÅÑ¡¡ÒÃÊзŒÍ¹áʧ.........................80

¡Ô¨¡ÃÃÁ·Õè 13

㪌§Ò¹á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§໚¹ÊÇÔµªÊ§Ñè §Ò¹´ŒÇÂàÊÕ§.......83

¡Ô¨¡ÃÃÁ·Õè 14

㪌§Ò¹á¼§Ç§¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹àÅ×Íè ¹ ¡Ñº¡ÒÃà¤Å×Íè ¹·Õ·è Ò§¡Å...........................................................86

¡Ô¨¡ÃÃÁ·Õè 15

㪌§Ò¹á¼§Ç§¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع ¡Ñº¡ÒÃà¤Å×Íè ¹·Õ·è Ò§¡Å...........................................................88

¡Ô¨¡ÃÃÁ·Õè 16

ÇÑ´¤‹ÒµÑÇà¡çº»ÃШØâ´Â㪌áËŋ§¨‹Ò¡ÃÐáʤ§·Õãè ¹á¼§Ç§¨Ã ÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò.......................................................91

¡Ô¨¡ÃÃÁ·Õè 17

à«Åä¿¿‡Òà¤ÁÕ..........................................................................95

l

5

º··Õè 6 ¡Ò÷´Åͧ㪌§Ò¹ SCi-BOX ´ŒÇÂâ»Ãá¡ÃÁÀÒÉÒàºÊÔ¡......................................97 ¡Ô¨¡ÃÃÁ·Õè 18

¢ÑºàÊÕ§´ŒÇÂÊÇÔµª ................................................................107

¡Ô¨¡ÃÃÁ·Õè 19

ÊÇÔµªàÅ×Í¡ÃÕàŏ ...................................................................108

¡Ô¨¡ÃÃÁ·Õè 20

¡ÒÃÇÑ´áÅÐáÊ´§¤‹ÒÊÑ­­Ò³ÍйÒÅÍ¡º¹¤ÍÁ¾ÔÇàµÍÏ ¢Í§ SCi-BOX .......................................................................109

¡Ô¨¡ÃÃÁ·Õè 21

¤Çº¤ØÁ·ÔÈ·Ò§¡ÒÃËÁع¢Í§ÁÍàµÍÏ俵紌Ǡἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡...................................111

¡Ô¨¡ÃÃÁ·Õè 22

¤Çº¤ØÁ¤ÇÒÁàÃçǢͧÁÍàµÍÏ俵紌ÇÂἧǧ¨Ã µÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡.................................................113

¡Ô¨¡ÃÃÁ·Õè 23

¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ..........................................................115

¡Ô¨¡ÃÃÁ·Õè 24

¡ÒÃà¢Õ¹â»Ãá¡ÃÁµÔ´µ‹ÍâÁ´ÙÅ SLCD..................................119

¡Ô¨¡ÃÃÁ·Õè 25

¡ÒÃÇÑ´áÅÐáÊ´§¤‹ÒÊÑ­­Ò³ÍйÒÅÍ¡¼‹Ò¹âÁ´ÙÅ SLCD ¢Í§ SCi-BOX ......................................................................123

¡Ô¨¡ÃÃÁ·Õè 26

¡ÒÃÇÑ´áÅÐáÊ´§¤‹ÒÊÑ­­Ò³ÍйÒÅÍ¡¨Ò¡á¼§Ç§¨Ã µÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡´ŒÇÂàÊÕ§ .................................125


6

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

7

º··Õè 1

á¹Ð¹íÒ SCi-B X

ªØ´¡Å‹Í§ÊÁͧ¡ÅÊíÒËÃѺàÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ ´ŒÇÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ SCi-BOX ໚¹á¼§Ç§¨Ãà͹¡»ÃÐʧ¤·ºÕè ÃèØÍ»Ø ¡Ã³¤Çº¤ØÁẺâ»Ãá¡ÃÁ䴌¢¹Ò´àÅç¡·Õàè ÃÕÂ¡Ç‹Ò “äÁâ¤Ã¤Í¹â·ÃÅàÅÍϔ (microcontroller) ËÇÁ¡ÑºÇ§¨Ãàª×Íè Áµ‹Í¤ÍÁ¾ÔÇàµÍÏà¾×Íè ¡ÒÃâ»Ãá¡ÃÁáÅÐ Ê×Íè ÊÒâŒÍÁÙÅ â´ÂÀÒÂã¹ÂѧºÃèØÍ»Ø ¡Ã³áÊ´§¼Å¡Ò÷íÒ§Ò¹ (actuator) ÍÒ·Ô Ç§¨Ã¢ÑºÁÍàµÍÏ ǧ¨Ã¢Ñº ÃÕàÅ�� áÅÐʋǹàª×Íè Áµ‹ÍÍØ»¡Ã³µÃǨ¨ÑºÊÑ­­Ò³ËÃ×Íૹà«ÍÏ (sensor) änj´ÇŒ  ´Ñ§¹Ñ¹é ¨Ö§ÊÒÁÒö¹íÒἧ ǧ¨Ã SCi-BOX ¹ÕÁé Ò㪌㹡Ò÷´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏáÅÐâ¤Ã§§Ò¹ÇÔ·ÂÒÈÒʵÏ·àÕè ¡ÕÂè Ç¢ŒÍ§¡ÑºÃкº ¤Çº¤ØÁÍѵâ¹ÁѵäÔ ´ŒÍ‹ҧÊдǡáÅÐÁÕ»ÃÐÊÔ·¸ÔÀÒ¾ÊÙ§ àª×èÍÁµ‹Í¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ (¼‹Ò¹·Ò§¢Ò¾Íϵ P16)

ʋǹÃѺáÅлÃÐÁÇżÅÊÑ­­Ò³ ÍйÒÅÍ¡·Õè¨Ø´ SENSOR0-7 â´Â㪌äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ÊíÒËÃѺá»Å§ÊÑ­­Ò³ÍйÒÅÍ¡ ໚¹´Ô¨µÔ ÍÅ (Analog to digital converter co-processor) ·íҧҹËÇÁ´ŒÇÂ

ʋǹàª×èÍÁµ‹ÍÍØ»¡Ã³ÀÒ¹͡Ẻ ´Ô¨ÔµÍÅà¾ÔèÁàµÔÁ·Õè¨Ø´ P0-P7

P8-P11

P13

ǧ¨Ã¢ÑºÁÍàµÍÏ俵ç 2 ªØ´ ǧ¨Ã¢ÑºÃÕàŏ 4 ª‹Í§

i-Stamp äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ·íÒ§Ò¹´ŒÇÂâ»Ãá¡ÃÁ ÀÒÉÒàºÊÔ¡ P0-P7

ÃÙ»·Õè 1-1 ä´ÍÐá¡ÃÁ¡Ò÷íÒ§Ò¹¢Í§ SCi-B

P14 P15 P12

ǧ¨Ã¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ 2 ªØ´ ·íҧҹËÇÁ¡ÑºäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ÊíÒËÃѺ¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ (stepper motor co-processor)

¢ÑºÊÑ­­Ò³àÊÕ§¼‹Ò¹ ÅíÒ⾧ໂÂâ«

‹Œ Åз´ÅͧÇÔ·ÂÒÈÒʵϴnj ¡ŋͧÊÁͧ¡Å X ºÍÏ´àÃÕ¹ÃÙá


8

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

1.1 ¤Ø³ÊÁºÑµ·Ô ҧ෤¹Ô¤¢Í§ SCi-BOX ʋǹ¤Çº¤ØÁËÅÑ¡

l ʋǹ¤Çº¤ØÁËÅѡ㪌 i-Stamp ἧǧ¨ÃäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏàºÊÔ¡áʵÁ»Š 2SX ÊÒÁÒöà¢Õ¹â»Ãá¡ÃÁ¤Çº¤ØÁ

áÅоѲ¹Ò¡Ò÷íҧҹ䴌´ÇŒ ÂÀÒÉÒ¾ÕàºÊÔ¡ l ¢¹Ò´Ë¹‹Ç¤ÇÒÁ¨íÒ 16 ¡ÔâÅ亵 ẋ§Í͡໚¹ 8 ʋǹ ʋǹ 2 ¡ÔâÅ亵 ÊÒÁÒöàÃÕ¡㪌§Ò¹µ‹Íà¹×Í è §¡Ñ¹ä´Œ l ¤ÇÒÁàÃçÇ㹡ÒûÃÐÁÇżŤíÒÊѧè ÀÒÉÒàºÊÔ¡ 10,000 ¤íÒÊÑ§è µ‹ÍÇÔ¹Ò·Õ l àª×Í è Áµ‹Í¡Ñº¤ÍÁ¾ÔÇàµÍϼҋ ¹¾Íϵ͹ءÃÁÊíÒËÃѺ´ÒǹâËÅ´â»Ãá¡ÃÁáÅÐÊ×Íè ÊÒâŒÍÁÙÅ

¨Ø´µ‹ÍÍÔ¹¾ØµàÍÒµ¾µØ ÁÕÍ¹Ô ¾ØµàÍÒµ¾µØ ÊíÒËÃѺÃѺÊÑ­­Ò³´Ô¨µÔ ÍÅ 8 ª‹Í§ ÊÒÁÒö¡íÒ˹´ãˌ໚¹ÍÔ¹¾ØµËÃ×ÍàÍÒµ¾µØ 䴌Í‹ҧÍÔÊÃÐ l ÁÕ͹ Ô ¾ØµÃѺÊÑ­­Ò³ä¿¿‡ÒẺÍйÒÅÍ¡ÊíÒËÃѺµ‹Í¡ÑºÍØ»¡Ã³µÃǨ¨Ñº 8 ª‹Í§ áç´Ñ¹ÍÔ¹¾ØµÊÙ§ÊØ´äÁ‹à¡Ô¹ 5V ·íҧҹËÇÁ¡ÑºäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏá»Å§ÊÑ­­Ò³ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ (ADC Co-processor) ¤ÇÒÁÅÐàÍÕ´ ¢Í§¡ÒÃá»Å§ÊÑ­­Ò³ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ 10 ºÔµ ãˌ¤Ò‹ ¢Í§¢ŒÍÁÙÅ໚¹ 0-1,023 l

ÀÒ¤ÍØ»¡Ã³àÍÒµ¾µØ l ÁÕ LED áÊ´§Ê¶Ò¹Ð¡Ò÷íÒ§Ò¹ 4 ´Ç§

ÁÕǧ¨Ã¢ÑºÃÕàŏ 4 ªØ´ ᵋÅЪش·íÒ§Ò¹ÍÔÊÃШҡ¡Ñ¹ ¾ÃŒÍÁÃÕàŏ¢¹Ò´ 12V 5A áÅШشµ‹ÍÍÍ¡ä»ãªŒ§Ò¹ ¾Ô¡´Ñ ¢Í§Ë¹ŒÒÊÑÁ¼ÑÊÃÕàŏ 220Vac 5A l ǧ¨Ã¢ÑºÁÍàµÍÏ俵碹Ҵ 6-12V ¨íҹǹ 2 ªØ´¾ÃŒÍÁä¿áÊ´§·ÔÈ·Ò§¡ÒÃËÁع l àÅ×Í¡¡Ò÷íÒ§Ò¹ÃÐËNjҧǧ¨Ã¢ÑºÃÕàŏáÅÐÁÍàµÍÏ俵紌ǨÑÁ ê à»ÍÏ l ǧ¨Ã¢ÑºÊàµç»à»ÍÏÁÍàµÍÏẺÂÙ¹âÔ ¾Å‹ÒÏ 12V 2 ªØ´ ·íҧҹËÇÁ¡ÑºäÁâ¤Ã¤Í¹â·ÃÅàÅÍϤǺ¤ØÁÊàµç»à»ÍÏ ÁÍàµÍÏ (Stepper motor Co-processor) l ÁÕÅÒí ⾧ໂÂâ«ÊíÒËÃѺ¢ÑºÊÑ­­Ò³àÊÕ§ 1 µÑÇ ¤ÇÒÁ¶Õ· è ¢Õè ºÑ ãˌ䴌Á¤Õ ÇÒÁ´Ñ§ÊÙ§ÊØ´ÍÂÙ㋠¹ª‹Ç§ 1kHz-3kHz l

Í×¹è æ »‡Í¹ä¿àÅÕÂé §ä´Œ 2 ¨Ø´¤×Í ¼‹Ò¹·Ò§á¨¡ÍÐá´»àµÍÏËÃ×ͼ‹Ò¹·Ò§à·ÍÏÁ¹Ô ÍźÅçÍ¡ ÁÕǧ¨Ã¨Ñ´¢ÑÇé áç´Ñ¹ÀÒÂã¹ ·íÒãˌÊÒÁÒö㪌¡ºÑ ÍÐá´»àµÍÏ·ÁÕè ¡Õ ÒèѴ¢ÑÇé áç´Ñ¹áººã´¡ç䴌 l ä¿àÅÕÂ é §ÍÔ¹¾Øµ 9-16V ÀÒÂã¹ÁÕǧ¨Ã¤Çº¤ØÁáç´Ñ¹¤§·Õ·è Õè +5V 1A l

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í»ÃСͺ㹪ش SLCD16x2 âÁ´ÙÅ LCD ¢¹Ò´ 16 µÑÇÍÑ¡Éà 2 ºÃ÷Ѵ·Õãè ªŒ¡ÒõԴµ‹ÍẺ͹ءÃÁ (serial interface) ÊíÒËÃѺ áÊ´§¢ŒÍ¤ÇÒÁ, µÑÇàÅ¢ áÅÐÊÑ­Åѡɳ l


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

9

ÍÐá´»àµÍÏ俵ç 12V 500mA l ÊÒ»ҡ¤ÕºÊíÒËÃѺµ‹ÍÇÑ´ÊÑ­­Ò³ l ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³·Ò§´Ô¨µ Ô ÍÅ 3 ¡ÅØÁ‹ 9 ªØ´ »ÃСͺ´ŒÇ : l

¡ÅØÁ‹ µÃǨ¨ÑºÊÑ­­Ò³áººÅͨԡ (¡ÅØÁ‹ D) ἧǧ¨ÃÊÇÔµª 3 ªØ´ ἧǧ¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz 2 ªØ´ ἧǧ¨Ãà»ÃÕºà·ÕºÊÑ­­Ò³ 2 ªØ´ ¡ÅØÁ‹ µÃǨÇÑ´¤‹Ò¤§·Õàè ÇÅÒ RC (¡ÅØÁ‹ C) ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò 1 ªØ´ ¡ÅØÁ‹ µÃǨ¨ÑºÊÑ­­Ò³ªÑÇè ¢³Ð (¡ÅØÁ‹ P) ἧǧ¨ÃµÃǨ¨ÑºàÊÕ§ 1 ªØ´ l

ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³áÅÐÇÑ´»ÃÔÁÒ³·Ò§¿Ê¡Ô ʏẺÍйÒÅÍ¡ 2 ¡Å‹ÁØ 20 ªØ´ »ÃСͺ´ŒÇ : ¡ÅØÁ‹ µÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡ (¡ÅØÁ‹ A) ἧǧ¨ÃµÃǨ¨Ñºáʧ 2 ªØ´ ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ 2 ªØ´ ἧǧ¨ÃµÃǨ¨ÑºÍسËÀÙÁÔ 2 ªØ´ ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ 1 ªØ´ ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌à¾×Íè ¨‹ÒÂáç´Ñ¹ 5 ªØ´ ẋ§à»š¹ 3 Ẻ¤×Í áººâ»à·¹ªÔâÍÁÔàµÍϵÇÑ µÑ§é (2 ªØ´), µÑǹ͹ (2 ªØ´) áÅÐẺÊäÅ´ (1 ªØ´) ἧǧ¨Ãâ¿âµŒ·ÃÒ¹«ÔÊàµÍÏ 2 ªØ´ 㪌µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàôà¾×Íè à»ÅÕÂè ¹à»š¹áç´Ñ¹ËÃ×ÍÊÑ­­Ò³Åͨԡ ἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò 1 ªØ´ ἧǧ¨ÃÇÑ´¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò 1 ªØ´ ἧǧ¨ÃÅ´·Í¹áç´Ñ¹ä¿¿‡Ò 㪌ÊÒí ËÃѺÇÑ´áç´Ñ¹ä¿¿‡Ò 1 ªØ´ â´ÂÊÒÁÒöàÅ×Í¡¡ÒÃÅ´·Í¹ä´Œ 2 à·‹Ò ¡ÅØÁ‹ ÍØ»¡Ã³àÍÒµ¾µØ (¡ÅØÁ‹ O) ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô 2 ªØ´ ἧǧ¨Ã¢Ñº LED 2 ÊÕ 1 ªØ´

l ÁÍàµÍÏ俵ç ¢¹Ò´ 3-12V 1 µÑÇ

ʵç»à»ÍÏÁÍàµÍÏẺÂÙ¹âÔ ¾Å‹ÒÏ 12V 1 µÑÇ l µÑǵŒÒ¹·Ò¹áÅеÑÇà¡çº»ÃШØÊÒí ËÃѺ·´Åͧ ¨íҹǹÍ‹ҧÅÐ 10 ¤‹Ò ¤‹ÒÅÐ 1 µÑÇ l


10

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

D5 1N5819

J1 DC INPUT 6-16V.

+V

S1 POWER ON / OFF

C5 220/16V

D6 1N4001 IC1 LM2940CT -5.0

K1 BATT. INPUT

C2 0.1/63V D1-D4 1N4001 x4

STEPPER MOTOR #1

C4 0.1/63V

+5V

2 3 C8 0.1/63V

C7 0.1/63V

K2 DOWNLOAD DB-9 FEMALE

S2 RESET

+5V

+5V

K8 SENSOR5

+5V

6

K7 SENSOR4

+5V

7 AN0

5 AN2

GP3 GP5

IC2 i-Stamp

K5 SENSOR2

+5V

5 AN2

K4 SENSOR1

+5V

6

K3 SENSOR0

+5V

7 AN0

3

AN1

R3 10k

2

18

20

C12 1/50V

P15 P14

P8 P9

GP5 2

GP3

4

GND 10

P10 R4 150

P11

CR1 4MHz

R12 220

+5V

K16 P5

+5V

R10 220

10

K15 P4

+5V

R9 220

9

K14 P3

+5V

R8 220

8

K13 P2

+5V

R7 220

7

K12 P1

+5V

R6 220

6

R5 220

11

5

R14 10k K21 MOTOR-A

C13 10/16V

13

SP1 PIEZO

14 16

MOTOR-A #1

2

MOTOR-A #2

7 2A

11

P7

8

9

IC8/4

1

IC8/1

IC8/3

10 3

5 4

6

16 IC8/2

P6

9

IC8/1-IC8/4 : 74HC32

P5

1Y 3

1A

2Y

4Y

3A

3Y

14

RY1 RELAY 12V

INVERT

+

C15 0.1/63V

+

13 12 5

K23 P8 RELAY NO C

P1

LED2 DIR. #A LED3 DIR. #B

R16 2k2

K22 MOTOR-B

4

DIRECT

DC MOTOR

JP1 DRIVER SELECT

P2

+ DIRECT

11

34EN

P3

+

R15 2k2

Vcc1

P4

INVERT

6

12EN

15 4A 1 2

C14 0.1/63V

IC7 L293DNE

15

10

12

+5V

17

MOTOR-B #1

K17 P6

+5V

5

SER IN 6

19

12 13

R11 220

K11 P0

BUSY 7

R15 10k

20

MOTOR-B #2 K18 P7

4

NXP2220S-SMC

1 RST

+5V

8

+5V

1D 1C 1B 1A 2D 2C 2B 2A +Vcc IC5

P13

IC4 QP410

AN3

1

19 18 17 16 12 13 14 15

C11 0.1/63V

R13 10k Q4 BC557

P12

1 +5V

2

MCLR

IC3 QP410

+5V K6 SENSOR3

3

TxD

R2 150

8

4

+5V

4

AN1

5

RxD

C10 0.1/63V

AN3

K9 SENSOR6

6

+5V

1 3

K10 SENSOR7

7

RN1 2k2 *8

+5V

C9 0.1/63V

A

IC6 ULN2803

9 8

4

1

B

11 12 13 14 15 16 17 18 10

+V

23

2 3 4 5

C

D

A

K20 STEPPER MOTOR #2 CONNECTOR

C6 0.1/63V

+5V

B

K19 STEPPER MOTOR #1 CONNECTOR

21

6 7

C

D

LED1 POWER

C1 470/25V

PHASE A to D COIL

PHASE A to D COIL

R1 510

C3 47/16V

STEPPER MOTOR #2

+V RELAY

K24 P9 RELAY NO C

K25 P10 RELAY NO C

K26 P11 RELAY NO C

9

P0 1 3 5 7

D0 Q0 D1 Q1 D2 Q2 D3 Q3

4&

4%

4'

4 

8

16

R24

14

R23

12

R22

10

R21 R21-R24 47 x4

IC9 ULN2003

R17-R20 510 x4

LED7 LED6 LED5 LED4 P11 P10 P9 P8

ÃÙ»·Õè 1-2 ǧ¨ÃÊÁºÙó¢Í§ SCi-B

X

¡Å‹Í§ÊÁͧ¡Åà¾×Íè ¡ÒÃàÃÕ¹ÃÙጠÅз´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

11

¤Í¹à¹ç¡àµÍÏàª×Íè Áµ‹Í¾Íϵ͹ءÃÁ ᨍ¡áÅÐà·ÍÏÁ¹Ô ÍÅÊíÒËÃѺ¨‹ÒÂä¿

ÅíÒ⾧ໂÂâ«

ÊÇÔµªà»´-»´

¤Í¹à¹ç¡àµÍÏ SENSOR0-SENSOR7 µ‹Í¡Ñº ἧǧ¨Ã µÃǨ¨Ñºã¹ ¡ÅØÁ‹ ÊÑ­­Ò³ ÍйÒÅÍ¡

i-Stamp

¤Í¹à¹ç¡àµÍÏ P0-P7

µ‹ÍÁÍàµÍÏ俵ç ¨Ø´µ‹Í˹ŒÒÊÑÁ¼ÑÊÃÕàŏ

µ‹ÍÊàµç»à»ÍÏÁÍàµÍÏ LED 4 ´Ç§ ¨ÑÁê à»ÍÏàÅ×Í¡¡Ò÷íÒ§Ò¹ÃÐËNjҧ ǧ¨Ã¢ÑºÃÕàŏáÅÐǧ¨Ã¢ÑºÁÍàµÍÏ俵ç ¡ÒèѴÊÃâҾÍϵ¢Í§ i-Stamp ÊíÒËÃѺ¡Ò÷íÒ§Ò¹º¹ SCi-B X

P0-P7 ໚¹¨Ø´µ‹ÍÃѺËÃ×Íʋ§ÊÑ­­Ò³´Ô¨µÔ ÍŠ㪌µÍ‹ ¡Ñº SLCD ËÃ×Íἧǧ¨Ã¨µÃǨ¨ÑºÊÑ­­Ò³´Ô¨µÔ ÍÅ (D) P8-P11 µ‹Í¡Ñº LED à¾×Íè áÊ´§¼Å, ǧ¨Ã¢ÑºÁÍàµÍÏ俵ç 2 ªØ´ (P8-P9 áÅÐ P10-P11) áÅÐǧ¨Ã¢ÑºÃÕàŏ 4 ª‹Í§ P12 µ‹ÍÅíÒ⾧ໂÂâ« P13 µ‹Í¡ÑºÇ§¨Ãá»Å§ÊÑ­­Ò³ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ à¾×Íè ͋ҹ¤‹Ò¨Ò¡¨Ø´µ‹Í SENSOR0-SENSOR7 P14-P15 µ‹Í¡ÑºÇ§¨Ã¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ 2 ªØ´ â´Â P14 ໚¹¢Ò¢ŒÍÁÙŠʋǹ P15 ໚¹¢ÒµÃǨÊͺʶҹÐ

ÃÙ»·Õè 1-3 áÊ´§Ê‹Ç¹»ÃСͺ·Ò§¡ÒÂÀÒ¾¢Í§ ¡Å‹Í§ÊÁͧ¡Å

SCi-B X

ºÍÏ´àÃÕ¹ÃÙዌ Åз´ÅͧÇÔ·ÂÒÈÒʵϴnj Â


12

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

1.2 ¡Ò÷´ÊͺºÍÏ´ SCi-BOX 1.2.1 µÔ´µÑ§é «Í¿µáÇÏ SCi-BOC Activity â´Â¹íÒ«Õ´ÃÕ ÍÁ·Õ¨è ´Ñ ÁҾÌÍÁ¡ÑºªØ´ SCi-BOX ãʋŧ ä»ã¹«Õ´ÃÍÁä´Ã¿¢Í§¤ÍÁ¾ÔÇàµÍÏ ¨Ò¡¹Ñ¹é ¤Œ¹ËÒä¿Å SCi-BOX.exe ·íÒ¡ÒôѺàºÔŤÅÔ¡ ¨Ð»ÃÒ¡¯ ˹ŒÒµ‹Ò§ãËŒÂ¹× Âѹ¡ÒõԴµÑ§é ´Ñ§ÃÙ»

1.2.2 ¡´»ØÁ† OK ¨ÐࢌÒÊÙ¡‹ Ãкǹ¡ÒõԴµÑ§é â»Ãá¡ÃÁ

1.2.3 ¡´»ØÁ† Next à¾×Íè ãˌ´Òí à¹Ô¹¡ÒõԴµÑ§é µ‹Íä» ¨¹àÊÃç¨ÊÔ¹é ¡Ãкǹ¡ÒÃ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

13

1.2.4 ·íÒ¡ÒÃàÃÕ¡â»Ãá¡ÃÁ SCi-BOX Activity ¢Ö¹é ÁÒ㪌§Ò¹ â´Âä»·Õ»è Á؆ Start à Program àSci-BOX à Sci-BOX Activity ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§ËÅÑ¡¢Í§â»Ãá¡ÃÁ¢Ö¹ é ÁҴѧÃÙ»·Õè 1-4

ÃÙ»·Õè 1-4 ˹ŒÒµ‹Ò§ËÅÑ¡¢Í§«Í¿µáÇÏ Sci-BOX Activity ·Õãè ªŒã¹¡Ò÷´ÅͧáÅз´Êͺ ºÍÏ´ SCi-B X 1.2.5 µÔ´µÑ§é ἧǧ¨ÃäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ i-Stamp ŧº¹ºÍÏ´ SCi-BOX ·Õµè Òí á˹‹§«çÍ¡ à¡çµ 24 ¢Ò·ÕÇè ҋ §ÍÂً

µÔ´µÑ§é i-Stamp ŧº¹ «çÍ¡à¡çµ 24 ¢Ò·ÕÇè ҋ § º¹ºÍÏ´ SCi-B X µÒÁ·ÔÈ·Ò§´Ñ§ã¹ÃÙ» ÃÐÇѧÍ‹ÒàÊÕºãˌ¼´Ô ´Œ Ò ¹ËÃ× Í ¢ÒàËÅ×è Í Á ¡Ñ¹à´ç´¢Ò´

ÃÙ»·Õè 1-5 áÊ´§¡ÒõԴµÑ§é i-Stamp ŧº¹ºÍÏ´ SCi-B X ¨ÐµŒÍ§ÃÐÁÑ´ÃÐÇÑ§ã¹¢Ñ¹é µÍ¹ ¹Õàé »š¹¾ÔàÈÉ à¾ÃÒÐËÒ¡µÔ´µÑ§é ¼Ô´´ŒÒ¹ËÃ×Í¢ÒàËÅ×Íè Á¡Ñ¹ ¨Ð·íÒãˌ i-Stamp àÊÕÂËÒÂ䴌


14

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

1.2.6 µ‹ÍÊÒ¨ҡ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏࢌҡѺ SCi-BOX ´Ñ§ÃÙ»·Õè 1-6 µ‹Íä»Âѧ¾Íϵ͹ءÃÁ ¢Í§¤ÍÁ¾ÔÇàµÍÏ

¤Í¹à¹ç¡àµÍÏ DB-9 µÑÇàÁÕ $ % & '

ÊÒÂàª×Íè Áµ‹Í ¾Íϵ͹ءÃÁ ´ŒÒ¹µÑÇàÁÕÂ



! " #

ÊÒÂàª×Íè Áµ‹Í ¾Íϵ͹ءÃÁ ´ŒÒ¹µÑǼٌ

ÊÒÂÁÑŵԤÍÏ 9 àʌ¹

RS-232 DOWNLOAD



! " #

DC INPUT RESET

i-Stamp OFF

SCi-BOX BASIC Stamp in Science Experiment

$ % & '

ON

¤Í¹à¹ç¡àµÍÏ DB-9 µÑǼٌ

ÃÙ»·Õè 1-6 ¡Òõ‹ÍÊÒÂÃÐËNjҧ¤ÍÁ¾ÔÇàµÍÏ¡ºÑ ºÍÏ´ SCi-B

X

1.2.7 ä»·Õªè ͋ § 1 àÅ×Í¡´ÒǹâËÅ´¡Ô¨¡ÃÃÁ AT07-Switch ´Ñ§ã¹ÃÙ»·Õè 1-7

ÃÙ»·Õè 1-7 áÊ´§Ë¹ŒÒµ‹Ò§¢Í§¡Ô¨¡ÃÃÁ·Õè 07 «Ö§è 㪌㹡Ò÷´ÊͺºÍÏ´ SCi-B

X


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

15

1.2.8 µ‹Íἧǧ¨ÃÊÇÔµªà¢ŒÒ·Õ¨è ´Ø P1 º¹ºÍÏ´ SCi-BOX 1.2.9 àÅ×Í¡¨ÑÁê à»ÍÏ RELAY/MOTOR º¹ºÍÏ´ SCi-BOX ä»ÂѧµíÒá˹‹§ RELAY áŌǨ‹Ò ä¿ãˌᡋºÍÏ´ SCi-BOX 1.2.10 ¡´»ØÁ† Download ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§áÊ´§¡ÒôÒǹâËÅ´¢Ö¹é â´ÂµÑÇâ»Ãá¡ÃÁ¨Ð¤Œ¹ ËÒÎÒÏ´áÇÏàͧ ¨Ò¡ÃÙ»¾ºÎÒÏ´áÇϵ͋ ÍÂÙ·‹ ¾Õè Íϵ͹ءÃÁ COM1 àÁ×Íè ´ÒǹâËÅ´àÊÃç¨ÊÔ¹é ¨Ð»ÃÒ¡¯ ˹ŒÒµ‹Ò§á¨Œ§¡ÒôÒǹâËÅ´àÊÃç¨ÊÁºÙó ãˌ¡´»ØÁ† OK

ÃÙ»·Õè 1-8 áÊ´§Ë¹ŒÒµ‹Ò§¢Í§¡ÒôÒǹâËÅ´â»Ãá¡ÃÁŧº¹ SCi-B

X

l.2.11 ·´Åͧ¡´ÊÇÔµªº¹á¼§Ç§¨ÃÊÇÔµª Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§ LED ·ÕèµíÒá˹‹§ P8-P11 º¹ºÍÏ´ SCi-BOX áÅàÊÕ§¡Ò÷íÒ§Ò¹¢Í§ÃÕàŏᵋÅеÑÇàÁ×Íè ¡´ÊÇÔµªã¹áµ‹ÅФÃѧé ËÒ¡·Ø¡Í‹ҧ¶Ù¡µŒÍ§ àÁ×Íè ´ÒǹâËÅ´â»Ãá¡ÃÁáÅŒÇ LED ·Ñ§é ËÁ´¨Ð´ÑºÅ§ àÁ×Íè ¡´ÊÇÔµª ¤ÃÑ§é ·Õè 1 LED ·Õµè Òí á˹‹§ P8 ¨ÐµÔ´ÊNjҧ ¾ÃŒÍÁ¡Ñºä´ŒÂ¹Ô àÊÕ§¡Òõ‹Í˹ŒÒÊÑÁ¼ÑʢͧÃÕàŏ P8 ã¹ µíÒá˹‹§¢ÇÒÊØ´ àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 2 LED P9 µÔ´ÊNjҧ äŋàÃÕ§ÅíҴѺ仨¹¤Ãº áŌÇǹ·íÒ§Ò¹«éÒí Ëҡ䴌¼ÅµÒÁ¹Õáé Ê´§Ç‹Ò ¢³Ð¹Õé SCi-BOX ¾ÃŒÍÁÊíÒËÃѺ¡Ò÷´ÅͧàÃÕ¹ÃÙጠŌÇ


16

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

1.3 ¢ŒÍ¤Çû¯ÔºµÑ Ô à¾×Íè ãˌà¤Ã×Íè §Á×ÍáÅÐÍØ»¡Ã³ÍÂÙ㋠¹ÊÀÒ¾·Õ¾è ÌÍÁ·íÒ§Ò¹µÅÍ´àÇÅÒ ÊÔ§è ·Õ¤è ÇáÃзíÒ·Ø¡¤ÃÑ§é ·Õãè ªŒ §Ò¹ªØ´·´Åͧ SCi-BOX ¤×Í 1. »´ÊÇÔµª POWER ·Ø¡¤ÃÑ§é ·ÕÁè ¡Õ ÒöʹËÃ×͵‹ÍÊÒÂࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 2. »´ÊÇÔµª POWER ·Ø¡¤ÃÑ駷ÕèÁÕ¡Òõ‹ÍËÃ×ͻŴÊÒ¢ͧἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ËÃ×Í ÍØ»¡Ã³ã´æ ࢌҡѺ SCi-BOX ·Ñé§ 2 ¢ŒÍ¢ŒÒ§µŒ¹¹Õé໚¹ÊÔ觷Õ赌ͧ¡ÃзíÒ à¾×èÍ»‡Í§¡Ñ¹äÁ‹ãˌ i-Stamp Íѹ໚¹á¼§Ç§¨Ã äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏËÅÑ¡·Õãè ªŒ¤Çº¤ØÁ¡Ò÷íÒ§Ò¹·Ñ§é ËÁ´¢Í§ºÍÏ´ SCi-BOX ä´ŒÃºÑ ¤ÇÒÁàÊÕÂËÒÂÍѹ à¹×Íè §ÁÒ¨Ò¡¡ÃÐáÊä¿¿‡Ò¡ÃЪҡ ã¹¢³Ð·ÕÁè ¡Õ ÒûŴËÃ×͵‹ÍÊÒÂÊÑ­­Ò³ 3. ËÅѧ¨Ò¡·Õ·è ´ÅͧàÊÃç¨ã¹áµ‹ÅСÒ÷´Åͧ ¤Çû´ÊÇÔµª¡Í‹ ¹ ·Õ¨è зíÒ¡ÒûŴÊÒÂÊÑ­­Ò³ à¾×è͵‹Íἧǧ¨ÃãËÁ‹à¢ŒÒä»à¾×èÍ·íÒ¡Ò÷´Åͧã¹ËÑÇ¢ŒÍãËÁ‹ 4. äÁ‹¤ÇûŴËÃ×͵‹ÍÊÒÂÊÑ­­Ò³¢Í§á¼§Ç§¨Ãã´æ ࢌÒä»ã¹ SCi-BOX ã¹¢³Ð·Õè SCi-BOX ¡íÒÅѧ·íÒ§Ò¹ ànj¹áµ‹Á¢Õ ¹Ñé µÍ¹¡Òû¯ÔºµÑ ÍÔ ¹×è ã´·ÕÃè кØà¨ÒШ§Ç‹ÒµŒÍ§ÊÒÂÊÑ­­Ò³ã¹¢³Ð·íÒ§Ò¹¢Í§¡Òà ·´Åͧ¹Ñé¹æ 5. äÁ‹¤ÇÃÊÑÁ¼ÑÊἋ¹ÃкÒ¤ÇÒÁÌ͹·ÕÍè ÂÙº‹ ÃÔàdz´ŒÒ¹º¹·Ò§¢ÇҢͧºÍÏ´ SCi-BOX à¾ÃÒР໚¹¾×é¹·Õè·ÕèÁÕ¤ÇÒÁÌ͹áÅÐÁÕÍسËÀÙÁÔÊÙ§¾Í¤Çà Íѹà¹×èͧÁÒ¨Ò¡¡Ò÷íÒ§Ò¹µÒÁ»¡µÔ¢Í§á¼§Ç§¨Ã 6. ËÒ¡ÁÕ¤ÇÒÁ¼Ô´¾ÅÒ´ã´æ à¡Ô´¢Ö¹é µŒÍ§»´ÊÇÔµª POWER ·Ñ¹·Õ 7. äÁ‹ãªŒÍÐá´»àµÍÏ俵ç·ÕÁè áÕ Ã§´Ñ¹¢ÒÍÍ¡à¡Ô¹ +16V ¡Ñº SCi-BOX 8. ËÅѧ¨Ò¡àÊÃç¨ÊÔ¹é ¡Ò÷´Åͧ ãˌ»Å´ÊÒÂàª×Íè Áµ‹Í¤ÍÁ¾ÔÇàµÍÏáÅÐÊÒ¢ͧÍÐá´»àµÍÏËÃ×Í áËŋ§¨‹ÒÂä¿ÍÍ¡¨Ò¡ºÍÏ´ SCi-BOX àÊÁÍ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

17

º··Õè 2

ÍØ»¡Ã³àÍÒµ¾ØµÊíÒËÃѺ¡ÒÃàÃÕ¹ÃٌáÅз´Åͧ ÇÔ·ÂÒÈÒʵÏ´ŒÇÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍÃì 㹪ش SCi-BOX 䴌ºÃèØÍ»Ø ¡Ã³ÊÒí ËÃѺáÊ´§¼Å¡Ò÷íÒ§Ò¹änjº¹á¼§Ç§¨ÃËÅÑ¡ÍÂÙˋ ÅÒÂẺ ÃÇÁ·Ñ§é ἧǧ¨ÃáÊ´§¼Å·Õµè ͋ ÍÍ¡ÁÒµ‹Ò§ËÒ¡ ÊÒÁÒöÊÃػ䴌´§Ñ ¹Õé

2.1. ǧ¨Ã¢Ñº LED ·íÒ§Ò¹´ŒÇÂÅͨԡ “1” ¨íҹǹ 4 ª‹Í§ ¢Ñº´ŒÇ¢ҾÍϵ P8-P11 ¢Í§ i-Stamp

E

ä´âÍ´à»Å‹§áʧ (Light-emitting diode : LED) ໚¹ÍØ»¡Ã³·ÕèÊÒÁÒö¡íÒà¹Ô´áʧÍÍ¡ÁÒ䴌àÁ×èÍ䴌ÃѺ¨‹ÒÂä¿Í‹ҧ¶Ù¡µŒÍ§ ¡Òè‹ÒÂä¿ãˌ LED ·íÒ§Ò¹àÃÕÂ¡Ç‹Ò ¡ÒÃäºáÍÊ (bias) áÅСÒÃäºáÍÊ·Õ·è Òí ãˌ LED ·íÒ§Ò¹ àÃÕÂ¡Ç‹Ò ¡ÒÃäºáÍʵç (forward bias) áç´Ñ¹·Õãè ªŒäºáÍÊãˌ LED ·íÒ§Ò¹ Áդҋ 1-4.5 V ¶ŒÒ¡ÃÐáÊäËż‹Ò¹ LED ÁÒ¡ ·íÒãˌáç´Ñ¹·Õµè ¡¤Ã‹ÍÁ LED Áդҋ ÁÒ¡ áʧ·Õè LED ¢ÑºÍÍ¡ÁÒ¡ç¨ÐÊNjҧ¢Ö¹é â´Â»¡µÔáç´Ñ¹äºáÍʵç¢Í§ LED ෋ҡѺ 2V LED ÊÒÁÒöà»Å‹§áʧÍ͡䴌ËÅÒÂÊÕ¢¹Öé ÍÂÙ¡‹ ºÑ Ç‹Ò ¹íÒÊÒÃ¡Ö§è µÑǹíÒª¹Ô´ã´ÁÒ ÊÌҧ໚¹ LED ¡Ã³ÕÊáÕ ´§áÅÐàËÅ×ͧ·íÒ¨Ò¡á¡ÅàÅÕÂè ÁÍÒÏà«ä¹´¿ÍÊä¿´ (GaAsP) ʋǹÊÕà¢ÕÂÇ·íÒ¨Ò¡á¡ÅàÅÕÂè Á¿ÍÊä¿´ (GaP) »ÃÔÁÒ³¡ÃÐáÊä¿¿‡Ò·Õàè ËÁÒÐÊÁÊíÒËÃѺ¢Ñº LED ¤×Í 10-20mA ´Ñ§¹Ñ¹é 㹡Òà 㪌§Ò¹ LED ¨Ö§µŒÍ§ÁÕµÇÑ µŒÒ¹·Ò¹¨íÒ¡Ñ´¡ÃÐáʵ‹Í͹ءÃÁËÇÁÍÂÙ´‹ nj ¡ÒÃËÒ¤‹Ò¢Í§µÑÇ µŒÒ¹·Ò¹·Õãè ªŒã¹¡ÒèíÒ¡Ñ´¡ÃÐáÊãˌ LED ·íÒ䴌â´Â㪌ʵ٠à Vcc − VF RS = IF

â´Â·Õè VCC ¤×Íä¿àÅÕÂé §, VF ¤×Íáç´Ñ¹äºáÍʵç·Õµè ¡¤Ã‹ÍÁ LED áÅÐ IF ¤×Í ¡ÃÐáÊä¿¿‡Ò·Õäè Ëż‹Ò¹ LED àÁ×Íè ä´ŒÃºÑ äºáÍʵç

A

K

(¡) ÊÑ­Åѡɳ¢Í§ LED ¢Òá¤â·´

¢ÒáÍâ¹´

(¢) â¤Ã§ÊÌҧÀÒÂ㹢ͧ LED R1 Vs

LED1

+

I

(¤) ¡Òõ‹ÍµÑǵŒÒ¹·Ò¹à¾×èͨíÒ¡Ñ´

ã¹·Ò§µÃ§¡Ñ¹¢ŒÒÁ ËÒ¡¨‹ÒÂáç´Ñ¹äºáÍÊ¡ÅѺᡋ LED ¹Í¡¨Ò¡ LED ¡ÃÐáÊãˌᡋ LED ¨ÐäÁ‹·Òí §Ò¹áÅŒÇ ÍÒ¨·íÒãˌ LED àÊÕÂËÒÂà¹×Íè §¨Ò¡ LED ÁÕ굄 ÃÒ¡Ò÷¹áç´Ñ¹ÂŒÍ¹ ¡ÅѺ䴌äÁ‹Ê§Ù ¹Ñ¡ à¾Õ§ 3-10V ෋ҹѹé


NSOR3

P11 P10

P9

P3

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

P8

SENSOR2

P2

MOTOR P14, P15 : STEPPER MOTOR CONTROL

P1

SENSOR1 SENSOR0

Stepper motor Co-processor

RELAY

P0

l

RELAY 12V 5A

RELAY 12V 5A

RELAY 12V 5A

RELAY 12V 5A

MOTOR A

B

INV-A

INV-B

STEPPER MOTOR1 STEPPER MOTOR2

P11 RELAY P10 RELAY

P9 RELAY

P8 RELAY

ÃÙ»·Õè 2-1 áÊ´§¾×¹é ·Õ¢è ͧÍØ»¡Ã³àÍÒµ¾µØ º¹

P8-P9 MotorA P10-P11 MotorB

18

ǧ¨Ã¢ÑºÃÕàŏáÅÐÁÍàµÍÏ俵ç¹Ñ¹é ¨Ð µŒ Í §àÅ× Í ¡Í‹ Ò §ã´Í‹ Ò §Ë¹Öè § â´Â㪌 ¨ÑÁê à»ÍÏ RELAY/MOTOR º¹ºÍÏ´ SCiBOX ʋǹǧ¨Ã¢Ñº LED ¨ÐÊÒÁÒöÊÑ§è ¡Òà 䴌 ⠴µç áÅШÐáÊ´§¼Å仾Ì Í Áæ ¡ÑºÇ§¨Ã¢ÑºÃÕàŏËÃ×ÍÁÍàµÍϴnj Â

SCi-B X

2.2 ǧ¨Ã¢ÑºÃÕàŏ 12V P11 P10

P9

P3

ÁÕ 4 ª‹Í§ ÁÕ¾¡Ô ´Ñ ˹ŒÒÊÑÁ¼ÑÊ·¹áç´Ñ¹ä¿ÊÅѺ䴌 220Vac 5A ¢Ñº´ŒÇ¢ҾÍϵ P8-P11 ¢Í§ i-Stamp P8

LED ·Õµè Òí á˹‹§¢Ò P8-P11 ¨ÐµÔ´ÊNjҧµÒÁ¡Ò÷íÒ§Ò¹ÃÕàŏ ´ŒÇ ઋ¹ ¶ŒÒ P8 RELAY ·íÒ§Ò¹ LED ·Õµè Òí á˹‹§ P8 ¨ÐµÔ´ ÊNjҧ P2

RELAY

P0

P1

MOTOR

RELAY 12V 5A

P11 RELAY P10 RELAY

RELAY 12V 5A

RELAY 12V 5A

P9 RELAY

P8 RELAY

MOTOR A

B

INV-A

INV-B

P8-P9 MotorA P10-P11 MotorB

RELAY 12V 5A

˹ŒÒÊÑÁ¼ÑʢͧÃÕàŏ àÊÁ×͹໚¹ÊÇÔµªµÑ´µ‹Í

E ÊÑ­Åѡɳ¢Í§ÃÕàŏ ˹ŒÒÊÑÁ¼ÑÊ NC C

¢´ÅÇ´

ÃÕàŏ (Relay) ໚¹ÍØ»¡Ã³áÁ‹àËÅç¡ä¿¿‡ÒáººË¹Ö§è ·Õ·è Òí ˹ŒÒ·Õàè »š¹ÊÇÔµªµ´Ñ µ‹ÍË¹Ö§è ªØ´ ËÃ×ÍÁÒ¡¡Ç‹Ò ¢Ö¹é ÍÂÙ¡‹ ºÑ ¨íҹǹ˹ŒÒÊÑÁ¼ÑÊ·ÕÃè àÕ ÅµÇÑ Ë¹Ö§è æ ºÃèØÍÂً ÃÕàŏ»ÃСͺ´ŒÇ ʋǹÊíҤѭ 2 ʋǹ¤×Í ¢´ÅÇ´ (coil) áÅÐ˹ŒÒÊÑÁ¼ÑÊ (contact) ẋ§à»š¹Ë¹ŒÒÊÑÁ¼ÑÊ»¡µÔ (Normally Closed :NC) áÅл¡µÔແ´Ç§¨ÃËÃ×ÍäÁ‹µÍ‹ (Normally Opened :NC) ¡Òà ¡ÃеعŒ ãˌÃàÕ Å·Òí §Ò¹·íÒ䴌§Ò‹ ÂÁÒ¡à¾Õ§¨‹ÒÂáç´Ñ¹ãˌᡋ¢´ÅÇ´ã¹»ÃÔÁÒ³·Õ¢è ´ÅÇ´¹Ñ¹é µŒÍ§¡Òà ¡ç¨Ð·íÒãˌáÁ‹àËÅç¡ä¿¿‡Òà¡Ô´¢Ö¹é ·ÕËè ¹ŒÒÊÑÁ¼ÑÊ à¡Ô´¡Òôٴ˹ŒÒÊÑÁ¼Ñʨҡ¨Ø´ NC ÁÒÂѧ¨Ø´ NO ´Ñ§¹Ñ¹é àÁ×Íè ÃÕàŏ·Òí §Ò¹Ë¹ŒÒÊÑÁ¼ÑÊ NO ¨Ðµ‹Íǧ¨Ã ʋǹ NC ¨Ðແ´Ç§¨Ã á·¹ ã¹Åѡɳйշé Òí §Ò¹àËÁ×͹໚¹ÊÇÔµª 2 ·Ò§·Õ¤è Ǻ¤ØÁ´ŒÇÂáÁ‹àËÅç¡ä¿¿‡Ò

NO

NC

+ -

+V

C NO

ÃÕàÅÂÂ§Ñ äÁ‹·Òí §Ò¹

NC

+ -

C NO

ÃÕàŏàÃÔÁè ·íÒ§Ò¹

+V


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

19

2.3 ǧ¨Ã¢ÑºÁÍàµÍÏ俵ç

ÊÒÁÒö¢ÑºÁÍàµÍÏ俵çÊÙ§ÊØ´ 12V 500mA ¨íҹǹ 2 µÑÇ ãªŒ¢Ò¾Íϵ P8-P9 ÊíÒËÃѺ¢ÑºÁÍàµÍÏ µÑÇ·Õè 1 áÅÐ P10-P11 ÊíÒËÃѺ¢ÑºÁÍàµÍϵÇÑ ·Õè 2 ÁÕ LED 2 ÊÕáÊ´§¢ÑÇé ¢Í§áç´Ñ¹·Õ¨è ҋ ÂãˌᡋÁÍàµÍÃä¿ µÃ§ ¶ŒÒËÒ¡ LED áÊ´§ÊÕá´§ ËÁÒ¶֧¨‹ÒÂä¿¡ÅѺ¢ÑÇé ¶ŒÒ LED áÊ´§ÊÕà¢ÕÂÇ ËÁÒ¶֧ ¨‹ÒÂ俵ç¢ÑÇé «Ö§è ¨ÐÁռŵ‹Í·Ôȷҧ㹡ÒÃËÁع¢Í§ÁÍàµÍÏ â´ÂÁÕ¡Ò÷íÒ§Ò¹´Ñ§¹Õé ÁÍàµÍÏ A P8 P9 0 1 1 0 0 0 1 1

¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ ËÁع¡ÅѺ·Ò§ (LED áÊ´§ÊÕá´§) ËÁعµÒÁ·ÔÈ (LED áÊ´§ÊÕà¢ÕÂÇ) ᡹ÍÔÊÃÐ (LED ´Ñº áÅÐ᡹ÁÍàµÍÏ໚¹ÍÔÊÃÐ ËÁع´ŒÇÂÁ×Í䴌§Ò‹ Â) ºÑ§¤Ñºá¡¹ (LED ´Ñº áÅÐ᡹ÁÍàµÍ϶¡Ù ºÑ§¤Ñº ËÁع´ŒÇÂÁ×Í䴌ÂÒ¡)

ÁÍàµÍÏ B P10 P11 0 1 1 0 0 0 1 1

¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ ËÁع¡ÅѺ·Ò§ (LED áÊ´§ÊÕá´§) ËÁعµÒÁ·ÔÈ (LED áÊ´§ÊÕà¢ÕÂÇ) ᡹ÍÔÊÃÐ (LED ´Ñº áÅÐ᡹ÁÍàµÍÏ໚¹ÍÔÊÃÐ ËÁع´ŒÇÂÁ×Í䴌§Ò‹ Â) ºÑ§¤Ñºá¡¹ (LED ´Ñº áÅÐ᡹ÁÍàµÍ϶¡Ù ºÑ§¤Ñº ËÁع´ŒÇÂÁ×Í䴌ÂÒ¡)

2.4. ǧ¨Ã¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ ÊÒÁÒö¢ÑºÊàµç»à»ÍÏÁÍàµÍÏẺÂÙ¹âÔ ¾Å‹ÒÏ 12V 500mA 䴌 2 µÑÇ â´Â㪌¢Ò¾Íϵ P14 áÅÐ P15 ¢Í§ i-Stamp ËÑÇã¨ËÅÑ¡¤×ÍäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏÃNj Á«Ö§è àÃÕÂ¡Ç‹Ò Êàµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍÏ (Stepper motor Co-processor) ·íÒ˹ŒÒ·ÕÃè ºÑ ¢ŒÍÁÙÅã¹Í¹Ø¡ÃÁÁÒ¨Ò¡¢Ò¾Íϵ P14 àÃÕ¡¢Ò¹ÕÇé ҋ SERIN ¨Ò¡¹Ñ¹é Êàµç»à»ÍÏ ÁÍàµÍÏâ¤â»Ãà«Êà«ÍϨлÃÐÁǿތÍÁÙÅ áŌÇʋ§ä»¢ÑºÁÍàµÍÏãˌËÁعµÒÁ·Õ¡è Òí ˹´ ã¹¢³Ð·ÕÊè àµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍÏ·Òí §Ò¹ÍÂً ¨Ðʋ§ÊÑ­­Ò³¡ÅѺä»Âѧ i-Stamp ¼‹Ò¹·Ò§ ¢Ò¾Íϵ P15 à¾×èÍᨌ§ãˌ·ÃÒºÇ‹Ò Âѧ¤§·íÒ¡ÒâѺÁÍàµÍÏÍÂً äÁ‹ÊÒÁÒöÃѺ¢ŒÍÁÙÅãËÁ‹ä´Œ ¨ÐàÃÕ¡¢Ò ÊÑ­­Ò³¹ÕÇé ҋ BUSY ¡ÒÃÃÕ૵·íÒ䴌â´Âʋ§ÊÑ­­Ò³ÁÒ·Õ¢è Ò RST ¢Í§Êàµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍÏ ¡ÒÃÃѺ¢ŒÍÁÙÅà¾×Íè ¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ㪌ËÃ×ÍÍѵÃÒàÃçÇ㹡Òö‹Ò·ʹ¢ŒÍÁÙÅ 9,600 ºÔµµ‹ÍÇÔ¹Ò·Õ ¨íҹǹºÔµ¢ŒÍÁÙŤ×Í 8 ºÔµ áÅÐäÁ‹ÁºÕ µÔ µÃǨÊͺ¢ŒÍÁÙÅ ·Ø¡¤ÃÑ§é ·ÕÁè Õ¡ÒÃʋ§¢ŒÍÁÙÅÁÒÂѧÊàµç»à»ÍÏÁÍàµÍÏ â¤â»Ãà«Êà«ÍϨÐÁÕÊ­ Ñ ­Ò³ BUSY µÍºÃѺ໚¹Åͨԡ “0” ¡ÅѺä»Âѧ i-Stamp à¾×Íè ᨌ§Ç‹Ò¡íÒÅѧ¡ÃзíÒ ¤íÒÊѧè ÍÂً áÅÐàÁ×Íè àÊÃç¨ÊÔ¹é ÊÑ­­Ò³ BUSY ¡ç¨Ð¶Ù¡à«µà»š¹Åͨԡ “1” â´ÂÍѵâ¹ÁÑµÔ à¾×Íè ¡ÃзíÒ¤íÒÊÑ§è µ‹Íä»


20

l

E

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

Êàµç»à»ÍÏÁÍàµÍÏ (stepper motor) ໚¹

ÁÍàµÍÏẺ˹Ö觷ÕèÁÕ¡ÒÃËÁعẺ໚¹¨Ñ§ËÇÐËÃ×ÍàÃÕ¡NjÒ໚¹Êàµç» ¡Å‹Ò Ǥ×Í àÁ×èͨ‹ÒÂÊÑ­­Ò³ãˌᡋÁÍàµÍÏÍ‹ҧ¶Ù¡µŒÍ§ ÁÍàµÍϨÐËÁعä»à»š¹ ¨Ñ§ËÇРʋǹ¨ÐËÁع«ŒÒÂËÃ×Í¢ÇÒ¢Öé¹ÍÂً¡Ñº¢ÑéǢͧ¡Òè‹ÒÂä¿ãˌᡋ¢´ÅÇ´ ÀÒÂã¹ÁÍàµÍÏ ¤ÇÒÁÅÐàÍÕ´¢Í§¡ÒÃËÁع¢Í§Êàµç»à»ÍÏÁÍàµÍϨТֹé ÍÂً ¡Ñºâ¤Ã§ÊÌҧ¢Í§Êàµç»à»ÍÏÁÍàµÍÏáÅÐǧ¨Ã¢Ñº â¤Ã§ÊÌҧ¢Í§Êàµç»à»ÍÏÁÍàµÍÏẺÂÙ¹Ôâ¾Å‹ÒϨоѹ¢´ÅÇ´ 2 ¢´º¹áµ‹ÅТÑÇé áÁ‹àËÅ硢ͧ᡹àËÅ硤§·Õè (ÊàµàµÍÏ : stater) ᵋÅТ´áº‹§ ໚¹ 2 à¿Ê ÃÇÁÁÍàµÍÏ·§Ñé µÑÇÁÕ¢´ÅÇ´ 4 à¿Ê ¤×Í à¿Ê 1, 2, 3 áÅÐ 4 ÁÕ¡Òà µ‹ÍÊÒ¨ҡ¢´ÅǴᵋÅТ´à¾×Íè ¨‹ÒÂä¿àÅÕÂé § ·íÒãˌÊàµç»à»ÍÏÁÍàµÍÏẺ ¹ÕÁé Õ 5 áÅÐ 6 ÊÒ â´ÂÊÒ·Õè 5 áÅÐ 6 ¤×ÍÊÒÂä¿àÅÕÂé § ã¹¡Ã³Õ 6 ÊÒµŒÍ§ ¹íÒÊÒÂä¿àÅÕÂé §·Ñ§é ÊͧÁÒµ‹ÍËÇÁ¡Ñ¹ áŌǨ‹ÒÂ俨֧¨Ð·íÒãˌÁÍàµÍÏ·Òí §Ò¹ ¡ÒâѺÊàµç»à»ÍÏÁÍàµÍÏÍ‹ҧ§‹ÒÂÁÕ 3 Ẻ¤×Í ¿ÙÅÊàµç»Ë¹Ö§è à¿Ê, ¿ÙÅÊàµç»Êͧà¿Ê áÅÐ ÎÒŏ¿Êàµç» Ẻ˹Öè§à¿Ê໚¹¡ÒâѺ·Õ觋Ò·ÕèÊØ´ â´Â»‡Í¹ÊÑ­­Ò³¡Ãе،¹¢´ ÅÇ´¤ÃÑé§ÅÐà¿Êäŋ¡Ñ¹ä» ઋ¹ àÃÔèÁ¨Ò¡à¿Ê·Õè 1 µ‹Í´ŒÇÂà¿Ê·Õè 2, 3 áÅÐ 4 áŌÇǹ¡ÅѺÁÒà¿Ê·Õè 1 ãËÁ‹ ËÃ×ÍàÃÔÁè ¨Ò¡à¿Ê·Õè 1 ä»Âѧà¿Ê·Õè 4, 3 áÅÐ 2 áŌÇǹ¡ÅѺÁÒà¿Ê·Õè 1 ÍÕ¡¤ÃÑ§é ´ŒÇÂÅíҴѺ¡Òû‡Í¹ÊÑ­­Ò³·Õµè ҋ §¡Ñ¹ ·íÒãˌ ·ÔÈ·Ò§¡ÒÃËÁع¢Í§Êàµç»à»ÍÏÁÍàµÍÏÊǹ·Ò§¡Ñ¹´ŒÇ ¡ÒâѺÊàµç»à»ÍÏ ÁÍàµÍÏẺ¹Õé ¨ÐÁÕ¢´ÅÇ´à¾Õ§à¿Êà´ÕÂÇ·Õäè ´ŒÃºÑ ÊÑ­­Ò³¡ÃеعŒ ẺÊͧà¿Ê¤ÅŒÒ¡ѺẺ˹֧è à¿Ê ᵋ᷹·Õ¨è Ðʋ§ÊÑ­­Ò³à¾Õ§ à¿Êà´ÕÂÇ ¨Ð»‡Í¹ÊÑ­­Ò³ä»Âѧà¿Ê¢Í§ÁÍàµÍÏ·ãÕè ¡ÅŒ¡¹Ñ ã¹àÇÅÒà´ÕÂǡѹ áÅÐàÃÕ§ÅíҴѺ¡Ñ¹ä» àÃÔÁè ´ŒÇ¡Òû‡Í¹ÊÑ­­Ò³ä»Âѧà¿Ê·Õè 1 áÅÐ 2 ¾ÃŒÍÁ ¡Ñ¹ã¹Êàµç»·Õè 1 ¨Ò¡¹Ñ¹é »‡Í¹ÊÑ­­Ò³ä»Âѧà¿Ê·Õè 2 áÅÐ 3 ¶Ñ´ÁÒã¹Êàµç» ·Õè 3 »‡Í¹ÊÑ­­Ò³ä»·Õàè ¿Ê 3 áÅÐ 4 Êàµç»·Õè 4 »‡Í¹ÊÑ­­Ò³ä»Âѧà¿Ê·Õè 4 áÅÐ 1 áŌÇǹ¡ÅѺ价Õàè ¿Ê·Õè 1 áÅÐ 2 ÍÕ¡¤ÃÑ§é ´ŒÇ¡ÒâѺẺ¹Õ·é Òí ãˌ䴌 áçºÔ´ËÃ×ͷͤ (toque) ÁÒ¡¢Ö¹é ᵋ㪌¾Åѧ§Ò¹ã¹¡ÒâѺà¾ÔÁè ÁÒ¡¢Ö¹é ẺÎÒŏ¿Êàµç» ໚¹áºº·Õäè ´ŒÃºÑ ¤ÇÒÁ¹ÔÂÁÁÒ¡·ÕÊè ´Ø à¹×Íè §¨Ò¡ª‹Ç ãˌÁÍàµÍÏËÁع䴌Í‹ҧÅÐàÍÕ´ÁÒ¡¢Ö¹é ໚¹Êͧ෋Ңͧ¤ÇÒÁÅÐàÍÕ´»¡µÔ ¡ÒâѺẺ¹Õé¼ÊÁÃÐËNjҧẺ˹Öè§áÅÐÊͧà¿Ê ¡Å‹ÒǤ×Í ÁÕ·Ñ駡Òû‡Í¹ ÊÑ­­Ò³¡Ãе،¹ä»Âѧ¢´ÅÇ´à¾Õ§à¿Êà´ÕÂÇáÅоÌÍÁ¡Ñ¹Êͧà¿Ê㹪‹Ç§ àÇÅÒ˹Öè§ ´ŒÇ¡ÒâѺẺ¹Õéʋ§¼ÅãˌáçºÔ´à¾ÔèÁ¢Öé¹ ¤ÇÒÁ¶Ù¡µŒÍ§¢Í§ µíÒá˹‹§·ÕËè ÁعÁÕà¾ÔÁè ÁÒ¡¢Ö¹é à¾Õ§ᵋÇҋ 㹡ÒâѺᵋÅÐÊàµç»¨Ðãˌ¼Åà¾Õ§ ¤ÃÖ§è Êàµç»¢Í§¡ÒâѺ»¡µÔ ´Ñ§¹Ñ¹é ËÒ¡µŒÍ§¡ÒÃãˌ¡ÒÃà¤Å×Íè ¹·Õàè »š¹ä»áººàµçÁ Êàµç» ¨ÐµŒÍ§¡íÒ˹´ãˌ·Òí ¡ÒÃËÁØ¹ä» 2 Êàµç»µ‹Íà¹×Íè §¡Ñ¹

PHASE 4

PHASE 4 +V

PHASE 3

PHASE 3

PHASE 2

PHASE 1

PHASE 2 +V PHASE 1

+V

â¤Ã§ÊÌ Ò §¢Í§Êàµç » à»ÍÏ Á ÍàµÍÏ á ºº ÂÙ¹Ôâ¾Å‹ÒÏ Êàµç»·Õè PHASE 1 PHASE 2 PHASE 3 PHASE 4 1 ·íÒ§Ò¹ 2 ·íÒ§Ò¹ 3 ·íÒ§Ò¹ 4 ·íÒ§Ò¹

¡Òû‡Í¹ÊÑ­­Ò³à¾×Íè ¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ Ẻ¿ÙÅÊàµç»Ë¹Öè§à¿Ê Êàµç»·Õè PHASE 1 PHASE 2 PHASE 3 PHASE 4 1 ·íÒ§Ò¹ ·íÒ§Ò¹ 2 ·íÒ§Ò¹ ·íÒ§Ò¹ 3 ·íÒ§Ò¹ ·íÒ§Ò¹ 4 ·íÒ§Ò¹ ·íÒ§Ò¹

¡Òû‡Í¹ÊÑ­­Ò³à¾×Íè ¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ Ẻ¿ÙÅàµç»Êͧà¿Ê Êàµç»·Õè PHASE 1 1 ·íÒ§Ò¹ 2 ·íÒ§Ò¹ 3 4 5 6 7 8 ·íÒ§Ò¹

PHASE 2 ·íÒ§Ò¹ ·íÒ§Ò¹ ·íÒ§Ò¹ -

PHASE 3 ·íÒ§Ò¹ ·íÒ§Ò¹ ·íÒ§Ò¹ -

PHASE 4 ·íÒ§Ò¹ ·íÒ§Ò¹ ·íÒ§Ò¹

¡Òû‡Í¹ÊÑ­­Ò³à¾×Íè ¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ ẺÎÒŏ¿Êàµç»


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

2.5 ἧǧ¨Ãä¿áÊ´§¼Å 2 ÊÕ : LED

l

21

(µ‹Í¡Ñº P0-P7)

㪌 LED Ẻ 2 ÊÕ㹡ÒÃáÊ´§¼Å â´ÂàÅ×͡䴌 2 Ẻ

LED

O

220

4 HIGH

/

LOW

LED

LOW

O

¶ŒÒ໚¹ÊÑ­­Ò³Åͨԡ "0" ¨ÐáÊ´§¼Å໚¹ÊÕà¢ÕÂÇ

HIGH

ª‹Í§ HIGH ¶ŒÒÍÔ¹¾Øµà»š¹Åͨԡ "1" LED µÔ´à»š¹ÊÕá´§ ª‹Í§ LOW ¶ŒÒÍÔ¹¾Øµà»š¹Åͨԡ "0" LED µÔ´à»š¹ÊÕà¢ÕÂÇ ¶ŒÒäÁ‹ãª‹ÊÑ­­Ò³·Õè¡íÒ˹´ LED ¨Ð´Ñº

¶ŒÒ໚¹ÊÑ­­Ò³Åͨԡ "1" ¨ÐáÊ´§¼Å໚¹ÊÕá´§

Bi-color LED

2.6 ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô : Infrared LED

(µ‹Í¡Ñº P0-P7)

㪌 LED à»Å‹§áʧÍÔ¹¿ÃÒàô¢¹Ò´ 3 ÁÁ. 㪌§Ò¹ä´Œ 2 Ẻ¤×Í Ê‹§áººµ‹Íà¹×èͧ

·íÒ§Ò¹àÁ×Íè ä´ŒÃºÑ Åͨԡ "1" 㪌¡ºÑ ἧǧ¨Ãâ¿âµŒ·ÃÒ¹«ÔÊàµÍÏà¾×Íè ÇÑ´ÃдѺ ¤ÇÒÁࢌÁ¢Í§áʧÍÔ¹¿ÃÒàô·ÕÊè §‹ ÍÍ¡ä» Ê‹§áººÊÑ­­Ò³¤ÇÒÁ¶Õè ´ŒÇ¡ÒüÊÁÊÑ­­Ò³¾Òˏ¤ÇÒÁ¶Õè 38kHz 㹡óչãÕé ªŒÃNj Á¡Ñºá¼§Ç§¨Ã âÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàôà¾×Íè µÃǨÊͺ¡ÒÃÃѺÊÑ­­Ò³ O

Infrared LED # Infrared LED

E

LED ·Õãè ˌáʧÍÔ¹¿ÃÒàôÁÑ¡¹ÔÂÁ·íÒ¨Ò¡á¡ÅàÅÕÂè ÁÍÒÏà«ä¹´ (GaAs)


22

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

2.7 SLCD : âÁ´ÙÅ LCD Ẻ͹ءÃÁ

(µ‹Í¡Ñº P0-P7)

l áÊ´§¼Å䴌 16 µÑÇÍÑ¡Éà 2 ºÃ÷Ѵ

µ‹Í¡Ñº¾Íϵ¢Í§äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ i-Stamp 䴌â´ÂµÃ§ (㹡óÕ㪌 SCi-BOX µ‹Íࢌҷբè Ò P0-P7 ¢Òã´¢Ò˹֧è ) l àª×Í è Áµ‹Í¡Ñº¾Íϵ͹ءÃÁ RS-232 䴌â´ÂµÃ§ l

ÊÒÁÒöàÅ×Í¡ÊÑ­­Ò³àª×Íè Áµ‹Í໚¹áººâ´ÂµÃ§ (direct) ËÃ×Í áºº¡ÅѺÅͨԡ (invert) 䴌 l àÅ×Í¡ÍѵÃÒàÃçÇ㹡Òö‹Ò·ʹ¢ŒÍÁÙÅ䴌 2 ¤‹Ò¤×Í 2,400 áÅÐ 9,600 ºÔµµ‹ÍÇÔ¹Ò·Õ ã¹ÃٻẺ¢ŒÍÁÙÅ 8 ºÔµ äÁ‹Á¾Õ ÒÃÔµÕé ºÔµËÂØ´ 1 ºÔµ (8N1) l àÅ×Í¡ªØ´¤íÒÊÑ§è ¤Çº¤ØÁ䴌·§Ñé ẺÁҵðҹáÅÐà¾ÔÁ è àµÔÁ l

l 㪌ÊÒµ‹Í 3 àʌ¹¤×Í Vcc (+), GND (G) áÅÐ Serial input (S) l

㪌ä¿àÅÕÂé §ä´Œµ§Ñé ᵋ +5 ¶Ö§ +12V

2.7.1 ¡ÒÃ㪌§Ò¹ SLCD : âÁ´ÙÅ LCD Ẻ͹ءÃÁ ã¹ÃÙ»´ŒÒ¹Å‹Ò§áÊ´§ÃÒÂÅÐàÍÕ´¢Í§á¼§Ç§¨Ã´ŒÒ¹ËÅѧ¢Í§ SLCD º¹ºÍÏ´ÁÕ¨ÁÑê à»ÍÏà¾×Íè ¤Çº¤ØÁ ¡Ò÷íÒ§Ò¹·Ñ§é ÊÔ¹é 4 µÑÇ ´Ñ§ÁÕÃÒÂÅÐàÍÕ´µ‹Í仹Õé 14

1

»ÃѺ¤ÇÒÁÊNjҧ¢Í§¨ÍáÊ´§¼Å

µ‹Íŧ¡ÃÒÇ´

+ S G

BRIGHTNESS

DI IN

24 96

16 8

ST EX

14

NXP1008S-LCD

INPUT

1

CONNECTOR 14 PIN

CONNECTOR 2x7 PIN

¤Í¹à¹ç¡àµÍÏÊÒí ËÃѺàª×Íè Áµ‹ÍâÁ´ÙÅ LCD Áҵðҹ ·Ñ§é Ẻá¶Çà´ÕÂè Ç 1x14 ¢Ò áÅÐá¶Ç¤Ù‹ 2x7 ¢Ò

¢ŒÍÁÙÅ͹ءÃÁ µ‹Íä¿àÅÕÂé §

(c) 2000 Innovative Experiment

àÅ×Í¡âËÁ´¤íÒÊѧè

àÅ×Í¡¡ÒÃáÊ´§¼Å

àÅ×Í¡ºÍ´àõ

àÅ×Í¡ÅѡɳÐÊÑ­­Ò³

¤íÒÊÑè§à¾ÔèÁàµÔÁ (EX)

8 ËÅÑ¡µ‹ÍºÃ÷Ѵ (8)

9600 ºÔµµ‹ÍÇÔ¹Ò·Õ (96)

¡ÅѺÅͨԡËÃ×Í RS-232 (IN)

¤íÒÊÑè§Áҵðҹ (ST)

16 ËÅÑ¡µ‹ÍºÃ÷Ѵ (16)

2400 ºÔµµ‹ÍÇÔ¹Ò·Õ (24)

àª×Íè Áµ‹Íâ´ÂµÃ§ (DI)


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

23

1. ¨ÑÁê à»ÍÏàÅ×Í¡âËÁ´¤íÒÊѧè (mode command jumper) 㪌ÊÒí ËÃѺàÅ×Í¡âËÁ´¤íÒÊѧè à¾×Íè ¤Çº¤ØÁ ¡ÒÃáÊ´§¼Å¢Í§âÁ´ÙÅ LCD «Ö§è àÅ×͡䴌 2 âËÁ´¤×Í âËÁ´¤íÒÊѧè Áҵðҹ (ST) «Ö§è ¨ÐµÃ§¡ÑºâÁ´ÙÅ LCD ¢Í§ Scott Edwards ·Õäè ´ŒÃºÑ ¤ÇÒÁ¹ÔÂÁ·ÑÇè âÅ¡ áÅÐâËÁ´¤íÒÊѧè à¾ÔÁè àµÔÁ (Extended mode command : EX) ÊÒÁÒö´ÙÃÒÂÅÐàÍÕ´à¾ÔÁè àµÔÁ䴌ã¹ËÑÇ¢ŒÍªØ´¤íÒÊÑ§è ¢Í§ SLCD »¡µÔ¨ÐàÅ×Í¡ä»·Õâè ËÁ´¤íÒÊѧè Áҵðҹ (ST) 2. ¨ÑÁê à»ÍÏàÅ×Í¡ºÃ÷Ѵ¢Í§¡ÒÃáÊ´§¼Å (lines jumper) 㪌àÅ×Í¡¨íҹǹºÃ÷Ѵ¢Í§¡ÒÃáÊ´§ ¼Å Áմnj ¡ѹ 2 Ẻ¤×ÍẺ 1/8 Duty ËÁÒ¶֧ àÅ×Í¡áÊ´§¼Å 8 ËÅÑ¡µ‹ÍºÃ÷Ѵ áÅÐẺ 1/16 Duty ËÁÒ¶֧ àÅ×Í¡áÊ´§¼Å 16 ËÅÑ¡ËÃ×͵ÑÇÍÑ¡Éõ‹ÍºÃ÷ѴËÃ×ÍÁÒ¡Ç‹Ò »¡µÔ¨ÐàÅ×Í¡änj·Õè 1/16 «Ö§è ËÁÒ¶֧ àÅ×Í¡¡ÒÃáÊ´§¼ÅẺËÅÒºÃ÷Ѵ 3. ¨ÑÁê à»ÍÏàÅ×Í¡ºÍ´àõËÃ×ÍÍѵÃÒàÃçÇ㹡ÒÃÊ×Íè ÊÒâŒÍÁÙÅ͹ءÃÁ (baudrate select jumper) àÅ×Í¡ 䴌 2 ¤‹Ò¤×Í 2400 ºÔµµ‹ÍÇÔ¹Ò·Õ áÅÐ 9600 ºÔµµ‹ÍÇÔ¹Ò·Õ ã¹ÃٻẺ¨íҹǹºÔµ¢ŒÍÁÙÅ 8 ºÔµ äÁ‹ÁºÕ µÔ ¾ÒÃÔµÕé áÅÐÁÕºµÔ ËÂØ´ 1 ºÔµ 4. ¨ÑÁê à»ÍÏàÅ×Í¡ÃٻẺ¢Í§ÊÑ­­Ò³àª×Íè Áµ‹Í (interface signal jumper) ÁÕ´ŒÇ¡ѹ 2 Ẻ¤×Í áºº¡ÅѺÅͨԡáÅÐ RS-232 (invert logic TTL/CMOS level or RS-232 : IN) ¡Ñºáººàª×Íè Áµ‹Íâ´ÂµÃ§ (direct logic TTL/CMOS level : DI) ¶ŒÒËÒ¡¹íÒ SLCD ä»àª×èÍÁµ‹Í¡Ñº¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ µŒÍ§àÅ×Í¡ä»·Õè IN ¶ŒÒËÒ¡àª×Íè Áµ‹Í¡ÑºäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏâ´ÂµÃ§ ÊÒÁÒöàÅ×͡䴌·§Ñé IN áÅÐ DI ¡ÒûÃѺ¤ÇÒÁÊNjҧ¢Í§¨ÍáÊ´§¼Å·íÒ䴌â´Â»ÃѺ·Õµè Òí á˹‹§ BRIGHTNESS ¨Ø´àª×Íè Áµ‹Í¡ÑºÍØ»¡Ã³ÀÒ¹͡ÁÕ 3 ¨Ø´¤×Í ¨Ø´µ‹Íä¿àÅÕÂé § +Vcc (+), ÍÔ¹¾ØµÊÑ­­Ò³Í¹Ø¡ÃÁ (serial input : S) áÅШشµ‹Í¡ÃÒÇ´ (GND : G)

2.7.2 ¡ÒÃàª×Íè Áµ‹Í SLCD ¡Ñº SCi-BOX ·íÒ䴌§Ò‹ ÂÁÒ¡ à¾Õ§µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡¢Ò¾Íϵ P0-P7 ¢Òã´¢ÒË¹Ö§è º¹ºÍÏ´ SCi-BOX ࢌҡѺ ¢Ò¢ŒÍÁÙŢͧ SLCD ʋǹ¡ÒáíÒ˹´¨ÑêÁà»ÍÏà¾×èÍàÅ×Í¡¡Ò÷íÒ§Ò¹¢Í§âÁ´ÙÅáÊ´§¼Å SLCD 㹪ش «Í¿µáÇÏ SCi-BOCX Activity ¨ÐÁÕ¡ÒáíÒ˹´ãˌàÅ×Í¡¨ÑÁê à»ÍÏänjÍ‹ҧàËÁÒÐÊÁáÅŒÇ ÊÒÁÒö´Ù䴌¨Ò¡ µÑÇÍ‹ҧã¹áµ‹ÅСԨ¡ÃÃÁ ´Ñ§¹Ñ¹é 㹡Ò÷´Åͧ¢Ñ¹é µŒ¹ ¼ÙàŒ ÃÕ¹ËÃ×ͼٷŒ ´ÅͧäÁ‹Á¤Õ ÇÒÁ¨íÒ໚¹µŒÍ§à¢Õ¹¤íÒÊѧè à¾×Íè ¤Çº¤ØÁ¡Òà áÊ´§¼Å¢Í§âÁ´ÙÅ SLCD ᵋÍ‹ҧ㴠áÅШÐÁÕÃÒÂÅÐàÍÕ´à¾ÔÁè àµÔÁ¾ÃŒÍÁ·Ñ§é µÑÇÍ‹ҧâ»Ãá¡ÃÁÊíÒËÃѺ㪌 §Ò¹âÁ´ÙÅ SLCD 㹺··Õàè ¡ÕÂè Ç¢ŒÍ§¡Ñº¡ÒÃà¢Õ¹â»Ãá¡ÃÁÀÒÉÒàºÊÔ¡à¾×Íè ÊÌҧ¡Ò÷´Åͧ¢Ö¹é àͧµ‹Íä»


24

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

25

º··Õè 3

ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³·Ò§´Ô¨ÔµÍÅ ÊíÒËÃѺ¡ÒÃàÃÕ¹ÃٌáÅз´Åͧ ÇÔ·ÂÒÈÒʵÏ´ŒÇÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ ÊÑ­­Ò³´Ô¨µÔ ÍŨоԨÒóҷÕÃè дѺÊÑ­­Ò³à»š¹ËÅÑ¡ «Ö§è ÁÕà¾Õ§ 2 ÃдѺ¤×Í ÃдѺÊÙ§áÅеèÒí â´Â ÃдѺÊÑ­­Ò³¹ÕÍé Ò¨àÃÕÂ¡Ç‹Ò Åͨԡ (logic) ÃдѺÊÑ­­Ò³Ê٧㹷ҧ´Ô¨µÔ ÍŤ×ÍÃдѺÊÑ­­Ò³·ÕÁè ¤Õ Ò‹ ã¡ÅŒ à¤Õ§ËÃ×Í෋ҡѺáç´Ñ¹ä¿àÅÕÂé § ¡íÒ˹´ãˌ໚¹Åͨԡ “1” ËÃ×Í “high” ʋǹÃдѺÊÑ­­Ò³µèÒí ¤×Í ÃдѺ ÊÑ­­Ò³·Õàè ·Õº෋ҡÃÒÇ´ ¡íÒ˹´à»š¹Åͨԡ “0” ËÃ×Í “low” ´Ñ§¹Ñé¹ã¹á¼§Ç§¨ÃµÃǨ¨ÑºÊÑ­­Ò³·Ò§´Ô¨ÔµÍÅ¡ç¨Ðãˌ¼Å¡ÒõÃǨ¨ÑºÍÍ¡ÁÒ໚¹ÃдѺÅͨԡ ઋ¹¡Ñ¹ â´Â㹪ش SCi-BOX 䴌¨´Ñ àµÃÕÂÁἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³áºº´Ô¨µÔ ÍÅänj 3 ¡ÅØÁ‹ ¤×Í

1. ¡ÅØÁ‹ µÃǨ¨ÑºÊÑ­­Ò³áººÅͨԡ (¡ÅØÁ‹ D) »ÃСͺ´ŒÇ ἧǧ¨ÃÊÇÔµª (SWITCH), ἧǧ¨Ã âÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz (38kHz Infrared Receiver mudule) áÅÐἧǧ¨Ãà»ÃÕºà·ÕºÊÑ­­Ò³ (COMPARATOR) 2. ¡ÅØÁ‹ µÃǨÇÑ´¤‹Ò¤§·Õàè ÇÅÒ RC (¡ÅØÁ‹ C) 䴌ᡋ ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò (CAPACITANCE) 3. ¡ÅØÁ‹ µÃǨ¨ÑºÊÑ­­Ò³ªÑÇè ¢³Ð (¡ÅØÁ‹ P) 䴌ᡋ ἧǧ¨ÃµÃǨ¨ÑºàÊÕ§ (SOUND)


26

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

3.1 ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³Åͨԡ 3.1.1 ἧǧ¨ÃÊÇÔµª : SWITCH

(µ‹Í¡Ñº P0-P7)

LOW

,

àÁ×Íè ¡´à»š¹Åͨԡ 0 áÅÐáÊ´§ä¿à»š¹ÊÕà¢ÕÂÇ

HIGH

ÁÕÊÇÔµª¾ÃŒÍÁä¿áÊ´§¼ÅãˌàÍÒµ¾µØ 2 Ẻ¤×Í ·Õªè ͋ § HIGH ¶ŒÒ¡´ÊÇÔµª¨Ðʋ§Åͨԡ”1” ä¿ÊÕá´§µÔ´ ·Õªè ͋ § LOW ¶ŒÒ¡´ÊÇÔµª¨Ðʋ§Åͨԡ “0” ä¿ÊÕà¢ÕÂǵԴ ¶ŒÒäÁ‹ÁÕ¡Òá´ LED ´Ñº Åͨԡ·Õäè ´Œ¡¨ç Ð䴌¼Å¡ÅѺ¡Ñ¹

àÁ×Íè ¡´à»š¹Åͨԡ 1 áÅÐáÊ´§ä¿à»š¹ÊÕá´§

,

5916+0

SWITCH

510

10k

HIGH

4 /

LOW

Bi-color LED

3.1.2 ἧǧ¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz : Infrared Receiver (µ‹Í¡Ñº P0-P7) 㪌µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô·Õ¼è ÊÁÊÑ­­Ò³¾Òˏ¤ÇÒÁ¶Õè 38 kHz ãˌ¼Å໚¹Åͨԡ “1” àÁ×Íè µÃǨ¨ÑºÊÑ­­Ò³äÁ‹ä´Œ ãˌ¼Å໚¹Åͨԡ “0” àÁ×Íè µÃǨ¨ÑºÊÑ­­Ò³áʧ䴌 INFRARED RECEIVER

! IR Receiver module

E



0.1/50V

»¡µÔáŌÇâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô·íҧҹ䴌´·Õ ÊÕè ´Ø ·Õ¤è ÇÒÁ¶Õè 38.5kHz ᵋ㹠¤ÇÒÁ໚¹¨ÃÔ§ âÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz ÊÒÁÒöÃѺÊÑ­­Ò³·ÕÁè Õ ¤ÇÒÁ¶Õãè ¡ÅŒà¤Õ§ࢌÒÁÒ䴌 ᵋ¡ÒõͺʹͧËÃ×ͤÇÒÁäǨÐŴŧÍ‹ҧÁÒ¡ ¨Ò¡Ãٻ໚¹¡ÃÒ¿áÊ´§ãˌàË繶֧¤ÇÒÁäÇ㹡ÒÃÃѺÊÑ­­Ò³¢Í§âÁ´ÙÅÃѺ áʧÍÔ¹¿ÃÒàô·Õ¤è ÇÒÁ¶Õµè ҋ §æ ·Õ¤è ÇÒÁ¶Õè 38.5kHz ¨Ð໚¹¨Ø´·Õãè ˌ¤ÇÒÁáç ¢Í§ÊÑ­­Ò³ÊÙ§ÊØ´

¤ÇÒÁäÇ (5dBµ‹Íª‹Í§)

,

&

$ ! !" !& "

¤ÇÒÁ¶Õè (kHz)

"$ # #" #&


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

3.1.3 ἧǧ¨Ãà»ÃÕºà·ÕºÊÑ­­Ò³ : COMPARATOR

l

27

(µ‹Í¡Ñº P0-P7)

㪌à»ÃÕºà·Õºáç´Ñ¹ÃÐËNjҧ A ¡Ñº B â´Âãˌ¼ÅÅѾ¸à»š¹ ÊÑ­­Ò³´Ô¨µÔ ÍÅÅͨԡ "0" ¾ÃŒÍÁ¡Ñºä¿áÊ´§ ÁÕ 2 àÍÒµ¾µØ ¤×Í àÍÒµ¾µØ A>B áÅÐ B>A ¢ŒÍ¨íÒ¡Ñ´ : ÃдѺ¢Í§ÊÑ­­Ò³·Õ¹è Òí ÁÒà»ÃÕºà·Õº¡Ñ¹¨ÐµŒÍ§äÁ‹ à¡Ô¹ 3.5 V.

LM339 A>B RED

510

A>B

A>B ,

ãˌÅͨԡ "0" àÁ×Íè A > B ãˌÅͨԡ "0" àÁ×Íè B > A

B>A GREEN

6 5

B

B

1

3

A

A

B>A

8

2

A

COMPARATOR

B

D

7 4

B>A Active Low output

Input 3.5V max.

3.2 ἧǧ¨ÃµÃǨÇÑ´¤‹Ò¤§·Õàè ÇÅÒ RC (¡ÅØÁ‹ C) ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò : CAPACITANCE

(µ‹Í¡Ñº P0-P7)

ãªŒÇ´Ñ ¤‹Ò¤ÇÒÁ¨Øä¿¿‡Òã¹Ë¹‹Ç¿ÒÃÑ´ (Farad) â´ÂÇÑ´¨Ò¡¤ÒºàÇÅÒ¤§·Õè RC +5V.

ST=0 10k

PORT

C ·Õµè ͌ §¡ÒÃÇÑ´ GND

+5V.

C ·Õ赌ͧ¡ÒÃÇÑ´ PORT

10k ST=1

GND

¤Ø³ÊÁºÑµ¢Ô ͧἧǧ¨ÃàÁ×Íè µ‹Í·Õ¨è ´Ø ST=0 ໚¹¡ÒÃÇÑ´â´Â㪌෤¹Ô¤¡ÒÃÇÑ´¤ÒºàÇÅÒ¤§·Õè RC ·Õè㪌㹡ÒûÃÐ¨Ø µÑ§é ᵋáç´Ñ¹àÃÔÁè µŒ¹ 0V ¶Ö§ 1.5V (ÁÕ»ÃШØÍÂً 33.3 % ¢Í§áç´Ñ¹) «Ö§è àÇÅÒ·Õäè ´Œ¨Ðãˌ¤ÒºàÇÅÒá»Ã¼Ñ¹µÒÁ¤‹Ò R áÅÐ C ·Õµè ͋ ËÇÁ´ŒÇ ¡ÒäÒ»ÃÐ¨Ø ãˌʧ‹ áç´Ñ¹ 0V ÍÍ¡ä» ¤Ø³ÊÁºÑµ¢Ô ͧἧǧ¨ÃàÁ×Íè µ‹Í·Õ¨è ´Ø ST=1 ໚¹¡ÒÃÇÑ´â´Â㪌෤¹Ô¤¡ÒÃÇÑ´¤ÒºàÇÅÒ¤§·Õè RC ·Õè㪌㹡ÒûÃÐ¨Ø µÑé§áµ‹áç´Ñ¹àÃÔèÁµŒ¹ 5V ¨¹¡ÃзÑè§àËÅ×Í 1.5V (ÁÕ»ÃШØÍÂً 66.7 % ¢Í§áç´Ñ¹) «Ö§è àÇÅÒ·Õäè ´Œ¹Õé ¨Ðãˌ¤ÒºàÇÅÒá»Ã¼Ñ¹µÒÁ¤‹Ò R áÅÐ C ·Õµè ͋ ËÇÁ´ŒÇ ¡ÒäÒ»ÃÐ¨Ø ãˌʧ‹ áç´Ñ¹ +5V ÍÍ¡ä»


28

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

3.2 ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ªÑÇè ¢³Ð (¡ÅØÁ‹ P) ἧǧ¨ÃµÃǨ¨ÑºàÊÕ§ : SOUND

(µ‹Í¡Ñº P0-P7)

㪌µÃǨ¨Ñº¡ÒÃà»ÅÕÂè ¹á»Å§ÃдѺàÊÕ§ ઋ¹àÊÕ§»ÃºÁ×Í àÊÕ§¾Ù´ ÇÑ´¨Ò¡¤ÇÒÁ¡ÇŒÒ§¢Í§ÊÑ­­Ò³·Õèà»ÅÕè¹á»Å§ ã¹ÀÒÇл¡µÔ ໚¹Åͨԡ "0" àÁ×Íè ÁÕàÊÕ§ࢌÒÁÒ à»š¹Åͨԡ "1" 2

10k

MIC.

SOUND

0.1/50V

10k

470k BC547 470k

¤Í¹à´¹à«ÍÏäÁâ¤Ã⿹ ËÅÑ¡¡Ò÷íÒ§Ò¹¤×Í

àÁ×èÍÁÕÊÑ­­Ò³àÊÕ§ÁÒµ¡¡Ãзºá¼‹¹à¤Å×è͹äËÇ ËÃ×Íä´ÍÐá¿ÃÁ (diaphram) «Ö§è ໚¹á¼‹¹µÑǹíÒä¿¿‡Ò ´ŒÇ ·íÒãˌà¡Ô´¡ÒÃà¤Å×è͹·Õè ¤ÇÒÁ¨Øä¿¿‡ÒÀÒÂã¹ ÃÐËNjҧἋ¹µÑǹíÒ·Ñé§ÊͧἋ¹à¡Ô´¡ÒÃà»ÅÕè¹á»Å§ µÒÁ¡ÒÃÊÑ蹢ͧ¤Å×è¹àÊÕ§ áç´Ñ¹µ¡¤Ã‹ÍÁ¢Í§µÑÇ äÁâ¤Ã⿹¡ç¨Ðà»ÅÕÂè ¹á»Å§µÒÁä»´ŒÇ ¨Ö§·íÒãˌà¡Ô´ ໚¹ÊÑ­­Ò³ä¿¿‡ÒÍÍ¡ÁÒ ¢ŒÍ´Õ¢Í§äÁâ¤Ã⿹Ẻ ¹Õ¤é Í× ÊÒÁÒöµÍºÊ¹Í§µ‹ÍàÊÕ§䴌´Õ ÁÕ¤ÇÒÁäÇÊÙ§ ãˌ ÊÑ­­Ò³àÍÒµ¾ØµÁÕ¤ÇÒÁáçàËÁÒÐÊÁ¡Ñº¤‹Ò¤ÇÒÁ µŒÒ¹·Ò¹·Ò§ä¿ÊÅѺ¢Í§Áѹ ᵋ¢ÍŒ àÊÕ¤×Í µŒÍ§ÁÕáç ´Ñ¹ä¿¿‡ÒàÅÕÂé §änjµÅÍ´àÇÅÒ

ÃÐÂÐˋҧà¡Ô´¡ÒÃà»ÅÕÂè ¹á»Å§ ·íÒãˌ¤Ò‹ ¤ÇÒÁ¨Øä¿¿‡Òà»ÅÕÂè ¹á»Å§ Ἃ¹µÑǹíÒÍÂÙ¡‹ ºÑ ·Õè Ἃ¹µÑǹíÒà¤Å×Íè ¹äËÇ

E

+Vcc

¤Å×¹è àÊÕ§ ÊÑ­­Ò³àÍÒµ¾µØ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

29

º··Õè 4

ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡ ÊíÒËÃѺ¡ÒÃàÃÕ¹ÃٌáÅз´Åͧ ÇÔ·ÂÒÈÒʵÏ´ŒÇÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ

㹡ÒùíÒäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏࢌÒä»àª×èÍÁâ§㪌§Ò¹ã¹¡Ò÷´Åͧ·Ò§ÇÔ·ÂÒÈÒʵÏ ËÑÇ㨠Ê��Ҥѭ¤×Í ¡Ãкǹ¡ÒÃá»Å§ÊÑ­­Ò³ËÃ×Í»ÃÔÁÒ³·Ò§ÇÔ·ÂÒÈÒʵÏÁÒ໚¹ÊÑ­­Ò³ä¿¿‡ÒËÃ×Í¢ŒÍÁÙÅ ·Ò§´Ô¨µÔ ÍÅ «Ö§è ¨ÐÁմnj ¡ѹ 2 ¡Ãкǹ¡ÒÃËÅÑ¡¤×Í 1. ¡Ãкǹ¡ÒõÃǨ¨ÑºáÅÐá»Å§ÊÑ­­Ò³ËÃ×Í»ÃÔÁÒ³·Ò§ÇÔ·ÂÒÈÒʵÏÁÒ໚¹ÊÑ­­Ò³ä¿¿‡Ò 2. ¡Ãкǹ¡ÒÃá»Å§ÊÑ­­Ò³ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ (analog to digital conversion : ADC) 㹡Ãкǹ¡ÒÃáá ÍØ»¡Ã³ÊíҤѭ¤×Í µÑǵÃǨ¨ÑºËÃ×Íૹà«ÍÏ (sensor) ˹ŒÒ·ÕèÊíҤѭ¤×Í à»ÅÕÂè ¹ËÃ×Íá»Å§»ÃÔÁÒ³·Ò§ÇÔ·ÂÒÈÒʵÏÁÒ໚¹áç´Ñ¹ä¿¿‡Ò ÍÒ·Ô äÁâ¤Ã⿹㪌㹡ÒÃá»Å§ÊÑ­­Ò³àÊÕ§໚¹ÊÑ­­Ò³ä¿¿‡Ò à·ÍÏÁÔÊàµÍÏ㪌µÃǨÇÑ´ÍسËÀÙÁÔà¾×èÍà»ÅÕè¹໚¹¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò µÑǵÃǨ¨Ñº»ÃÒ¡¯¡ÒóÎÍÅŏ (hall effect) 㪌µÃǨ¨ÑºÊ¹ÒÁáÁ‹àËÅç¡á»Å§à»š¹áç´Ñ¹ä¿¿‡Ò µÑǵŒÒ¹·Ò¹á»Ã¤‹ÒµÒÁáʧ㪌㹡ÒõÃǨ¨Ñºáʧà¾×èÍà»ÅÕè¹໚¹¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò ʋǹ㹡Ãкǹ¡Ò÷ÕèÊͧ ¨Ð໚¹àÃ×èͧ¢Í§Ç§¨ÃÍÔàÅç¡·Ã͹ԡʏ·Õè¨Ð¹íÒÊÑ­­Ò³ä¿¿‡Ò·Õè䴌 ¨Ò¡¡Ãкǹ¡ÒÃááÁÒá»Å§à»š¹¢ŒÍÁÙÅ·Ò§´Ô¨µÔ ÍÅà¾×Íè ʋ§ä»Âѧ»ÃÐÁÇżÅÂѧäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ µ‹Íä» ¨Ø´·Õ赌ͧãˌ¤ÇÒÁʹã¨ã¹Ê‹Ç¹¹Õé¤×Í ¤ÇÒÁÅÐàÍÕ´㹡ÒÃá»Å§ÊÑ­­Ò³ ǧ¨Ãá»Å§ÊÑ­­Ò³ ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ·Õàè ËÁÒÐÊÁ㹡ÒùíÒÁÒ㪌㹡Ò÷´ÅͧÇÔ·ÂÒÈÒʵϤÇÃÁÕ¤ÇÒÁÅÐàÍÕ´äÁ‹¹ÍŒ  ¡Ç‹Ò 8 ºÔµ «Ö§è ãˌ¤ÇÒÁᵡµ‹Ò§¢Í§¢ŒÍÁÙÅ 256 ¤‹Ò áÅжŒÒÂÔ§è ÁÕ¤ÇÒÁÅÐàÍÕ´Ê٧෋Òã´ÂÔ§è ´Õ à¾ÃÒШÐãˌ ¼Å¡ÒÃá»Å§·Õáè Á‹¹ÂíÒÁÒ¡¢Ö¹é ᵋ¹¹Ñè ¨Ð·íÒãˌµ¹Œ ·Ø¹¢Í§ÃкºÊÙ§¢Ö¹é µÒÁä»´ŒÇÂ


30

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

㹪ش SCi-BOX 䴌ºÃèØἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³·Ò§ÍйÒÅÍ¡änjÁÒ¡à¾Õ§¾Íµ‹Í¡ÒõÃǨ ÇÑ´»ÃÔÁÒ³·Ò§ÇÔ·ÂÒÈÒʵÏ·ÊÕè Òí ¤Ñ­Í‹ҧ¤Ãº¶ŒÇ¹Ãͺ´ŒÒ¹ Íѹ»ÃСͺ´ŒÇ 1. ἧǧ¨ÃµÃǨ¨Ñºáʧ (LDR Light sensor) 2 ªØ´ 2. ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ (REFLECT) 2 ªØ´ 3. ἧǧ¨ÃµÃǨ¨ÑºÍسËÀÙÁÔ (Temperature sensor) 2 ªØ´ 4. ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ (Magnetic field sensor) 1 ªØ´ 5. ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌à¾×Íè ¨‹ÒÂáç´Ñ¹ 5 ªØ´ ẋ§à»š¹ 3 Ẻ¤×Í áººâ»à·¹ªÔâÍ ÁÔàµÍÏ (POTENTIOMETER) µÑǵѧé 2 ªØ´, µÑǹ͹ 2 ªØ´ áÅÐẺÊäÅ´ (SLIDE) 1 ªØ´ 6. ἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàôâ´Â㪌â¿âµŒ·ÃÒ¹«ÔÊàµÍÏ (Photo transistor) 2 ªØ´ 7. ἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò (CURRENT) 1 ªØ´ 8. ἧǧ¨ÃÇÑ´¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò (RESISTANCE) 1 ªØ´ 9. ἧǧ¨ÃÅ´·Í¹áç´Ñ¹ä¿¿‡Ò (ATTENUATOR) 1 ªØ´ ÊíÒËÃѺ㪌㹡ÒÃÇÑ´áç´Ñ¹ä¿¿‡Ò ¡ÒÃàª×Íè Áµ‹Íἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡·Ñ§é ËÁ´à¢ŒÒ¡Ñº SCi-BOX ·íÒ䴌â´Âµ‹ÍÊÒ ÊÑ­­Ò³à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0-SENSOR7 㹺·¹Õ¨é Ð͸ԺÒ¶֧ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡·Ñ§é ËÁ´·ÕÁè ãÕ ¹ªØ´ SCi-BOX à¾×Íè ໚¹ ¢ŒÍÁÙÅàº×Íé §µŒ¹ã¹¡Ò÷íÒ¤ÇÒÁࢌÒ㨶֧¡Ò÷íÒ§Ò¹ ÊíÒËÃѺ¡ÒùíÒä»·´Åͧ¹Ñ¹é ÊÒÁÒö¡ÃзíÒ䴌 2 ÇÔ¸Õ ¤×Í ·´Åͧ¼‹Ò¹ªØ´«Í¿µáÇÏ SCi-BOX Activity ã¹ÇÔ¸Õ¹Õé¼ÙŒ·´ÅͧÊÒÁÒö´íÒà¹Ô¹¡Ò÷´Åͧ䴌µÒÁ ¢Ñ鹵͹·ÕèÃкØã¹Ë¹ŒÒµ‹Ò§¢Í§â»Ãá¡ÃÁ áÅдټšÒ÷´Åͧ䴌㹷ѹ·Õ â´ÂäÁ‹¨íÒ໚¹µŒÍ§à¢Õ¹ â»Ãá¡ÃÁµÔ´µ‹Í¡ÑºäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ i-Stamp º¹ºÍÏ´ SCi-BOX ᵋÍ‹ҧ㴠ÇÔ¸·Õ ÊÕè ͧ ¨Ð໚¹¡ÒõԴµ‹Í¡ÑºäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ i-Stamp º¹ºÍÏ´ SCi-BOX ¨Ö§µŒÍ§ÁÕ¡Òà à¢Õ  ¹â»Ãá¡ÃÁÀÒÉÒàºÊÔ ¡ ¢Öé ¹ àͧà¾×è Í ·í Ò ¡Ò÷´Åͧ «Öè § ¡Ò÷´Åͧ¨ÐÁÕ ¤ ÇÒÁ«Ñ º «Œ Í ¹ËÃ× Í ÁÕ »ÃÐÊÔ·¸ÔÀÒ¾à¾Õ§㴨ТÖé¹ÍÂً¡Ñº¡ÒÃà¢Õ¹â»Ãá¡ÃÁ¢Í§¼ÙŒ·´Åͧ໚¹»˜¨¨ÑÂËÅÑ¡ ¼Å·Õè䴌¤×Í ¼ÙŒàÃÕ¹ ÊÒÁÒöÊÌҧ¡Ò÷´ÅͧÇÔ·ÂÒÈÒʵÏâ´Â㪌äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ໚¹ÍØ»¡Ã³»ÃСͺ¢Ö¹é àͧ䴌 «Ö§è ¨Ð¹íÒä»Êً¡ÒÃÍ͡Ẻ¾Ñ²¹ÒáÅÐÊÌҧâ¤Ã§§Ò¹ÇÔ·ÂÒÈÒʵÏ䴌´ŒÇµ¹àͧ㹷ÕèÊØ´


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

4.1 ἧǧ¨ÃµÃǨ¨Ñºáʧ : LDR Light sensor

l

31

(µ‹Í¡Ñº SENSOR0-SENSOR7)

㪌µÃǨ¨ÑºáʧÊNjҧ àÅ×Í¡àÍÒµ¾µØ 䴌 2 Ẻ¤×Í +

áç´Ñ¹àÍÒµ¾µØ à¾ÔÁè àÁ×Íè áʧµ¡¡Ãзº

+

áç´Ñ¹àÍÒµ¾µØ Ŵŧ àÁ×Íè áʧµ¡¡Ãзº

LIGHT

10k

àÁ×Íè áʧÁÒ¡¢Ö¹é áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é

+

LDR Light

àÁ×Íè áʧÁÒ¡¢Ö¹é áç´Ñ¹·Õäè ´Œ¨ÐŴŧ

+

)

A

LDR

4.2 ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ : REFLECT

+

+

(µ‹Í¡Ñº SENSOR0-SENSOR7)

ÁÕ LED ¡íÒà¹Ô´áʧÊÕá´§áŌÇ㪌 LDR ËÃ×͵ÑǵŒÒ¹·Ò¹ á»Ã¤‹ÒµÒÁáʧÃѺáʧ·ÕèÊзŒÍ¹¡ÅѺÁÒ ãˌ¼Å໚¹áç´Ñ¹á»Ã µÒÁ¤ÇÒÁࢌÁ¢Í§áʧ·ÕèÊзŒÍ¹¡ÅѺÁÒ A

ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ LED ¡íÒà¹Ô´áʧ

LED ¡íÒà¹Ô´áʧÊÕá´§ LDR ÃѺáʧÊÕá´§·Õè ÊзŒÍ¹Çѵ¶Ø¡ÅѺÁÒ

+ REFLECT

E

LDR

10k

220

Red LED super bright

+

µÑǵŒÒ¹·Ò¹á»Ã¤‹ÒµÒÁáʧËÃ×Í LDR (Light Dependent Resistor)

ÊÒáÖ觵ÑǹíÒ äÇáʧ ¢Òµ‹Í㪌§Ò¹ ÃٻËҧ

ÊÑ­Åѡɳ

LDR ÃѺáʧÊзŒÍ¹

REFLECT

໚¹ÍØ»¡Ã³·ÁÕè ¤Õ ³ Ø ÊÁºÑµ¾Ô àÔ Èɤ×Í ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò¢Í§Áѹ¨Ðà»ÅÕÂè ¹á»Å§ àÁ×èÍÁÕáʧÁÒµ¡¡Ãзº â´Â¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹¨ÐŴŧàÁ×èÍÁÕáʧÁÒµ¡¡Ãзº áÅÐà¾ÔÁè ¤‹ÒÁÒ¡¢Ö¹é ËÒ¡áʧ·Õµè ¡¡ÃзºÅ´¤ÇÒÁÊNjҧŧ áÅÐÊÙ§ÊØ´àÁ×Íè äÁ‹ÁáÕ Ê§ ã´æ µ¡¡Ãзº ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹¢Í§ LDR ¨ÐÍÂÙ㋠¹ª‹Ç§ 1kΩ - 500kΩ ÍѵÃÒʋǹ ¢Í§¤ÇÒÁµŒÒ¹·Ò¹ã¹ª‹Ç§Á×´µ‹ÍÊNjҧÁդҋ »ÃÐÁÒ³ 10,000 : 1 ¤ÇÒÁäÇ㹡ÒÃÃѺáʧ ¢Í§ LDR ¨Ð¢Ö¹é ¡Ñºª¹Ô´¢Í§ÊÒÃ¡Ö§è µÑǹíÒ·Õ¹è Òí ÁÒ㪌¼ÅÔµ ¶ŒÒ໚¹á¤´àÁÕÂÁ«ÑÅä¿´ (CdS) ¨Ð·íÒ§Ò¹¡Ñºáʧ·ÕÁè ÂÕ Ò‹ ¹¤ÇÒÁÂÒǤÅ×¹è 0.6 µm «Ö§è ¡ç¤Í× áʧÊNjҧ¸ÃÃÁ´Ò¹Ñ¹è àͧ 㹡ÒÃàÅ×͡㪌 LDR µŒÍ§Ê¹ã¨µÑÇá»Ã 3 µÑǤ×Í ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ÊÙ§ÊØ´àÁ×Íè äÁ‹ÁáÕ Ê§ÁÒ µ¡¡Ãзº, ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹µèÒí ÊØ´àÁ×Íè ÁÕáʧÁÒµ¡¡Ãзº áÅÐ áç´Ñ¹ãªŒ§Ò¹ÊÙ§ÊØ´


32

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

4.3 ἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ : Temperature sensor

(µ‹Í¡Ñº SENSOR0-SENSOR7)

㪌ÇÑ´ÍسËÀÙÁÔâ´ÂµÑÇÇѴ໚¹µÑǵŒÒ¹·Ò¹á»Ã¤‹Ò¼¡¼Ñ¹¡Ñº ÍØ ³ ËÀÙ ÁÔ Ë Ã× Í à·ÍÏ ÁÔ Ê àµÍÏ á ºº NTC (Negative temperature coefficient) àÅ×͡㪌䴌 2 Ẻ¤×Í +

àÁ×Íè ÍسËÀÙÁÊÔ §Ù ¢Ö¹é ¤‹Òáç´Ñ¹¡ç¨ÐÁÒ¡¢Ö¹é

+

àÁ×Íè ÍسËÀÙÁÊÔ §Ù ¢Ö¹é ¤‹Òáç´Ñ¹¡ç¨ÐŴŧ +

A

à·ÍÏÁÔÊàµÍÏ µÑǵÃǨ¨ÑºÍسËÀÙÁÔ +

Temperature

àÁ×èÍÍسËÀÙÁÔÊÙ§¢Öé¹ áç´Ñ¹·Õè䴌¨ÐŴŧ àÁ×èÍÍسËÀÙÁÔÊÙ§¢Öé¹ áç´Ñ¹·Õè䴌¨ÐÁÒ¡¢Ö¹é

A

Temperature sensor

1k

T

+

+

àºÍϢͧà·ÍÏÁÔÊàµÍÏ·Õè㪌ã¹á¼§Ç§¨Ã µÃǨÇÑ´ÍسËÀÙÁÔ â´Â¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ ¢Í§à·ÍÏÁÊÔ àµÍÏ ³ ÍسËÀÙÁËÔ ÍŒ § (25ðC) Áդҋ ෋ҡѺ 10kΩ

ÃÙ»·Õè 4-1 ¡ÃÒ¿¤Ø³ÊÁºÑµ¢Ô ͧà·ÍÏÁÊÔ àµÍÏ·ãÕè ªŒã¹á¼§Ç§¨ÃµÃǨÇÑ´ÍسËÀÙÁÔ (Temperature sensor) 㹪ش SCi-B X â´Â᡹¹Í¹¤×ͤ‹Ò¢Í§ÍسËÀÙÁÔÃͺµÑÇà·ÍÏÁÔÊàµÍÏã¹Ë¹‹ÇÂͧÈÒà«Åà«ÕÂÊ Ê‹Ç¹á¡¹µÑ§é ¤×ͤ‹Ò¤ÇÒÁµŒÒ¹·Ò¹¢Í§à·ÍÏÁÊÔ àµÍÏã¹Ë¹‹Ç¡ÔâÅâÍˏÁ (kΩ)


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

33

4.4 ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ : Magnetic field

(µ‹Í¡Ñº SENSOR0-SENSOR7) 㪌ÇÑ´¤ÇÒÁࢌÁ¢Í§Ê¹ÒÁáÁ‹àËÅç¡ ãˌ¼ÅÅѾ¸à»š¹áç´Ñ¹ºÇ¡ àÁ×Íè ·ÔÈʹÒÁáÁ‹àËÅ硾ا‹ ÍÍ¡áÅжŒÒʹÒÁáÁ‹àËÅ硾ا‹ à¢ŒÒ ¨Ðãˌ¼Å໚¹ ź àÁ×Íè äÁ‹ÁÊÕ ¹ÒÁáÁ‹àËÅ硨Ð䴌¤Ò‹ ¡ÅÒ§ 2.5V áÅФÇÒÁäÇ㹡ÒÃÇÑ´ ¤×Í 1.3 mV µ‹Í¤ÇÒÁࢌÁʹÒÁáÁ‹àËÅç¡ 1 à¡Òʏ (Gauss) ¤‹Òáç´Ñ¹·Õäè ´Œ = 2.5 + (0.0013 N ¤ÇÒÁࢌÁʹÒÁáÁ‹àËÅç¡ã¹ ˹‹ÇÂà¡Òʏ : Gauss) Magnetic field )

Magnetic Field

A

UGN3503 Hall-effect sensor

·ÔÈʹÒÁáÁ‹àËÅç¡ ¾Ø‹§ÍÍ¡ ໚¹¤‹ÒºÇ¡

1 0.1/50V 3 2

4.4.1 ¤Ø³ÊÁºÑµàÔ º×Íé §µŒ¹¢Í§ UGN3503U ã¹á¼§Ç§¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ãªŒ UGN3503 «Ö§è ໚¹äÍ«Õ˹ŒÒ·Õ¾è àÔ ÈÉÊíÒËÃѺµÃǨ ¨Ñº»ÃÒ¡¯¡ÒóÎÍÅËÃ×ÍÎÍÅàͿ࿚¡µ (hall effect) ÁÕ¤³ Ø ÊÁºÑµ·Ô ÊÕè Òí ¤Ñ­´Ñ§¹Õé l µÃǨ¨ÑºÊ¹ÒÁáÁ‹àËÅç¡·ÕÁ è ¤Õ ÇÒÁäǶ֧ 23kHz l áç´Ñ¹àÍÒµ¾µ Ø ·Õ¤è ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ 0 G ¤×Í 2.5V ·Õäè ¿àÅÕÂé § +5V l ¤ÇÒÁäÇ㹡Ò÷íÒ§Ò¹ 1.30mV/G ·Õäè ¿àÅÕÂé § +5V UGN3503 ÁÕ¢Òµ‹Í㪌§Ò¹ 3 ¢Ò¤×Í ¢Òä¿àÅÕÂé § (Vcc), ¢Òáç´Ñ¹àÍÒµ¾µØ (Vout), ¢Ò¡ÃÒÇ´ (GND) ´Ñ§áÊ´§ã¹ÃÙ» ·Õè 4-2 ¾ÃŒÍÁ¡Ñ¹¹Ñ¹é ã¹ÃÙ»ÂѧáÊ´§¤ÇÒÁÊÑÁ¾Ñ¹¸¢Í§áç´Ñ¹ àÍÒµ¾µØ ¡Ñº¤‹Ò¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ ¨ÐàËç¹Ç‹Ò ¶ŒÒ¤‹Ò ¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ÁÕ·Ôȷҧ໚¹ºÇ¡ ¤‹Òáç´Ñ¹ àÍÒµ¾µØ ¨Ðà¾ÔÁè ÊÙ§¢Ö¹é ¨Ò¡ÃдѺ 0 à¡Òʏ«§Öè Áդҋ áç´Ñ¹à·‹Ò¡Ñº 2.5V áÅжŒÒËÒ¡¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ÁÕ·ÈÔ ·Ò§à»š¹ ź ¤‹Òáç´Ñ¹àÍÒµ¾µØ ¨ÐŴŧ¨Ò¡ÃдѺáç´Ñ¹ 2.5V

UGN3503

Vout (V)

+Vcc GND Vout

4.0

B = +500 G

3.5 3.0

B=0G

2.5 2.0 1.5 -40 -20 0

B = -500 G +25

+85

ÍسËÀÙÁãÔ ªŒ§Ò¹ (ͧÈÒà«Åà«ÕÂÊ)

+125

ÃÙ»·Õè 4-2 ¡ÒèѴ¢Ò¢Í§ UGN3503


34

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¤ÇÒÁÃÙàŒ º×Íé §µŒ¹à¡ÕÂè ǡѺʹÒÁáÁ‹àËÅç¡

S

N

N

S

N

S

S

áÁ‹àËÅç¡ A

(¡)

áÁ‹àËÅç¡ B

N

B =

N

áÁ‹àËÅç¡ A

àʌ¹áçáÁ‹àËÅç¡

φ A

B ¤×Í ¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ ÁÕ Ë¹‹ÇÂ໚¹ àÇàºÍÏ/µÒÃÒ§ àÁµÃ (W/m2) ËÃ×Í à·ÊÅÒ (T) f ¤×Í àʌ¹áçáÁ‹àËÅç¡ËÃ×Í»ÃÔÁÒ³¿ÅÑ¡«áÁ‹àËÅç¡ (àÇàºÍÏ) A ¤×Í ¾×¹é ·Õµè §Ñé ©Ò¡¡Ñºàʌ¹áçáÁ‹àËÅç¡ (µÒÃÒ§àÁµÃ : m2) ¤‹Ò¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ã¹Ë¹‹ÇÂàÅ硡NjÒà·ÊÅÒ·Õ¹è ÂÔ ÁÇÑ´ ¤×Í à¡Òʏ (Gauss : G) â´Â 1 à·ÊÅÒ෋ҡѺ 10,000 à¡Òʏ

áÁ‹àËÅç¡ B

(¢)

S

¤Ø³ÊÁºÑµÔáÁ‹àËÅç¡ à»š¹¤Ø³ÊÁºÑµÔ¾ÔàÈÉ·ÕèÊÒÁÒö´Ù´ âÅËÐ䴌¢Í§ÊÔ¹á˺ҧª¹Ô´ ¨Ö§¹íÒä»ãªŒÊÌҧáÁ‹àËÅ硶ÒÇà ¢ÑéÇáÁ‹àËÅç¡ »ÃСͺ´ŒÇ¢ÑéÇà˹×Í (N) áÅТÑéÇ㵌 (S) ¶ŒÒ¹íÒáÁ‹àËÅç¡ 2 ªÔ¹é ÁÒÇÒ§ã¡ÅŒ¡¹Ñ ¨Ð·íÒãˌà¡Ô´áç¡ÃзíÒµ‹Í¡Ñ¹ â´Â¶ŒÒËÒ¡¢ÑéÇáÁ‹àËÅç¡ÁÕª¹Ô´à´ÕÂǡѹ¨Ðà¡Ô´áç¼ÅÑ¡ÃÐËNjҧ¡Ñ¹ ã¹·Ò§µÃ§¡Ñ¹¢ŒÒÁ¶ŒÒ¢ÑÇé ¢Í§áÁ‹àËÅ硷ѧé Êͧᵡµ‹Ò§¡Ñ¹¨Ðà¡Ô´áç ´Ù´ÃÐËNjҧ¡Ñ¹ àʌ¹áçáÁ‹àËÅç¡ à»š¹àʌ¹áç·Õ¶è ¡Ù ÊÁÁص¢Ô ¹Öé à¾×Íè ͸ԺÒ ¾ÄµÔ¡ÃÃÁÍíÒ¹Ò¨áÁ‹àËÅç¡ â´Âàʌ¹áçáÁ‹àËÅ硨ÐÇÔ觨ҡ¢ÑéÇ N ä»Âѧ¢ÑéÇ S ᵋÀÒÂã¹µÑÇ᷋§áÁ‹àËÅ硨ÐÇÔ觨ҡ¢ÑéÇ Sä»Âѧ¢ÑéÇ N áÅÐÁÕ¤ÇÒÁ˹Òṋ¹¢Í§àʌ¹áçáÁ‹àËÅç¡ÊÙ§·Õºè ÃÔàdz¢ÑÇé áÁ‹àËÅç¡ ¹Í¡¨Ò¡¹ÕéÂѧÊÒÁÒö´Ù´á·‹§âÅËÐâ´ÂÍÒÈÑ¡ÒÃà˹ÕèÂǹíÒãˌ âÅËзÕèÁÒࢌÒã¡ÅŒ¹Ñé¹à»š¹áÁ‹àËÅ硪ÑèǤÃÒÇ «Ö觨зíÒãˌºÃÔàdz·Õè ã¡ÅŒ¢ÑéÇáÁ‹àËÅ硢ͧâÅËÐ ¡ÅÒÂ໚¹¢ÑéÇáÁ‹àËÅ硪¹Ô´µÃ§¢ŒÒÁ¡Ñº áÁ‹àËÅ硶ÒÇà ËÅѧ¨Ò¡¹Ñ¹é àÊÁ×͹NjÒÁÕáÁ‹àËÅç¡ 2 µÑÇ ·ÕÁè ¢Õ ÇÑé áÁ‹ àËÅ硵‹Ò§ª¹Ô´¡Ñ¹ÁÒÇÒ§ã¡ÅŒ¡Ñ¹ ¨Ö§·íÒãˌáÁ‹àËÅç¡áÅÐâÅËдѧ ¡Å‹ÒÇà¡Ô´¡Òôٴ¡Ñ¹ ʹÒÁáÁ‹àËÅç¡âÅ¡ ÁÕ¢ÇÑé áÁ‹àËÅç¡ N ÍÂÙ·‹ ¢Õè ÇÑé âš㵌 áÅÐ ¢ÑÇé áÁ‹àËÅç¡ S ÍÂÙ·‹ ¢Õè ÇÑé âÅ¡à˹×Í ¹Ñ¹è ¤×Íàʌ¹áçáÁ‹àËÅç¡âÅ¡¨ÐÁÕ ·ÔÈÇÔ§è ¨Ò¡¢ÑÇé âš㵌ä»Âѧ¢ÑÇé âÅ¡à˹×Í ¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ (magnetic flux density) ¤×Í »ÃÔÁÒ³àʌ¹áçáÁ‹àËÅç¡·Õµè ¡µÑ§é ©Ò¡µ‹Í˹֧è ˹‹ÇÂ¾×¹é ·Õè áÅÐ ÁÕ·ÈÔ ·Ò§à´ÕÂǡѺàʌ¹áçáÁ‹àËÅç¡´ŒÇÂઋ¹¡Ñ¹ ¤íҹdzËÒ¤‹Ò¤ÇÒÁ ˹Òṋ¹¢Í§Ê¹ÒÁáÁ‹àËÅç¡ä´Œ¨Ò¡¤ÇÒÁÊÑÁ¾Ñ¹¸

¾×¹é ·Õè A µÒÃÒ§àÁµÃ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

35

4.4.2 ¡ÒÃá»Å¤ÇÒÁËÁÒ¨ҡ UGN3503U

㹡ÒÃá»Å¤ÇÒÁËÁÒÂáç´Ñ¹·Õäè ´Œ¨Ò¡ UGN3503U à¾×Íè ãˌ䴌¤Ò‹ ¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ ÍÍ¡ÁÒ¨Ð㪌¡ÒûÃÐÁÒ³¤‹ÒẺàªÔ§àʌ¹ â´Â㪌¤‹Ò¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡à»š¹ 0 ¡íÒ˹´ãˌ áç´Ñ¹àÍÒµ¾µØ 2.5V ໚¹¨Ø´ÍŒÒ§ÍÔ§ àÁ×Íè ÁÕ¡ÒÃà»ÅÕÂè ¹á»Å§¢Í§àÍÒµ¾µØ ·Ø¡æ 1.3mV ¤ÇÒÁ˹Òṋ¹ ʹÒÁáÁ‹àËÅ硨Ð��»ÅÕÂè ¹ä» 1 à¡Òʏ (G) ´Ñ§¹Ñ¹é ¡ÒÃá»Å§¤‹Ò¨ÐÁÕ¤ÇÒÁÊÑÁ¾Ñ¹¸´§Ñ ¹Õé BG ≈

Vout − .# .!

........................................................................... (ÊÁ¡Ò÷Õè 1)

â´Â·Õè B ¤×Í ¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡ã¹Ë¹‹ÇÂà¡Òʏ Vout ¤×Í áç´Ñ¹àÍÒµ¾µØ ·ÕÍè ҋ ¹ä´Œ¨Ò¡ UGN3503U

ᵋ㹡ÒÃà¢Õ¹â»Ãá¡ÃÁ㪌§Ò¹à¾×Íè ãˌ¤Ò‹ àÃÔÁè µŒ¹¢Í§ BG ෋ҡѺÈٹ㹢³ÐÂѧäÁ‹ÁÊÕ ¹ÒÁáÁ‹ àËÅç¡ÀÒ¹͡ÁÒ¡Ãзº UGN3503 ¨Ð䴌໚¹ BG ≈

(Aout

− Ainit )  #  ×   ##  .!

.......................................................... (ÊÁ¡Ò÷Õè 2)

â´Â·Õè Ainit ¤×Í ¤‹Ò¢ŒÍÁÙÅ´Ô¨µÔ ÍŢͧÊÑ­­Ò³ÍйÒÅÍ¡·Õäè ´Œ¨Ò¡ UGN3503 ã¹¢³ÐäÁ‹ÁÊÕ ¹ÒÁáÁ‹àËÅç¡ÀÒ¹͡ ÁÒ¡Ãзº (䴌ÁÒ¨Ò¡¡Ò÷´Êͺ) Aout ¤×Í ¤‹Ò¢ŒÍÁÙÅ´Ô¨µÔ ÍŢͧÊÑ­­Ò³ÍйÒÅÍ¡·Õäè ´Œ¨Ò¡ UGN3503 ³ àÇÅÒã´æ

·ÔÈ·Ò§¢Í§Ê¹ÒÁáÁ‹àËÅç¡·ÕÁè Ò¡ÃзººÃÔàdz´ŒÒ¹Ë¹ŒÒ¢Í§ UGN3503 Áռŵ‹Íà¤Ã×Íè §ËÁÒ¢ͧ ¤‹Ò¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅç¡·Õè͋ҹ䴌 ¶ŒÒʹÒÁáÁ‹àËÅç¡ÁÕ·ÔȾ؋§à¢ŒÒËÒ UGN3503 ¤‹Ò¤ÇÒÁË¹Ò á¹‹¹Ê¹ÒÁáÁ‹àËÅç¡·ÕÍè ҋ ¹ä´Œ¨Ð໚¹ºÇ¡ ᵋ¶ÒŒ ÁÕ·ÈÔ ¾Ø§‹ ÍÍ¡ ¤‹Ò¤ÇÒÁ˹Òṋ¹Ê¹ÒÁáÁ‹àËÅ硨Ð໚¹Åº ¶ŒÒ¹íÒáÁ‹àËÅç¡ÁÒࢌÒã¡ÅŒ´ÒŒ ¹Ë¹ŒÒ¢Í§ UGN3503 áŌÇ͋ҹ¤‹Ò¨Ò¡¡ÒÃá»Å¤ÇÒÁËÁÒÂÍÍ¡ÁÒ ÁÕà¤Ã×Íè §ËÁÒÂ໚¹ºÇ¡ áÊ´§Ç‹Ò ´ŒÒ¹·ÕÍè ÂÙ㋠¡ÅŒµÇÑ UGN3503 ¢Í§áÁ‹àËÅç¡à»š¹¢ÑÇé à˹×Í(à¾ÃÒÐàʌ¹áç áÁ‹àËÅ硾؋§ÍÍ¡¨Ò¡¢ÑéÇáÁ‹àËÅç¡à˹×Í) ᵋ¶ŒÒËÒ¡¤‹Ò·Õè͋ҹ䴌ÁÕà¤Ã×èͧËÁÒÂ໚¹ÅºáÊ´§Ç‹Ò´ŒÒ¹·ÕèÍÂً ã¡ÅŒ UGN3503 ໚¹¢ÑÇé 㵌 ã¹ÃÙ»·Õè 4-3 áÊ´§·ÔÈ·Ò§¢Í§Ê¹ÒÁáÁ‹àËÅ硡Ѻ¡ÒõÃǨ¨Ñº¢Í§ UGN3503

UGN3503

N

N S

¤‹Ò¤ÇÒÁ˹Òṋ¹ ʹÒÁáÁ‹àËÅç¡à»š¹ºÇ¡ áç´Ñ¹àÍÒµ¾µØ ÊÙ§¡Ç‹Ò +2.5V

S

UGN3503

¤‹Ò¤ÇÒÁ˹Òṋ¹ ʹÒÁáÁ‹àËÅç¡à»š¹Åº áç´Ñ¹àÍÒµ¾µØ µíÒè ¡Ç‹Ò +2.5V

ÃÙ»·Õè 4-3 áÊ´§¼Å¡Ò÷íÒ§Ò¹¢Í§ UGN3503 àÁ×Íè ä´ŒÃºÑ Ê¹ÒÁáÁ‹àËÅç¡ã¹·ÔÈ·Ò§·Õáè µ¡µ‹Ò§¡Ñ¹


36

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

4.5 ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع : POTENTIOMETER (µ‹Í¡Ñº SENSOR0-SENSOR7) POTENTIOMETER

A

+

+

10k Linear

㪌¡Òí ˹´áç´Ñ¹ 0-5V µÒÁ¡ÒÃËÁع᡹ ¹íÒä»ãªŒÇ´Ñ ¤‹ÒÁØÁáÅÐÃÐÂзҧ䴌 ÁÕẺµÑǵѧé áÅÐ µÑǹ͹ ãˌàÍÒµ¾µØ 2 Ẻ¤×Í áç´Ñ¹ÁÒ¡¢Ö¹é àÁ×Íè ËÁع·Ç¹à¢çÁ¹Ò́¡ÒËÃ×Í µÒÁà¢çÁ¹Ò́¡Ò ẺµÑǵѧé

àÁ×Íè ËÁع·Ç¹à¢çÁ¹ÒÌÔ¡Ò áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é

A

àÁ×Íè ËÁعµÒÁà¢çÁ¹ÒÌÔ¡Ò áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é

POTENTIOMETER

ẺµÑǹ͹

àÁ×Íè ËÁع·Ç¹à¢çÁ¹ÒÌÔ¡Ò áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é

A

àÁ×Íè ËÁعµÒÁà¢çÁ¹ÒÌÔ¡Ò áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é

Potentiometer

4.6 ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹àÅ×Íè ¹ : SLIDE

(µ‹Í¡Ñº SENSOR0-SENSOR7) A

SLIDE

㪌¡Òí ˹´áç´Ñ¹ 0 - 5 V µÒÁ¡ÒûÃѺ᡹àÅ×Íè ¹ ¹íÒä»ãªŒ ÇÑ´ÃÐÂзҧ䴌 ãˌàÍÒµ¾µØ 2 Ẻ¤×Í 10k Linear àÁ×Íè àÅ×Íè ¹ÁÒ·Ò§¢ÇÒ áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é àÁ×Íè àÅ×Íè ¹ÁÒ·Ò§«ŒÒ áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é àÁ×èÍàÅ×è͹ÁÒ·Ò§¢ÇÒ áç´Ñ¹·Õè䴌¨ÐÁÒ¡¢Öé¹ )

àÁ×èÍàÅ×è͹价ҧ«ŒÒ áç´Ñ¹·Õè䴌¨ÐÁÒ¡¢Öé¹

+

+


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

37

4.7 ἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàôâ´Â㪌â¿âµŒ·ÃÒ¹«ÔÊàµÍÏ : Photo Transistor (µ‹Í¡Ñº SENSOR0-SENSOR7) 㪌µÃǨ¨Ñºáʧ·ÕÁè ¤Õ ÇÒÁÂÒǤÅ×¹è ÍÂÙ㋠¹ª‹Ç§ÍÔ¹¿ÃÒàô «Ö§è Áդҋ ÃÐËNjҧ 1 äÁâ¤ÃàÁµÃ (µm) -1 ÁÔÅÅÔàÁµÃ (mm) ÊÒÁÒö㪌§Ò¹ä´Œ 2 ÅѡɳФ×Í 1. ͋ҹ¤‹Ò໚¹ÃдѺ¤ÇÒÁࢌÁáʧẺÍйÒÅÍ¡ â´Âáç´Ñ¹ àÍÒµ¾Øµ·Õè䴌¨ÐŴŧàÁ×èÍ䴌ÃѺáʧÍÔ¹¿ÃÒàô·ÕèÁÕ¤ÇÒÁࢌÁà¾ÔèÁ¢Öé¹

)

PHOTO TRANSISTOR

2. µÃǨÊͺNjҵÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô䴌ËÃ×ÍäÁ‹ ãˌàÍÒµ¾µØ ໚¹ÊÑ­­Ò³´Ô¨µÔ ÍÅẺÅͨԡ "0" àÁ×Íè µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô䴌 ¡ÒÃ㪌§Ò¹ ¤ÇÃ㪌§Ò¹Ã‹ÇÁ¡Ñºá¼§Ç§¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED «Ö§è ¨Ñ´ÁҾÌÍÁ¡Ñ¹áŌÇ㹪ش SCi-BOX (´ÙÃÒÂÅÐàÍÕ´ à¾ÔÁè àµÔÁ㹺··Õè 2)

E

10k

Photo transistor

¡ÒáíÒ˹´Ê໡µÃÑÁ¢Í§áʧ (optical spectrum) àËÅ×ͧ

Á‹Ç§

à¢ÕÂÇ

¹íéÒà§Ô¹

400 nm

ÃѧÊÕàÍç¡« (X-rays) 1nm

500 nm

ÍÑŵÌÒäÇâÍàÅçµ 10nm

100nm

ã¡ÅŒÍÔ¹¿ÃÒàô ʌÁ

600 nm

áʧ¢ÒÇ

á´§

700 nm

800 nm

ÍÔ¹¿ÃÒàô 1µm

¤ÇÒÁÂÒǤÅ×è¹

10µm

100µm

äÁâ¤ÃàÇ¿ 1mm 10mm

nm ¤×Í ¹Òâ¹àÁµÃ (10-9 àÁµÃ), µm ¤×Í äÁâ¤ÃàÁµÃ (10-6 àÁµÃ) áÅÐ mm ¤×Í ÁÔÅÅÔàÁµÃ (10-3 àÁµÃ)

ËÁÒÂà赯 : ÍѵÃÒʋǹ¢Í§ÃÐÂÐˋҧã¹Ãٻ໚¹ÃÐÂÐˋҧ·Õäè Á‹à»š¹ÊѴʋǹ¨ÃÔ§


38

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

4.8 ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò : RESISTANCE (µ‹Í¡Ñº SENSOR0-SENSOR7) ãªŒÇ´Ñ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò â´Âãˌáç´Ñ¹àÍÒµ¾µØ ໚¹ÍѵÃÒʋǹ 1mV / Ω áÅÐÇÑ´¤‹Ò䴌ʧ٠ÊØ´ 4000Ω ËÃ×Í 4kΩ ÀÒÂã¹á¼§Ç§¨ÃÁÕáËŋ§ ¨‹Ò¡ÃÐáʤ§·Õè 1mA àÁ×Íè ¹íÒµÑǵŒÒ¹·Ò¹ÁÒµ‹ÍÇÑ´ ·Õ¨è ´Ø ÇÑ´¹Ñ¹é ¡ç¨Ðà¡Ô´áç ´Ñ¹ä¿µÃ§¢Ö¹é â´Âáç´Ñ¹·Õäè ´Œ¨Ð໚¹ÊѴʋǹ¤§·Õ¡è ºÑ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ RESISTANCE

)

LM334

constant current source

1

100n 2

3

68R

1mA set

TLC2272 8

5

7

6

R ·Õµè ͌ §¡ÒÃÇÑ´

OUT

4

Output 1mV./Ω

Input 4000Ω Max. (Current source 4V. limited)

4.9 ἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò : CURRENT

(µ‹Í¡Ñº SENSOR0-SENSOR7)

ãªŒÇ´Ñ ¡ÃÐáÊä¿¿‡Ò¡ÃÐáʵç â´Âµ‹Í͹ءÃÁ¡Ñº¨Ø´·Õµè ͌ §¡ÒÃÇÑ´ ãˌáç´Ñ¹àÍÒµ¾µØ ã¹ÍѵÃÒʋǹ 5 mV/mA ÇѴ䴌ʧ٠ÊØ´ 1,000mA â´Â㪌µÇÑ µŒÒ¹·Ò¹µ‹Í¡íÒ˹´Â‹Ò¹ÇÑ´ (R shunt) = 0.5Ω ÍѵÃÒ·¹ ¡íÒÅѧÊÙ§ÊØ´ 500mW )

CURRENT 10k

0.5R

6

8

5

OUT

1.5V

A

7

4

TLC2272 1k 10k Input : 1A max.

¨Ø´µ‹ÍÇÑ´ ¡ÃÐáÊä¿

Output : 5mV/mA

0.5 Ohm

1k

OUT

0.1/50V

CURRENT

·ÔÈ¡ÃÐáÊ俵ç ·Õµè ͌ §¡ÒÃÇÑ´

LOAD

µÑÇÍ‹ҧ¡Òõ‹Íἧǧ¨Ã CURRENT à¾×Íè ÇÑ´¡ÃÐáÊä¿¿‡Ò


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

39

4.10 ἧǧ¨Ãἧǧ¨ÃÅ´·Í¹áç´Ñ¹ä¿¿‡Ò (ATTENUATOR) (µ‹Í¡Ñº SENSOR0-SENSOR7) 㪌ÇÑ´¤‹Òáç´Ñ¹ä¿¿‡Ò¡ÃÐáʵçâ´Âµ‹Í¤Ã‹ÍÁËÃ×Í¢¹Ò¹¡Ñº ¨Ø´·Õµè ͌ §¡ÒÃÇÑ´ àÅ×Í¡ÍѵÃÒ¡ÒÃÅ´·Í¹áç´Ñ¹ÍÔ¹¾Øµä´Œ 2 Ẻ ¤×Í l1

àÅ×Í¡ÍѵÃÒÅ´·Í¹ 1:1 ·íÒãËŒÃºÑ áç´Ñ¹ÍÔ¹¾Øµ 0-5V

l 1/2

àÅ×Í¡ÍѵÃÒÅ´·Í¹ 2:1 ·íÒãËŒÃºÑ áç´Ñ¹ÍÔ¹¾Øµ 0-10V )

ATTENUATOR

A

ATT. 1 1/2

1M

VOLT

¨Ø´µ‹ÍÇÑ´ áç´Ñ¹ä¿¿‡Ò

ATTENUATOR

1

1/2

5

·Õ赌ͧ¡ÒÃÇÑ´

6

1M Ratio 1 : Input 0-5V. Ratio 1/2 : Input 0-10V.

àº×Íé §µŒ¹¡Ñº¡ÒÃá»Å§ÊÑ­­Ò³ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ

0.1/50V 8

OUT

7

4 TLC2272

Output : 0-5V

E

ÊÑ­­Ò³¨Ðä´ŒÃºÑ ¡ÒÃá»Å§à»š¹¨íҹǹ·Ò§´Ô¨µÔ ÍÅ â´Â¡Òà ÊØÁ‹ ËÃ×Íá«Á»ÅÔ§é (sampling) ´Ñ§ã¹ÃÙ» ¶ŒÒËҡǧ¨Ãá»Å§ÊÑ­­Ò³ ¢ŒÍÁÙÅ´Ô¨ÔµÍÅ 001101100111 ÁÕàÍÒµ¾µØ 8 àʌ¹ ¨ÐÁբ͌ ÁÙÅà¡Ô´¢Ö¹é 28 ËÃ×Í 256 ÃËÑÊ 000101101111 ¤‹Ò¤ÇÒÁÅÐàÍÕ´¢Í§µÑÇá»Å§ÊÑ­­Ò³¶Ù¡Í¸ÔºÒ´ŒÇ ÃÐÂÐˋҧ·Õ¹è ͌ ·ÕÊè ´Ø ¢Í§¤‹Òáç´Ñ¹·Ò§ÍÔ¹¾Øµ·Õàè ¾ÔÁè ¢Ö¹é «Ö§è ¶Ù¡¡íÒ˹´ ÊÑ­­Ò³ÍйÒÅÍ¡ â´ÂµÑÇá»Å§ÊÑ­­Ò³¹Ñ¹é ÃÐÂÐˋҧÂÔ§è ¹ŒÍÂ෋ÒäËË ¤‹Ò¤ÇÒÁÅÐàÍÕ´ ÂÔè§ÊÙ§¢Öé¹ â´Â¤‹Ò¤ÇÒÁÅÐàÍÕ´á»Ã¼Ñ¹µÃ§¡Ñº¨íҹǹºÔµàÍÒµ¾Øµ ¶ŒÒµÑÇá»Å§ÊÑ­­Ò³ÁÕ¢¹Ò´ 8 ºÔµ ÃдѺ¢Í§ÊÑ­­Ò³ÍÔ¹¾Øµ¶Ù¡ ᷹໚¹àÅ¢°Ò¹Êͧ¨Ò¡ 00000000 ¶Ö§ 11111111 ¶ŒÒÍÔ¹¾ØµàÃÔÁè ÃÐÂÐˋҧ¢Í§¡ÒÃÊ؋Á µŒ¹¨Ò¡ 0-5 V ´Ñ§¹Ñ¹é ¤ÇÒÁÅÐàÍÕ´෋ҡѺ 5/256 = 0.0195V ¶ŒÒ¢ŒÍÁÙÅàÍÒµ¾µØ ໚¹ 00000001 ¨Ðá·¹áç´Ñ¹ 0.0195V ¡ÒÃÊØÁ‹ ÊÑ­­Ò³ÍйÒÅÍ¡à¾×Íè ¡íÒ˹´¢ŒÍÁÙÅ´Ô¨µÔ ÍÅ ¶ŒÒ໚¹ 00000010 ¨Ðá·¹áç´Ñ¹ 0.039 V ã¹·Ò§¡ÅѺ¡Ñ¹ËÒ¡µŒÍ§¡Ò÷ÃÒº¢ŒÍÁÙÅ´Ô¨ÔµÍŢͧáç´Ñ¹ 3.042 V ¨ÐËÒ䴌¨Ò¡ 3.042/0.0195 = 156 °Ò¹ÊÔº á»Å§à»š¹àÅ¢ °Ò¹Êͧ¨Ð䴌¤Ò‹ ෋ҡѺ 10011100 INNOVATIVE EXPERIMENT


40

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

41

º··Õè 5

ʹء¡Ñº¡Ô¨¡ÃÃÁà¾×èÍ¡ÒÃàÃÕ¹ÃٌáÅз´Åͧ ÇÔ·ÂÒÈÒʵÏ´ŒÇÂäÁâ¤Ã¤Í¹â·ÃÅàÅÍϡѺ ªØ´«Í¿µáÇÏ SCi-BOX Activity ËÅѧ¨Ò¡·íÒ¤ÇÒÁÃÙ¨Œ ¡Ñ ¡Ñºá¼§Ç§¨Ã¤Çº¤ØÁ SCi-BOX áÅÐἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³áººµ‹Ò§æ ä»áŌÇ㹺··Õ¼è ҋ ¹ÁÒ µ‹Í仹ըé Ð໚¹ÀÒ¤»¯ÔºµÑ àÔ ¾×Íè ãˌ¡ÒÃàÃÕ¹ÃÙʌ ÁºÙóáºº â´Â㹺·¹Õ¹é Òí àÊ¹Í ¡ÒÃàÃÕ¹ÃٌáÅз´ÅͧÇÔ·ÂÒÈÒʵÏ´ŒÇ¡ŋͧÊÁͧ¡Å¡ÑºªØ´«Í¿µáÇÏÊíÒàÃç¨ÃÙ»·Õèª×èÍ SCi-BOX Activity â´Â㹫ͿµáÇÏ䴌ºÃèء¨Ô ¡ÃÃÁÊíÒËÃѺ·´ÅͧänjÁÒ¡¶Ö§ 15 ¡Ô¨¡ÃÃÁ ÁÕ¡ÒÃ㪌ἧǧ¨Ã áÊ´§¼ÅáÅÐἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³Í‹ҧ¤Ãº¶ŒÇ¹ â´ÂäÁ‹¨Òí ໚¹µŒÍ§à¢Õ¹â»Ãá¡ÃÁËÇÁ´ŒÇ ª‹Í§àÅ×Í¡¡Ô¨¡ÃÃÁ·Õµè ͌ §¡Ò÷´Åͧ

˹ŒÒµ‹Ò§á¨Œ§ÍØ»¡Ã³·ãèÕ ªŒã¹áµ‹ÅСԨ¡ÃÃÁ ÃÇÁ¶Ö§ÀÒ¾áÊ´§¡Òõ‹ÍÊÒÂ㹡Ò÷´Åͧ

ÃкØÅÒí ´Ñºã¹¡Ò÷´Åͧ áÅдټÅÍ‹ҧªÑ´à¨¹

àÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§éÑ ¨Ò¡ ¨ÍÀÒ¾ËÃ×ÍâÁ´ÙÅ SLCD ª‹Í§áÊ´§¼Å¡Ò÷íÒ§Ò¹ º¹¨ÍÀÒ¾¢Í§â»Ãá¡ÃÁ àÁ×èÍàÅ×Í¡áÊ´§¼Å´ŒÇÂâÁ´ÙÅ SLCD ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§¡Òà àª×èÍÁµ‹ÍáÅСíÒ˹´¨ÑêÁà»ÍÏ ¢Í§âÁ´ÙÅ SLCD

ÃÙ»·Õè 5-1 ÃÒÂÅÐàÍÕ´¢Í§Ë¹ŒÒµ‹Ò§ â»Ãá¡ÃÁ SCi-BOX Activity Ẻ˹֧è


42

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

5.1 ÅÖ¡ÍÕ¡¹Ô´¡Ñº«Í¿µáÇÏ SCi-BOX Activity SCi-BOX ÊÒÁÒöÃͧÃѺ«Í¿µáÇÏ䴌ËÅÒÂẺ ÊíÒËÃѺã¹Ë¹Ñ§Ê×ÍàŋÁ¹Õ¹é Òí ÁÒàÊ¹Í 2 Ẻ ¤×Í áººÊíÒàÃç¨ÃÙ»¾ÃŒÍÁ㪌§Ò¹ËÃ×Í User mode áÅÐẺ¾Ñ²¹Òâ»Ãá¡ÃÁËÃ×Í Developer mode ÊíÒËÃѺ«Í¿µáÇÏ SCi-BOX Activity ¶Ù¡¾Ñ²¹Ò¢Ö¹é à¾×Íè 㪌§Ò¹ SCi-BOX ã¹áººÊíÒàÃç¨ÃÙ»¾ÃŒÍÁ 㪌§Ò¹ ¡Å‹ÒǤ×Í àÅ×͡㪌§Ò¹ Sci-BOX ´ŒÇÂâ»Ãá¡ÃÁ·ÕÁè ÍÕ ÂÙˋ Ã×Íâ»Ãá¡ÃÁ·Õäè ´ŒÊÌҧàÍÒänjáÅŒÇ ·íÒãˌ ¼Ù㌠ªŒÊÒÁÒö¹íÒàÍÒ Sci-BOX ä»ãªŒ§Ò¹ËÃ×Í·íÒ¡Ò÷´Åͧ䴌·¹Ñ ·Õ â´ÂäÁ‹¨Òí ໚¹µŒÍ§à¢Õ¹â»Ãá¡ÃÁ à¾ÔÁè àµÔÁ ·íÒãˌÊдǡáÅÐÅ´¤ÇÒÁÂا‹ Âҡ㹡ÒÃ㪌§Ò¹¢Í§¼Ù㌠ªŒÍ¹×è æ䴌 ´Ñ§áÊ´§ä´ÍÐá¡ÃÁ¡Ò÷íÒ§Ò¹ ã¹ÃÙ»·Õè 5-2 â»Ãá¡ÃÁ¨Ðẋ§Í͡໚¹Êͧʋǹ ¤×Í Ê‹Ç¹áá໚¹â»Ãá¡ÃÁËÅÑ¡º¹ Sci-BOX à¢Õ¹´ŒÇ BASIC Stamp Editor ໚¹ÀÒÉÒàºÊԡẺ·Õàè ÃÕÂ¡Ç‹Ò ¾ÕàºÊÔ¡ (PBASIC) «Ö§è ໚¹â»Ãá¡ÃÁ¾Ñ²¹ÒÊíÒËÃѺ äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ i-Stamp â´Â੾ÒР㹡ÒäǺ¤ØÁ¡Ò÷íÒ§Ò¹º¹ºÍÏ´¨Ðẋ§à»š¹ä¿ÅÂ͋ ·Õè ¢Ö¹é µŒ¹´ŒÇª×Íè ATxx µÒÁ´ŒÇª×Íè ¡Ô¨¡ÃÃÁ ÁÕ¹ÒÁÊ¡ØÅ .BSX áŌÇá»Å໚¹ä¿ÅÍͺà¨ç¡µ (ATxx.OBJ) ʋǹ·ÕÊè ͧ¤×Íâ»Ãá¡ÃÁËÅÑ¡º¹à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏ ·Õàè »š¹Ë¹ŒÒµ‹Ò§µÔ´µ‹Í¡Ñº¼Ù㌠ªŒáºº¡ÃÒ¿¿¡ à¢Õ¹´ŒÇ Borland Delphi 7 Personal ¼ÙŒãªŒ§Ò¹ËÃ׼ٌ·´ÅͧÊÒÁÒöàÅ×Í¡´ÒǹâËÅ´¡Ô¨¡ÃÃÁ·Õ赌ͧ ¡Ò÷´Åͧ ã¹Ë¹ŒÒµ‹Ò§à´ÕÂǡѹ¹Ñé¹ä´ŒáÊ´§ÃÙ»ÍØ»¡Ã³·Õ赋ÍËÇÁ´ŒÇ ÃÇÁ¶Ö§ÃÒÂÅÐàÍÕ´â´Â‹ͧ͢ ¡Ô¨¡ÃÃÁ¹Ñ¹é æ áÅÐÂѧÊÒÁÒöáÊ´§¼Åº¹Ë¹ŒÒ¨Í䴌â´ÂäÁ‹¨Òí ໚¹µŒÍ§à»´â»Ãá¡ÃÁÍ×¹è ÁÒ㪌§Ò¹Ã‹ÇÁ ´ŒÇÂᵋÍ‹ҧ㴠ÊíÒËÃѺ¡ÒÃ㪌§Ò¹ SCi-BOX ã¹áºº¾Ñ²¹Òâ»Ãá¡ÃÁËÃ×Í Developer mode ¨Ð͸ԺÒÂã¹ÃÒ ÅÐàÍÕ´ÀÒÂËÅѧ Sci-BOX ºÃèØÃËÑÊâ»Ãá¡ÃÁ¢Í§ àºÊÔ¡áʵÁ»Š 2SX

ÊÒÂÊÑ­­Ò³

¡Ô¨¡ÃÃÁ¡Ò÷´Åͧ ʋǹàª×Íè Áµ‹Í

ÃÙ»·Õè 5-2 áÊ´§ä´ÍÐá¡ÃÁâ¤Ã§ÊÌҧ·Ò§«Í¿µáÇϢͧ¡ÒÃ㪌§Ò¹ SCi-BOX ÀÒÂ㵌¡Ò÷íÒ§Ò¹´ŒÇ «Í¿µáÇÏẺÊíÒàÃç¨ÃÙ»¾ÃŒÍÁ㪌


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

43

5.2 á¹Ð¹íÒ«Í¿µáÇÏ SCi-BOX Data logger ¹Í¡¨Ò¡«Í¿µáÇÏ SCi-BOX Activity áÅŒÇ ã¹¡ÒÃàÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ SCi-BOX ´ŒÇ«ͿµáÇÏÊÒí àÃç¨ÃÙ»¾ÃŒÍÁ㪌§Ò¹ ÂѧÁÕ«Í¿µáÇÏ ÍÕ¡µÑÇË¹Ö§è ·Õ¢è Íá¹Ð¹íÒ¤×Í Sci-BOX Data logger SCi-BOX Data logger ໚¹â»Ãá¡ÃÁÊíÒËÃѺà¡çº¢ŒÍÁÙŨҡἧǧ¨ÃµÃǨ¨ÑºáÅÐÇÑ´ÊÑ­­Ò³ Ẻ 1 áÅÐ 2 ª‹Í§¾ÃŒÍÁ¡ÑºáÊ´§¡ÃÒ¿áÅÐà¡çº¢ŒÍÁÙÅŧã¹ä¿Å à¾×Íè ¹íÒä»ãªŒà»š¹°Ò¹¢ŒÍÁÙŢͧ¡Òà ÇÔà¤ÃÒÐˏËÃ×ͤíҹdzã¹â»Ãá¡ÃÁÍ×¹è æ ઋ¹ Microsoft Excel 䴌 ÊíÒËÃѺ«Í¿µáÇϵÇÑ ¹Õ¨é еԴµÑ§é ÁÒ ¾ÃŒÍÁ¡Ñº¡ÒõԴµÑ§é ªØ´«Í¿µáÇÏ SCi-BOX Activity â»Ãá¡ÃÁ¨Ðẋ§Í͡໚¹ 2 ʋǹ ʋǹáá໚¹â»Ãá¡ÃÁËÅÑ¡º¹ Sci-BOX à¢Õ¹´ŒÇ BASIC Stamp Editor à¾×èÍ㪌 SCi-BOX ¤Çº¤ØÁ¡ÒÃ͋ҹ¢ŒÍÁÙŨҡἧǧ¨ÃµÃǨ¨ÑºáÅÐÇÑ´ÊÑ­­Ò³µ‹Ò§æ áŌÇʋ§¢ŒÍÁÙÅä»Âѧà¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÃÍ¡Õ ·Í´Ë¹Ö§è â´ÂÁÕä¿ÅÊÒí àÃ稾ÌÍÁ㪌´§Ñ ¹Õé Single.BSX ÊíÒËÃѺ͋ҹ¢ŒÍÁÙŨҡἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡ª‹Í§à´ÕÂÇ C_Single.BSX ÊíÒËÃѺ͋ҹ¢ŒÍÁÙŨҡἧǧ¨ÃÇÑ´¤ÇÒÁ¨Øä¿¿‡Òª‹Í§à´ÕÂÇ Dual.BSX ÊíÒËÃѺ͋ҹ¢ŒÍÁÙŨҡἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡ 2 ª‹Í§¾ÃŒÍÁ¡Ñ¹ â´Âä¿Å·Ñé§ÊÒÁ䴌ÃѺ¡ÒÃá»Å§ãˌ໚¹ä¿ÅÍͺà¨ç¡µà¾×èÍ㪌§Ò¹Ã‹ÇÁ¡ÑºÊ‹Ç¹¢Í§â»Ãá¡ÃÁ º¹¤ÍÁ¾ÔÇàµÍϵ‹Íä» ÍÕ¡´ŒÒ¹Ë¹Ö觤×Íâ»Ãá¡ÃÁËÅÑ¡º¹à¤Ã×èͧ¤ÍÁ¾ÔÇàµÍÏ ẋ§à»š¹â»Ãá¡ÃÁ͋ҹ¢ŒÍÁÙŪ‹Í§à´ÕÂÇ áÅÐ 2 ª‹Í§ â´Â¨ÐáÊ´§µ‹Í·´Åͧ ÃÇÁ¶Ö§¢Ñ鹵͹¡ÒÃàµÃÕÂÁÍÂ‹Ò§Â‹Í áÅÐáÊ´§¼Åº¹Ë¹ŒÒ¨Í໚¹ ¡ÃÒ¿áÅеÑÇàÅ¢¾ÃŒÍÁæ¡Ñ¹ ·íÒãˌ´Ùá¹Ç⹌Á¢Í§¢ŒÍÁÙÅáÅÐÊÒÁÒöà¡çº¢ŒÍÁÙÅä»ãªŒÇÔà¤ÃÒÐˏ䴌 â»Ãá¡ÃÁã¹Ê‹Ç¹¹Õàé ¢Õ¹¢Ö¹é ´ŒÇ Borland Delphi 7 Personal ¡ÒÃàÃÕ¡㪌§Ò¹ãˌ价ջè Á؆ Start à Program àSci-BOX à Sci-BOX SingleData 㹡óշÕè µŒÍ§¡ÒôټŢͧÊÑ­­Ò³à¾Õ§ª‹Í§à´ÕÂÇ áÅжŒÒµŒÍ§¡ÒôټŠ2 ª‹Í§ãˌàÅ×Í¡ Sci-BOX DualData á·¹ ã¹ÃÙ»·Õè 5-3 áÊ´§¢Ñ鹵͹¡ÒÃ㪌§Ò¹â»Ãá¡ÃÁáÅÐÃÒÂÅÐàÍÕ´ʋǹ»ÃСͺ·Ñé§ËÁ´¢Í§ â»Ãá¡ÃÁ


44

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

! 

¡´»ØÁ† Connect àÅ×Í¡ª‹Í§ Run

àÅ×Í¡¨íҹǹ¢ŒÍÁÙÅ·Õµè ͌ §¡ÒÃà¡çº (100-1,000) àÁ×Íè µŒÍ§¡ÒÃµÑ§é ¤‹Ò㹪‹Í§àËŋҹÕé ¨ÐµŒÍ§Â¡àÅÔ¡¡ÒõԴ¡ÑººÍÏ´ àÅ×Í¡¤ÇÒÁÅÐàÍÕ´¢Í§á¡¹¢ŒÍÁÙÅ SCi-BOX àÊÕ¡‹Í¹ (1,024 ËÃ×Í 65,536) àÅ×Í¡ª‹Ç§àÇÅÒ㹡ÒÃà¡çº¤‹Ò áÅÐàÁ×Íè µÑ§é ¤‹ÒàÊÃç¨ ¨Ö§¡´»ØÁ† Connect áÅÐàÅ×Í¡ª‹Í§ Run (100-50,000 ÁÔÅÅÔÇ¹Ô Ò·Õ)

ª‹Í§áÊ´§ÅíҴѺáÅФ‹Ò¢Í§ ¢ŒÍÁÙÅ·Õäè ´ŒÃºÑ µÑÇàÅ¢ªØ´áá໚¹àÅ¢ÅíҴѺ µÑÇàÅ¢ªØ´ËÅѧ໚¹¢ŒÍÁÙŨÃÃÔ§

àÅ×Í¡¡ÒÃ͋ҹ¤‹Ò

¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§àÅ×Í¡ ¡Òõ‹Íἧǧ¨Ã 2 Ẻ¤×Í SENSOR ¡Ñº Capacitance

ª‹Í§áÊ´§Ê¶Ò¹Ð¡ÒÃÃѺ¢ŒÍÁÙÅ ´ŒÇ¡Ãҿ᷋§

¶ŒÒµŒÍ§¡ÒÃáÊ´§ àʌ¹¡ÃÔ´ãˌàÅ×Í¡·Õ¹è èÕ

ºÑ¹·Ö¡¢ŒÍÁÙÅ໚¹ä¿Å .txt Ōҧ¢ŒÍÁÙÅáÊ´§¼Å ºÑ¹·Ö¡ÃÙ»¡ÃÒ¿ ໚¹ä¿Å .bmp

¶ŒÒàÅ×Í¡ SENSOR ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§¡Òõ‹ÍÊÒÂáÅÐÃÒÂÅÐàÍÕ´ ¡Ò÷´Åͧ ´Ñ§¹Õé

àÅ×Í¡Êբͧàʌ¹¡ÃÒ¿

àÁ×Íè µ‹ÍÊÒÂÊÑ­­Ò³µÒÁ·Õ¡è Òí ˹´áÅŒÇ ¡´»ØÁ† OK ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§´ÒǹâËÅ´â»Ãá¡ÃÁ àÁ×ÍàÃÕºÌÍÂãˌ¡´»ØÁ† OK ¶ŒÒàÅ×Í¡ Capacitance ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§¡Òõ‹ÍÊÒÂáÅÐÃÒÂÅÐàÍÕ´ ¡Ò÷´Åͧ ´Ñ§¹Õé

ÃÙ»·Õè 5-3 ¢Ñ¹é µÍ¹¡ÒÃ㪌§Ò¹â»Ãá¡ÃÁáÅÐÃÒÂÅÐàÍÕ´ʋǹ»ÃСͺ·Ñ§é ËÁ´¢Í§â»Ãá¡ÃÁ SCi-BOX Data logger Ẻ SingleData


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

45

¡ÒÃàµÃÕÂÁ¡ÒÃàÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ ¡Ñº¡Å‹Í§ÊÁͧ¡Å SCi-B X ´ŒÇ «Í¿µáÇÃì SCi-BOX Activity ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ÊÒÂàª×Íè Áµ‹Í¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏËÃ×ÍÊÒ CX-232 3. ¤ÍÁ¾ÔÇàµÍÏ·µÕè ´Ô µÑ§é Ãкº»¯ÔºµÑ ¡Ô ÒÃÇÔ¹â´Çʏ ¾ÃŒÍÁ·Ñ§é ÁÕ¾Íϵ͹ءÃÁNjҧÍ‹ҧ¹ŒÍ 1 ¾Íϵ 4. µÑÇá»Å§ USB ໚¹¾Íϵ͹ءÃÁ (USB to Serial port converter) ¡Ã³Õ¤ÍÁ¾ÔÇàµÍÏ·ãÕè ªŒäÁ‹Á¾Õ Íϵ͹ءÃÁ 5. Ἃ¹«Õ´ÃÕ ÍÁâ»Ãá¡ÃÁ SCi-BOX

»¯ÔºµÑ ¡Ô Òà 1. ·íÒ¡ÒõԴµÑ§é â»Ãá¡ÃÁ SCi-BOX Activity ´ŒÇÂ¢Ñ¹é µÍ¹µÒÁ·Õáè ¹Ð¹íÒ㹺··Õè 1 2. µ‹ÍÊÒ¨ҡ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏࢌҡѺºÍÏ´ SCi-BOX 3. ¨Ò¡¹Ñ¹é ·íÒ¡ÒÃແ´â»Ãá¡ÃÁ SCi-BOX Activity àÅ×Í¡¡Ô¨¡ÃÃÁ·Õµè ͌ §¡Òà áŌǻ¯ÔºµÑ µÔ ÒÁ¢Ñ¹é µÍ¹·ÕÃè кØ㹡Ԩ¡ÃÃÁ ¹Ñ¹é æ

HEAT SINK

POWER

Don't Touch !! High temperature

SENSOR6 SENSOR5

P13 : A/D

ADC #1

RESET

SCi-BOX

BASIC Stamp in Science Experiment

i-Stamp

P5

SENSOR7 Co-processor

P4

P12 SOUND

SENSOR3

P11 P10

P9

P3

#2

P8

P2

MOTOR

P1

SENSOR1 SENSOR0

Stepper motor Co-processor

SENSOR2

RELAY

P0

SENSOR4

ADC

Co-processor

P14, P15 : STEPPER MOTOR CONTROL

P7

Í‹ÒÊÑÁ¼ÑÊἋ¹ÃкÒ¤ÇÒÁÌ͹ ¢³Ð·íÒ§Ò¹ !!!!!

SERIAL PORT ON

P6

DC. IN 6-16V

RELAY 12V 5A

RELAY 12V 5A

RELAY 12V 5A

RELAY 12V 5A

P9 RELAY

P8 RELAY

STEPPER MOTOR1 STEPPER MOTOR2

P11 RELAY P10 RELAY

MOTOR A

B

INV-A

INV-B

P8-P9 MotorA P10-P11 MotorB

ON


46

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 1

ʹء¡Ñºàʌ¹áçáÁ‹àËÅç¡â´Â㪌ἧǧ¨ÃµÃǨ¨ÑºáÅÐ ÇѴʹÒÁáÁ‹àËÅç¡ (AT01-Hall effect) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¤Ø³ÅѡɳТͧàʌ¹áçáÁ‹àËÅç¡ â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ Magnetic Field 3. áÁ‹àËÅ硶ÒÇÃẺà¡×Í¡ÁŒÒ Ẻ᷋§µÃ§ áÅÐáÁ‹àËÅç¡Êѧà¤ÃÒÐˏáçÊÙ§ Neodynium (áÁ‹àËÅç¡¢ÒÇ) äÁ‹ÁãÕ ¹ ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 4. âÁ´ÙÅáÊ´§¼Å SLCD

»¯ÔºµÑ ¡Ô Òà 1. µ‹Íἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ Magnetic Field ·Õµè Òí á˹‹§ SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT01-Hall effect


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

Z

47

¡Ò÷íÒ§Ò¹àº×éͧµŒ¹¢Í§µÑǵÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡

Y

B

l

θ α B'

X

B' = ( B COSθ ) COSα

àÁ×Íè àʌ¹áçáÁ‹àËÅç¡ B µ¡¡Ãзº·ÕÁè ·Õ ÈÔ ·Ò§à¢ŒÒËÒµÑǵÃǨÇÑ´ ¤‹Ò·Õäè ´Œ¨Ðà¾ÔÁè ¢Ö鹨ҡ¤‹Ò¡ÅÒ§ ᵋ¶ŒÒ¡ÅѺ·Ôȡѹ ¤‹Ò·Õè䴌·ÕèŴŧ â´Âãˌ¼Å¨Ò¡»ÃÔÁÒ³ àʌ¹áçáÁ‹àËÅç¡·Õµè ¡¡ÃзºµÑ§é ©Ò¡¡ÑºÃйҺ¢Í§µÑǵÃǨÇÑ´ B' (᡹ Z)

3. ¡‹Í¹àÃÔÁè µŒ¹·íÒ§Ò¹·Ø¡¤Ãѧé ãˌ¹Òí ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡Í͡ˋҧ¨Ò¡Ê¹ÒÁáÁ‹àËÅç¡ áŌÇàÃÔÁè ແ´·íÒ§Ò¹à¾×Íè »ÃѺà·Õº¤‹Ò 0 ¡‹Í¹¹íÒä»ãªŒÇ´Ñ ËÃ×Í¡´ÊÇÔµ« RESET º¹ SCi-BOX à¾×Íè àÃÔÁè »ÃѺ¤‹ÒãËÁ‹ä´Œ 4. ¨Ò¡¹Ñ¹é ¹íÒἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡ Magnetic Field ä»·´ÅͧÇÑ´¡ÑºáÁ‹àËÅç¡ã¹Åѡɳе‹Ò§æ Êѧࡵ¼Å·ÕÍè ҋ ¹ä´Œ â´ÂàÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Í à¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡ 4.1 ·´Åͧ¡ÑºáÁ‹àËÅç¡áººá·‹§ â´Â·´ÅͧÇÑ´¨Ò¡áÁ‹àËÅç¡·Õè·ÃÒº·ÔÈ·Ò§ ´Ñ§µÑÇÍ‹ҧ áŌÇÊÃØ»¼Å ÅͧÇҴ໚¹·ÔÈ·Ò§áÅÐá¹Ç¢Í§àʌ¹áçáÁ‹àËÅç¡ à»ÃÕºà·Õº¡Ñº¼ÅÅѾ¸¡ºÑ ·ÄÉ®ÕáÁ‹àËÅç¡·ÕÁè ÍÕ Âً

"

´ŒÒ¹·ÕèÁըش ἧǧ¨Ã Magnetic Field



N

S

N

$

2mm.

#

N

2mm. S

$

6mm. N

S

N

S

$

N

S

6mm.

6mm.

4.2 ¨ÑºáÁ‹àËÅç¡á·‹§µÑ§é ¢Ö¹é áŌÇ㪌ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁ áÁ‹àËÅç¡ Magnetic Field ÇÑ´Ãͺæ ᷋§áÁ‹àËÅç¡ áŌÇÊÃØ»¼Å ÇҴ໚¹·ÔÈ ·Ò§áÅÐá¹Ç¢Í§àʌ¹áçáÁ‹àËÅç¡ à»ÃÕºà·Õº¡Ñº¼ÅÅѾ¸¡ºÑ ·ÄÉ®ÕáÁ‹àËÅç¡ 4.3 ·´ÅͧËÒ¢ÑÇé áÁ‹àËÅ硨ҡáÁ‹àËÅç¡á·‹§·Õäè Á‹·ÃÒº·ÔÈ

S

N

S

N

S

45°

% 6mm.

4mm.

!

N 6mm.

S

2mm. N

30°

S

& 6mm.

N S


48

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

4.4 ·´Åͧ¡ÑºáÁ‹àËÅç¡à¡×Í¡ÁŒÒ â´Â·´ÅͧÇÑ´¨Ò¡áÁ‹àËÅç¡·Õ·è ÃÒº·ÔÈ·Ò§ ´Ñ§µÑÇÍ‹ҧ áŌÇÊÃØ»¼Å Åͧ ÇҴ໚¹·ÔÈ·Ò§áÅÐá¹Ç¢Í§àʌ¹áçáÁ‹àËÅç¡ à»ÃÕºà·Õº¡Ñº¼ÅÅѾ¸¡ºÑ ·ÄÉ®ÕáÁ‹àËÅç¡·ÕÁè ÍÕ Âً

N 6mm. S

6mm. S

S

$

N

N 2mm.

&

N

N

#

90° S

S

àÅ×Íè ¹ä»-ÁÒ ¡Ö§è ¡ÅÒ§áÁ‹àËÅç¡

2mm.

!

S

2mm.

"

6mm.

N

N



% S

ἧǧ¨Ã Magnetic Field

àÅ×Íè ¹ä»-ÁÒ ¡Ö§è ¡ÅÒ§áÁ‹àËÅç¡

N

´ŒÒ¹·ÕÁè ¨Õ ´Ø

30°

N

"

6mm.

' N S

S

S

5. ·íÒ¡Ò÷´Åͧã¹ÅѡɳÐà´ÕÂǡѹ¡ÑºáÁ‹àËÅç¡Êѧà¤ÃÒÐˏáçÊÙ§ Neodynium áÅÐáÁ‹àËÅç¡áººÍ×¹è æ ·ÕÍè ÂÙË ͺ µÑÇ àª‹¹ »ÅÒÂ䢤ǧ ÅíÒ⾧ ËÃ×ÍáÁ‹àËÅç¡·Õ¡è ŋͧ´Ô¹ÊÍ

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

49

¡Ô¨¡ÃÃÁ·Õè 2

ʹء¡Ñº¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Òâ´Â㪌ἧǧ¨Ã ÇÑ´¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò (AT02-Resistance) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¤Ø³ÅѡɳТͧ¡Òõ‹ÍµÑǵŒÒ¹·Ò¹ä¿¿‡Ò â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò RESISTANCE 3. µÑǵŒÒ¹·Ò¹ä¿¿‡Ò ¤‹ÒµÑǵŒÒ¹·Ò¹ ÃËÑÊÊÕẺ 4 ᶺ ¹éÒí µÒÅ-´íÒ-á´§-·Í§ 1kΩ 2 kΩ á´§-´íÒ-á´§-·Í§ à¢ÕÂÇ-´íÒ-¹éÒí µÒÅ-·Í§ 500Ω 4. ÊÒ»ҡ¤Õº 5. ¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

ÃËÑÊÊÕẺ 5 ᶺ ¹éÒí µÒÅ-´íÒ-´íÒ-¹éÒí µÒÅ-¹éÒí µÒÅ á´§-´íÒ-´íÒ-¹éÒí µÒÅ-¹éÒí µÒÅ à¢ÕÂÇ-´íÒ-´íÒ-´íÒ-¹éÒí µÒÅ

¤Ø³ÊÁºÑµÔ¢Í§á¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò ÁÕáËŋ§¨‹Ò¡ÃÐáʤ§·Õè 1mA ÍÂً㹵ÑÇ ·íÒãˌÁÕáç´Ñ¹µ¡¤Ã‹ÍÁ ÍØ»¡Ã³·¶Õè ¡Ù ÇѴʋ§ÍÍ¡ÁÒ ¨íÒ¡Ñ´änjäÁ‹à¡Ô¹ 4V «Ö§è ¶ŒÒ¹íÒµÑǵŒÒ¹·Ò¹ ÁÒÇÑ´ áç´Ñ¹·Õäè ´Œ¨Ð໚¹ÊѴʋǹ¤§·Õ¡è ºÑ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ «Ö§è ෋ҡѺ 1mV/Ω ¨Ö§·íÒãËŒÇ´Ñ ä´ŒäÁ‹à¡Ô¹ 4kΩ

E

µÑǵŒÒ¹·Ò¹

ÍÐää×͵ÑǵŒÒ¹·Ò¹

¨íҹǹ 4 µÑÇ ¨íҹǹ 1 µÑÇ ¨íҹǹ 2 µÑÇ

+5V

áËŋ§¨‹Ò¡ÃÐáʤ§·Õè 1mA ÍØ»¡Ã³ ·Õµè ͌ §¡ÒÃÇÑ´

+

áç´Ñ¹àÍÒµ¾µØ <4V -

ÊÑ­Åѡɳ

µÑǵŒÒ¹·Ò¹ (resistor) ໚¹ÍØ»¡Ã³ÍàÔ Åç¡·Ã͹ԡʏ¾¹×é °Ò¹·ÕÊè ´Ø ·Õµè ͌ §ÃÙ¨Œ ¡Ñ ໚¹Íѹ´Ñºáá ˹ŒÒ·Õè ËÅÑ¡¢Í§µÑǵŒÒ¹·Ò¹¤×Í ãªŒÅ´¡ÃÐáÊä¿¿‡Ò â´Â¶ŒÒµÑǵŒÒ¹·Ò¹Áդҋ ÁÒ¡ ¡ÃÐáÊä¿¿‡Ò¡ç¨ÐäËż‹Ò¹µÑÇÁѹ 䴌¹ÍŒ  ¨Ö§¹ÔÂÁ㪌µÇÑ µŒÒ¹·Ò¹ã¹¡ÒäǺ¤ØÁ¡ÃÐáÊä¿¿‡Òã¹Ç§¨Ã

˹‹Ç¢ͧµÑǵŒÒ¹·Ò¹

¤‹Ò¢Í§µÑǵŒÒ¹·Ò¹¤×Í ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò (resistance) ÁÕ˹‹ÇÂ໚¹ âÍˏÁ (Ohm : Ω ) ˹‹Ç·ÕèãË­‹¢Ö鹤×Í ¡ÔâÅâÍˏÁ ( kiloOhm : kΩ ) «Öè§ÁÕ¤‹Ò෋ҡѺ 1,000Ω ˹‹Ç·ÕèãË­‹¡Ç‹Ò¤×Í 1 àÁ¡Ð âÍˏÁ (MegaOhm : MΩ) ෋ҡѺ 1,000 kΩ ËÃ×Í 1,000,000 Ω


50

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

E

ÃËÑÊᶺÊÕ (color code) ÊÕ·Õè¾ÔÁ¾Å§º¹µÑǵŒÒ¹·Ò¹à¾×èͺ͡¤‹Ò¢Í§ÁÕ¤ÇÒÁ ËÁÒÂá·¹´ŒÇµÑÇàÅ¢µ‹Ò§æ µÒÁµÒÃÒ§

¤ÇÒÁËÁÒ¢ͧᵋÅÐᶺÊÕ

㹡óÕ໚¹µÑǵŒÒ¹·Ò¹·ÕÁè ¤Õ ÇÒÁ¼Ô´¾ÅÒ´ 5% ¨ÐÁÕ á¶ºÊÕ 4 ᶺ (ÃÙ» ¡) ᵋÅÐᶺÁÕ¤ÇÒÁËÁÒ´ѧ¹Õé ᶺáá ໚¹µÑÇàÅ¢ËÅÑ¡áá¢Í§¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ÃÇÁ ᶺÊÕ·ÕèÊͧ ໚¹µÑÇàÅ¢¢Í§ËÅÑ¡·ÕèÊͧ¢Í§¤‹Ò¤ÇÒÁµŒÒ¹ ·Ò¹ÃÇÁ ᶺÊÕ·ÊÕè ÒÁ ໚¹µÑǤٳ ᶺÊØ´·ŒÒ ໚¹á¶ºÊբͧ¤‹Ò¤ÇÒÁ¼Ô´¾ÅÒ´ Ëҡ໚¹á¶º ÊշͧËÁÒ¶֧Áդҋ ¤ÇÒÁ¼Ô´¾ÅÒ´ 5% áÅжŒÒ໚¹à»š¹ÊÕà§Ô¹ ¨ÐËÁÒ¤ÇÒÁÇ‹Ò ÁÕ¤ÇÒÁ¼Ô´¾ÅÒ´ 10% µÑÇÍ‹ҧ ᶺÊÕ·Õè 1, 2 áÅÐ 3 ໚¹ÊÕá´§ ÊØ´·ŒÒÂ໚¹á¶ºÊÕ ·Í§ µÑǵŒÒ¹·Ò¹µÑǹÕÁé ¤Õ Ò‹ ෋Òã´ ÊÕá´§¢Í§á¶ºÊÕ·Õè 1 áÅÐ 2 á·¹´ŒÇÂàÅ¢ 2 ã¹¢³Ð ·Õáè ¶ºÊÕ·ÊÕè ÒÁ໚¹ÊÕá´§ µÑǤٳ¤×Í 100 ¨Ö§ä´Œà»š¹ 22x100 = 2,200 ˹‹Ç·Õäè ´Œ¨Ð໚¹ Ω ᵋà¾×Íè ãˌ´¡Ù ÃЪѺ¢Ö¹é ¨Ö§µŒÍ§ »ÃѺ໚¹Ë¹‹Ç·Õãè Ë­‹¢¹Öé ໚¹ 2.2kΩ ¤‹Ò¼Ô´¾ÅÒ´¤×Í 5% µÑǵŒÒ¹·Ò¹·ÕÁè áÕ ¶ºÊÕ 4 ᶺ·ÕÁè ¤Õ ÇÒÁ¼Ô´¾ÅÒ´ 5 % ໚¹áºº·Õè¹ÔÂÁáÅÐ໚¹¾×é¹°Ò¹·ÕèÊØ´ àËÁÒÐ ÊíÒËÃѺ¡ÒÃ㪌§Ò¹à¾×Íè àÃÔÁè µŒ¹àÃÕ¹ÃÙ͌ ‹ҧÂÔ§è 㹡óշàÕè »š¹ÃËÑÊᶺÊÕ 5 ᶺ (ÃÙ» ¢) ᶺ·ÕËè ¹Ö§è ¶Ö§ÊÒÁ ໚¹µÑÇàÅ¢ËÅÑ¡·Õè 1-3 ¢Í§¤‹Ò¤ÇÒÁµŒÒ¹ ·Ò¹ ᶺ·ÕÊè Õè ໚¹á¶ºÊբͧµÑǤٳ ᶺ·ÕËè Ҍ ໚¹¡ÒÃáÊ´§¤‹Ò¤ÇÒÁ¼Ô´¾ÅÒ´¢Í§µÑǵŒÒ¹·Ò¹ ¶ŒÒ໚¹ÊÕ¹Òéí µÒŨÐ໚¹¡ÒÃáÊ´§¤‹Ò¤ÇÒÁ¼Ô´¾ÅÒ´ 1% ¶ŒÒᶺÊÕ·Õè 1-3 ໚¹ÊÕá´§ àËÅ×ͧ ʌÁ ᶺ·ÕÊè àÕè »š¹ÊÕ à¢ÕÂÇ áÅÐÊØ´·ŒÒÂ໚¹ÊÕ¹Òéí µÒÅ µÑǵŒÒ¹·Ò¹¹ÕÁé ¤Õ Ò‹ ෋Òã´ 3 ᶺÊÕáá¤×Í á´§ àËÅ×ͧ ʌÁ á·¹´ŒÇÂàÅ¢ 2, 4 áÅÐ 3 ʋǹᶺ·ÕÊè àÕè »š¹ÊÕàËÅ×ͧ µÑǤٳ¤×Í 10,000 ¨Ö§ä´Œ ໚¹ 2,430,000 ˹‹ÇÂ໚¹ Ω »ÃѺ໚¹ 2,430kΩ áµ‹Â§Ñ ·íÒ ãˌ໚¹Ë¹‹Ç MΩ 䴌 ÁÕ¤‹Ò෋ҡѺ 2.43MΩ ¤‹Ò¤ÇÒÁ¼Ô´ ¾ÅÒ´ 1%

ÊÕ ¤‹ÒµÑÇàÅ¢ ´íÒ 0 ¹íÒé µÒÅ 1 á´§ 2 ʌÁ 3 àËÅ×ͧ 4 à¢ÕÂÇ 5 ¹íéÒà§Ô¹ 6 Á‹Ç§ 7 à·Ò 8 ¢ÒÇ 9 ·Í§ à§Ô¹ äÁ‹ÁÕÊÕ -

µÑǤٳ 1 10 100 1,000 10,000 100,000 1,000,000 10,000,000 100,000,000 1,000,000,000 0.1 0.01 -

¤‹Ò¼Ô´¾ÅÒ´ 1% 5% 10% 20%

à»ÍÏà«ç¹µ¤ÇÒÁ¼Ô´¾ÅÒ´ µÑǤٳ (¨íҹǹàÅ¢Èٹ) µÑÇàÅ¢ËÅÑ¡·ÕÊè ͧ µÑÇàÅ¢ËÅÑ¡·ÕËè ¹Ö§è

(¡)

à»ÍÏà«ç¹µ¤ÇÒÁ¼Ô´¾ÅÒ´ µÑǤٳ (¨íҹǹàÅ¢Èٹ) µÑÇàÅ¢ËÅÑ¡·ÕÊè ÒÁ µÑÇàÅ¢ËÅÑ¡·ÕÊè ͧ µÑÇàÅ¢ËÅÑ¡·ÕËè ¹Ö§è

(¢)


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

51

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡á¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò RESISTANCE à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT02-Resistance 3. µ‹ÍÊÒ»ҡ¤Õº·Õ¨è ´Ø ÇÑ´¢Í§á¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò RESISTANCE NSOR7 SENSOR6

Co-processor

SENSOR5

P13 : A/D

ADC #1

SENSOR4

ADC

Co-processor

#2

SENSOR2 SENSOR1 SENSOR0

Stepper motor Co-processor

SENSOR3

RESISTANCE

)

P14, STEP CON

OUT STEPPER MOTOR1 STE

ÃÙ»·Õè A2-1 ¡Òõ‹Íἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò RESISTANCE à¾×Íè ÇÑ´¤‹Ò¢Í§µÑǵŒÒ¹·Ò¹

E

¡Òäíҹdz¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ÃÇÁàº×éͧµŒ¹ ǧ¨Ã͹ءÃÁ ¹íÒ¤‹Ò¢Í§µÑǵŒÒ¹·Ò¹·Ñ§é ËÁ´ÁÒÃÇÁ¡Ñ¹ µÒÁ¤ÇÒÁÊÑÁ¾Ñ¹¸ Rt = R1+R2+...Rn

R1

R2

Rn

Rt

ǧ¨Ã¢¹Ò¹ ¤íҹdz䴌¨Ò¡ Rt =

1 1 1 1 + + ... + R1 R1 Rn

R1

R2

Rn

Rt


52

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

4. ·´ÅͧÇÑ´¤‹ÒµÑǵŒÒ¹·Ò¹·Õµè ͋ ¡Ñ¹ã¹áººµ‹Ò§æ Êѧࡵ¼ÅÅѾ¸·ÍÕè ҋ ¹ä´Œ â´ÂàÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨Í ËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡



1kΩ

2kΩ

!

"

500Ω

500Ω

#

$

%

&

1kΩ

1kΩ

500Ω 500Ω

1kΩ

1kΩ

'



1kΩ

1kΩ

1kΩ

1kΩ

500Ω 500Ω

2kΩ

1kΩ

1kΩ



1kΩ 500Ω

500Ω

500Ω

ÇÔ¸Õ¡ÒÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹â´Â㪌ÁÑŵÔÁÔàµÍÏẺà¢çÁ

1kΩ

E

ã¹ÁÑŵÔÁàÔ µÍÏẺà¢çÁ¨ÐÁÕÂҋ ¹ÇÑ´¤ÇÒÁµŒÒ¹·Ò¹ÍÂÙ´‹ nj  Êà¡Å¢Í§¤ÇÒÁµŒÒ¹·Ò¹¨ÐÁÕ¤ÇÒÁᵡµ‹Ò§¨Ò¡Êà¡Å ¢Í§áç´Ñ¹¤×Í Êà¡Å¢Í§¤ÇÒÁµŒÒ¹·Ò¹µèÒí ¨ÐÍÂÙ·‹ Ò§¢ÇÒ ã¹¢³Ð·ÕÊè à¡Å¢Í§¤ÇÒÁµŒÒ¹·Ò¹ÊÙ§¨ÐÍÂÙ·‹ Ò§«ŒÒ ¡‹Í¹·íÒ ¡ÒÃÇÑ´µŒÍ§ÁÕ¡ÒûÃѺ¤‹Ò 0Ω (zero adjust) ¡‹Í¹ â´Â¡ÒùíÒ»ÅÒ¢ͧÁÔàµÍÏÁÒáµÐ¡Ñ¹ à¢çÁ¢Í§ÁÔàµÍϺ¹Ë¹ŒÒ»˜´ ¨ÐÊÇԧ价ҧ¢ÇÒÁ×Í ¨Ò¡¹Ñ¹é ·íÒ¡ÒûÃѺ»ØÁ† zero adjust ¨¹à¢çÁªÕ·é µÕè Òí á˹‹§ 0Ω ¡ÒûÃѺ¤‹ÒÈٹ¹µÕé ͌ §¡ÃзíÒ·Ø¡¤ÃÑ§é ·ÕÁè ¡Õ ÒÃà»ÅÕÂè ¹Â‹Ò¹ÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ áÅзء¤ÃÑ§é ·Õµè ͌ §¡ÒÃÇÑ´¤‹Ò¤ÇÒÁ µŒÒ¹·Ò¹ ·Ñ§é ¹Õàé ¾×Íè ãˌ¤Ò‹ ·ÕÇè ´Ñ ä´ŒÁ¤Õ ÇÒÁáÁ‹¹ÂíÒÁÒ¡·ÕÊè ´Ø Â‹Ò¹ÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹º¹ÁÑŵÔÁàÔ µÍÏâ´Â·ÑÇè ä» ¨Ðẋ§à»š¹ 4 ‹ҹ¤×Í Rx1 ÊÒÁÒöÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä´Œµ§Ñé ᵋ 0-500Ω â´Â»ÃÐÁÒ³, Rx10 ÊÒÁÒöÇÑ´¤ÇÒÁµŒÒ¹·Ò¹ä´Œµ§Ñé ᵋ 500Ω-5k Ω , Rx1k ÇѴ䴌ÃÐËNjҧ 5 kΩ - 50 kΩ áÅÐ Rx10k ÇѴ䴌ÃÐËNjҧ 10 kΩ- 5 MΩ Í‹ҧäáçµÒÁ ¤ÇÒÁ ÊÒÁÒö㹡ÒÃÇÑ´·Õè¡Å‹ÒÇÁÒ¹Õé໚¹¤‹Òâ´Â»ÃÐÁҳ෋ҹÑé¹

¤‹Ò¤ÇÒÁ¼Ô´¾ÅÒ´¢Í§µÑǵŒÒ¹·Ò¹

ã¹µÑǵŒÒ¹·Ò¹·Ø¡µÑǨÐÁÕ¤‹Ò¤ÇÒÁ¼Ô´¾ÅÒ´·ÃҺ䴌¨Ò¡á¶ºÊÕᶺÊØ´·ŒÒº¹µÑǵŒÒ¹·Ò¹áÅдŒÇ¤‹Ò ¤ÇÒÁ¼Ô´¾ÅÒ´¹Õàé ͧ·íÒãˌ¤Ò‹ ·Õáè ·Œ¨ÃÔ§¢Í§µÑǵŒÒ¹·Ò¹µÑÇ˹֧è æ Áբͺࢵ¤ÇÒÁ໚¹ä»ä´ŒÍÂÙˋ ÅÒ¤‹Ò ´Ñ§µÑÇÍ‹ҧ µÑǵŒÒ¹·Ò¹ 27 kΩ ¼Ô´¾ÅÒ´ 5% ËÁÒ¤ÇÒÁÇ‹Ò Áդҋ ¤ÇÒÁ¼Ô´¾ÅҴ෋ҡѺ 27 x 1000 x0.05 = 1,350Ω ´Ñ§¹Ñ¹é ‹ҹ¢Í§¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹¨ÐÍÂÙ·‹ Õè 25,650-28,350Ω (ÁÒ¨Ò¡ 27,000-1,350 áÅÐ 27,000+1,350) ËÃ×Í 25.6528.35 kΩ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

53

¡Òõ‹ÍµÑǵŒÒ¹·Ò¹ËÅÒÂæ µÑÇࢌҴŒÇ¡ѹ㹡Ò÷´Åͧ¹ÕÊé ÒÁÒö·íÒ䴌ËÅÒÂÇÔ¸Õ (¡) 㪌¡Òþѹ¢ÒࢌҴŒÇ¡ѹ (¢) 㪌ÊÒ»ҡ¤Õºµ‹Íµ‹ÍÃÐËNjҧµÑǵŒÒ¹·Ò¹ ´Ñ§µÑÇÍ‹ҧ

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #1 5. ¨Ò¡ÃÙ»¡Òõ‹Íǧ¨Ã·´Åͧ ãËŒÇ´Ñ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹¤Ã‹ÍÁ¨Ø´µ‹Ò§æ ´Ñ§¹Õé A

2kΩ

C

1kΩ 1kΩ

1kΩ

B

#Ω

D

A - B ÇѴ䴌෋ҡѺ .................................... Ω B - C ÇѴ䴌෋ҡѺ .................................... Ω C - D ÇѴ䴌෋ҡѺ .................................... Ω A - C ÇѴ䴌෋ҡѺ .................................... Ω A - D ÇѴ䴌෋ҡѺ .................................... Ω B - D ÇѴ䴌෋ҡѺ .................................... Ω Êѧࡵ¼Å·ÕèÇѴ䴌㹡ÒÃᵋªØ´ ·´Åͧ¤íҹdz¼ÅµÒÁ·ÄÉ®Õ à»ÃÕºà·Õº¡Ñ¹

6. ËÒ¡ÃжҧµŒ¹äÁŒãʋ´¹Ô áˌ§Å§ä» ¡´´Ô¹ãˌṋ¹¾ÍÊÁ¤Çà áŌǹíÒ á·‹§âÅËзÕÊè ÒÁÒö¹íÒä¿¿‡Ò䴌 ÍҨ໚¹ÅÇ´àËÅç¡ËÃ×Í᷋§ÍÐÅÙÁàÔ ¹ÕÂÁ ·Õäè ´Œ¨Ò¡äÁŒá¢Ç¹àÊ×Íé ¡ç䴌 ´Ñ´ãˌµÃ§¨íҹǹ 2 ᷋§ »˜¡Å§ã¹´Ô¹Ë‹Ò§¡Ñ¹ »ÃÐÁÒ³ 1 ¹ÔÇé ¿Øµ ãËŒÅ¡Ö ¾Í»ÃÐÁÒ³ ᵋäÁ‹¶§Ö ¡Œ¹¡Ãжҧ áŌǵ‹ÍÊÒ »Ò¡¤Õºà¢ŒÒ¡Ñºá¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹à¾×Íè ÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ 7. ¤‹ÍÂæ à·¹éÒí ŧ㹴Թ Êѧࡵ¼ÅÅѾ¸·àÕè »ÅÕÂè ¹á»Å§ 8. à»ÅÕÂè ¹¨Ò¡´Ô¹àáˌ§»š¹¿Í§¹éÒí ËÁÒ´æ áŌǴټšÒ÷´ÅͧàÁ×Íè ¡´ ¿Í§¹éÒí

SCi-B X

Microcontroller in Science experiment

RESISTANCE

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #2

)

OUT


54

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 3

ÇÑ´¤‹ÒµÑÇà¡çº»ÃШØâ´Â㪌ἧǧ¨ÃÇÑ´¤ÇÒÁ¨Øä¿¿‡Ò (AT03-Capatance) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¤Ø³ÅѡɳТͧ¡Òõ‹ÍµÑÇà¡çº»ÃШØä¿¿‡Ò â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò CAPACITANCE 3. µÑÇà¡çº»ÃШØä¿¿‡Ò 100nF ËÃ×Í 0.1 µF 50V ¨íҹǹ 3 µÑÇ 470nF ËÃ×Í 0.47µF 50V ¨íҹǹ 1 µÑÇ 1µF 50V ¨íҹǹ 1 µÑÇ 4. ¤ÍÁ¾ÔÇàµÍÏËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

»¯ÔºµÑ ¡Ô ÒÃ

P4

P5

1. µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡¨Ø´ ST = 1 ¢Í§á¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò CAPACITANCE à¢ŒÒ·Õ¨è ´Ø P0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT03-Capacitance 3. µ‹ÍÊÒ»ҡ¤Õº·Õ¨è ´Ø ÇÑ´ CAPACITOR à¾×Íè ·´ÅͧÇÑ´¤‹ÒµÑÇà¡çº»ÃШØä¿¿‡Ò

INV-A

INV-B

CAPACITOR

B

P8-P9 MotorA P10-P11 MotorB

A

ST=0

P8 RELAY

MOTOR

C

RELAY 12V 5A

ST=1

P0

P1

P2

P3

P12 SOUND

ÃÙ»·Õè A3-1 ¡Òõ‹Íἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò CAPACITANCE à¾×Íè ÇÑ´¤‹Ò¢Í§µÑÇà¡çº»ÃШØ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

55

4. ¹íÒä»ÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡ÒàÁ×Íè µ‹ÍµÑÇà¡çº»ÃШØã¹Åѡɳе‹Ò§æ Êѧࡵ¼ÅÅѾ¸·ÍÕè ҋ ¹ä´Œ â´ÂàÅ×Í¡¡ÒÃáÊ´§¼Å䴌 ·Ñ§é ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡ 

# 100nF

' 100nF

100nF

$

 100nF

470nF

100nF

100nF 100nF

100nF

470nF 100nF

!

% 100nF 1µF

"

470nF

1µF

&

 1µF

100nF

100nF

100nF

470nF

100nF

100nF 470nF

E

ä´ÍÔàÅ硵ÃÔ¡

¢Òµ‹Í㪌§Ò¹

µÑÇà¡çº»ÃÐ¨Ø (Capacitor)

¢Òµ‹Í㪌§Ò¹

໚¹ÍØ»¡Ã³·ÕèÁÕâ¤Ã§ÊÌҧÀÒÂã¹à»š¹µÑǹíÒ 2 ʋǹ·Õè¶Ù¡¡Ñé¹´ŒÇ ©¹Ç¹ àÁ×èÍÁÕáç´Ñ¹à¡Ô´¢Öé¹ÃÐËNjҧµÑǹíÒ·Ñé§Êͧ ¨Ðà¡Ô´»ÃШØä¿¿‡Ò¢Öé¹ à¾Åµ ÃÐËNjҧµÑǹíÒ ¡ÒÃà¡çº»ÃШØä¿¿‡Ò¤×;×é¹°Ò¹¡Ò÷íÒ§Ò¹¢Í§µÑÇà¡çº (¡) â¤Ã§ÊÌҧ »ÃÐ¨Ø µÑǹíÒ·Ñé§ÊͧÀÒÂã¹µÑÇà¡çº»ÃШبÐÁÕÅѡɳÐ໚¹á¼‹¹ àÃÕÂ¡Ç‹Ò à¾Åµ (plate) ʋǹ©¹Ç¹·Õ¡è ¹Ñé ÍÂÙË ÐËNjҧà¾Åµ·Õàè ÃÕÂ¡Ç‹Ò ä´ÍÔàÅç¡·ÃÔ¡ (dielectric) ¤ÇÒÁÊÒÁÒö㹡ÒÃà¡çº»ÃШØä¿¿‡Ò¢Í§µÑÇà¡çº»ÃШبТֹé ÍÂÙ¡‹ ºÑ ẺäÁ‹ÁÕ¢ÑéÇ áººâ¾ÅÕàÍÊàµÍÏ, à«ÃÒÁÔ¡, äÁŋÒÏ ¢¹Ò´¢Í§à¾ÅµáÅЪ¹Ô´¢Í§ä´ÍÔàÅ硵ÃÔ¡ ã¹ÃÙ»·Õè 1-3 áÊ´§â¤Ã§ÊÌҧáÅÐ ÊÑ­Åѡɳ µÑÇà¡çº»ÃШط¹Õè ÂÔ Á㪌§Ò¹¤×Í áººà«ÃÒÁÔ¡, â¾ÅÕàÍÊàµÍÏ, äÁŋÒÏ ẺÍÔàÅç¡·ÃÍäŵ (ÁÕ¢ÑéÇ) ẺÁÕ¢ÑéÇ (äÁ‹ÁÕ¢ÑéÇ), ÍÔàÅç¡·ÃÍäŵ áÅÐá·¹·ÒÅÑèÁ (ÁÕ¢ÑéÇ) ª¹Ô´¢Í§µÑÇà¡çº»ÃШبР(¢) ÊÑ­Åѡɳ (¤) ÃٻËҧ àÃÕ¡µÒÁÇÑÊ´Ø·Õè¹íÒÁÒ㪌໚¹ä´ÍÔàÅ硵ÃÔ¡ µÑÇà¡ºç »Ã Ð¨

+

0.1µF

Ø


56

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Òõ‹ÍµÑÇà¡çº»ÃШØËÅÒÂæ µÑÇࢌҴŒÇ¡ѹ㹡Ò÷´Åͧ¹ÕÊé ÒÁÒö·íÒ䴌ËÅÒÂÇÔ¸Õ (¡) 㪌¡Òþѹ¢ÒࢌҴŒÇ¡ѹ (¢) 㪌ÊÒ»ҡ¤Õºµ‹Íµ‹ÍÃÐËNjҧµÑÇà¡çº»ÃÐ¨Ø 5. ·´Åͧ¤íҹdz¼ÅµÒÁ·ÄÉ®Õà»ÃÕºà·Õº¡Ñ¹ 6. ·íÒ¡Ò÷´Åͧ«éÒí ᵋà»ÅÕÂè ¹¨Ø´µ‹Í¢Í§á¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò CAPACITANCE ¨Ò¡ ST=1 ໚¹ ST=0 áŌÇÊÅѺÊÒ»ҡ¤Õº¨Ò¡ÊÒ·Õ赋͡Ѻ¢ÒºÇ¡¢Í§µÑÇà¡çº»ÃÐ¨Ø (¡Ã³ÕÇÑ´µÑÇà¡çº»ÃШØẺÍÔàÅç¡·ÃÍäŵ·ÕèÁÕ¢ÑéÇ) ÁÒµ‹Í·Õ¢è Òź ʋǹÊÒ·յè ͋ ¡Ñº¢Òźà´ÔÁ à»ÅÕÂè ¹ä»µ‹Í¡Ñº¢ÒºÇ¡á·¹ ¨Ò¡¹Ñ¹é ÇÑ´¤‹ÒáŌÇà»ÃÕºà·Õº¼Å¡ÒÃÇÑ´ ¤‹Ò¢Í§·Ñ§é Êͧ¡Ã³Õ 7. ·´Åͧ¹íÒµÑÇà¡çº»ÃШت¹Ô´Í×¹è ·ÕÁè ¤Õ Ò‹ ¤ÇÒÁ¨Ø෋ҡѹ Êѧࡵ¼Å·Õäè ´Œ¨Ò¡¡Ò÷´Åͧ

SCi-B X

Microcontroller in Science experiment

E

¡ÒÃáÊ´§¤‹Ò¢Í§µÑÇà¡çº»ÃШØ

ÁÕ 2 Ẻ¤×Í áººÃкØÁҪѴਹ ¨Ð¾ºã¹µÑÇà¡çº»ÃШØẺÍÔàÅç¡·ÃÍäŵáÅÐẺâ¾ÅÕàÍÊàµÍÏ ·ÕÃè кغ¹ µÑǶѧàÅÂÇ‹Ò Áդҋ ෋Òã´ áÅз¹áç´Ñ¹ä´Œà·‹Ò㴠Ẻ·Õè 2 ºÍ¡à»š¹àŢ¡¡íÒÅѧ¢Í§Ë¹‹Ç¾Ôâ¡¿ÒÃÑ´ ¡µÑÇÍ‹ҧ ¤‹Ò 104 ËÁÒ¶֧ 1x104 ¢Í§Ë¹‹Ç¾Ôâ¡¿ÒÃÑ´ (pF) ¨Ð෋ҡѺ 1 ¹Ò⹿ÒÃÑ´ (nF) ËÃ×Í 0.1 äÁâ¤Ã ¿ÒÃÑ´ (µF) ÁÑ¡¾ºã¹µÑÇà¡çº»ÃШØẺà«ÃÒÁÔ¡ áÅÐäÁŋÒÏ ˹‹Ç¢ͧµÑÇà¡çº»ÃШØàÃÕ§ÅíҴѺ¨Ò¡Ë¹‹ÇÂàÅç¡ä»¶Ö§Ë¹‹ÇÂãË­‹·¹Õè ÂÔ Á㪌§Ò¹ ÊÃػ䴌´§Ñ ¹Õé ¾Ôâ¡¿ÒÃÑ´ (pF) Áդҋ µÑǤٳàŢ¡¡íÒÅѧàÁ×Íè à·Õº¡ÑºË¹‹Ç¿ÒÃѴ෋ҡѺ 10-12 ¿ÒÃÑ´ (F) ¹Ò⹿ÒÃÑ´ (nF) Áդҋ µÑǤٳàŢ¡¡íÒÅѧàÁ×Íè à·Õº¡ÑºË¹‹Ç¿ÒÃѴ෋ҡѺ 10-9 ¿ÒÃÑ´ (F) äÁâ¤Ã¿ÒÃÑ´ (µF) Áդҋ µÑǤٳàŢ¡¡íÒÅѧàÁ×Íè à·Õº¡ÑºË¹‹Ç¿ÒÃѴ෋ҡѺ 10-6 ¿ÒÃÑ´ (F) ¤‹Ò¢Í§µÑÇà¡çº»ÃШطÁÕè ¨Õ Òí ˹‹ÒÂÁդҋ µÑ§é ᵋäÁ‹¡¾Õè âÔ ¡¿ÒÃѴ仨¹¶Ö§ËÅÒÂæ ¾Ñ¹äÁâ¤Ã¿ÒÃÑ´ ʋǹÍѵÃÒ¡Ò÷¹áç´Ñ¹¹Ñ¹é ÁÕãˌàÅ×Í¡µÑ§é ᵋ 6.3V 仨¹¶Ö§ËÅÒÂÌÍÂâÇŵ ᵋ·¹Õè ÂÔ Á¨ÐÍÂÙ㋠¹ÃдѺ 16-50V

¡Òäíҹdz¤‹Ò¤ÇÒÁ¨Øä¿¿‡ÒÃÇÁàº×éͧµŒ¹ ǧ¨Ã͹ءÃÁ ¤íҹdz䴌¨Ò¡ Ct =

1 1 1 1 + + ... + C1 C1 Cn

ǧ¨Ã¢¹Ò¹ ¹íÒ¤‹Ò¢Í§µÑÇà¡çº»ÃШط§Ñé ËÁ´ÁÒÃÇÁ¡Ñ¹ µÒÁ¤ÇÒÁÊÑÁ¾Ñ¹¸ Ct = C1 + C2 + ... + Cn


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

57

¡Ô¨¡ÃÃÁ·Õè 4

ÇÑ´¡ÃÐáÊ俵çã¹Ç§¨Ãâ´Â㪌ἧǧ¨ÃÇÑ´¡ÃÐáÊ ä¿¿‡Ò (AT04-Current) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃÇÑ´¡ÃÐáÊä¿¿‡Òã¹Ç§¨Ã â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò CURRENT 3. µÑǵŒÒ¹·Ò¹ä¿¿‡Ò ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ ÃËÑÊÊÕ 4 ᶺ ±5% ÃËÑÊÊÕẺ 5 ᶺ ±1% ¹éÒí µÒÅ-´íÒ-´íÒ-·Í§ ¹éÒí µÒÅ-´íÒ-´íÒ-·Í§-¹éÒí µÒÅ ¨íҹǹ 1 µÑÇ 10Ω 1/2W ¹éÒí µÒÅ-à¢ÕÂÇ-´íÒ-·Í§ ¹éÒí µÒÅ-à¢ÕÂÇ-´íÒ-·Í§-¹éÒí µÒÅ ¨íҹǹ 1 µÑÇ 15Ω 1/2W ʌÁ-´íÒ-´íÒ-·Í§ ʌÁ-´íÒ-´íÒ-·Í§-¹éÒí µÒÅ ¨íҹǹ 2 µÑÇ 30Ω 1/2W 4. ẵàµÍÃÕè 1.5V ¨íҹǹ 2 ¡ŒÍ¹, ẵàµÍÃÕè 9V ¨íҹǹ 1 ¡ŒÍ¹ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. ¡ÐºÐ¶‹Ò¹ 1 ¡ŒÍ¹áººÁÕÊÒÂä¿ ¨íҹǹ 2 µÑÇ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 6. ¢ÑÇé ¶‹Ò¹ 9V ¨íҹǹ 1 ªØ´ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 7. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¡ÃÐáÊä¿¿‡ÒäËÅ

¤Ø³ÊÁºÑµ¢Ô ͧἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò CURRENT

»¯ÔºµÑ ¡Ô ÒÃ

Rs 0.5Ω

x10

Vout

ÁÕµÇÑ µŒÒ¹·Ò¹ 0.5Ω µ‹Í¢¹Ò¹¡Ñº¨Ø´ÇÑ´¡ÃÐáÊ à¾×Íè ·íÒ˹ŒÒ·Õè ໚¹µÑÇÇÑ´¡ÃÐáÊ àÁ×Íè ¡ÃÐáÊäËż‹Ò¹ ¨Ðãˌáç´Ñ¹µ¡¤Ã‹ÍÁ ÍÍ¡ÁÒ¤‹ÒË¹Ö§è ¨Ò¡¹Ñ¹é ·íÒ¡ÒâÂÒÂÍÕ¡ 10 à·‹Ò à»š¹áç´Ñ¹ ·ÕÇè ´Ñ ä´Œ ¤Ô´à»š¹ÍѵÃÒʋǹáç´Ñ¹µ‹Í¡ÃÐáʤ×Í 5mV/mA áÅРǧ¨Ã¹ÕÇé ´Ñ ä´ŒÊ§Ù ÊØ´ 1A

1. µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡á¼§Ç§¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò CURRENT à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT04-Current 3. µ‹ÍÊÒ»ҡ¤Õº·Õ¨è ´Ø ÇÑ´¢Í§á¼§Ç§¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò CURRENT à��×Íè ·´ÅͧÇÑ´¤‹Ò¡ÃÐáÊä¿¿‡Ò


58

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÃÙ»·Õè A4-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT04-Current ã¹â»Ãá¡ÃÁ SCi-BOX Activity 4. ¨Ò¡¹Ñ¹é ¹íÒ仵‹Í·´Åͧ¡Ñº¶‹Ò¹ä¿©ÒÂáÅеÑǵŒÒ¹·Ò¹ â´Âãˌ¨´Ø ÇÑ´¡ÃÐáÊ͹ءÃÁ¡ÑºÇ§¨Ã µÑÇÍ‹ҧ´Ñ§ÃÙ»

0.5Ω

1.5V

OUT CURRENT

¨Ø´µ‹ÍÇÑ´ ¡ÃÐáÊä¿¿‡Ò

)

Ω

0.5Ω

1.5V

OUT CURRENT

¨Ø´µ‹ÍÇÑ´ ¡ÃÐáÊä¿

)

#Ω

1.5V

0.5Ω

'8

OUT CURRENT

¨Ø´µ‹ÍÇÑ´ ¡ÃÐáÊä¿

)

!Ω

㹡ÒÃ㪌¶Ò‹ ¹ä¿©Ò 1.5V ¤ÇÃãʋŧ㹡кж‹Ò¹ ¨Ò¡¹Ñ¹é µ‹ÍÊÒÂࢌҡѺǧ¨Ãâ´Â㪌ÊÒ»ҡ¤Õºª‹Ç ʋǹ ¶‹Ò¹ËÃ×ÍẵàµÍÃÕè 9V ¤ÇÃ㪌¢ÇÑé ¶‹Ò¹ÁÒµ‹Íà¢ŒÒ·Õ¨è ´Ø ¨‹ÒÂáç´Ñ¹ ¨Ò¡¹Ñ¹é ¹íÒÊÒ¢ͧ¢ÑÇé ¶‹Ò¹¹Ñ¹é ÁÒµ‹Íǧ¨Ãà¾×Íè ·íÒ ¡Ò÷´Åͧ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

59

5. àÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§ ǧ¨ÃËÅÑ¡ »ÃÒ¡¯¼Å¡Ò÷´Åͧ´Ñ§¹Õé ǧ¨Ã·Õè 1 ÇÑ´¤‹Ò¡ÃÐáÊä¿¿‡Ò䴌෋ҡѺ ................................... ǧ¨Ã·Õè 2 ÇÑ´¤‹Ò¡ÃÐáÊä¿¿‡Ò䴌෋ҡѺ ................................... ǧ¨Ã·Õè 3 ÇÑ´¤‹Ò¡ÃÐáÊä¿¿‡Ò䴌෋ҡѺ ................................... 6. ·´Åͧà»ÅÕÂè ¹¤‹ÒµÑǵŒÒ¹·Ò¹·Õãè ªŒ¨Òí ¡Ñ´¡ÃÐáÊã¹Ç§¨ÃËÅÒÂæ ¤‹Ò ãˌ´·Ù ÈÔ ·Ò§¢Í§¡ÃÐáÊä¿¿‡Ò´ŒÇ Êѧࡵ¼Å ·ÕÇè ´Ñ ä´Œã¹¡ÒÃᵋª´Ø ·´Åͧ¤íҹdz¼ÅµÒÁ·ÄÉ®Õà»ÃÕºà·Õº¡Ñ¹ (Í‹ÒÅ×ÁNjҡÒõ‹Íà¾×Íè ÇÑ´¡ÃÐáÊ ¨ÐµŒÍ§¤Ô´¤‹Ò ¢Í§µÑǵŒÒ¹·Ò¹ 0.5Ω ࢌÒä»ã¹Ç§¨Ã´ŒÇÂ)

¡Ò÷´Åͧà¾ÔÁè àµÔÁ CURRENT 0.5Ω

OUT

SCi-B X

Microcontroller in Science experiment

A

7. ãˌµÍ‹ ÊÒ»ҡ¤Õº¨Ò¡á¼§Ç§¨ÃÇÑ´¡ÃÐáÊä¿¿‡Òä»Âѧ¢ÑÇé ÁÍàµÍÏ俵ç 8. ·´ÅͧËÁع᡹ÁÍàµÍϴnj ¤ÇÒÁàÃçǵ‹Íà¹×Íè § ·Ñ§é ·ÔȵÒÁà¢çÁ¹Ò́¡Ò áÅзǹà¢çÁ¹Ò́¡Ò Êѧࡵ¤‹Ò·Õè͋ҹ䴌 ÃÇÁ¶Ö§¡Ò÷´ÅͧËÁعàÃçÇ¢Öé¹ Êѧࡵ¼Å àÁ×Íè ËÁعÁÍàµÍÏ㹷ÔȵÒÁà¢çÁ¹Ò́¡Ò ÇÑ´¤‹Ò¡ÃÐáÊä¿¿‡Ò䴌෋ҡѺ ................................... àÁ×Íè ËÁعÁÍàµÍÏ㹷Ôȷǹà¢çÁ¹Ò́¡Ò ÇÑ´¤‹Ò¡ÃÐáÊä¿¿‡Ò䴌෋ҡѺ ................................... ·íÒäÁ¨Ö§à»š¹àª‹¹¹Ñ¹é ?


60

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 5

ÇÑ´áç´Ñ¹ä¿µÃ§â´Â㪌ἧǧ¨ÃÅ´·Í¹áç´Ñ¹ (AT05- Attenuator) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃÇÑ´áç´Ñ¹ä¿µÃ§ã¹Ç§¨Ã â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÅ´·Í¹áç´Ñ¹ Attenuator 3. ẵàµÍÃÕè 9 V ¾ÃŒÍÁ¢ÑÇé ẵàµÍÃÕè 4. µÑǵŒÒ¹·Ò¹ä¿¿‡Ò ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ ÃËÑÊÊÕ 4 ᶺ ±5% ¹éÒí µÒÅ-´íÒ-á´§-·Í§ 1kΩ á´§-´íÒ-á´§-·Í§ 2kΩ à¢ÕÂÇ-´íÒ-¹éÒí µÒÅ-·Í§ 500Ω 5. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

ÃËÑÊÊÕẺ 5 ᶺ ±1% ¹éÒí µÒÅ-´íÒ-´íÒ-¹éÒí µÒÅ-¹éÒí µÒÅ á´§-´íÒ-´íÒ-¹éÒí µÒÅ-¹éÒí µÒÅ à¢ÕÂÇ-´íÒ-´íÒ-´íÒ-¹éÒí µÒÅ

¨íҹǹ 2 µÑÇ ¨íҹǹ 1 µÑÇ ¨íҹǹ 1 µÑÇ

¤Ø³ÊÁºÑµ¢Ô ͧἧǧ¨ÃÅ´·Í¹áç´Ñ¹ä¿¿‡Ò Attenuator 1M

Vin 1M

1

Ratio 1 : input 0-5V

1/2 Ratio 1/2 : input 0-10V

Vout

ÁÕµÇÑ µŒÒ¹·Ò¹ 1MΩ 2 µÑǵ‹Í¡Ñ¹à»š¹Ç§¨Ãẋ§áç´Ñ¹ ·íÒ˹ŒÒ·Õàè »š¹âËÅ´ãˌ¡ºÑ ǧ¨Ã â´Â»ÃѺÍѵÃÒʋǹ áç´Ñ¹·ÕÇè ´Ñ à»š¹ 1 ËÃ×Í 1/2 (ẋ§¤ÃÖ§è ) ·íÒãˌÇÊÒÁÒöÇÑ´áç´Ñ¹ÍÔ¹¾Øµä´ŒÊ§Ù ¢Ö¹é 2 ෋ҴŒÇÂ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

61

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡á¼§Ç§¨ÃÅ´·Í¹áç´Ñ¹ Attenuator à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. àÅ×Í¡ÍѵÃÒÅ´·Í¹áç´Ñ¹à»š¹ 1/2 3. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT05-Attenuator 4. µ‹ÍÊÒ»ҡ¤Õº·Õ¨è ´Ø ÇÑ´ VOLT ¢Í§á¼§Ç§¨ÃÅ´·Í¹áç´Ñ¹ Attenuator à¾×Íè ·´ÅͧÇÑ´¤‹Òáç´Ñ¹µÒÁ¨Ø´µ‹Ò§æ ¢Í§Ç§¨Ãã¹ÃÙ»·Õè A5-2 â´ÂàÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§ µ‹ÍࢌҷÕè¨Ø´µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡ ¡Òõ‹Íǧ¨ÃÊÒÁÒö㪌ÊÒ»ҡ¤ÕºËÃ×;ѹ¢ÒÍØ»¡Ã³à¢ŒÒ´ŒÇ¡ѹ ʋǹ ẵàµÍÃÕè 9V ¤Çõ‹Í¢ÑÇé ẵàµÍÃÕ¡è ͋ ¹ ¨Ò¡¹Ñ¹é ¨Ö§¹íÒÊÒ¨ҡ¢ÑÇé ẵàµÍÃÕÁè Òµ‹Íǧ¨Ã 5. ·íÒ¡ÒäíҹdzËÒ¤‹Òáç´Ñ¹µ¡¤Ã‹ÍÁµÒÁ¨Ø´µ‹Ò§æ ¢Í§Ç§¨Ã·´Åͧã¹ÃÙ»·Õè A5-2 áŌÇà»ÃÕºà·Õº¡Ñº¤‹Ò·ÕÇè ´Ñ ä´Œ¨Ò¡¢Ñ¹é µÍ¹·Õè 4

ÃÙ»·Õè A5-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT05-Attenuator ã¹â»Ãá¡ÃÁ SCi-BOX Activity


62

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X A 500Ω

l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ A - B 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ A - C 䴌......................V

B 9V

l ÇÑ´¤Ã‹ÍÁẵàµÍÃÕè 9 V 䴌áç´Ñ¹à·‹Ò¡Ñº........V

l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ A - D 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´

1kΩ C 1kΩ D 2kΩ E

A - E 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ B - C 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ B - D 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ B - E 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ C - D 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ C - E 䴌......................V l ÇÑ´áç´Ñ¹ÃÐËNjҧ¨Ø´ D - E 䴌......................V

ÃÙ»·Õè A5-2 ǧ¨ÃÊíÒËÃѺ·´Åͧ㹡Ԩ¡ÃÃÁ AT05-Attenuator à¾×Íè ·´ÅͧÇÑ´áç´Ñ¹ä¿µÃ§ã¹Ç§¨Ã

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #1 6. Ëҿͧ¹éÒí ˹һÃÐÁÒ³ 1 ¹ÔÇé ªØº¹éÒí ¾ÍËÁÒ´ ¹íÒἋ¹·Í§á´§ áÅÐἋ¹ÍÐÅÙÁàÔ ¹ÕÂÁ ÇÒ§»ÃСº·Ñ§é Êͧ´ŒÒ¹ áŌǵ‹ÍÊÒ»ҡ¤Õºä»Âѧἧǧ¨ÃÅ´·Í¹áç´Ñ¹ Atteuator àÅ×Í¡ ¨ÑÁê à»ÍÏŴ·Í¹ä»·Õµè Òí á˹‹§ “1” ¹Ñ¹è ¤×ÍäÁ‹Á¡Õ ÒÃÅ´·Í¹áç´Ñ¹ ÇÑ´áç´Ñ¹ä¿¿‡Ò Êѧࡵ ¼Åº¹Ë¹ŒÒ¨Í¤Ãѧé áá ¨Ò¡¹Ñ¹é ¹íÒ¹éÒí ÁйÒÇË´ŧ仺¹¿Í§¹éÒí ·ÕÅйŒÍ Êѧࡵ¼Å·Õäè ´Œ

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #2

µ‹Íä»Âѧἧǧ¨Ã Å´·Í¹áç´Ñ¹

7. ¹íÒ᷋§âÅËÐÊͧ᷋§¨Ò¡¡Ò÷´Åͧà¾ÔÁè àµÔÁ #1 àÊÕºŧã¹ÁйÒÇ, ËÑÇÁѹ½Ãѧè , ͧع‹ , ʌÁ, ½Ãѧè Êѧࡵ¼Å¢Í§ ¡ÒÃÇÑ´áç´Ñ¹·Õäè ´Œ ¼Å¢Í§¡ÒÃÇÑ´áç´Ñ¹ã¹ÁйÒÇ ÇÑ´áç´Ñ¹ä´Œ .......................................V ¼Å¢Í§¡ÒÃÇÑ´áç´Ñ¹ã¹ËÑÇÁѹ½Ãѧè ÇÑ´áç´Ñ¹ä´Œ .......................................V ¼Å¢Í§¡ÒÃÇÑ´áç´Ñ¹ã¹Í§Ø‹¹ ÇÑ´áç´Ñ¹ä´Œ .......................................V ¼Å¢Í§¡ÒÃÇÑ´áç´Ñ¹ã¹ÊŒÁ ÇÑ´áç´Ñ¹ä´Œ .......................................V ¼Å¢Í§¡ÒÃÇÑ´áç´Ñ¹ã¹½ÃÑè§ ÇÑ´áç´Ñ¹ä´Œ .......................................V ·íÒäÁ¨Ö§à»š¹àª‹¹¹Ñ¹é ?

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

63

¡Ô¨¡ÃÃÁ·Õè 6

àŋ¹¡Ñº¤Ø³ÊÁºÑµÔ¢Í§áʧâ´Â㪌ἧǧ¨ÃµÃǨ¨Ñº áʧ (AT06- Light) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃÇÑ´¤ÇÒÁࢌÁáʧ â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃµÃǨ¨Ñºáʧ LDR Light sensor 3. ä¿©Ò äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 4. Ἃ¹¾ÅÒʵԡãÊÊյҋ §æ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. Ἃ¹â¾ÅÒäë 2 Ἃ¹ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 6. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµáÔ ¼§Ç§¨ÃµÃǨ¨Ñºáʧ LDR Light sensor (¾Ô¨ÒÃ³Ò·Õ¨è ´Ø µ‹Íá»Ã¼Ñ¹µÒÁáʧ) +5V. LDR

10k

໚¹¡ÒÃÇÑ´â´Â㪌෤¹Ô¤¡ÒÃẋ§áç´Ñ¹ 㪌µÑǵŒÒ¹·Ò¹á»Ã¤‹ÒµÒÁáʧ ËÃ×Í LDR ·Õ·è Òí ¨Ò¡á¤´àÁÕÂÁ«ÑÅä¿´ (CdS) àÁ×Íè ÁÕáʧµ¡¡Ãзº ¤‹Ò¤ÇÒÁ µŒÒ¹·Ò¹¢Í§ LDR ¨ÐŴŧ ʋ§¼Åãˌáç´Ñ¹µ¡¤Ã‹ÍÁµÑǵŒÒ¹·Ò¹ 10kW PORT Áդҋ ÁÒ¡¢Ö¹é ¹Ñ¹è ¤×Í·Õ¨è ´Ø µ‹Í PORT Íѹ໚¹àÍÒµ¾µØ ¡ç¨ÐÁÕáç´Ñ¹ÊÙ§¢Ö¹é µÒÁ ä»´ŒÇ ᵋ¶ÒŒ áʧ·Õµè ¡¡Ãзº LDR ÁÕ¤ÇÒÁࢌÁŴŧ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ ¢Í§ LDR ¨ÐÁÒ¡¢Ö¹é ʋ§¼Åãˌáç´Ñ¹àÍÒµ¾µØ Ŵŧ

+

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñºáʧ LDR Light sensor ·Õ¨è ´Ø µ‹Í + à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT06-Light 3. ¨Ò¡¹Ñ¹é ¹íÒä»·´ÅͧÇÑ´¤‹Ò¤ÇÒÁࢌÁáʧã¹ÊÀÒÇе‹Ò§æ ¡Ñ¹ Êѧࡵ¼ÅÅѾ¸·ÍÕè ҋ ¹ä´Œ â´ÂàÅ×Í¡¡ÒÃáÊ´§¼Å䴌 ·Ñ§é ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡


64

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÃÙ»·Õè A6-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT06-Light ã¹â»Ãá¡ÃÁ SCi-BOX Activity áËŋ§¡íÒà¹Ô´áʧ (ä¿©ÒÂ)

Ἃ¹¾ÅÒʵԡãÊÊյҋ §æ ἧǧ¨ÃµÃǨ¨Ñºáʧ LDR Light sensor ·´ÅͧàÅ×Íè ¹ä»-ÁÒ µ‹ÍÊÒÂä»Âѧ¨Ø´ SENSOR0 ¢Í§ SCi-BOX

ÃÙ»·Õè A6-2 ¡Ò÷´Åͧ¤Ø³ÊÁºÑµ¢Ô ͧáʧáÅСÒÃÃѺáʧ¢Í§á¼§Ç§¨ÃµÃǨ¨Ñºáʧ LDR LIght sensor 㹡Ԩ¡ÃÃÁ AT06-Light ¢Í§ SCi-BOX Activity ¡Ò÷´Åͧ¤×Í Ê‹Í§áʧ¨Ò¡ä¿©Ò¼‹Ò¹µÑÇ¡Åҧ͋ҧἋ¹¾ÅÒʵԡãÊÊÕµ‹Ò§æ à¾×èÍ·´ÊÍºÇ‹Ò áʧ¨Ð ÊÒÁÒö¼‹Ò¹µÑÇ¡ÅҧẺ¹Õäé »ä´Œ´àÕ ¾Õ§äà â´Âἧǧ¨ÃµÃǨ¨Ñºáʧ¨Ð¤ÍÂÃѺáʧ·Õ¼è ҋ ¹µÑÇ¡ÅÒ§ÁÒ áç´Ñ¹·ÕÍè Í¡ ¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñºáʧ¨Ð໚¹µÑÇ·Õºè §‹ ºÍ¡Ç‹Ò áʧÊÒÁÒö¼‹Ò¹µÑÇ¡ÅҧἋ¹¾ÅÒʵԡãÊÊÕã´ä´Œ´¡Õ Njҡѹ «Ö§è ã¹ ¡Ò÷´Åͧ¨ÃÔ§ÍÒ¨µŒÍ§ÁÕ¡ÒûÃѺµíÒá˹‹§¢Í§á¼§Ç§¨ÃµÃǨ¨Ñºáʧ´ŒÇ à¾×èÍãˌ¡ÒõÃǨ¨Ñº·íÒ䴌¼Å´Õ·ÕèÊØ´ áÅÐÅ´¡ÒÃú¡Ç¹¨Ò¡áʧÀÒ¹͡´ŒÇÂ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

65

4. à»ÅÕÂè ¹µÑÇ¡ÅÒ§¨Ò¡á¼‹¹¾ÅÒʵԡãÊ໚¹á¼‹¹â¾ÅÒäë (polarize) 2 Ἃ¹ ¨Ñ´ÇÒ§µÒÁÃÙ»·Õè A6-3 áŌǷíÒ¡Òà ·´ÅͧÇÑ´¤‹Ò¤ÇÒÁࢌÁáʧã¹ÊÀÒÇе‹Ò§æ

ἧǧ¨Ã µÃǨ¨Ñºáʧ

ÇҧἋ¹â¾ÅÒäë Ἃ¹ááã¹á¹ÇµÑ§é

ËÁعἋ¹â¾ÅÒäëã¹ÁØÁµ‹Ò§æ áŌǷ´ÅͧÇÑ´áʧã¹áµ‹ÅЪ‹Ç§ ¤ÇÒÁÊNjҧ·Õµè ¡¡Ãзº

áËŋ§¡íÒà¹Ô´áʧ ÃÙ»·Õè A6-3 ¡Ò÷´Åͧ¤Ø³ÊÁºÑµ¢Ô ͧáʧáÅСÒÃÃѺáʧ¢Í§á¼§Ç§¨ÃµÃǨ¨Ñºáʧ LDR LIght sensor àÁ×Íè 㪪ŒµÇÑ ¡Åҧ໚¹á¼‹¹â¾ÅÒäë 2 Ἃ¹ Çҧ㹷Õáè µ¡µ‹Ò§¡Ñ¹

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 5. ·´Åͧà»ÅÕÂè ¹ä»ãªŒ¨´Ø µ‹ÍàÍÒµ¾µØ Ẻá»Ã¼¡¼Ñ¹¡Ñºáʧ¢Í§á¼§Ç§¨ÃµÃǨ¨Ñºáʧ LDR Light sensor Êѧࡵ ¼Å·Õèà»ÅÕè¹á»Å§

SCi-B X

Microcontroller in Science experiment


66

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 7

ÊÇÔµª¤Çº¤ØÁä¿ 4 ´Ç§ â´Â㪌ἧǧ¨ÃÊÇÔµª (AT07-Switch) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´ÅͧµÔ´µ‹Í¡ÑºÍØ»¡Ã³µÃǨ¨ÑºÅͨԡ l à¾×Í è ãˌÊÒÁÒö»ÃÐÂØ¡µãªŒá¼§Ç§¨ÃÊÇÔµªã¹¡ÒÃÊÌҧÃкº¤Çº¤ØÁÍ‹ҧ§‹Ò â´Â㪌ÊÇÔµªà¾Õ§µÑÇà´ÕÂÇÊѧè ແ´ »´ä¿ 4 ´Ç§äŋàÃÕ§¡Ñ¹ l

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÊÇÔµª 3. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

ÃÙ»·Õè A7-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT07-Switch ã¹â»Ãá¡ÃÁ SCi-BOX Activity


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

67

»¯ÔºµÑ ¡Ô ÒÃ

P11 P10

P9

P3

1. µ‹ÍÊÒ¨ҡ¨Ø´µ‹Í HIGH ¢Í§á¼§Ç§¨ÃÊÇÔµªà¢ŒÒ·Õ¨è ´Ø µ‹Í P1 ¢Í§ SCi-BOX 2. àÅ×Í¡¨ÑÁê à»ÍÏ RELAY/MOTOR º¹ Sci-BOX ä»·Õµè Òí á˹‹§ RELAY P8

P2

RELAY

P0

P1

MOTOR

RELAY 12V 5A

P11 RELAY P10 RELAY

RELAY 12V 5A

RELAY 12V 5A

P9 RELAY

P8 RELAY

MOTOR A

B

INV-A

INV-B

P8-P9 MotorA P10-P11 MotorB

RELAY 12V 5A

˹ŒÒÊÑÁ¼ÑʢͧÃÕàŏ àÊÁ×͹໚¹ÊÇÔµªµÑ´µ‹Í

3. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT07-Switch 4. ·´Åͧ¡´ÊÇÔµª Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§ÃÕàŏàÁ×Íè ÁÕ¡Òá´ÊÇÔµ«áµ‹ÅФÃÑ§é ¾ÃŒÍÁ¡ÑºÊѧࡵ¼Å·ÕÍè ҋ ¹ä´Œº¹¨ÍÀÒ¾ ËÃ×Í·Õâè Á´ÙÅ SLCD àÁ×Íè ´ÒǹâËÅ´â»Ãá¡ÃÁáÅŒÇ LED ·Ñ§é ËÁ´¨Ð´ÑºÅ§ àÁ×Íè ¡´ÊÇÔµª ¤ÃÑ§é ·Õè 1 LED ·Õµè Òí á˹‹§ P8 ¨ÐµÔ´ ÊNjҧ ¾ÃŒÍÁ¡Ñºä´ŒÂ¹Ô àÊÕ§¡Òõ‹Í˹ŒÒÊÑÁ¼ÑʢͧÃÕàŏ P8 ã¹µíÒá˹‹§¢ÇÒÊØ´ àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 2 LED P9 µÔ´ÊNjҧ äŋàÃÕ§ÅíҴѺ仨¹¤Ãº áŌÇǹ·íÒ§Ò¹«éÒí ʋǹ¡ÒÃáÊ´§¼Åº¹¨ÍÀÒ¾áÅÐâÁ´ÙÅ LCD ¨ÐáÊ´§à»š¹µÑÇàÅ¢°Ò¹Êͧ¢¹Ò´ 4 ºÔµ â´ÂºÔµã´·Õ·è Òí §Ò¹ ¨Ð໚¹ “1” ºÔµ·Õàè ËÅ×Í໚¹ “0” ·Ñ§é ËÁ´ ¨Ö§à¡Ô´à»š¹¢ŒÍÁÙŴѧ¹Õé 0000 àÁ×Íè àÃÔÁè ·íÒ§Ò¹ 0001 àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 1 ºÔµ P8 ૵໚¹ “1” 0010 àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 2 ºÔµ P9 ૵໚¹ “1” 0100 àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 3 ºÔµ P10 ૵໚¹ “1” 1000 àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 4 ºÔµ P11 ૵໚¹ “1” 0000 àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 5 áŌÇǹ¡ÅѺ价Õè 0001 ãËÁ‹


68

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 5. à»ÅÕÂè ¹ä»ãªŒ¨´Ø µ‹Í LOW ¢Í§á¼§Ç§¨ÃÊÇÔµª Êѧࡵ¼Å·Õàè »ÅÕÂè ¹á»Å§ 6. ¨Ò¡¡Ò÷íÒ§Ò¹¢Í§ÃÕàŏ ÊÒÁÒöµ‹Í˹ŒÒÊÑÁ¼ÑÊ令Ǻ¤ØÁÍØ»¡Ã³ÀÒ¹͡䴌 â´Âµ‹Í͹ءÃÁ¡ÑºÇ§¨Ã´Ñ§ÃÙ» ÃÕàŏ

¢Ñéǵ‹Í

ËÅÍ´ä¿ 220V 60W

»ÅÑê¡ä¿ 220Vac

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

69

¡Ô¨¡ÃÃÁ·Õè 8

µÃǨ¨ÑºÇѵ¶ØẺµÑ´ÅíÒáʧ â´Â㪌ἧǧ¨ÃµÃǨ¨Ñºáʧ ÍÔ¹¿ÃÒàô (AT08-IR Beam) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃ㪌§Ò¹µÑǵÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô â´Â㪌¤³ Ø ÊÁºÑµ¡Ô ÒÃʋ§¼‹Ò¹ÅíÒáʧ

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED 3. ἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo-transistor 4. Ἃ¹¾ÅÒʵԡãÊËÃ×Í¡ÃШ¡ãÊ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. Ἃ¹¾ÅÒʵԡ·Öºáʧ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 6. Ἃ¹âÅËÐ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 7. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

PORT 510

Object

¤Ø³ÊÁºÑµÔ·Õ蹋Òʹã¨ã¹¡Ò÷íҧҹËÇÁ¡Ñ¹¢Í§á¼§Ç§¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô (Infrared LED) ¡Ñºá¼§Ç§¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo transistor +5V 10k

Vout IR LED

Photo transistor

ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED ¨Ðʋ§ áʧÍÔ¹¿ÃÒàôàÁ×èÍ䴌ÃѺÊÑ­­Ò³Åͨԡ “1” ÁÒ·Õè¢Ò PORT ·Ò§´ŒÒ¹µÑÇÃѺ·Õèἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒ àô Photo transistor ¨Ð·íÒ˹ŒÒ·ÕÃè ºÑ áʧÍÔ¹¿ÃÒàô â´Â¨Ðãˌ à ÍÒµ ¾Ø µ ໚ ¹ ÅÍ¨Ô ¡ “1” àÁ×è Í äÁ‹ ÁÕ á ʧ ÍÔ¹¿ÃÒàôÁÒµ¡¡Ãзº ¹Ñ¹è ¤×Íà¡Ô´¡Òúѧáʧ´ŒÇÂÇѵ¶Ø (object) áÅÐãˌàÍÒµ¾µØ Åͨԡ “0” àÁ×Íè ÁÕáʧÍÔ¹¿ÃÒàô µ¡¡Ãзº ¹Ñ¹è ¤×ÍäÁ‹ÁÇÕ µÑ ¶Øº§Ñ áʧÍÔ¹¿ÃÒàô

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED à¢ŒÒ·Õ¨è ´Ø µ‹Í P0 ¢Í§ SCi-BOX 2. µ‹ÍÊÒ¨ҡἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo transistor à¢ŒÒ·Õ¨è ´Ø µ‹Í P1 ¢Í§ SCi-BOX


70

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÃÙ»·Õè A8-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT08-IR Beam ã¹â»Ãá¡ÃÁ SCi-BOX Activity 3. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT08-IR Beam 4. Çҧἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàôáÅÐἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàôãËŒË¹Ñ Ë¹ŒÒࢌÒËҡѹ ˋҧ»ÃÐÁÒ³ 5 ૹµÔàÁµÃ ´Ñ§ÃÙ»·Õè A8-2 áŌǡ´ÊÇÔµª RESET º¹ SCi-BOX à¾×Íè àÃÔÁè µŒ¹¹Ñº¤‹Ò 5. ·´Åͧ¹íÒἋ¹¾ÅÒʵԡËÃ×ÍÇѵ¶Øµ‹Ò§æ ÁҵѴÅíÒáʧ Êѧࡵ¤‹Ò·Õè¹Ñºº¹¨ÍÀҾNjÒÁÕ¡ÒÃà»ÅÕè¹á»Å§ËÃ×ÍäÁ‹ ËÃ×ÍÍҨ㪌âÁ´ÙÅ SLCD 㹡ÒÃáÊ´§¼Å¡ç䴌 â´Âµ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§ SCi-BOX ¹íÒἋ¹¾ÅÒʵԡµ‹Ò§æ ÁҵѴ¼‹Ò¹ÅíÒáʧ ἧǧ¨Ã¡íÒà¹Ô´áʧ ÍÔ¹¿ÃÒàô Infrared LED

ἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo transistor µ‹Íä»Âѧ P1 ¢Í§ SCi-BOX µ‹Íä»Âѧ P0 ¢Í§ SCi-BOX

ÃÙ»·Õè A8-2 ¡Òõ‹ÍÍØ»¡Ã³·´Åͧ㹡Ԩ¡ÃÃÁ AT08-IR Beam


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

71

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #1 6. ·´Åͧ»ÃÐÂØ¡µãªŒ§Ò¹à¾ÔÁè àµÔÁ â´Â¹íÒἋ¹¾ÅÒʵԡãÊÁÒµÔ´à·» PVC ÊÕ´Òí (à·»¾Ñ¹ÊÒÂä¿) ´Ñ§ÃÙ» ¨Ò¡¹Ñ¹é ¡´ÊÇÔµª RESET º¹ SCi-BOX áŌÇÅҡᶺ¾ÅÒʵԡ·Õ·è Òí ¢Ö¹é µÑ´¼‹Ò¹ÅíÒáʧªŒÒæ Êѧࡵ¼Å ¨Ò¡¹Ñ¹é µÔ´á¶ºà·» ÊÕ´Òí à¾ÔÁè ໚¹ 6, 7 áÅÐ 8 áÅз´Åͧ«éÒí Êѧࡵ¼Å

1 cm.

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #2 7. µÑ´á¼‹¹¾ÅÒʵԡãÊ໚¹á¼‹¹¡ÅÁ áŌǵԴ෻ÊÕ´íÒ໚¹Ê‹Ç¹æ ´Ñ§ÃÙ» à¨ÒÐÃٵ窋ͧ¡ÅÒ§áÅеԴ᡹ࢌÒä» ¡´ÊÇÔµª RESET º¹ SCi-BOX áÅз´ÅͧËÁعἋ¹¾ÅÒʵԡ Êѧࡵ¼Å ÃÑÈÁÕ 2 ૹµÔàÁµÃ á¹ÇÅíÒáʧ·ÕÊè ͋ §¼‹Ò¹

4 ʋǹ

8 ʋǹ

16 ʋǹ

8. »ÃÐÂØ¡µ¹Òí ä»ãªŒ§Ò¹â´ÂãªŒÇ´Ñ ÃÐÂзҧ â´ÂãˌËÁعἋ¹¾ÅÒʵԡ仵ÒÁ¾×¹é ·Õµè ͌ §¡ÒÃÇÑ´ áÅФ‹Ò·Õäè ´Œ¨Ò¡¨Í áÊ´§¼Å໚¹¨íҹǹª‹Í§·Õ¹è ºÑ 䴌 ËÁع仵ÒÁÃÐÂзҧ

µÑÇʋ§áÅÐ µÑǵÃǨ¨Ñº

¨Ò¡ÃÙ»µÑÇÍ‹ҧ㪌Ἃ¹¡ÅÁ 16 ʋǹ ¨ÐÊÌҧÊÑ­­Ò³ 8 ¤ÃÑ§é µ‹Í 1 Ãͺ ෋ҡѺ¤Ãѧé ÅÐ 360/8 = 45 ͧÈÒ ¤Ô´à»š¹ÃÐÂзҧ 2πr / 8 = πr /4 ´Ñ§¹Ñ¹é ¶ŒÒ㪌Ἃ¹¾ÅÒʵԡÃÑÈÁÕ 2 ૹµÔàÁµÃ ¢ŒÍÁÙŢͧ¡ÒõÃǨ¨Ñº¨Ðà¾ÔÁè ·Ø¡æ ÃÐÂзҧ π/ 2 ËÃ×Í 1.57 ૹµÔàÁµÃ ¶ŒÒ͋ҹ¤‹Ò䴌 86 ÃÐÂзҧ·Õäè ´Œ¨ÃÔ§¤×Í (π/ 2) x 86 = 135 ૹµÔàÁµÃ 9. ¹Í¡¨Ò¡¹Ñ¹é ÂѧÊÒÁÒö¹íҼšÒ÷´Åͧ㹡Ԩ¡ÃÃÁ¹Õäé »»ÃÐÂØ¡µà¾×Íè ¹ÑºÊÔ§è ¢Í§ä´Œ´§Ñ ÃÙ» µÑÇʋ§ µÑÇÃѺ ÃÙ»áÊ´§¡ÒÃ㪌¹ºÑ Çѵ¶Ø··èÕ ºÖ áʧ ã¹ÃкºÊÒ¾ҹÅíÒàÅÕ§

SCi-B X

Microcontroller in Science experiment


72

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 9

µÃǨ¨ÑºÇѵ¶ØẺÊзŒÍ¹áʧ â´Â㪌ἧǧ¨ÃµÃǨ¨Ñºáʧ ÍÔ¹¿ÃÒàô (AT09-IR Reflect) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ㪌§Ò¹µÑǵÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô â´Â㪌¤³ Ø ÊÁºÑµ¡Ô ÒÃÊзŒÍ¹áʧ

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED 3. ἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo-transistor 4. Ἃ¹¾ÅÒʵԡÊÕ¢ÒÇËÃ×Í¡ÃШ¡à§Ò äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. Ἃ¹¾ÅÒʵԡÊÕ´Òí ´ŒÒ¹ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 6. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµÔ·Õ蹋Òʹã¨ã¹¡Ò÷íҧҹËÇÁ¡Ñ¹¢Í§á¼§Ç§¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô (Infrared LED) ¡Ñºá¼§Ç§¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo transistor 㹡Òà µÃǨ¨ÑºÇѵ¶ØẺÊзŒÍ¹áʧ Object

Photo transistor PORT

510

10k

IR LED Vout

+5V

ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED ¨Ðʋ§áʧÍÔ¹¿ÃÒàôàÁ×Íè ä´ŒÃºÑ ÊÑ­­Ò³Åͨԡ “1” ÁÒ·Õè ¢Ò PORT ·Ò§´ŒÒ¹µÑÇÃѺ·Õèἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo transistor ¨Ð·íÒ˹ŒÒ·ÕÃè ºÑ áʧÍÔ¹¿ÃÒàô â´Â ¨ÐãˌàÍÒµ¾µØ ໚¹Åͨԡ “1” àÁ×Íè äÁ‹ÁáÕ Ê§ÍÔ¹¿ÃÒàôÁÒµ¡¡Ãзº ¹Ñ¹è ¤×ÍäÁ‹Á¡Õ ÒÃÊзŒÍ¹áʧ¨Ò¡Çѵ¶Ø (object) áÅÐãˌàÍÒµ¾µØ Åͨԡ “0” àÁ×Íè ÁÕáʧÍÔ¹¿ÃÒàôµ¡¡Ãзº ¹Ñ¹è ¤×Í ÁÕ¡ÒÃÊзŒÍ¹áʧÍÔ¹¿ÃÒàô¡ÅѺÁÒ¨Ò¡Çѵ¶Ø


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

73

ÃÙ»·Õè A9-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT09-IR Reflect ã¹â»Ãá¡ÃÁ SCi-BOX Activity

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED à¢ŒÒ·Õ¨è ´Ø µ‹Í P0 ¢Í§ SCi-BOX 2. µ‹ÍÊÒ¨ҡἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô Photo transistor à¢ŒÒ·Õ¨è ´Ø µ‹Í P1 ¢Í§ SCi-BOX 3. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT09-IR Reflect 4.Çҧἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàôáÅÐἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàôãËŒË¹Ñ Ë¹ŒÒä»ã¹·Ò§à´ÕÂǡѹáÅÐÇÒ§ªÔ´ ¡Ñ¹ ´Ñ§ÃÙ»·Õè A9-2 áŌǡ´ÊÇÔµª RESET à¾×Íè àÃÔÁè µŒ¹¹Ñº¤‹Ò ¹íÒÇѵ¶Øµ‹Ò§æ ÁÒá¡Ç‹§Ë¹ŒÒµÑǵÃǨ¨Ñº ·´Åͧ·ÕèÃÐÂÐˋҧ µ‹Ò§æ¡Ñ¹ ἧǧ¨ÃµÃǨ¨Ñº ἧǧ¨Ã¡íÒà¹Ô´áʧ áʧÍÔ¹¿ÃÒàô ÍÔ¹¿ÃÒàô Photo transistor Infrared LED

ÃÙ»·Õè A9-2 ¡ÒèѴÇҧἧǧ¨ÃµÃǨ¨Ñº áʧÍÔ¹¿ÃÒàôà¾×Íè µÃǨ¨ÑºÇѵ¶Øâ´Â㪌 ¡ÒÃÊзŒÍ¹áʧÍÔ¹¿ÃÒàô㹡Ԩ¡ÃÃÁ AT-09 IR Reflect


74

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

5. ·´Åͧ¹íÒἋ¹¾ÅÒʵԡËÃ×ÍÇѵ¶ØµÒ‹ §æ ÁÒá¡Ç‹§¼‹Ò¹Ë¹ŒÒµÑǵÃǨ¨Ñº â´Â·´Åͧ·Õ¤è ÇÒÁˋҧµ‹Ò§¡Ñ¹ Êѧࡵ¤‹Ò ·Õ¹è ºÑ º¹¨ÍÀҾNjÒÁÕ¡ÒÃà»ÅÕÂè ¹á»Å§ËÃ×ÍäÁ‹ ËÃ×ÍÍҨ㪌âÁ´ÙÅ SLCD 㹡ÒÃáÊ´§¼Å¡ç䴌 â´Âµ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§ SCi-BOX

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 6. ·´Åͧ»ÃÐÂØ¡µãªŒ§Ò¹à¾ÔÁè àµÔÁ໚¹µÑǹѺÃͺà¾ÅÒ â´ÂËÒ·‹Í¾ÅÒʵԡËÃ×Í᷋§Çѵ¶Ø·Ã§¡Ãк͡Í×¹è æ ·ÕÁè àÕ ÊŒ¹ ¼‹Ò¹Èٹ¡ÅÒ§»ÃÐÁÒ³ 1 ¹ÔéÇ¢Öé¹ä» ¾Ñ¹Ãͺ᡹´ŒÇÂà·»¾Ñ¹ÊÒÂä¿ÊÕ´íÒãˌÃͺáÅеԴᶺÊзŒÍ¹áʧ ઋ¹ ʵԡà¡ÍÏÊàÕ §Ô¹ËÃ×ÍÊÕ¢ÒÇ ´Ñ§ÃÙ»µÑÇÍ‹ҧ ¨Ò¡¹Ñ¹é ¡´ÊÇÔµª RESET áŌǷ´ÅͧËÁع·‹Í¾ÅÒʵԡä»Ãͺæ ãˌÍÂÙ㋠¹ á¹Ç¢Í§µÑǵÃǨ¨Ñº Êѧࡵ¼Å·Õàè ¡Ô´¢Ö¹é 㹡ÒÃËÁعᵋÅÐÃͺ µÑÇÃѺ

ᶺÊзŒÍ¹áʧ

µÑÇʋ§ ËÁعä»Ãͺæ

7. ¹Í¡¨Ò¡¹Ñ¹é ÂѧÊÒÁÒö¹íҼšÒ÷´Åͧ㹡Ԩ¡ÃÃÁ¹Õäé »»ÃÐÂØ¡µà¾×Íè ¹ÑºÊÔ§è ¢Í§ä´Œ´§Ñ ÃÙ» µÑÇÃѺ µÑÇʋ§

ÃÙ»áÊ´§¡ÒÃ㪌¹ÑºÇѵ¶Ø·ÕèÊзŒÍ¹áʧ䴌 ã¹ÃкºÊÒ¾ҹÅíÒàÅÕ§

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

75

¡Ô¨¡ÃÃÁ·Õè 10

µÃǨ¨ÑºÇѵ¶ØẺ¡ÃÐà¨Ô§áʧ â´Â㪌ἧǧ¨Ã âÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô (AT10-IR Ranging) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃ㪌§Ò¹âÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz 㹡ÒõÃǨ¨ÑºÇѵ¶Ø

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED 3. ἧǧ¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz 4. Ἃ¹¾ÅÒʵԡÊÕ¢ÒÇËÃ×Í¡ÃШ¡à§Ò äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. Ἃ¹¾ÅÒʵԡÊÕ´Òí ´ŒÒ¹ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 6. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµÔ·Õ蹋Òʹã¨ã¹¡Ò÷íҧҹËÇÁ¡Ñ¹¢Í§á¼§Ç§¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô (Infrared LED) ¡Ñºá¼§Ç§¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz 㹡ÒõÃǨ¨ÑºÇѵ¶Ø Object Infrared receiver module PORT 510 38kHz

IR LED

+5V OUT

㹡Ò÷íÒ§Ò¹»¡µÔἧǧ¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz àÁ×Íè äÁ‹ä´ŒÃºÑ ÊÑ­­Ò³ 38kHz ·Õ¼è ÊÁÁҡѺáʧ ÍÔ¹¿ÃÒàô ¨ÐãˌÅͨԡ “1” ÍÍ¡ÁÒ·Ò§àÍÒµ¾µØ ·Õ¨è ´Ø OUT ᵋ¶ÒŒ ä´ŒÃºÑ áʧÍÔ¹¿ÃÒàô·Õ¼è ÊÁÊÑ­­Ò³¤ÇÒÁ ¶Õè 38 kHz Í‹ҧµ‹Íà¹×Íè § ¨Ðãˌʭ Ñ ­Ò³ÅͨԡàÍÒµ¾µØ ÍÍ¡ÁÒ໚¹ “0” 㹪‹Ç§àÇÅҹѹé æ ´Ñ§¹Ñ¹é áʧÍÔ¹¿ÃÒàô ·Õè ¶Ù ¡ ʋ § ÍÍ¡¨Ò¡á¼§Ç§¨Ã¡í Ò à¹Ô ´ áʧÍÔ ¹ ¿ÃÒàô Infrared LED ¨ÐµŒÍ§ÁÕ¡ÒüÊÁ¤ÇÒÁ¶Õè 38 kHz à¢ŒÒ ä»àÁ×Íè µŒÍ§¡ÒÃʋ§Åͨԡ “0” áÅÐäÁ‹·Òí §Ò¹ã´æ àÁ×Íè ʋ§ Åͨԡ “1”

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô Infrared LED à¢ŒÒ·Õ¨è ´Ø µ‹Í P0 ¢Í§ SCi-BOX 2. µ‹ÍÊÒ¨ҡἧǧ¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô 38kHz à¢ŒÒ·Õ¨è ´Ø µ‹Í P1 ¢Í§ SCi-BOX


76

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÃÙ»·Õè A10-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT10-IR Ranging ã¹â»Ãá¡ÃÁ SCi-BOX Activity 3. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT10-IR Ranging 4. Çҧἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàôáÅÐἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàôãËŒË¹Ñ Ë¹ŒÒä»ã¹·Ò§à´ÕÂǡѹáÅÐÇÒ§ ªÔ´¡Ñ¹´Ñ§ÃÙ»áŌǡ´ÊÇÔµª RESET à¾×Íè àÃÔÁè µŒ¹¹Ñº¤‹Ò

µÑÇÃѺ µÑÇʋ§ 5. ·´Åͧ¹íÒἋ¹¾ÅÒʵԡËÃ×ÍÇѵ¶ØµÒ‹ §æ ÁÒá¡Ç‹§¼‹Ò¹Ë¹ŒÒµÑǵÃǨ¨Ñº â´Â·´Åͧ·Õ¤è ÇÒÁˋҧµ‹Ò§¡Ñ¹ Êѧࡵ¤‹Ò ·Õ¹è ºÑ º¹¨ÍÀҾNjÒÁÕ¡ÒÃà»ÅÕÂè ¹á»Å§ËÃ×ÍäÁ‹ ËÃ×ÍÍҨ㪌âÁ´ÙÅ SLCD 㹡ÒÃáÊ´§¼Å¡ç䴌 â´Âµ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§ SCi-BOX


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 6. ÊÒÁÒö¹íÒ¤ÇÒÁÃÙጠÅмšÒ÷´Åͧ㹡Ԩ¡ÃÃÁ¹ÕÁé Ò»ÃÐÂØ¡µãªŒã¹¡ÒÃá¡ᶺÊÕ¢ÒÇ-´íÒ ´Ñ§ÃÙ» àÅ×Íè ¹ªØ´µÃǨ¨Ñºä»-ÁÒ ãˌá¹ÇÅíÒáʧ µ¡¡Ãзº¾×é¹ÊÕ¢ÒÇ-´íÒ á¼§Ç§¨Ã¡íÒà¹Ô´ áʧÍÔ¹¿ÃÒàô Infrared LED

ἧǧ¨ÃâÁ´ÙÅÃѺáʧ ÍÔ¹¿ÃÒàô 38kHz Infrared receiver module

·´Åͧ·ÕèÃÐÂÐˋҧµ‹Ò§æ¡Ñ¹ 3 cm.

SCi-B X

Microcontroller in Science experiment

l

77


78

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 11

ÇÑ´ÍسËÀÙÁÔâ´Â㪌à·ÍÏÁÔÊàµÍÏ (AT11-Temperature) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃÇÑ´á¹Ç⹌ÁÍسËÀÙÁÔ â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ Temperature 3. áËŋ§¡íÒà¹Ô´¤ÇÒÁÌ͹ÊíÒËÃѺ·´Åͧ ઋ¹ ä´Ãà»†Ò¼Á ¶ŒÒ㪌äÁŒ¢´Õ ä¿ËÃ×Íà·ÕÂ¹ä¢ ã‹ ËŒÇÒ§ÍØ»¡Ã³µÃǨÇѴˋҧÍÍ¡ ÁÒàÅ硹ŒÍ Í‹Òãˌⴹà»ÅÇä¿â´ÂµÃ§ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 4. áËŋ§¡íÒà¹Ô´¤ÇÒÁàÂç¹ÊíÒËÃѺ·´Åͧ ઋ¹ ¹éÒí á¢ç§ µŒÍ§ÃÐÇѧäÁ‹ãˌ¢Ò¢Í§ÍØ»¡Ã³µÇÑ µÃǨÇÑ´â´¹¹éÒí â´ÂµÃ§ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµ·Ô ¹Õè ҋ ʹ㨢ͧἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ Temperature +5V

T PORT

10k

+

໚¹¡ÒÃÇÑ´â´Â㪌෤¹Ô¤¡ÒÃẋ§áç´Ñ¹ â´Â¹íÒµÑǵŒÒ¹·Ò¹á»Ã¤‹ÒµÒÁÍسËÀÙÁÔ áºº¼¡¼Ñ¹ (NTC) ÁÒµ‹ÍËÇÁ¡ÑºµÑǵŒÒ¹·Ò¹ àÁ×Íè ÍسËÀÙÁÊÔ §Ù ¢Ö¹é ¤ÇÒÁµŒÒ¹·Ò¹ ¢Í§à·ÍÏÁÔÊàµÍϨÐŴŧ ·íÒãˌáç´Ñ¹µ¡¤Ã‹ÍÁµÑǵŒÒ¹·Ò¹ 10kΩ «Ö觡ç¤×Í áç´Ñ¹àÍÒµ¾µØ ¢Í§Ç§¨Ã¨ÐÁդҋ ÁÒ¡¢Ö¹é ᵋ¶ÒŒ ÍسËÀÙÁÅÔ ´Å§ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ ¢Í§à·ÍÏÁÊÔ àµÍϨÐÁÒ¡¢Ö¹é ·íÒãˌáç´Ñ¹àÍÒµ¾µØ Ŵŧ Ø ËÀÙÁÔ à·ÍÏÁÊÔ àµÍÏ·¹Õè Òí ÁÒ㪌§Ò¹¹Ñ¹é ¨ÐÁդҋ ¤ÇÒÁµŒÒ¹·Ò¹à·‹Ò¡Ñº 10kΩ ·ÕÍè ³ ˌͧ (25 ͧÈÒà«Åà«ÕÂÊ)

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡ¨Ø´µ‹Í + (á»Ã¼Ñ¹µÒÁÍسËÀÙÁÔ) ¢Í§á¼§Ç§¨ÃÇÑ´ÍسËÀÙÁÔ Temperature ä»Âѧ¨Ø´µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT11-Temperature 3. àÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§ ǧ¨ÃËÅÑ¡


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

79

ÃÙ»·Õè A11-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT11-Temperature ã¹â»Ãá¡ÃÁ SCi-BOX Activity 4. ¹íÒἧǧ¨ÃÇÑ´ÍسËÀÙÁÇÔ Ò§änj·ÍÕè ³ Ø ËÀÙÁËÔ ÍŒ § Êѧࡵ¤‹Ò·ÕÍè ҋ ¹ä´Œ 5. ·´Åͧ¹íÒä»ÇÑ´¡ÑºáËŋ§¡íÒà¹Ô´¤ÇÒÁÌ͹áÅÐàÂç¹ Êѧࡵ¼ÅÅѾ¸·ÍÕè ҋ ¹ä´Œ ·´Åͧ¡ÒùíÒ áÅСÒþҤÇÒÁÌ͹ â´Â¡ÒÌҵÑǵÃǨ¨Ñºä»·ÕèµíÒá˹‹§µ‹Ò§æ éí¹Ò á ¢ç §

ἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ

ἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ ÃÐÇѧÍ‹Òãˌ¢Ò¢Í§ à·ÍÏÁÔÊàµÍÏÊÑÁ¼ÑÊ ¡Ñ º ¹íéÒá¢ç § â´ÂµÃ§

áËŋ§¡íÒà¹Ô´¤ÇÒÁàÂç¹

áËŋ§¡íÒà¹Ô´¤ÇÒÁÌ͹

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 6. ·´Åͧà»ÅÕè¹ä»ãªŒ¨Ø´µ‹Íá»Ã¼¡¼Ñ¹¡ÑºÍسËÀÙÁԢͧἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ Êѧࡵ¼Å·Õàè »ÅÕÂè ¹á»Å§

SCi-B X

Microcontroller in Science experiment


80

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 12

µÃǨÇÑ´¤ÇÒÁࢌÁÊÕâ´Â㪌¡ÒÃÊзŒÍ¹áʧÊÕá´§´ŒÇ ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ (AT12- Red light reflect) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒÃ㪌§Ò¹á¼§Ç§¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ã¹¡ÒÃÇÑ´¤ÇÒÁࢌÁÊÕ â´Â㪌¤³ Ø ÊÁºÑµ¡Ô ÒÃÊзŒÍ¹áʧ

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ REFLECT 3. ¡ÃдÒÉ¢ÒÇ áÅСÃдÒÉ¢ÒÇ·Õãè ªŒ´¹Ô ÊÍ´íÒ½¹àºÒæ ໚¹Ãٻǧ¡ÅÁ´íÒ àʌ¹¼‹Ò¹Èٹ¡ÅÒ§»ÃÐÁÒ³ 1 ૹµÔàÁµÃ ·Õ¤è ÇÒÁࢌÁ´Ô¹Ê͵‹Ò§æ ¡Ñ¹ ઋ¹ F, HB, 2B, E äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 4. ¡ÃдÒÉÊյҋ §æ ¡Ñ¹ ઋ¹ á´§ à¢ÕÂÇ àËÅ×ͧ ¿‡Ò ´íÒ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ 5. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼Å ËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµ·Ô ¹Õè ҋ ʹã¨ã¹¡Ò÷íÒ§Ò¹¢Í§á¼§Ç§¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ REFLECT Object

Red LED super bright

220 +5V

LDR Vout 10k

ã¹á¼§Ç§¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ ÁÕáËŋ§¡íÒà¹Ô´áʧÊÕá´§«Ö§è 䴌¨Ò¡ LED ÊÕᴧẺÊNjҧ¾ÔàÈÉËÃ×Í«Ùà»ÍÏäºÃµÊ‹Í§ÍÂًµÅÍ´àÇÅÒ Ê‹Ç¹¡ÒõÃǨ¨ÑºáʧÊзŒÍ¹¹Ñ鹨Ð㪌µÑǵŒÒ¹·Ò¹á»Ã¤‹ÒµÒÁ áʧËÃ×Í LDR µ‹ÍËÇÁ¡ÑºµÑǵŒÒ¹·Ò¹ 10kΩ ໚¹Ç§¨Ãẋ§áç´Ñ¹ â´Âãˌ¼ÅÅѾ¸¤Í× ¶ŒÒÁÕáʧÊзŒÍ¹¡ÅѺÁÒÁÒ¡ ¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹¢Í§ LDR ¨ÐŴŧ ·íÒãˌáç´Ñ¹àÍÒµ¾µØ ¢Í§Ç§¨Ã «Ö§è ¡ç¤Í× áç´Ñ¹µ¡¤Ã‹ÍÁ µÑǵŒÒ¹·Ò¹ 10kΩ Áդҋ ÁÒ¡¢Ö¹é ᵋ¶ÒŒ áʧ·ÕÊè зŒÍ¹¡ÅѺÁÒÁչ͌  ¤‹Ò ¤ÇÒÁµŒÒ¹·Ò¹¢Í§ LDR ¡ç¨ÐÁÒ¡¢Ö¹é ·íÒãˌáç´Ñ¹àÍÒµ¾µØ Ŵŧ

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ REFLECT ä»Âѧ¨Ø´µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT12-Red light reflect 3. ¨Ñ´Çҧἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹¤ÇèÒí ˹ŒÒ¡Ñº¡ÃдÒÉ â´ÂÊѧࡵºÃÔàdz·Õ·è Òí ¡ÒÃÇÑ´¨Ò¡áʧÊÕá´§·ÕÊè ͋ §ÍÍ¡ ¨Ò¡á¼§Ç§¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

81

ÃÙ»·Õè A12-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT12-Red light reflect ã¹â»Ãá¡ÃÁ SCi-BOX Activity 4. ¹íÒ¡ÃдÒÉ·Õ½è ¹´Ô¹ÊÍàÍÒänjÁÒ·´Åͧ â´ÂÇÑ´·ÕÃè ÐÂÐˋҧ¨Ò¡¡ÃдÒÉ»ÃÐÁÒ³ 5 ÁÔÅÅÔàÁµÃ Êѧࡵ¤‹Ò·ÕÍè ҋ ¹ 䴌ã¹áµ‹ÅÐ¾×¹é ·Õè àÁ×Íè à·Õº¡ÑºÊÕ¢ÒǢͧ¾×¹é ¡ÃдÒÉ â´ÂàÅ×Í¡¡ÒÃáÊ´§¼Å䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡ ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹ REFLECT ¼§´Ô¹ÊÍ·Õ½è ¹àÍÒänj ·´Åͧ·ÕÃè ÐÂÐˋҧµ‹Ò§æ¡Ñ¹ ¡ÃдÒÉ¢ÒÇ·Õ½è ¹´Ô¹ÊÍàÍÒänj

¾×é¹·Õè¢ÒǢͧ¡ÃдÒÉ ºÃÔàdz·Õ½è ¹´ŒÇ´ԹÊͤÇÒÁࢌÁ F ºÃÔàdz·Õ½è ¹´ŒÇ´ԹÊͤÇÒÁࢌÁ 2B ºÃÔàdz·Õ½è ¹´ŒÇ´ԹÊͤÇÒÁࢌÁ HB

ÇÑ´¤‹Ò䴌 .............................................. ÇÑ´¤‹Ò䴌............................................... ÇÑ´¤‹Ò䴌.............................................. ÇÑ´¤‹Ò䴌..............................................


82

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

5. ·´ÅͧÇÑ´¤‹ÒᶺÊÕ´Òí ´ŒÒ¹Å‹Ò§¹Õé Êѧࡵ¤‹Ò·ÕÍè ҋ ¹ä´Œ â´Â͋ҹ¤‹Ò¨Ò¡ÊÕ´Òí ·Ò§«ŒÒÂä»ÂѧÊÕ¢ÒÇ·Ò§¢ÇÒ Êѧࡵ¼Å ·Õàè ¡Ô´¢Ö¹é

¾×é¹·Õè´íÒ·Ò§«ŒÒÂÊØ´ ¾×é¹·ÕèµÃ§¡ÅÒ§ ¾×é¹·Õè´íÒ·Ò§¢ÒÇÊØ´

ÇÑ´¤‹Ò䴌 .............................................. ÇÑ´¤‹Ò䴌............................................... ÇÑ´¤‹Ò䴌..............................................

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 6. ·´Åͧ¡Ñº¡ÃдÒÉ¢ÒÇઋ¹à´ÔÁ ᵋà»ÅÕÂè ¹á»Å§ÃÐÂÐˋҧ·Õ·è Òí ¡ÒÃÇÑ´µÑ§é ᵋ 1 ÁÔÅÅÔàÁµÃ ¨¹¶Ö§ 3 ૹµÔàÁµÃ Êѧࡵ¼Å·Õäè ´Œ 7. ·íÒ¡Ò÷´Åͧ¡Ñº¡ÃдÒÉÊÕ͹×è æ ´ŒÇÂÇÔ¸¡Õ ÒÃà´ÕÂǡѺ¢ŒÍ 4 Êѧࡵ¼Å·Õäè ´Œ

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

83

¡Ô¨¡ÃÃÁ·Õè 13

㪌§Ò¹á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§໚¹ÊÇÔµªÊÑ觧ҹ´ŒÇÂàÊÕ§ (AT13- Sound event) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒõÃǨ¨ÑºàÊÕ§ â´Â㪌¤Í¹à´¹à«ÍÏäÁâ¤Ã⿹¢¹Ò´àÅç¡

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃµÃǨ¨ÑºàÊÕ§ SOUND 3. ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍϵÇÑ µÑ§é 4. ἧǧ¨Ãà»ÃÕºà·ÕºÊÑ­­Ò³ 5. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼ÅËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµ·Ô ¹Õè ҋ ʹã¨ã¹¡Ò÷íÒ§Ò¹¢Í§á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§ SOUND

MIC

PORT

ἧǧ¨Ã¹Õé ·í Ò Ë¹Œ Ò ·Õè ¢ ÂÒÂáç´Ñ ¹ ·Õè ä ´Œ ¨ Ò¡¡ÒÃá»Å§ ÊÑ ­ ­Ò³àÊÕ Â §à»š ¹ ÊÑ ­ ­Ò³ä¿¿‡ Ò ¢Í§¤Í¹à´¹à«ÍÏ äÁâ¤Ã⿹ãˌáç¢Öé¹ à¾×èÍãˌÊÒÁÒö㪌§Ò¹ä´Œ´ŒÇ¡Òà µÃǨÊͺÅͨԡ䴌 â´ÂÊÑ­­Ò³¨Ð¶Ù¡¢ÂÒµÒÁ¨Ñ§ËÇÐ ¢Í§àÊÕ§·Õàè ¡Ô´¢Ö¹é

COM

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡἧǧ¨ÃµÃǨ¨ÑºàÊÕ§ SOUND ä»Âѧ¨Ø´µ‹Í P0 º¹ SCi-BOX 2. àÅ×Í¡¨ÑÁê à»ÍÏ RELAY/MOTOR º¹ SCi-BOX ä»·Õµè Òí á˹‹§ RELAY 3. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT13-Sound event 4. ·´Åͧà¤ÒÐàÊÕ§ËÃ×ͻúÁ×Íã¡ÅŒæ äÁâ¤Ã⿹º¹á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§ Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§ÃÕàŏº¹ SCiBOX ÃÕàŏ㹵íÒá˹‹§ P8 ¡ç¨Ð·íÒ§Ò¹-ËÂØ´·íÒ§Ò¹ÊÅѺ¡Ñ¹µÒÁ¨Ñ§ËÇТͧàÊÕ§·Õµè ÃǨ¨Ñºä´Œ Êѧࡵ䴌¨Ò¡àÊÕ§ ¢Í§Ë¹ŒÒÊÑÁ¼ÑÊÃÕàŏ·ÕèµÑ´µ‹ÍÊÅѺ¡Ñ¹


84

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÃÙ»·Õè A13-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT13-Sound event ã¹â»Ãá¡ÃÁ SCi-BOX Activity

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 5. ·íÒ¡Ò÷´ÅͧËÇÁ¡ÑºÍØ»¡Ã³Í¡Õ 2 µÑǤ×Í á¼§Ç§¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 Potentiometer áÅÐἧǧ¨Ãà»ÃÕº à·ÕºÊÑ­­Ò³ COMPARATOR â´Âµ‹ÍÊÒÂÊÑ­­Ò³´Ñ§ÃÙ»

ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 A

ÊÑ­­Ò³àÊÕ§ (B)

A>B

ÃдѺ͌ҧÍÔ§ (A) A

Potentiometer

D

SOUND

ἧǧ¨ÃµÃǨ¨ÑºàÊÕ§

B>A

B

P

ἧǧ¨Ãà»ÃÕºà·Õº ÊÑ­­Ò³

A>B ãˌ¼Å໚¹Åͨԡ "0" A<B ãˌ¼Å໚¹Åͨԡ "1"

µ‹Íä»Âѧ P0 ¢Í§ SCi-BOX B>A ãˌ¼Å໚¹Åͨԡ "0" B<A ãˌ¼Å໚¹Åͨԡ "1"


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

85

6. àÅ×͡㪌ʭ Ñ ­Ò³àÍÒµ¾µØ ¨Ò¡ª‹Í§ A>B ¢Í§á¼§Ç§¨Ãà»ÃÕºà·ÕºÊÑ­­Ò³ â´Â¨Ð·íÒ§Ò¹·ÕÅè ͨԡ “0” µ‹Íä» à¢ŒÒ·Õ¨è ´Ø P0 ¢Í§ SCi-BOX á·¹·Õ¡è Òõ‹ÍµÃ§¨Ò¡á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§㹡Ò÷´Åͧ¢ŒÍ·Õè 1 7. àÅ×Í¡¨ÑÁê à»ÍÏ RELAY/MOTOR ä»ÂѧµíÒá˹‹§ RELAY à¾×Íè àÅ×Í¡ãˌÃàÕ Å·Òí §Ò¹ 8. ·íÒ¡ÒûÃѺ᡹ËÁع¢Í§µÑǵŒÒ¹·Ò¹º¹á¼§Ç§¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 Potentiometer à¾×Íè ¡íÒ˹´ÃдѺ¤ÇÒÁ äǢͧàÊÕ§·Õµè ͌ §¡Òà à§×Íè ¹ä¢ã¹¡Ò÷íÒ§Ò¹ ¶ŒÒÊÑ­­Ò³àÊÕ§¨Ò¡á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§µèÒí ¡Ç‹ÒÃдѺ·Õµè §Ñé änj´ÇŒ Âἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 LED ÊÕá´§·Õàè ÍÒµ¾µØ A>B ¨ÐµÔ´ÊNjҧ áÅÐÃÕàŏäÁ‹·Òí §Ò¹ ¶ŒÒÊÑ­­Ò³àÊÕ§¨Ò¡á¼§Ç§¨ÃµÃǨ¨ÑºàÊÕ§ÊÙ§¡Ç‹ÒÃдѺ·Õµè §Ñé änj´ÇŒ Âἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 LED ÊÕà¢ÕÂÇ·Õàè ÍÒµ¾µØ B>A («Ö§è ¡ç¤Í× A<B ¹Ñ¹è àͧ) ¨ÐµÔ´ÊNjҧ ÃÕàŏ·Òí §Ò¹ áÅÐÁÕ¡ÒâѺàÊÕ§ÍÍ¡·Ò§ÅíÒ⾧º¹ºÍÏ´ SCi-BOX ´ŒÇÂ

SCi-B X

Microcontroller in Science experiment


86

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 14

㪌§Ò¹á¼§Ç§¨ÃµŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹àÅ×è͹¡Ñº ¡ÒÃà¤Å×Íè ¹·Õ·è Ò§¡Å (AT14- Linear position) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒäÇÒÁÊÑÁ¾Ñ¹¸ÃÐËNjҧ¡ÒÃà¤Å×Íè ¹·Õ·è Ò§¡Å¡Ñº¤‹Ò¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹àÅ×Íè ¹ËÃ×ÍẺÊäÅ´ (VARIABLE RESISTOR : SLIDE Type) 3. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼ÅËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµ¢Ô ͧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹àÅ×Íè ¹ËÃ×ÍÊäÅ´ Variable resistor : Slide type +

»¯ÔºµÑ ¡Ô ÒÃ

+

໚¹¡ÒÃÇÑ´â´Â㪌෤¹Ô¤¡ÒÃẋ§áç´Ñ¹ ¨Ò¡µÑǵŒÒ¹·Ò¹ »ÃѺ¤‹Ò䴌Ẻ᡹àÅ×Íè ¹ËÃ×ÍÊäÅ´ (slide) ã¹áºº B «Ö§è ÁÕ ¡ÒÃà»ÅÕÂè ¹á»Å§áººàªÔ§àʌ¹ (linear type) «Ö§è ÁÕ굄 ÃÒ¡Òà à»ÅÕÂè ¹á»Å§¤‹Òµ‹Í¡ÒÃàÅ×Íè ¹á¡¹à»š¹àªÔ§àʌ¹µÃ§ ¨Ö§ÊÒÁÒö ¹íҾĵԡÃÃÁ¡ÒÃàÅ×è͹᡹¹ÕéÁÒ㪌㹡ÒÃÇÑ´ÃÐÂзҧ䴌 â´Â¤‹Ò¢Í§¤ÇÒÁµŒÒ¹·Ò¹·Õèà»ÅÕè¹á»Å§ä»·íÒãˌáç´Ñ¹ à»ÅÕÂè ¹á»Å§µÒÁã¹ÍѵÃÒʋǹ·ÕÊè ÁÑ ¾Ñ¹¸¡ºÑ ÃÐÂзҧ

1. µ‹ÍÊÒ¨ҡἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌ẺÊäÅ´à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT14-Linear position 3. ·´ÅͧàÅ×Íè ¹á¡¹¢Í§µÑǵŒÒ¹·Ò¹ä»ÁÒ Êѧࡵ¤‹Ò·ÕÍè ҋ ¹ä´Œ¡ºÑ ÃÐÂзҧ·Õàè ¤Å×Íè ¹·Õäè » â´Â㹡ÒÃáÊ´§¼ÅÊÒÁÒö àÅ×͡䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Íâ´Â㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§á¼§Ç§¨ÃËÅÑ¡ àÅ×è͹᡹ä»ÁÒ µ‹Íä»Âѧ¨Ø´µ‹Í SENSOR0

ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌ẺÊäÅ´


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

87

ÃÙ»·Õè A14-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT14-Linear position ã¹â»Ãá¡ÃÁ SCi-BOX Activity 4. ·´ÅͧªÑ觹éíÒ˹ѡ¢Í§Çѵ¶Ø ¨Ò¡ÃÙ»¹íÒÊ»ÃÔ§·Õè·ÃÒº¤‹Ò¹Ô¨ (K) ÁÒ¼Ù¡àª×Í¡á¢Ç¹änjáŌǹíÒ»ÅÒÂàª×Í¡ÍÕ¡´ŒÒ¹Ë¹Ö§è ¾Ñ¹àÍÒänj·áÕè ¡¹ x ; ÃÐÂзÕèÊ»ÃÔ§Â×´ àÅ×Íè ¹¢Í§µÑǵŒÒ¹»ÃѺ¤‹Ò䴌 â´ÂãˌµÒí á˹‹§á¡¹¢Í§µÑǵŒÒ¹·Ò¹ÍÂً ÍÍ¡¨Ò¡ÊÀÒÇл¡µÔ ·ÕèµíÒá˹‹§ 0% áŌÇÂÖ´µÑǵŒÒ¹·Ò¹änj¡Ñº¼¹Ñ§ ·Ô駻ÅÒÂàª×Í¡änj ÊíÒËÃѺ¼Ù¡¡Ñº¡ŒÍ¹¹éÒí ˹ѡ·Õµè ͌ §¡Òêѧè ÃÐÂзÕè᡹¢Í§µÑǵŒÒ¹·Ò¹ à¤Å×è͹·Õè䴌¡ç෋ҡѺ x ઋ¹¡Ñ¹ 5. ¨Ò¡¹Ñ¹é »Å‹Í¡ŒÍ¹¹éÒí ˹ѡ áŌǤíҹdz¹éÒí ˹ѡ´Ñ§¹Õé ÃÐÂСÒÃà¤Å×è͹·Õè·Ñé§ËÁ´¢Í§á¡¹àÅ×è͹㹵ÑǵŒÒ¹·Ò¹ »ÃѺ¤‹Ò䴌¤Í× 0.027 àÁµÃ ¡íÒ˹´à»š¹ 100% ¤‹Ò·ÕÍè ҋ ¹ä´Œ 1% ¨Ö§à·‹Ò¡Ñº 0.00027 àÁµÃ 䴌ÃÐÂзҧ·ÕÊè »ÃÔ§à¤Å×Íè ¹·Õäè »à·‹Ò¡Ñº L = ¤‹Ò·ÕÍè ҋ ¹ä´Œ¨Ò¡Ë¹ŒÒ¨Í x 0.00027 àÁµÃ ¹íÒ¤‹Ò·Õäè ´Œä»¤Ù³¡Ñº¤‹Ò¹Ô¨Ê»ÃÔ§ (K) ·Õ·è ÃÒº¤‹Ò ¨Ð䴌໚¹ áç´Ö§Ê»ÃÔ§ (F) ¶ŒÒäÁ‹¤´Ô ¹éÒí ˹ѡ¢Í§ÍØ»¡Ã³Í¹×è æ Ãͺ´ŒÒ¹ àÁ×Íè Ê»ÃÔ§ÊÁ´Øŏ ¨Ð䴌Çҋ F = Kx áÅÐ F = mg ; g = 9.81 m/s2 Kx = mg á·¹¤‹Òã¹ÊÁ¡Òà ¨Ð䴌¹Òéí ˹ѡ¢Í§¡ŒÍ¹¹éÒí ˹ѡ

ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌ẺÊäÅ´

¡Ò÷´Åͧà¾ÔÁè àµÔÁ

¡ŒÍ¹¹íéÒ˹ѡ

SCi-B X

Microcontroller in Science experiment


88

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 15

㪌§Ò¹á¼§Ç§¨ÃµŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع¡Ñº ¡ÒÃà¤Å×Íè ¹·Õ·è Ò§¡Å (AT15- Rotation angular) ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¡ÒäÇÒÁÊÑÁ¾Ñ¹¸ÃÐËNjҧ¡ÒÃà¤Å×Íè ¹·Õ·è Ò§¡Å¡Ñº¤‹Ò¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع Potentiometer µÑǹ͹ËÃ×͵ѧé 3. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼ÅËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

¤Ø³ÊÁºÑµ¢Ô ͧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع Potentiometer

+

+

໚¹¡ÒÃÇÑ´â´Â㪌෤¹Ô¤¡ÒÃẋ§áç´Ñ¹¨Ò¡µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò 䴌ẺËÁعËÃ×Íâ»à·¹ÃªÔâÍÁÔàµÍÏã¹áºº B (linear type) «Ö§è ÁÕ굄 ÃÒ¡ÒÃà»ÅÕÂè ¹á»Å§¤‹Ò¤ÇÒÁ¨µŒÒ¹·Ò¹µ‹Í¡ÒÃà¤Å×Íè ¹·Õàè »š¹ àªÔ§àʌ¹µÃ§ ·íÒãˌ¤‹Ò·Õè䴌໚¹ÍѵÃÒʋǹ¡ÑºÁØÁ¢Í§á¡¹ËÁع·Õè à»ÅÕÂè ¹á»Å§ä» ÁÕ¨´Ø µ‹ÍàÍÒµ¾µØ 2 Ẻ¤×Í

+

ËÁع᡹µÒÁà¢çÁ¹Ò́¡Ò ¤‹Òáç´Ñ¹àÍÒµ¾µØ à¾ÔÁè

+ ËÁع᡹·Ç¹à¢çÁ¹Ò́¡Ò ¤‹Òáç´Ñ¹àÍÒµ¾µØ à¾ÔÁè

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡ¨Ø´µ‹Í + ¢Í§á¼§Ç§¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌ẺËÁع Potentiometer à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 ¢Í§ SCi-BOX 2. ´ÒǹâËÅ´â»Ãá¡ÃÁ´ŒÇÂä¿Å¢Í§¡Ô¨¡ÃÃÁ AT15-Rotation angular 3. ¨Ò¡¹Ñ¹é ãˌ¡´ÊÇÔµª RESET º¹ºÍÏ´ SCi-BOX à¾×Íè à·ÕºµíÒá˹‹§·Õè 0 ͧÈÒ¡‹Í¹ àÁ×Íè 㪌§Ò¹ÁØÁ·ÕËè Áع仨Ð䴌 ¤‹Ò໚¹¤‹ÒÁØÁÊÑÁ¾Ñ·¸¡ºÑ µíÒá˹‹§à´ÔÁ·Õµè §Ñé änj 4. ¹íÒἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌ẺËÁع Potentiometer 仵‹Í¡Ñº¡Åä¡·Õàè ¤Å×Íè ¹·Õáè ººËÁع (¨íÒ¡Ñ´¡ÒÃËÁع ¢Í§ Potentiometer ·Õãè ªŒänjãˌáÊ´§¼ÅäÁ‹à¡Ô¹ 220 ͧÈÒ) Êѧࡵ¼ÅÅѾ¸·ÍÕè ҋ ¹ä´Œã¹áµ‹ÅеíÒá˹‹§ â´Â㹡Òà áÊ´§¼ÅàÅ×͡䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍËÃ×Í㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§ SCi-BOX


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

89

ÃÙ»·Õè A15-1 ˹ŒÒµ‹Ò§¡Ô¨¡ÃÃÁ AT15-Rotation angular ã¹â»Ãá¡ÃÁ SCi-BOX Activity

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #1 5. ·´Åͧ·íÒà¤Ã×Íè §Á×ÍÇÑ´ÁØÁÍ‹ҧ§‹ÒÂæ ¶ŒÒµŒÍ§¡Ò÷ÃÒºÁØÁÃÐËNjҧ àʌ¹ A ¡Ñº B µÒÁÃÙ» ãˌËÁع᡹¢Í§µÑÇ µŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌º¹á¼§Ç§¨Ã Potentiometer ªÕäé »·Õàè ʌ¹ A ¡‹Í¹ áŌǡ´ÊÇÔµª RESET º¹ SCi-BOX à¾×Íè ¡íÒ˹´ ÁØÁàÃÔÁè µŒ¹à»š¹ 0 áŌÇËÁع仪շé àÕè ʌ¹ B áŌÇ͋ҹ¤‹Ò¨Ò¡¨ÍÀÒ¾ËÃ×Í·Õâè Á´ÙÅ SLCD ¤‹Ò·ÕÍè ҋ ¹ä´Œ¨Ð໚¹¤‹ÒÁØÁÊÑÁ¾Ñ·¸ÃÐËNjҧàʌ¹ A ¡Ñº B ¹Ñ¹è àͧ àʌ¹ A ÁØÁ·Õ赌ͧ¡Ò÷ÃÒº

àʌ¹ B

A

POTENTIOMETER


90

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ò÷´Åͧà¾ÔÁè àµÔÁ #2 6. »ÃÐÂØ¡µ¨Ò¡¼Å¡Ò÷´Åͧ·Õäè ´Œã¹¡Ô¨¡ÃÃÁä»ãªŒËÒÃÐÂзҧ¨Ò¡¼Ùʌ §Ñ ࡵä»ÂѧµÖ¡·Õ·è ÃÒº¤ÇÒÁÊÙ§ â´Â¡ÒÃàÅç§ ÁØÁ â´Â㪌¤ÇÒÁÃÙ·Œ Ò§µÃÕ⡳ÁÔµÔ

)

POTENTIOMETER

H ¤ÇÒÁÊÙ§¢Í§µÖ¡ Z = ÁØÁ·ÕÍè ҋ ¹¤‹Ò䴌 A = ÃÐÂÐˋҧ¢Í§µÑÇÇÑ´ÁØÁ¡Ñº¾×¹é ´Ô¹ D = ÃÐÂÐˋҧ¢Í§µÑÇÇÑ´ÁØÁ¡ÑºµÖ¡

â´Â¤ÇÒÁÊÑÁ¾Ñ¹¸·Ò§¤³ÔµÈÒʵÏ ¤×Í ÊÁ¡ÒÃ

tan Z =

H− A D

¶ŒÒ·ÃÒº¤ÇÒÁÊÙ§¢Í§µíÒá˹‹§ÇÑ´ÁØÁ A áÅФÇÒÁÊÙ§¢Í§µÖ¡ H áÅŒÇ ¹íÒ¤‹Ò¢Í§ÁØÁ·ÕÍè ҋ ¹ä´ŒÁÒá·¹¤‹Òã¹ ¨Ð䴌¼ÅÅѾ¸à»š¹ÃÐÂзҧ¨Ò¡¨Ø´Êѧࡵ¶Ö§µÖ¡

D=

H− A tan Z

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

91

¡Ô¨¡ÃÃÁ·Õè 16

ÇÑ´¤‹ÒµÑÇà¡çº»ÃШØâ´Â㪌áËŋ§¨‹Ò¡ÃÐáʤ§·Õè㹠ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¤Ø³ÅѡɳТͧ¡Òõ‹ÍµÑÇà¡çº»ÃШØä¿¿‡Ò·ÕÁè ¤Õ ÇÒÁ¨Øʧ٠â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò RESISTANCE 3. µÑÇà¡çº»ÃШØä¿¿‡Ò 1000µF 16V ẺÍÔàÅç¡·ÃÍäŵ ¨íҹǹ 1 µÑÇ 4. ¤ÍÁ¾ÔÇàµÍÏÊÒí ËÃѺáÊ´§¼Å

ËÅÑ¡¡ÒÃÇÑ´¤‹ÒµÑÇà¡çº»ÃШØâ´Â㪌áËŋ§¨‹Ò¡ÃÐáʤ§·Õè +5V

áËŋ§¨‹Ò¡ÃÐáʤ§·Õè 1mA µÑÇà¡çº»ÃÐ¨Ø ·Õ赌ͧ¡ÒÃÇÑ´

+

áç´Ñ¹àÍÒµ¾Øµ <4V -

ã¹á¼§Ç§¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò RESISTANCE ÁÕáËŋ§ ¨‹Ò¡ÃÐáÊä¿¿‡Ò¤§·Õè 1mA «Ö§è àÁ×Íè ÁÕÍ»Ø ¡Ã³ÁÒµ‹Í͹ءÃÁ¡ÑºáËŋ§ ¨‹Ò¡ÃÐáʤ§·Õè¹Õé ¨Ð·íÒãˌà¡Ô´áç´Ñ¹ä¿¿‡Òµ¡¤Ã‹ÍÁÍØ»¡Ã³µÑÇ ¹Ñ¹é æ áŌÇǧ¨Ã¨Ðʋ§¤‹Òáç´Ñ¹·Õµè ¡¤Ã‹ÍÁÍØ»¡Ã³¹¹Ñé ÍÍ¡ÁÒ «Ö§è ¶ŒÒ ËÒ¡¹íÒµÑÇà¡çº»ÃШØÁÒµ‹ÍÇÑ´·ÕèÍÔ¹¾Øµ¢Í§Ç§¨Ã ¨Ð䴌¡ÒÃà»ÅÕè¹ á»Å§áç´Ñ¹à»š¹ÊѴʋǹ¤§·Õ¡è ºÑ ¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò¢Í§µÑÇà¡çº»ÃÐ¨Ø ¹Ñ¹é æ áÅзء¤ÃÑ§é ·ÕÇè ´Ñ µŒÍ§¤Ò»ÃШØã¹µÑÇà¡çº»ÃШء͋ ¹àÊÁÍ

㹡Ԩ¡ÃÃÁ·Õè 16 áÅÐ 17 äÁ‹ä´ŒºÃèØÃÇÁänj㹪ش«Í¿µáÇÏ SCi-BOX Activity â´ÂµÃ§ Ëҡᵋ ÊÒÁÒö¹íÒâ»Ãá¡ÃÁ㹺ҧ¡Ô¨¡ÃÃÁÁÒ㪌ËÇÁ´ŒÇÂ䴌 ¹Í¡¨Ò¡¹Ñé¹Âѧ㪌«Í¿µáÇÏ SCi-BOX Data logger ª‹ÇÂ㹡ÒÃáÊ´§¼Å¡Ò÷íÒ§Ò¹´ŒÇ «Ö§è ¨ÐÁÕÃÒÂÅÐàÍÕ´ᵡµ‹Ò§¡Ñ¹ä»ã¹áµ‹ÅСԨ¡ÃÃÁ


92

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

»¯ÔºµÑ ¡Ô Òà 1. µ‹ÍÊÒ¨ҡἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Òà¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 º¹ SCi-BOX 2. ແ´â»Ãá¡ÃÁ Single channel data logger (µÔ´µÑ§é ÁҾÌÍÁ¡Ñº SCi-BOX Activity) ¡´»ØÁ† Load áŌÇàÅ×Í¡¡Òà ÇѴẺ SENSOR

3. µ‹ÍÊÒ»ҡ¤Õº·Õ¨è ´Ø ÇÑ´ RESISTOR à¾×Íè ·´ÅͧÇÑ´¤‹ÒµÑÇà¡çº»ÃШØä¿¿‡Ò â´Âãˌ´¢Ù ÇÑé ãˌ¶¡Ù µŒÍ§´ŒÇ ´Ñ§ÃÙ»

µÑÇà¡çº»ÃШطÕ赌ͧ¡ÒÃÇÑ´

+

¢ÑéǺǡ

RESISTOR

¤Ò»ÃШØ

A

OUT

4. ·íÒ¡ÒäÒ»ÃШØã¹µÑÇà¡çº»ÃÐ¨Ø â´Â¶ŒÒ¤‹Ò¤ÇÒÁ¨ØäÁ‹Ê§Ù ¹Ñ¡ ãËŒÅ´Ñ Ç§¨Ãâ´Â¹íÒ»Ò¡¤Õº¢Í§»ÅÒ·ѧé Êͧ¢ŒÒ§ÁÒ ÊÑÁ¼Ñʡѹ ᵋ¶ÒŒ µÑÇà¡çº»ÃШطÁÕè ¤Õ ÇÒÁ¨Øʧ٠æ (à¡Ô¹ 10,000µF) äÁ‹¤ÇÃÅѴǧ¨Ãâ´ÂµÃ§à¾ÃÒШÐà¡Ô´»ÃСÒÂä¿ä´Œ áÅШзíÒãˌµÇÑ à¡çº»ÃШØàÊ×Íè Á ¤ÇÃËÒµÑǵŒÒ¹·Ò¹ÁÒµ‹Í¢¹Ò¹à¾×Íè Å´¡ÃÐáÊ㹡ÒäÒ»ÃШØá·¹ µ‹Í¤ŒÒ§änjÍ‹ҧ ¹ŒÍÂ໚¹àÇÅÒ»ÃÐÁÒ³ 5τ â´Â¤‹Ò 1τ ෋ҡѺ 0.693 x R x C ´Ñ§¹Ñ¹é ¤‹ÒàÇÅÒ 5τ ¨Ö§à·‹Ò¡Ñº 3.465 x R x C ã¹·Õ¹è ãÕé ªŒµÇÑ à¡çº»ÃÐ¨Ø 1000µF ¨Ö§ÊÒÁÒöÅѴǧ¨Ãà¾×Íè ¤Ò»ÃШØ䴌â´ÂµÃ§


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

93

5. ¨Ò¡¹Ñ¹é µÑ§é µÑÇàÅ×Í¡ÊíÒËÃѺâ»Ãá¡ÃÁ Single channel data logger ´Ñ§¹Õé ¨íҹǹ¢ŒÍÁÙÅ (Number of record) 100 ªØ´ ¤ÇÒÁÅÐàÍÕ´ (Resolution) 1024 ÃдѺ ¡íÒ˹´ª‹Ç§àÇÅÒÊØÁ‹ ¢ŒÍÁÙÅ (Sampling time) 100 ÁÔÅÅÔÇ¹Ô Ò·Õ àÅ×Í¡áÊ´§àʌ¹¡ÃÔ´ (Grid display) ¨Ò¡¹Ñ¹é ¡´»ØÁ† Connect áÅÐàÅ×Í¡ Run 6. ËÅѧ¨Ò¡â»Ãá¡ÃÁàÃÔèÁáÊ´§¡ÃÒ¿áÅŒÇ ãˌá¡»ÅÒ»ҡ¤Õº·Õè㪌ÅѴǧ¨Ãà¾×èͤÒ»ÃШآͧµÑÇà¡çº»ÃШØÍÍ¡ ¨Ò¡¡Ñ¹ à¾×Íè àÃÔÁè µŒ¹¡ÒûÃШØáç´Ñ¹ â´Â¡Ð¨Ñ§ËÇÐãˌàÃÔÁè ·Õàè ʌ¹¡ÃÔ´á¹ÇµÑ§é ¾Í´Õ Êѧࡵ¼Å·Õäè ´Œº¹¡ÃÒ¿ 7. àÁ×Íè àÊÃç¨ÊÔ¹é ¡ÒÃáÊ´§¼Å¡ÃÒ¿ ãˌ·Òí ¡ÒäíҹdzËÒ¤‹ÒµÑÇà¡çº»ÃШØâ´Â㪌¡ÃÒ¿

8

¨Ò¡ÊÁ¡ÒÃ

dv Ic = C dt

10 µÑÇÍ‹ҧ㹪‹Ç§àÇÅÒ 1 ÇÔ¹Ò·Õ

àÁ×Íè ÍѵÃÒ¡ÒÃà»ÅÕÂè ¹á»Å§¡Ãҿ໚¹àʌ¹µÃ§ÁÕ¤ÇÒÁªÑ¹¤§·Õè ÊÒÁÒö»ÃÐÁÒ³¤‹Ò䴌໚¹

Ic = C

∆v ∆t

¨Ò¡àʌ¹¡ÃÔ´á¹ÇµÑ§é ᵋÅÐàʌ¹¨Ðˋҧ¡Ñ¹ 10 ªØ´¢ŒÍÁÙÅ ¤×Í ∆t =10 x 100 ÁÔÅÅÔÇ¹Ô Ò·Õ = 1 ÇÔ¹Ò·Õ ·íÒãˌà¡Ô´ ¡ÒÃà»ÅÕÂè ¹á»Å§ã¹á¹ÇµÑ§é 2 ª‹Í§ ᵋÅЪ‹Í§à·‹Ò¡Ñº 0.5V áÅÐ ∆V ໚¹ 1V á·¹¤‹Òã¹ÊÁ¡ÒèÐ䴌 1mA = 0.001 = C

1V 1s

ŒÒ¢ŒÒ§Ê Á¡ÒÃà¾×Íè ËÒ¤‹Ò C 䴌෋ҡѺ 0.001 F ËÃ×Í 1000µF

SCi-B X

Microcontroller in Science experiment


94

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 17

à«Åŏ俿‡Òà¤ÁÕ Chemical electric cell ¨Ø´»ÃÐʧ¤ à¾×Íè ·´Åͧ¤Ø³ÊÁºÑµ¢Ô ͧà«Åŏ俿‡Òà¤ÁÕ â´ÂÍÒÈÑÂà¤Ã×Íè §Á×͵ÃǨÇÑ´à¾×Íè áÊ´§¼Å

ÍØ»¡Ã³áÅÐà¤Ã×Íè §Á×Í 1. SCi-BOX 2. ἧǧ¨ÃÅ´·Í¹áç´Ñ¹ Attenuator 3. Ἃ¹âÅËЪ¹Ô´µ‹Ò§æ 䴌ᡋ ·Í§á´§, ÍÐÅÙÁàÔ ¹ÕÂÁ, àËÅç¡, Êѧ¡ÐÊÕ 4. ºÕ¡à¡ÍÏ ¢¹Ò´ 200 ÁÔÅÅÔÅµÔ Ã (ml.) 2 㺠5. ᷋§¤¹ÊÒÃà¤ÁÕ 6. ¹éÒí ¡Åѹè 7. â«à´ÕÂÁäδÃÍ¡ä«´ 8. ªŒÍ¹µÑ¡ÊÒÃà¤ÁÕ¢¹Ò´àÅç¡ 9. à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏáÊ´§¼ÅËÃ×ÍâÁ´ÙÅáÊ´§¼Å SLCD

äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ äÁ‹ÁãÕ ¹ªØ´ SCi-BOX µŒÍ§¨Ñ´ËÒà¾ÔÁè àµÔÁ

»¯ÔºµÑ ¡Ô Òà àµÃÕÂÁà¤Ã×èͧÁ×Í 1. ºÕ¡à¡ÍÏãºááãˌãʋ¹Òéí ¡Åѹè àÍÒänj 100ml. 2. àµÃÕÂÁÊÒÃÅÐÅÒÂâ«à´ÕÂÁäδÃÍ¡ä«´ã¹ºÕ¡à¡ÍÏ㺷Õè 2 ¨Ò¡¹éÒí ¡Åѹè 100 ml. áÅÐà¡Åç´â«à´ÕÂÁäδÃÍ¡ä«´ »ÃÐÁÒ³ 1 ªŒÍ¹µÑ¡ÊÒÃà¤ÁÕ¢¹Ò´àÅç¡ ¤¹ãˌÅÐÅÒ 3. ¢Ñ´·íÒ¤ÇÒÁÊÐÍҴἋ¹âÅËзÕãè ªŒ Ōҧ´ŒÇ¹éÒí ¡Åѹè àªç´ãˌáˌ§ 4 àµÃÕÂÁà¤Ã×Íè §Á×ÍÇÑ´â´ÂàÅ×Í¡¨ÑÁê à»ÍϺ¹á¼§Ç§¨ÃÅ´·Í¹áç´Ñ¹ Attenuator ä»·Õµè Òí á˹‹§ 1/2 áŌǵ‹ÍÊÒÂä» Âѧ¨Ø´µ‹Í SENSOR0 º¹ SCi-BOX 5. ແ´â»Ãá¡ÃÁ SCi-BOX Activity áŌÇàÅ×Í¡¡Ô¨¡ÃÃÁ AT05-Attenuator ·íÒ¡ÒôÒǹâËÅ´â»Ãá¡ÃÁ 6. 㹡ÒÃáÊ´§¼ÅàÅ×͡䴌·§Ñé ¨Ò¡Ë¹ŒÒ¨ÍÀÒ¾¢Í§â»Ãá¡ÃÁ SCi-BOX ACtivity ËÃ×Í㪌âÁ´ÙÅ SLCD Ëҡ㪌âÁ´ÙÅ SLCD µŒÍ§µ‹Íà¢ŒÒ·Õ¨è ´Ø µ‹Í P7 ¢Í§ SCi-BOX


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

95

¡Ò÷´Åͧ 1. ·´Åͧ¹íÒἋ¹âÅËÐ 2 Ἃ¹¨ØÁ‹ ŧ㹺աà¡ÍϹÒéí ¡Åѹè (㺷Õè 1) ·´ÅͧÇÑ´áç´Ñ¹ ¡ÅѺ¢ÑÇé ä»-ÁÒ áÅз´Åͧà»ÅÕÂè ¹ Ἃ¹âÅËÐÊÅѺ¡Ñ¹ ·íÒ¨¹¤Ãº·Ø¡ª¹Ô´ ºÑ¹·Ö¡¤‹Ò·ÕÍè ҋ ¹ä´Œ¨Ò¡µÑÇáÊ´§¼Å áÅÐãËŒÊ§Ñ à¡µ´Ù¿Í§ÍÒ¡ÒÈ·Õ¼è ÇÔ Ë¹ŒÒâÅËÐ ´ŒÇÂ

·Í§á´§ àËÅç¡ Êѧ¡ÐÊÕ ÍÐÅÙÁàÔ ¹ÕÂÁ

2. ¹íÒἋ¹âÅËШØÁ‹ ŧ㹺աà¡ÍÏ㹷Õè 2 ·Õãè ʋÊÒÃÅÐÅÒÂâ«à´ÕÂÁäδÃÍ¡ä«´ áÅзíÒ¡Ò÷´ÅͧàËÁ×͹¡Ñº¢Ñ¹é µÍ¹ ·Õ¼è ҋ ¹ÁÒ ºÑ¹·Ö¡¼Å·Õàè ¡Ô´¢Ö¹é 3. ¹íÒἋ¹·Í§á´§áÅÐἋ¹ÍÐÅÙÁàÔ ¹ÕÂÁÁÒãʋ㹺աà¡ÍÏ·Õè 2 ·Õãè ʋÊÒÃÅÐÅÒÂâ«à´ÕÂÁäδÃÍ¡ä«´ ¨Ò¡¹Ñ¹é ¹íÒÊÒ »Ò¡¤Õº´ŒÒ¹ä¿ºÇ¡ÁÒ˹պ·Õáè ¼‹¹·Í§á´§ ʋǹÊÒ»ҡ¤Õº´ŒÒ¹ä¿ÅºË¹Õº·Õáè ¼‹¹ÍÐÅÙÁàÔ ¹ÕÂÁ

4. ¨Ò¡¹Ñ¹é ¤‹ÍÂæ à·¹éÒí ¡ÅÑ¹è ¨Ò¡ºÕ¡à¡ÍÏ㺷Õè 1 ãʋ㹺աà¡ÍÏ㺷ÕÊè ͧ ÃÐËNjҧ·íÒ¡Ò÷´Åͧãˌ㪌᷋§¤¹ÊÒÃà¤ÁÕ ¤¹µÅÍ´àÇÅÒ ·´Åͧઋ¹¹Õäé »àÃ×Íè Âæ Êѧࡵ¼Å·Õäè ´ŒÇҋ ÁÕ¡ÒÃà»ÅÕÂè ¹á»Å§ËÃ×ÍäÁ‹ ·íÒäÁ¨Ö§à»š¹àª‹¹¹Ñ¹é ?


96

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ò÷´Åͧà¾ÔÁè àµÔÁ 5. ·´Åͧµ‹Íà¾ÔÁè ´Ñ§ÃÙ» â´Â 㪌»Ò¡¤Õºµ‹ÍࢌҡѺâÅËÐãˌàª×Íè Á⧡ѹÃÐËNjҧºÕ¡à¡ÍÏ áŌÇÇÑ´à·ÕºµÒÁ¨Ø´µ‹Ò§æ B A

C D

·Í§á´§ ÍÐÅÙÁÔà¹ÕÂÁ

6. à»ÅÕÂè ¹ÊÒÃÅÐÅÒ¨ҡâ«à´ÕÂÁäδÃÍ¡ä«´à»š¹¤Í»à»ÍÏ«ÅÑ à¿µËÃ×ÍÊÒûÃСͺâÅËÐÍ×¹è æ áŌǷ´ÅͧÍÕ¡¤Ãѧé Êѧࡵ¼Å·Õäè ´Œ

INNOVATIVE EXPERIMENT


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

97

º··Õè 6

¡Ò÷´Åͧ㪌§Ò¹ SCi-B X ´ŒÇ¡ÒÃ��¢Õ¹â»Ãá¡ÃÁÀÒÉÒàºÊÔ¡

¨Ò¡ã¹º··Õè 5 ·Õ¹è Òí àʹ͡Ò÷´Åͧ㪌§Ò¹ SCi-BOX ¡Ñº«Í¿µáÇÏã¹áººÊíÒàÃç¨ÃÙ»ËÃ×ÍàÃÕ¡ Ç‹Ò User mode «Ö§è ÍíҹǤÇÒÁÊдǡÍ‹ҧÁÒ¡µ‹Í·Ñ§é ¼ÙàŒ ÃÕ¹áÅСÒÃàµÃÕÂÁ¡Ò÷´ÅͧÇÔ·ÂÒÈÒʵÏ㹠á¹ÇãËÁ‹·ãÕè ªŒäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏÃNj Á´ŒÇ Í‹ҧäáçµÒÁ SCi-BOX ÊÒÁÒö¾Ñ²¹Òâ»Ãá¡ÃÁ·´Åͧ 䴌â´ÂµÑǼٌàÃÕ¹àͧ â´Â㪌«Í¿µáÇÏÊíÒËÃѺà¢Õ¹â»Ãá¡ÃÁ´ŒÇÂÀÒÉÒàºÊÔ¡â´Â੾ÒзÕèª×èÍ àºÊÔ¡ áʵÁ»ŠàÍ´ÔàµÍÏ (BASIC Stamp Editor) «Ö觹Ѻ¶Ö§»˜¨¨ØºÑ¹à»š¹àÇÍϪÑè¹ 2 áÅŒÇ ¨ÐàÃÕ¡¡ÒÃ㪌§Ò¹ SCi-BOX ã¹ÅѡɳйÕÇé ҋ ¡ÒÃ㪌§Ò¹ã¹áºº¾Ñ²¹Òâ»Ãá¡ÃÁ ËÃ×Í Developer mode 㹺·¹Õé¨Ð¡Å‹ÒǶ֧¡ÒÃ㪌§Ò¹â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏàº×éͧµŒ¹ ÊÃØ»ªØ´¤íÒÊÑè§ÀÒÉÒ àºÊÔ¡¢Í§ i-Stamp Íѹ໚¹äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏËÅÑ¡·Õè㪌㹪ش SCi-BOX áÅеÑÇÍ‹ҧâ»Ãá¡ÃÁ ÊíÒËÃѺ·´Åͧ㪌§Ò¹ SCi-BOX ´ŒÇÂâ»Ãá¡ÃÁÀÒÉÒàºÊÔ¡ Í‹ҧäáçµÒÁ ÊíÒËÃѺÃÒÂÅÐàÍÕ´Í‹ҧ ÊÁºÙó¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáÅЪش¤íÒÊÑ§è ¢Í§ i-Stamp ÁÕÍÂÙ㋠¹Ë¹Ñ§Ê×Í ¤Ø³ÊÁºÑµ·Ô Ò§ ÎÒÏ´áÇÏáÅЪش¤íÒÊÑ§è ¢Í§àºÊÔ¡áʵÁ»Š 2SX «Ö§è ¨Ñ´¾ÔÁ¾â´ÂºÃÔÉ·Ñ ÍÔ¹â¹àǵտ àÍç¡à¾ÍÃÔàÁ¹µ ¨íÒ¡Ñ´

6.1 ¡ÒÃ㪌§Ò¹ SCi-BOX ã¹áºº¾Ñ²¹Òâ»Ãá¡ÃÁËÃ×Í Developer mode ໚¹¡ÒÃ㪌§Ò¹ SCi-BOX ´ŒÇ¡ÒÃà¢Õ¹â»Ãá¡ÃÁ¢Ö¹é ÁÒãËÁ‹ â´Â¨ÐÊÒÁÒöà¢Õ¹੾ÒÐâ»Ãá¡ÃÁ ÀÒÉÒ¾ÕàºÊÔ¡ãˌ Sci-BOX ·íÒ§Ò¹´ŒÇµÑÇàÍ§à·‹Ò¹Ñ¹é «Ö§è àËÁÒÐÊíÒËÃѺ§Ò¹·Õäè Á‹¨Òí ໚¹µŒÍ§Ê‹§¢ŒÍÁÙÅÁÒ »ÃÐÁÇżŷÕàè ¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÏ ËÅѧ¨Ò¡´ÒǹâËÅ´áÅŒÇ ¡çÊÒÁÒö¶Í´ºÍÏ´ SCi-BOX ä»ãªŒ·ÍÕè ¹×è 䴌 ÃÇÁ¶Ö§¡ÒÃÊÌҧä¿Å Íͺਡ (.OBJ) à¾×Íè ¹íÒä»ãªŒã¹¤ÃÑ§é µ‹Íæä»ä´Œ â´ÂÊдǡ ËÃ×ͨÐà¢Õ¹â»Ãá¡ÃÁ·Ñ§é Êͧʋǹ ¤×Í à¢Õ¹â»Ãá¡ÃÁ¾ÕàºÊÔ¡ãˌ Sci-BOX ʋ§¢ŒÍÁÙż‹Ò¹¾Íϵ ͹ءÃÁÁÒÂѧà¤Ã×èͧ¤ÍÁ¾ÔÇàµÍÏ ¨Ò¡¹Ñé¹à¢Õ¹â»Ãá¡ÃÁʋǹµÔ´µ‹Í¡Ñº¾Íϵ͹ءÃÁ´ŒÇÂâ»Ãá¡ÃÁ ÀÒÉÒÍ×¹è ઋ¹ Borland Delphi ËÃ×Í Microsoft Visual Basic â´Âà¾ÔÁè ActiveX ¤Í¹â·ÃÅ MSCOMM32 à¾×è͵Դµ‹Í¾ÍϵËÇÁ´ŒÇ «Öè§àËÁÒÐÊíÒËÃѺ¼ÙŒ·ÕèÁÕ¤ÇÒÁ¶¹Ñ´ã¹¡ÒÃà¢Õ¹â»Ãá¡ÃÁÀÒÉÒº¹à¤Ã×èͧ


98

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¤ÍÁ¾ÔÇàµÍϴnj  ·íÒãˌÊÒÁÒöàª×Íè Áµ‹Í¡ÒÃ㪌§Ò¹ Sci-BOX ËÇÁ¡Ñº Application Í×¹è æ ·Õãè ªŒ§Ò¹à©¾ÒÐ ËÃ×Í»ÃÐÂØ¡µà¾ÔÁè àµÔÁ¨Ò¡µÑÇÍ‹ҧâ»Ãá¡ÃÁ·ÕÁè ÍÕ ÂÙዠŌÇ䴌 ÃÇÁ¶Ö§¡ÒÃÊÌҧä¿ÅÊ§Ñè §Ò¹ (.EXE) à¾×Íè ·íÒ §Ò¹ áÅÐàÃÕ¡ä¿ÅÍͺਡ (.OBJ) 㹡ÒôÒǹâËÅ´â»Ãá¡ÃÁ¾ÕàºÊÔ¡ã¹ Sci-BOX à¾×Íè ¹íÒä»ãªŒ§Ò¹ 䴌Í‹ҧÊдǡ µÒÁµŒÍ§¡ÒÃ

6.2 á¹Ð¹íÒâ»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ 㹡ÒÃà¢Õ¹â»Ãá¡ÃÁà¾×Íè ¤Çº¤ØÁ¡Ò÷íÒ§Ò¹¢Í§ i-Stamp ¹Ñ¹é 㪌ÀÒÉÒàºÊÔ¡·Õàè ÃÕÂ¡Ç‹Ò ¾ÕàºÊÔ¡ (PBASIC) â´Â¼‹Ò¹â»Ãá¡ÃÁ·Õªè Í×è Ç‹Ò àºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ (BASIC Stamp Editor) â»Ãá¡ÃÁ¹Õé ¨Ð¶Ù¡ãªŒã¹¡ÒõԴµ‹Í¤ÍÁ¾ÔÇàµÍÏ¡ºÑ àºÊÔ¡áʵÁ»Š¼Ò‹ ¹¾Íϵ͹ءÃÁÃÇÁ¶Ö§ãªŒã¹¡ÒÃà¢Õ¹áÅÐá¡Œä¢ â»Ãá¡ÃÁÀÒÉÒàºÊÔ¡ËÃ×Í·íÒ˹ŒÒ·Õàè »š¹àÍ´ÔàµÍϴnj  â´Ââ»Ãá¡ÃÁ¨ÐµÃǨÊͺ¡ÒÃà¢Õ¹â»Ãá¡ÃÁ ã¹·Ø¡ºÃ÷ѴNjҼԴäÇ¡óËÃ×ÍäÁ‹ áÅÐ㪌㹡ÒÃâËÅ´ËÃ×Íà¢Õ¹â»Ãá¡ÃÁŧº¹µÑÇàºÊÔ¡áʵÁ»Š à¾×Íè ·íÒ¡ÒÃÃѹ ¨Ö§¡Å‹ÒÇ䴌Çҋ â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾Õ§µÑÇà´ÕÂÇ·íҧҹ䴌¤ÃºÇ§¨Ã ·íÒãˌ ¡ÒÃàÃÕ¹ÃٌàºÊÔ¡áʵÁ»Š§‹ÒÂáÅÐÁÕ¢Ñ鹵͹¹ŒÍ ÊíÒËÃѺâ»Ãá¡ÃÁ·Õè¹íÒÁÒá¹Ð¹íÒ¹Õé໚¹àºÊÔ¡áʵÁ»Š àÍ´ÔàµÍÏ V2.0 ÃͧÃѺÀÒÉÒ¾ÕàºÊÔ¡¶Ö§àÇÍϪ¹Ñè 2.5 «Ö§è ÁÕ¤ÇÒÁÊÒÁÒöÊÙ§ÁÒ¡

6.2.1 Ãкº¤ÍÁ¾ÔÇàµÍÏ·µÕè ͌ §¡Òà l 㪌«¾ Õ ÂÕ àÙ ¾¹àµÕÂÁ 200MHz ¢Ö¹é ä» ¨ÍÀÒ¾ÊÕ SVGA

µÔ´µÑ§é Ãкº»¯ÔºµÑ ¡Ô ÒÃÇÔ¹â´Çʏ 95/98/ME/XP/2000 ËÃ×Í NT l ˹‹Ç¤ÇÒÁ¨íÒáÃÁÍ‹ҧ¹ŒÍ 24 àÁ¡Ð亵 áÅÐÁÕ¾¹ ×é ·ÕÇè ҋ §º¹ÎÒÏ´´ÔÊ¡ 10 àÁ¡Ð亵 l ¾Íϵ͹ءÃÁNjҧÍ‹ҧ¹ŒÍ 1 ¾Íϵ 㹡óշàÕè ¤Ã×Í è §¤ÍÁ¾ÔÇàµÍÏäÁ‹Á¾Õ Íϵ͹ءÃÁ ÊÒÁÒö ãªŒÍ»Ø ¡Ã³á»Å§¾Íϵ USB ໚¹¾Íϵ͹ءÃÁ (USB to Serial port converter) ᷹䴌 l

6.2.2 ¡ÒõԴµÑ§é â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ 6.2.2.1 µÔ´µÑ§é â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍϼҋ ¹·Ò§á¼‹¹«Õ´ÃÕ ÍÁ 1.1 ࢌÒä»·Õäè ´àÃ硵ÍÃÕè StampEditor2.0 ¨Ð¾ºä¿Å Setup stamp editor .exe ´ÑºàºÔÅé ¤ÅÔ¡·Õè ä¿Å¹¹Ñé à¾×Íè àÃÔÁè µŒ¹µÔ´µÑ§é â»Ãá¡ÃÁ 1.2 (¡) ¡Ã³Õ㪌¡ºÑ ÇÔ¹â´Çʏ 95/98/ME ËÒ¡¡ÒõԴµÑ§é ã¹¢ŒÍ 1.1 à¡Ô´¡ÒöÒÁËÒä¿Å·àÕè ¡ÕÂè Ç¢ŒÍ§¡Ñº ¡ÒèѴ¡ÒÃÃкºÇÔ¹â´Çʏ ãˌ¡àÅÔ¡¡ÒõԴµÑé§ áŌÇࢌÒä»ã¹ä´àÃ硵ÍÃÕè StampEditor2.0 áŌǵԴµÑé§ «Í¿µáÇÏàµÃÕÂÁ¾ÃŒÍÁÊíÒËÃѺµÔ´µÑ§é â»Ãá¡ÃÁ»ÃÐÂØ¡µ·ªÕè Í×è instmsia.exe ´ÑºàºÔÅé ¤ÅÔ¡à¾×Íè àÃÔÁè µÔ´µÑ§é 1.2 (¢) ¡Ã³Õ㪌¡ºÑ ÇÔ¹â´Çʏ NT/2000/XP ãˌàÅ×Í¡ä¿Å instmsiw.exe á·¹


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

99

Í‹ҧäáçµÒÁ ËÒ¡ã¹à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍϢͧ¼Ù㌠ªŒ§Ò¹ä´ŒÁ¡Õ ÒõԴµÑ§é «Í¿µáÇÏàµÃÕÂÁ¾ÃŒÍÁ¹Õé änjáÅŒÇ â»Ãá¡ÃÁ¨ÐäÁ‹µ´Ô µÑ§é «éÒí 㹡óշàÕè »š¹àÇÍϪ¹Ñè à´ÕÂǡѹËÃ×͵èÒí ¡Ç‹Ò ãˌ¢ÒŒ Á¢Ñ¹é µÍ¹¹Õäé »ä´ŒàÅÂ

6.2.2.2 ´ÒǹâËÅ´¨Ò¡ http://www.parallax.com ËÅѧ¨Ò¡´ÒǹâËÅ´ä¿Åµ´Ô µÑ§é ÁÒàáÅŒÇ ãˌ´ºÑ àºÔÅé ¤ÅÔ¡·Õäè ¿Å¹¹Ñé à¾×Íè àÃÔÁè µÔ´µÑ§é àËÁ×͹¡Ñº¢ŒÍ 1.2 ¶ŒÒËÒ¡Ãкº»¯ÔºÑµÔ¡ÒÃÇÔ¹â´ÇʏÂѧäÁ‹à¤ÂÁÕ¡ÒõԴµÑ駫ͿµáÇÏàµÃÕÂÁ¾ÃŒÍÁÊíÒËÃѺµÔ´µÑé§â»Ãá¡ÃÁ »ÃÐÂØ¡µãˌ¼ÙŒãªŒ§Ò¹µÔ´µÑ駫ͿµáÇÏàµÃÕÂÁ¤ÇÒÁ¾ÃŒÍÁ´Ñ§¡Å‹ÒÇ «Ö觴ÒǹâËŴ䴌·ÕèàǺ䫵¢Í§ Microsoft Í‹ҧäáçµÒÁ »˜­ËÒ¹Õ¨é оºäÁ‹ÁÒ¡¹Ñ¡ à¹×Íè §¨Ò¡«Í¿µáÇÏ»ÃÐÂØ¡µËÅÒÂæ µÑÇ ÁÑ¡¨ÐµÔ´ µÑ駫ͿµáÇÏàµÃÕÂÁ¤ÇÒÁ¾ÃŒÍÁ¹Õé仾ÌÍÁ¡Ñº«Í¿µáÇϢͧµÑÇàͧàÊÁÍ

6.2.3 ¡ÒÃàµÃÕÂÁâ»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏÊÒí ËÃѺµÔ´µ‹Í¡Ñº i-Stamp 1. ແ´â»Ãá¡ÃÁ¢Ö¹é ÁÒ㪌§Ò¹ â´Âä»·Õè Start à Program à Parallax Inc à Stamp editor 2.0 à BASIC Stamp editor V2.0 ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§¢Í§â»Ãá¡ÃÁµÒÁÃÙ»·Õè 6-1 2. ä»·Õàè Á¹Ù Edit à Preference ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§ preference ¢Ö¹é áŌÇàÅ×͡˹ŒÒµ‹Ò§ Editor operation ä»·Õ¡è Ãͺ Stamp mode and ports àÅ×Í¡ Default Com Port ãˌáÊ´§ AUTO áÅзժè ͋ § Default Project Downlode Mode àÅ×Í¡ãˌáÊ´§ Modified ´Ñ§áÊ´§ã¹ÃÙ»·Õè 6-2 3. ¤ÅÔ¡·Õ»è Á؆ OK à¾×Íè ¡ÅѺä»Âѧ˹ŒÒµ‹Ò§àÍ´ÔàµÍÏ ã¹â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ V2 䴌ÍÒí ¹Ç¤ÇÒÁÊдǡ㹡ÒÃà¢Õ¹â»Ãá¡ÃÁà¾ÔÁè ¢Ö¹é Í‹ҧÁÒ¡ ÍÒ·Ô ¡ÒÃᡤíÒÊÑ§è µÑÇá»Ã ÅÒàºÅ ´ŒÇÂÊÕ, ¡ÒûÃѺà»ÅÕÂè ¹¢¹Ò´¢Í§µÑÇÍÑ¡ÉÃ, ¡ÒûÃѺà»ÅÕÂè ¹ ÊÕ¾×鹢ͧ˹ŒÒµ‹Ò§áÊ´§¼Å «Ö觼ٌ㪌§Ò¹ÊÒÁÒöàÅ×͡䴌µÒÁ¤ÇÒÁµŒÍ§¡Òà â´ÂࢌÒä»·ÕèàÁ¹Ù Edit à Preference à Editor Appearance ´Ñ§ã¹ÃÙ»·Õè 6-3

6.2.4 ÃÒÂÅÐàÍÕ´â´ÂÊÃØ»¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ 6.2.4.1 àÁ¹Ùà¤Ã×Íè §Á×ͨѴ¡ÒÃῇÁ¢ŒÍÁÙÅÁҵðҹáÅСÒþÔÁ¾ ª×Íè ¢Í§àÁ¹Ù¹¤Õé Í× File ÁÕ¡Ò÷íÒ§Ò¹´Ñ§¹Õé New Document 㪌ÊíÒËÃѺÊÌҧῇÁ¢ŒÍÁÙÅãËÁ‹ Open File 㪌ÊÒí ËÃѺແ´á¿‡Á¢ŒÍÁÙÅ ¹ÒÁÊ¡ØÅ .BSX ÊÒÁÒö㪌¤ÂÕ Å ´Ñ ¤×Í Ctrl+O Save 㪌ÊÒí ËÃѺºÑ¹·Ö¡á¿‡Á¢ŒÍÁÙÅ㹪×Íè à´ÔÁ ÊÒÁÒö㪌¤ÂÕ Å ´Ñ ¤×Í Ctrl+S Save As 㪌ÊÒí ËÃѺºÑ¹·Ö¡¢ŒÍÁÙÅ àÁ×Íè µŒÍ§¡ÒÃà»ÅÕÂè ¹ª×Íè ῇÁ¢ŒÍÁÙÅ Generate Object Code 㪌ÊÌҧä¿Å¹ÒÁÊ¡ØÅ .exe ¢Í§«ÍÏÊâ»Ãá¡ÃÁ·Õèà¢Õ¹¢Öé¹à¾×èÍàÃÕ¡


100

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X àÅ×Í¡àºÊÔ¡áʵÁ»Š 2PE àÅ×Í¡àºÊÔ¡áʵÁ»Š 2P àÅ×Í¡àºÊÔ¡áʵÁ»Š 2SX àÅ×Í¡àºÊÔ¡áʵÁ»Š 2E àÅ×Í¡àºÊÔ¡áʵÁ»Š 2 Preference ແ´Ë¹ŒÒµ‹Ò§µÑ駤‹Ò ẋ§¾×é¹·Õèà¢Õ¹â»Ãá¡ÃÁ

àÅ×Í¡µÑÇá»ÅÀÒÉÒ¾ÕàºÊÔ¡ V2.5 àÅ×Í¡µÑÇá»ÅÀÒÉÒ¾ÕàºÊÔ¡ V2.5 µÃǨÊͺäÇ¡ó ´Ù˹‹Ç¤ÇÒÁ¨íÒ Ãѹâ»Ãá¡ÃÁ

ແ´ä¿Åª‹ÇÂàËÅ×Í (Help)

Identify

ÊÌҧä¿ÅãËÁ‹ ແ´ä¿Å »´ä¿Å ºÑ¹·Ö¡ä¿Å ແ´Ë¹ŒÒµ‹Ò§¤Œ¹ËÒä¿Å (explorer) ¾ÔÁ¾ä¿ÅÍÍ¡à¤Ã×èͧ¾ÔÁ¾ µÑ´¢ŒÍ¤ÇÒÁ ¤Ñ´ÅÍ¡¢ŒÍ¤ÇÒÁ ÇÒ§¢ŒÍ¤ÇÒÁ ¤Œ¹ËÒ

ແ´Ë¹ŒÒµ‹Ò§ Debug terminal ˹ŒÒµ‹Ò§¤Œ¹ËÒä¿Å (explorer)

¾×¹é ·Õàè ¢Õ¹â»Ãá¡ÃÁ

ᶺáÊ´§Ê¶Ò¹Ð

áÊ´§µíÒá˹‹§à¤ÍÏà«ÍÏ

ÃÙ»·Õè 6-1 áÊ´§Ë¹ŒÒµ‹Ò§ËÅÑ¡¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍϾÌÍÁáÊ´§Ê‹Ç¹»ÃСͺµ‹Ò§æ

ÃÙ»·Õè 6-2 ˹ŒÒµ‹Ò§ Editor Operation ÊíÒËÃѺ ÃÙ»·Õè 6-3 ˹ŒÒµ‹Ò§ Editor Appearance ÊíÒËÃѺ ¡íÒ˹´¡ÒõԴµ‹Í¢Í§àºÊÔ¡áʵÁ»Š 2SX àÅ×Í¡¡ÒÃáÊ´§¼Å¢Í§â»Ãá¡ÃÁàÍ´ÔàµÍÏ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

Print Close File Exit

l

101

㪌§Ò¹ä´Œ·¹Ñ ·Õ â´ÂäÁ‹µÍŒ §à»´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ¢¹Öé ÁÒ ãªŒ¾ÁÔ ¾«ÍÏÊä¿Å (ῇÁ¢ŒÍÁÙÅÀÒÉÒàºÊÔ¡·Õàè ¢Õ¹¢Ö¹é ) ¤ÕÂŏ ´Ñ ¤×Í Ctrl+P 㪌ÊíÒËÃѺ»´á¿‡Á¢ŒÍÁÙŠ㪌ÊíÒËÃѺÍÍ¡¨Ò¡â»Ãá¡ÃÁ

6.2.4.2 àÁ¹Ùᡌä¢á¿‡Á¢ŒÍÁÙÅ ª×Íè ¢Í§àÁ¹Ù¹¤Õé Í× Edit ÁÕÃÒÂÅÐàÍÕ´¢Í§à¤Ã×Íè §Á×Í‹ÍÂã¹àÁ¹Ù Edit µ‹Í仹Õé Undo 㪌¡àÅÔ¡¡ÒÃ㪌§Ò¹à¤Ã×Íè §Á×Íᡌ䢢ŒÍÁÙÅ¡‹Í¹Ë¹ŒÒ¹Õé ¤ÕÂŏ ´Ñ ¤×Í Ctrl+Z Cut 㪌µ´Ñ à¾×Íè ŒÒµíÒá˹‹§¢Í§¢ŒÍ¤ÇÒÁ·Õàè Å×Í¡ ¤ÕÂŏ ´Ñ ¤×Í Ctrl+X Copy 㪌¤´Ñ ÅÍ¡¢ŒÍ¤ÇÒÁ ¤ÕÂŏ ´Ñ ¤×Í Ctrl+C Paste 㪌ÇÒ§¢ŒÍ¤ÇÒÁ·Õµè ´Ñ ËÃ×ͤѴÅÍ¡ÁÒ ¤ÕÂŏ ´Ñ ¤×Í Ctrl+V Select All 㪌àÅ×Í¡¢ŒÍ¤ÇÒÁ·Ñ§é ËÁ´ã¹á¿‡Á¢ŒÍÁÙÅ ¤ÕÂŏ ´Ñ ¤×Í Ctrl+A Find/Replace 㪌¤¹Œ ËÒáÅÐá·¹·Õ¢è ͌ ¤ÇÒÁ ¤ÕÂŏ ´Ñ ¤×Í Ctrl+F Find Nex 㪌¤¹Œ ËÒ¢ŒÍ¤ÇÒÁµ‹Íä» ¤ÕÂŏ ´Ñ ¤×Í »ØÁ† F3 Preference 㪌»ÃѺà»ÅÕÂè ¹á¡Œä¢¾ÒÃÒÁÔàµÍϵҋ §æ ¢Í§àºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ ¶Ö§áÁŒÇ‹Ò·Õè˹ŒÒµ‹Ò§ Preference ¨Ð㪌»ÃѺ¡Ò÷íÒ§Ò¹¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ䴌 ᵋ㹡ÒÃ㪌§Ò¹¨ÃÔ§ â»Ãá¡ÃÁ¨Ð»ÃѺà»ÅÕÂè ¹áÅÐàÅ×Í¡¤‹Ò·Õàè ËÁÒÐÊÁâ´ÂÍѵâ¹ÁѵÍÔ ÂÙዠŌÇ

6.2.4.3 àÁ¹ÙàÅ×Í¡ä´àÃ硵տ (Directive) 1. Stamp : àÅ×Í¡Ãع‹ ¢Í§àºÊÔ¡áʵÁ»Š 2 ·Õµè ͌ §¡Ò÷íÒ§Ò¹ (BS2, BS2E, BS2SX, BS2P, BS2PE) ËÃ×ͨÐàÃÕ¡㪌§Ò¹¼‹Ò¹»ØÁ† «Ö§è Áմnj ¡ѹ 5 ÊÕá·¹Ãع‹ ¢Í§àºÊÔ¡áʵÁ»Š¡äç ´Œ ÊÕà¢ÕÂÇ㪌àÅ×Í¡àºÊÔ¡áʵÁ»Š 2 (BS2) ÊÕᴧ㪌àÅ×Í¡àºÊÔ¡áʵÁ»Š 2E (BS2E) ÊÕ¹Òéí à§Ô¹ãªŒàÅ×Í¡àºÊÔ¡áʵÁ»Š 2SX (BS2SX) i-Stamp ¨Ð㪌ä´àÃ硵տµÑǹÕé ÊÕàËÅ×Í§ãªŒàŒ Å×Í¡àºÊÔ¡áʵÁ»Š 2P (BS2P) ÊÕ¹Òéí µÒÅ㪌àÅ×Í¡àºÊÔ¡áʵÁ»Š 2PE (BS2PE) 2. Port : àÅ×Í¡¾Íϵ͹ءÃÁ·Õµè ͌ §¡ÒõԴµ‹Í´ŒÇ 3. PBASIC : 㪌àÅ×Í¡µÑÇá»ÅÀÒÉÒàºÊÔ¡ ÁÕãˌàÅ×Í¡ 2 Ãع‹ ¤×Í PBASIC 2.0 áÅÐ PBASIC 2.5 ÊíÒËÃѺã¹Ë¹Ñ§Ê×ÍàŋÁ¹Õé ¨Ð㪌 PBASIC2.5 ໚¹ËÅÑ¡


102

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

6.2.4.4 àÁ¹ÙáÊ´§¡Ò÷íÒ§Ò¹ ª×Íè ¢Í§àÁ¹Ù¹¤Õé Í× Run ໚¹àÁ¹Ùà¤Ã×Íè §Á×Í·ÕÁè ºÕ ·ºÒ·ÁÒ¡·ÕÊè ´Ø ÁÕà¤Ã×Íè §Á×Í‹Í·ÕÊè Òí ¤Ñ­¤×Í RUN

㪌ÊÒí ËÃѺÃѹâ»Ãá¡ÃÁ·Õàè ¢Õ¹¢Ö¹é ÊÒÁÒö㪌¤ÂÕ Å ´Ñ ¤×Í Ctrl+R

Check Syntax 㪌µÃǨÊͺäÇ¡ó¢Í§â»Ãá¡ÃÁÇ‹Ò ÁÕ¡ÒÃ㪌¤Òí ÊÑ§è ¼Ô´¾ÅÒ´ËÃ×ÍäÁ‹ Memory Map 㪌µÃǨÊͺ¤‹Ò¢Í§Ë¹‹Ç¤ÇÒÁ¨íҢͧàºÊÔ¡áʵÁ»Š ¤ÕÂŏ ´Ñ ¤×Í Ctrl+M Debug

㪌µÔ´µ‹ÍàºÊÔ¡áʵÁ»Š¡Ñº¤ÍÁ¾ÔÇàµÍÏ àÁ×èÍ㪌à¤Ã×èͧÁ×͹Õé˹ŒÒµ‹Ò§ Debug Terminal ¨Ð»ÃÒ¡¯¢Ö¹é ¤ÕÂŏ ´Ñ ¤×Í Ctrl+D

Identify

㪌¤¹Œ ËÒàºÊÔ¡áʵÁ»Š·µÕè ͋ ¡Ñº¾Íϵ͹ءÃÁ ¤ÕÂŏ ´Ñ ¤×Í Ctrl+I

·Õàè Á¹Ùà¤Ã×Íè §Á×͹ըé ÐÁÕà¾Õ§ Memory Map áÅÐ Debug à·‹Ò¹Ñ¹é ·Õàè Á×Íè àÃÕ¡㪌§Ò¹áŌǨлÃÒ¡¯ ˹ŒÒµ‹Ò§áÊ´§¡Ò÷íÒ§Ò¹¢Ö¹é ÁÒãËÁ‹ ¹Í¡¹Ñ¹é ¨ÐáÊ´§¡Ò÷íÒ§Ò¹¼‹Ò¹ºÒÏáÊ´§Ê¶Ò¹Ð (status bar) «Ö§è ÍÂً´ŒÒ¹Å‹Ò§¢Í§Ë¹ŒÒµ‹Ò§ËÅÑ¡¢Í§â»Ãá¡ÃÁ ¹Í¡à˹×Í仨ҡ¹Ñé¹à¤Ã×èͧÁ×Í·Ñé§ËÁ´ã¹àÁ¹Ù¹Õé¡ànj¹ Check Syntax ¨ÐÊÒÁÒö㪌§Ò¹ä´Œ¡çµ‹ÍàÁ×èÍàºÊÔ¡áʵÁ»Šàª×èÍÁµ‹ÍࢌҡѺ¤ÍÁ¾ÔÇàµÍÏáÅÐÊÒÁÒö µÔ´µ‹ÍÊ×èÍÊÒáѹ䴌

6.3 ¡ÒÃ㪌§Ò¹ SCi-BOX ¡Ñºâ»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏàº×Íé §µŒ¹ ÊÃػ໚¹¢Ñ鹵͹䴌´Ñ§¹Õé 6.3.1 ¹íÒ i-Stamp µÔ´µÑ§é ŧº¹«çÍ¡à¡çµ 24 ¢Òº¹á¼§Ç§¨Ã SCi-BOX

µÔ´µÑ§é i-Stamp ŧº¹ «çÍ¡à¡çµ 24 ¢Ò·ÕÇè ҋ § º¹ºÍÏ´ SCi-B X µÒÁ·ÔÈ·Ò§´Ñ§ã¹ÃÙ» ÃÐÇѧÍ‹ÒàÊÕºãˌ¼´Ô ´Œ Ò ¹ËÃ× Í ¢ÒàËÅ×è Í Á ¡Ñ¹à´ç´¢Ò´


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

103

6.3.2 µ‹ÍÊÒÂàª×Íè Áµ‹ÍÃÐËNjҧ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ¡ºÑ ἧǧ¨Ã SCi-BOX µ‹Íä»Âѧ¾Íϵ͹ءÃÁ ¢Í§¤ÍÁ¾ÔÇàµÍÏ ¤Í¹à¹ç¡àµÍÏ DB-9 µÑÇàÁÕ $ % &

'

! "

#



ÊÒÂàª×Íè Áµ‹Í ¾Íϵ͹ءÃÁ ´ŒÒ¹µÑÇàÁÕÂ

ÊÒÂàª×Íè Áµ‹Í ¾Íϵ͹ءÃÁ ´ŒÒ¹µÑǼٌ

ÊÒÂÁÑŵԤÍÏ 9 àʌ¹

RS-232 DOWNLOAD



#

! "

DC INPUT RESET

BASIC Stamp in Science Experiment

'

i-Stamp OFF

SCi-BOX

$ % &

ON

¤Í¹à¹ç¡àµÍÏ DB-9 µÑǼٌ

6.3.3 ¨‹ÒÂä¿ãˌᡋºÍÏ´ SCi-BOX áŌÇແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ V2.0 6.3.4 µÃǨÊÍºÇ‹Ò â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏÊÒÁÒöµÔ´µ‹Í¡Ñº i-Stamp 䴌ËÃ×ÍäÁ‹ â´Â ¡´¤Õ Ctrl I ËÃ×Í㪌àÁÒʏ¤ÅÔ¡é »ØÁ† Identify ËÃ×ÍࢌÒä»·Õàè Á¹Ù Run àÅ×Í¡ Identify ¶ŒÒ·Ø¡Í‹ҧ¶Ù¡µŒÍ§ ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§áÊ´§¡ÒõԴµ‹Í´Ñ§ã¹ÃÙ» ¨ÐàËç¹Ç‹Ò㹪‹Í§ COM1 ¨Ð»ÃÒ¡¯ª×Íè BASIC Stamp2SX V1.0 ໚¹¡ÒÃᨌ§ãˌ·ÃÒºÇ‹Ò â»Ãá¡ÃÁÊÒÁÒöµÔ´µ‹Í¡ÑºàºÊÔ¡áʵÁ»Š 2SX ÍÔ¹àµÍϾÃÕµàµÍÏ䴌áŌÇ


104

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

6.3.5 ·´Åͧà¢Õ¹â»Ãá¡ÃÁ§‹ÒÂæ µÒÁ¢Ñ¹é µÍ¹´Ñ§¹Õé 6.3.5.1 àÅ×Í¡ä´àÃ硵տËÃ×ͪ¹Ô´¢Í§àºÊÔ¡áʵÁ»Š·µÕè ͌ §¡ÒÃ㪌§Ò¹ ä»·Õàè Á¹Ù Directive àÅ×Í¡ Stamp à BS2SX ¨Ð»ÃÒ¡¯¢ŒÍ¤ÇÒÁ ‘{$STAMP BS2SX} ¢Ö¹é º¹ºÃ÷Ѵáá ¡´ Enter

6.3.5.2 ÂѧÍÂÙ·‹ àÕè Á¹Ù Directive àÅ×Í¡¾Íϵ͹ءÃÁ â´ÂàÅ×Í¡ Port à Com1 (ËÃ×Í Com Í×¹è æ µÒÁ·Õµè ͋ änj¨ÃÔ§) ¨Ð»ÃÒ¡¯¢ŒÍ¤ÇÒÁ ‘{$PORT COM1} º¹ºÃ÷Ѵ·ÕÊè ͧ ¡´ Enter

6.3.5.3 ÂѧÍÂً·ÕèàÁ¹Ù Directive àÅ×Í¡àÇÍϪÑ蹢ͧâ»Ãá¡ÃÁàÍ´ÔàµÍÏ PBASIC à Version2.5 ¨Ð»ÃÒ¡¯¢ŒÍ¤ÇÒÁ ‘{$PBASIC 2.5} ¢Ö¹é º¹ºÃ÷Ѵ·ÕÊè ÒÁ ¡´ Enter

6.3.5.4 ¾ÔÁ¾¤íÒÊÑè§ debug “welcome” ໚¹¡ÒÃÊѧè ãˌ i-Stamp ʋ§¢ŒÍ¤ÇÒÁ welcome ä»áÊ´§Âѧ˹ŒÒµ‹Ò§ Debug Terminal ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏ áŌǡ´ Enter


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

105

6.3.5.5 ¡´»ØÁ† Run ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§µÃǨÊͺ¡ÒÃàª×Íè Áµ‹ÍàºÊÔ¡áʵÁ»Š áÅлÃÒ¡¯ ˹ŒÒµ‹Ò§ Debug Terminal áÊ´§¢ŒÍ¤ÇÒÁ welcome ´Ñ§ã¹ÃÙ»

6.3.5.6 ¡´ÊÇÔµª RESET º¹ºÍÏ´ AX-2SX â»Ãá¡ÃÁ¨ÐáÊ´§¢ŒÍ¤ÇÒÁà´ÔÁº¹Ë¹ŒÒ µ‹Ò§ Debug Terminal «éÒí ÍÕ¡ à¹×Íè §¨Ò¡¡Òá´ÊÇÔµª RESET ໚¹¡ÒÃÊѧè ãˌàÃÔÁè ·íÒ§Ò¹ãËÁ‹Í¡Õ ¤Ãѧé 6.3.5.7 ¶ŒÒ»ÃÒ¡¯¢ŒÍ¤ÇÒÁ No BASIC Stamps found µÒÁÃÙ» áÊ´§Ç‹Ò ¡ÒÃàª×Íè Áµ‹Í ÃÐËNjҧ¤ÍÁ¾ÔÇàµÍÏ¡ºÑ i-Stamp ŌÁàËÅÇ «Ö§è ÍÒ¨à¡Ô´¨Ò¡ÊÒÂàª×Íè Áµ‹Í CX-232 ¢Ò´ËÃ×͵‹ÍäÁ‹¶¡Ù µŒÍ§ ãˌ·Òí ¡ÒõÃǨÊͺÊÒÂàª×Íè Áµ‹Í CX-232 â´ÂÁÕä´ÍÐá¡ÃÁ¡Òõ‹ÍÊÒ CX-232 áÊ´§ã¹ËÑÇ¢ŒÍ 6.3.2

6.3.6 ËÒ¡à¢Õ¹â»Ãá¡ÃÁ·´ÅͧàÃÕºÌÍÂáÅŒÇ µŒÍ§¡ÒÃà¡çºã¹ÃٻῇÁ¢ŒÍÁÙÅ ÊÔ§è ·Õµè ͌ §¡ÃзíÒ ¤×Í ãˌ ºÑ¹·Ö¡á¿‡Á¢ŒÍÁÙÅâ´Â¡íÒ˹´ãˌÁ¹Õ ÒÁÊ¡ØÅ .bsx àÊÁÍ à¹×Íè §¨Ò¡àºÊÔ¡áʵÁ»Š 2SX ÍÔ¹àµÍÏ ¾ÃÕµàµÍϨзíÒ¡ÒÃá»Åâ»Ãá¡ÃÁ¹ÒÁÊ¡ØÅ .bsx ෋ҹѹé


106

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

6.4 ÊÃØ»¤íÒÊÑ§è ¢Í§ i-Stamp ËÃ×ÍäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏàºÊÔ¡áʵÁ»Š 2SX ¡ÅØÁ‹ ¤íÒÊÑ§è ¨Ñ´¡ÒâŒÍÁÙÅ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ CON 㪌¡íÒ˹´¤‹Ò¤§·ÕèãˌᡋµÑÇá»Ã DATA DEBUG GET PUT RANDOM READ VAR WRITE

à¡çº¢ŒÍÁÙÅŧã¹Ë¹‹Ç¤ÇÒÁ¨íÒÍÕÍÕ¾ÃÍÁ¡‹Í¹¡ÒôÒǹâËÅ´ â»Ãá¡ÃÁ¾ÕàºÊԡŧã¹àºÊÔ¡áʵÁ»Š 2SX áÅÐ i-Stamp áÊ´§¤‹Ò¢Í§µÑÇá»Ã¼‹Ò¹·Ò§¤ÍÁ¾ÔÇàµÍÏ ͋ҹ¢ŒÍÁÙŨҡ˹‹Ç¤ÇÒÁ¨íÒÊá¤Ãµªá¾´ã¹àºÊÔ¡áʵÁ»Š 2SX à¡çº¢ŒÍÁÙÅŧã¹Ë¹‹Ç¤ÇÒÁ¨íÒÊá¤Ãµªá¾´ã¹àºÊÔ¡áʵÁ»Š 2SX Ê؋Á¢ŒÍÁÙŵÑÇàÅ¢ ͋ҹ¢ŒÍÁÙÅÃдѺ亵¨Ò¡Ë¹‹Ç¤ÇÒÁ¨íÒÍÕÍÕ¾ÃÍÁ ÁÒà¡çºänj㹵ÑÇá»Ã 㪌¡íÒ˹´µÑÇá»Ã à¢Õ¹¢ŒÍÁÙÅÃдѺ亵ä»à¡çºänjã¹Ë¹‹Ç¤ÇÒÁ¨íÒÍÕÍÕ¾ÃÍÁ

¡ÅØÁ‹ ¤íÒÊÑ§è ¤Çº¤ØÁÅíҴѺ¡Ò÷íÒ§Ò¹ (flow control command) ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ BRANCH ¡ÃÐâ´´ä»ÂѧµíÒá˹‹§·Õè¡íÒ˹´µÒÁ¤‹ÒµÑÇá»Ã END FOR...NEXT GOTO GOSUB IF...THEN NAP PAUSE RETURN RUN SLEEP STOP

·íÒ§Ò¹ã¹âËÁ´ÊÅÕ»¨¹¡Ç‹Ò¨ÐÁÕ¡ÒÃÃÕ૵àºÊÔ¡áʵÁ»Š 2SX ʋ§¼Åãˌ¡ÒÃ㪌¾Åѧ§Ò¹Å´Å§àËÅ×Í 50 äÁâ¤ÃáÍÁ»Š ( µ A) ¡íÒ˹´¨¹Ç¹Ãͺ·Õ赌ͧ¡ÒÃǹÅÙ»ËÃ×Í·íÒ§Ò¹«íéÒ ¡ÃÐâ´´ä»ÂѧáÍ´à´ÃÊã´æ ¡ÃÐâ´´ä»Âѧâ»Ãá¡ÃÁ‹Í à»ÃÕºà·Õºà§×è͹䢡‹Í¹¡ÒáÃÐâ´´ ËÂØ´·íҧҹ㹪‹Ç§àÇÅÒÊÑé¹æ ·íÒãˌ¡ÒÃ㪌¾Åѧ§Ò¹Å´Å§ ˹‹Ç§àÇÅÒ 0-65,536 ÇÔ¹Ò·Õ ¡ÃÐâ´´ÍÍ¡¨Ò¡â»Ãá¡ÃÁ‹Í Ãѹâ»Ãá¡ÃÁ·Õ赌ͧ¡Òà àÅ×͡䴌 8 â»Ãá¡ÃÁ ·íÒ§Ò¹ã¹âËÁ´»ÃÐËÂÑ´¾Åѧ§Ò¹ ËÂØ´¡Ò÷íÒ§Ò¹

¡ÅØÁ‹ ¤íÒÊÑ§è ¨Ñ´¡ÒÃÊÑ­­Ò³´Ô¨µÔ ÍÅ ÃÒÂÅÐàÍÕ´ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ BUTTON µÃǨÊͺ¡ÒÃÃѺ¤‹ÒËÃ×Í¡Òá´ÊÇÔµª COUNT HIGH INPUT LOW OUTPUT PULSIN PULSOUT REVERSE TOGGLE XOUT

¡ÅØÁ‹ ¤íÒÊÑ§è ¨Ñ´¡ÒÃÊÑ­­Ò³ÍйÒÅÍ¡ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ DTMFOUT ¡íÒà¹Ô´ÊÑ­­Ò³ DTMF ËÃ×ÍÊÑ­­Ò³»Ø†Áâ·ÃÈѾ· FREQOUT ¡íÒà¹Ô´ÊÑ­­Ò³ä«¹ 1 ËÃ×Í 2 ¤ÇÒÁ¶Õè µÑé§áµ‹ 0-82.917kHz PWM RCTIME

ÊÌҧÊÑ­­Ò³ PWM ¢¹Ò´ 8 ºÔµÍÍ¡ä»·Ò§¢Ò¾Íϵ ÇÑ´¤‹ÒàÇÅÒ¡ÒûÃШØ/¤Ò»ÃШآͧǧ¨Ã RC

¡ÅØÁ‹ ¤íÒÊÑ§è ¨Ñ´¡ÒâŒÍÁÙÅ͹ءÃÁ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ SERIN ÃѺ¢ŒÍÁÙÅ͹ءÃÁà¢ŒÒ ÁÕÃٻẺ¢ŒÍÁÙÅẺ N-8-1 ËÃ×Í E-7-1 SEROUT ʋ§¢ŒÍÁÙÅ͹ءÃÁÍÍ¡ã¹ÃٻẺ N-8-1 ËÃ×Í E-7-1 ·Ò§¢Ò S OUT SHIFTIN àÅ×è͹¢ŒÍÁÙÅࢌÒẺ͹ءÃÁ SHIFTOUT àÅ×è͹¢ŒÍÁÙÅÍ͡Ẻ͹ءÃÁ ¡ÅØÁ‹ ¤íÒÊÑ§è µÒÃÒ§¢ŒÍÁÙÅ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ LOOKDOWN ¤Œ¹ËÒµÑÇàÅ¢·ÕèàËÁ×͹¡Ñ¹ áŌÇà¡çº¤‹Òänj㹵ÑÇá»Ã LOOKUP ແ´µÒÃÒ§¢ŒÍÁÙÅ ¡ÅØÁ‹ ¤íÒÊÑ§è »ÃÐÁÇżŷҧ¤³ÔµÈÒʵÏ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ + ¤íÒÊÑ觡Òúǡ ¤íÒÊÑ觡ÒÃź

COS

¤íÒÊÑ觡Òäٳ â´Âʋ§¤‹Ò¼ÅÅѾ¸àÇÔÏ´´ŒÒ¹µíèÒ (16 ºÔµÅ‹Ò§) ¡ÅѺÁÒ ¤íÒÊÑ觡Òäٳ â´Âʋ§¤‹Ò¼ÅÅѾ¸àÇÔÏ´´ŒÒ¹ÊÙ§ (16 ºÔµº¹) ¡ÅѺÁÒ ¤íÒÊÑ觡ÒÃËÒà â´Âʋ§¤‹Ò¼ÅËÒèíҹǹàµçÁ·Õè䴌¡ÅѺÁÒ ¤íÒÊÑ觡ÒÃËÒà â´Âʋ§¤‹ÒàÈÉ·ÕèàËÅ×ͨҡ¡ÒÃËÒáÅѺÁÒ ¤íÒÊÑ觤ٳàÅ¢·È¹ÔÂÁ àÅ×è͹¢ŒÍÁÙÅä»·Ò§¢ÇÒ 1 ºÔµ ÁÕ¤‹Ò෋ҡѺËÒôŒÇ 2 àÅ×è͹¢ŒÍÁÙÅä»·Ò§«ŒÒ 1 ºÔµ ÁÕ¤‹Ò෋ҡѺ¤Ù³´ŒÇ 2 »ÃÐÁÇżÅ੾ÒТŒÍÁÙŵÑÇàŢẺäÁ‹¤Ô´à¤Ã×èͧËÁÒ ¤íҹdz¤‹Òâ¤ä«¹ (COSINE) ·Ò§µÃÕ⡳ÁÔµÔ

* ** / // */ >> << ABS

DIG

àÃÕ¡¤‹Ò¢Í§¢ŒÍÁÙŨҡËÅÑ¡·Õè¡íÒ˹´ ã¹ÃÙ»¢Í§àÅ¢°Ò¹ÊÔº

MAX

à¡çº¤‹ÒµÑÇá»Ã·ÕèÁÕ¤‹Ò¹ŒÍ¡NjÒËÃ×Í෋ҡѺ¢ŒÍÁÙÅ·Õè¡íÒ˹´ËÅѧ¤íÒÊÑ觹Õé

¹Ñº¨íҹǹä«à¡ÔÅËÃ×ÍÃͺ¢Í§ÊÑ­­Ò³ÍÔ¹¾Øµ ã¹Â‹Ò¹¤ÇÒÁ¶Õè 0-312.5kHz

MIN

à¡çº¤‹ÒµÑÇá»Ã·ÕèÁÕ¤‹ÒÁÒ¡¡Ç‹ÒËÃ×Í෋ҡѺ¢ŒÍÁÙÅ·Õè¡íÒ˹´ËÅѧ¤íÒÊÑ觹Õé

SIN

·íÒãˌ¢ÒàÍÒµ¾Øµà»š¹ÅͨԡÊÙ§ËÃ×Í "1" ¡íÒ˹´ãˌ·íҧҹ໚¹ÍÔ¹¾Øµ ·íÒãˌ¢ÒàÍÒµ¾Øµà»š¹ÅͨԡµíèÒËÃ×Í "0" ¡íÒ˹´ãˌ·íҧҹ໚¹àÍÒµ¾Øµ ÇÑ´ÊÑ­­Ò³¾ÑÅʏÍÔ¹¾Øµ ¤ÇÒÁÅÐàÍÕ´ 0.8 äÁâ¤ÃÇÔ¹Ò·Õ ( µ s)

SQR

¤íҹdz¤‹Ò䫹 (SINE) ·Ò§µÃÕ⡳ÁÔµÔ ¶Í´ÃÒ¡·ÕèÊͧ

ʋ§ÊÑ­­Ò³¾ÑÅʏÍÍ¡ ¤ÇÒÁÅÐàÍÕ´ 0.8 äÁâ¤ÃÇÔ¹Ò·Õ ( µ s) à»ÅÕè¹¢ÒÍÔ¹¾Øµà»š¹àÍÒµ¾ØµËÃ×ͨҡàÍÒµ¾Øµà»š¹ÍÔ¹¾Øµ ·íÒãˌ¢ÒàÍÒµ¾Øµ¡ÅѺÅͨԡ ¡íÒà¹Ô´ÃËÑʤǺ¤ØÁÊíÒËÃѺÍØ»¡Ã³µ‹Í¾‹Ç§Í¹Ø¡ÃÁ X-10

¡ÅØÁ‹ ¤íÒÊÑ§è »ÃÐÁÇżŷҧÅͨԡ ª×Íè ¤íÒÊѧè ÃÒÂÅÐàÍÕ´ & á͹´ (AND) ·Ò§Åͨԡ | ÍÍÏ (OR) ·Ò§Åͨԡ ^ DCD NCD REV

àÍ硤ÅÙ«Õ¿-ÍÍÏ (XOR) ·Ò§Åͨԡ àÅ×͡૵ºÔµ·Õ赌ͧ¡Òâͧ¢ŒÍÁÙÅ¢¹Ò´ 16 ºÔµ áÊ´§ºÔµ¹ÑÂÊíҤѭ¢Í§¢ŒÍÁÙÅ¢¹Ò´ 16 ºÔµ ÊÅѺºÔµ¢ŒÍÁÙÅ


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

107

¡Ô¨¡ÃÃÁ·Õè 18

¢ÑºàÊÕ§´ŒÇÂÊÇÔµª ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺ¤‹Ò¨Ò¡¡Òá´ÊÇÔµªº¹á¼§Ç§¨ÃÊÇÔµª·µÕè ͋ ÍÂÙ¡‹ ºÑ ¾Íϵ P0 ¢Í§ SCi-BOX áŌÇäÁâ¤Ã ¤Í¹â·ÃÅàÅÍϨзíÒ¡ÒâѺÊÑ­­Ò³àÊÕ§ÍÍ¡·Ò§ÅíÒ⾧ໂÂ⫺¹ºÍÏ´ SCi-BOX

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃÊÇÔµªÍ¹Ô ¾Øµ¡Ñº SCi-BOX à¢ŒÒ·Õ¨è ´Ø µ‹Í P0 2. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé '{$STAMP BS2SX} '{$PBASIC 2.5} '*************************************************** ' File : ACT18.BSX ' Purpose : Sound generation by switch ' Hardware : Connect SWITCH as actived “LOW” at P0 '*************************************************** ' Custom I/O ON this application SWITCH VAR IN0 ' Connect SWITCH here! SOUND CON 12 ' ON board speaker ' Variable defined FREQ VAR Word

' Channel SELECT

LOOP1: IF SWITCH=1 THEN LOOP1 FOR FREQ=600 TO 1000 STEP 100 FREQOUT SOUND,250,FREQ NEXT GOTO LOOP1

' ' ' '

WAIT switch pressed Sweep 1.5kHz TO 2.5kHz Send frequency out DO LOOP

' DO again

3. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 4. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ·´Êͺ¡Ò÷íÒ§Ò¹

SCi-B X

Microcontroller in Science experiment


108

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¡Ô¨¡ÃÃÁ·Õè 19

ÊÇÔµªàÅ×Í¡ÃÕàŏ ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺ¤‹Ò¨Ò¡¡Òá´ÊÇÔµªº¹á¼§Ç§¨ÃÊÇÔµª·µÕè ͋ ÍÂÙ¡‹ ºÑ ¾Íϵ P0 ¢Í§ SCi-BOX à¾×Íè àÅ×Í¡ ãˌäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ¢ºÑ ÃÕàŏẺ¡Åä¡ãˌ·Òí §Ò¹ â´Â¡Ò÷íÒ§Ò¹¨ÐäŋàÃÕ§໚¹ÅíҴѺµÒÁ¡Òá´ÊÇÔµª â´ÂàÃÔÁè ¨Ò¡àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 1 ÃÕàŏµÇÑ ·Õ1è «Ö§è µ‹ÍÍÂÙ¡‹ ºÑ ¢Ò¾Íϵ P8 ¨Ð·íÒ§Ò¹ ÊÒÁÒöÊѧࡵ䴌¨Ò¡ LED áÅÐàÊÕ§ ¡ÒõѴµ‹Í˹ŒÒÊÑÁ¼ÑʢͧÃÕàŏ àÁ×Íè ¡´ÊÇÔµª¤ÃÑ§é ·Õè 2 ÃÕàŏµÇÑ ·Õè 2 «Ö§è µ‹Í¡Ñº P9 ¨Ð·íÒ§Ò¹ äŋ仵ÒÁÅíҴѺઋ¹¹Õ¨é ¹ ¶Ö§ÃÕàŏµÇÑ ·Õè 4 «Ö§è µ‹Í¡Ñº¢Ò¾Íϵ P11 ¨Ò¡¹Ñ¹é ¨Ðǹ¡ÅѺÁÒ·ÕÃè àÕ ÅµÇÑ ·Õè 1 ÍÕ¡¤ÃÑ§é ·íҧҹǹઋ¹¹Õµé ÒÁ¡Òá´ÊÇÔµª

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃÊÇÔµªÍ¹Ô ¾Øµ¡Ñº SCi-BOX à¢ŒÒ·Õ¨è ´Ø µ‹Í P0 2. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé '{$STAMP BS2SX} '{$PBASIC 2.5} '****************************************************** ' File : ACT19.BSX ' Purpose : Relay selector ' Hardware : Jumper at RELAY position ' Connect SWITCH as actived “LOW” at P0 '****************************************************** SWITCH CON 0 ' Connect SWITCH here! CH VAR Byte ' Channel SELECT SW_VAR VAR Byte ' Switch variable PAUSE 1000 ' Delay 1s.FOR pheripheral initialize DIRC=%1111 ' Force P8-P11 as OUTPUT LOOP1: BUTTON SWITCH,0,255,0,SW_VAR,0,LOOP1 ' GET switch,one times CH=(CH+1)//5 ' GOTO NEXT STEP (0-5) LOOKUP CH,[%0000,%0001,%0010,%0100,%1000],OUTC ' GET STEP OUTPUT TO RELAYs PAUSE 100 'Delay 100ms. GOTO LOOP1 ' DO again

3. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 4. àÅ×Í¡¨ÑÁê à»ÍÏ RELAY/MOTOR º¹ºÍÏ´ SCi-BOX ä»·Õµè Òí á˹‹§ RELAY 5. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

109

¡Ô¨¡ÃÃÁ·Õè 20

¡ÒÃÇÑ´áÅÐáÊ´§¤‹ÒÊÑ­­Ò³º¹¤ÍÁ¾ÔÇàµÍϢͧ SCi-BOX ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺÊÑ­­Ò³ä¿¿‡Ò¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñº·Õ軇͹ࢌÒÁÒÂѧ SCi-BOX ¼‹Ò¹·Ò§¨Ø´µ‹Í SENSOR0-SENSOR7 áŌǹíÒä»áÊ´§¼Å·Õºè ¹¤ÍÁ¾ÔÇàµÍϼҋ ¹Ë¹ŒÒµ‹Ò§ Debig Terminal ¢Í§â»Ãá¡ÃÁàºÊÔ¡ áʵÁ»ŠàÍ´ÔàµÍÏ ÊÑ­­Ò³·Õäè ´Œ¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñºã¹¡ÅØÁ‹ ÊÑ­­Ò³ÍйÒÅÍ¡ (¡ÅØÁ‹ A) ·Õãè ªŒ¹¹Ñé ãˌàÍÒµ¾µØ ໚¹ áç´Ñ¹ä¿µÃ§ Áդҋ äÁ‹à¡Ô¹ 5V

ËÅÑ¡¡Òà ¡ÒÃÃѺÊÑ­­Ò³ÍàйÒÅÍ¡¢Í§ SCi-BOX ¨Ð㪌äÍ«Õá»Å§ÊÑ­­Ò³ÍйÒÅ͡໚¹´Ô¨µÔ ÍÅ 2 µÑÇ·íÒ§Ò¹ ËÇÁ¡Ñ¹ (´Ùû٠ǧ¨Ã¢Í§ SCi-BOX »ÃСͺ) â´ÂᵋÅеÑÇÊÒÁ��öÃѺÊÑ­­Ò³ä´Œ 4 ª‹Í§ ´Ñ§¹Ñ¹é SCi-BOX ¨Ö§ÊÒÁÒö ÃѺÊÑ­­Ò³ÍйÒÅ͡䴌ÃÇÁ 8 ª‹Í§ ᵋÅЪ‹Í§ÁÕ¤ÇÒÁÅÐàÍÕ´㹡ÒÃá»Å§ÊÑ­­Ò³ 10 ºÔµ áÅСÒõԴµ‹Í ÃÐËNjҧäÍ«Õá»Å§ÊÑ­­Ò³¹Õ¡é ºÑ äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ㪌¡ÒõԴµ‹ÍẺ͹ءÃÁ â´Â㪌ÊÒÂÊÑ­­Ò³à¾Õ§àʌ¹à´ÕÂÇ ÃٻẺ¢Í§¡ÒÃà¢Õ¹â»Ãá¡ÃÁµÔ´µ‹ÍµŒÍ§àÃÔÁè ¨Ò¡¡ÒÃÊÌҧÊÑ­­Ò³ Break à¾×Íè ᨌ§ãˌäÍ«Õá»Å§ÊÑ­­Ò³ ·ÃҺNjҵŒÍ§¡ÒõԴµ‹Íà¾×Íè ͋ҹ¤‹ÒáÅŒÇ â´Âà¢Õ¹໚¹â»Ãá¡ÃÁ䴌´§Ñ ¹Õé LOW SD : PAUSE 1 : HIGH SD

‘ Break signal

µ‹Í¨Ò¡¹Ñ¹é ·íÒ¡ÒÃʋ§¤íÒÊѧè à¾×Íè Ìͧ¢Í¢ŒÍÁÙŨҡäÍ«Õá»Å§ÊÑ­­Ò³ ÊÒÁÒöà¢Õ¹໚¹â»Ãá¡ÃÁ䴌´§Ñ ¹Õé SEROUT

SD,BAUD,[0]

‘ Request SENSOR0

µÑÇàÅ¢ [0] ã¹â»Ãá¡ÃÁ¢ŒÒ§µŒ¹à»š¹¡ÒÃàÅ×Í¡ª‹Í§ÊÑ­­Ò³ÍйÒÅÍ¡ SENSOR0-SENSOR7 ·Õµè ͌ §¡Òà ͋ҹ¤‹Ò ´Ñ§¹Ñ¹é µÑÇàÅ¢¹Õ¨é §Ö ÊÒÁÒöàÅ×͡䴌µ§Ñé ᵋ 0-7 ÊØ´·ŒÒÂÃÍÃѺ¢ŒÍÁÙŨҡäÍ«Õá»Å§ÊÑ­­Ò³ â´Â¢ŒÍÁÙÅ·Õ¡è ÅѺÁÒ¨ÐÁÕ¢¹Ò´ 10 ºÔµ ¨Ö§µŒÍ§ãªŒµÇÑ á»Ã¢¹Ò´ 16 ºÔµËÃ×Í¡íÒ˹´à»š¹àÇÔô (WORD) 㹡ÒÃÃѺ¢ŒÍÁÙÅ â´Â¢ŒÍÁÙÅ·ÕÊè §‹ ¡ÅѺÁÒ¨Ò¡äÍ«Õá»Å§ÊÑ­­Ò³¨ÐàÃÔÁè ¨Ò¡ 亵µÒèí (low byte) ¡‹Í¹ áŌǵÒÁ´ŒÇ¢ŒÍÁÙÅ亵Ê§Ù (high byte) «Ö§è ¨ÃÔ§æ áŌǨÐ㪌à¾Õ§ 2 ºÔµµèÒí ¢Í§¢ŒÍÁÙÅ亵 Ê٧෋ҹѹé SERIN

SD,BAUD,[VALUE.LowByte,VALUE.HighByte] ‘ Received data 2 byte to 1 word

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع Potentiometer µÑÇµÑ§é ¡Ñº SCiBOX à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 2. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé


110

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

'{$STAMP BS2SX} '{$PBASIC 2.5} '************************************************ ' File : ACT20.BSX ' Purpose : Show voltage value ON DEBUG terminal ' Hardware : Connect POTENTIOMETER at SENSOR0 '************************************************ ' System I/O AND constant , please DO NOT make change SD CON 13 ' Sci-BOX serial communication port BAUD CON 240 ' 9600bps constant ' Variable defined VALUE VAR Word RESULT VAR Word PAUSE

1000

' VALUE as SENSOR0 variable ' RESULT FOR calculation purpose ' Delay 1s. for pheripheral initialize

LOOP1 : LOW SD : PAUSE 1 : HIGH SD ' Break signal SEROUT SD,BAUD,[0] ' Request SENSOR0 SERIN SD,BAUD,[VALUE.LOWBYTE,VALUE.HIGHBYTE] ' Received DATA 2 Byte TO 1 Word DEBUG

HOME,"READ DATA = ",DEC4 VALUE," is "

' Convert 0-1023 DATA TO 000-499 ' 1024 STEP TO 500 STEP RESULT=(VALUE*/((62*$100)+$80))/128 ' Equation (Value * 62.5)/128 ' Represent DATA into 2 point decimal X.XX volt format DEBUG DEC1 RESULT DIG 2,".",DEC1 RESULT DIG 1,DEC1 RESULT DIG 0," volt" PAUSE 100 GOTO LOOP1

' Delay 100ms. ' DO again

4. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 5. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ·´Êͺ¡Ò÷íÒ§Ò¹ 6. ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§ Debug Terminal ¢Ö¹é ãˌ·´ÅͧËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌·µÕè ͋ ÍÂÙ¡‹ ºÑ SENSOR0 Êѧࡵ¡ÒÃáÊ´§¤‹Ò¢Í§Ë¹ŒÒµ‹Ò§ Debug Terminaal ¨Ð¾ºÇ‹Ò¤‹Ò·Õáè Ê´§¨ÐÁմnj ¡ѹ 2 Ẻ¤×Í áººáá໚¹¢ŒÍÁÙÅ´Ôº·ÕÍè ҋ ¹ä´Œ¨Ò¡äÍ«Õá»Å§ÊÑ­­Ò³ ໚¹ ¢ŒÍÁÙÅ´Ô¨µÔ ÍŠʋǹẺ·ÕÊè ͧ໚¹¢ŒÍÁÙÅáç´Ñ¹·Õäè ´Œ¨Ò¡¡Òäíҹdz¢ŒÍÁÙÅ´Ôºã¹áººáá à¾×Íè ãˌ໚¹¤‹Òáç´Ñ¹·Õè ÊÒÁÒöࢌÒã¨ä´Œ§Ò‹ Â¢Ö¹é ´Ñ§¹Ñ¹é ¨Ö§ÍÒ¨¡Å‹ÒÇ䴌Çҋ â»Ãá¡ÃÁ·´ÅͧµÑÇÍ‹ҧ¹Õ¤é Í× ¡ÒÃÊÌҧâÇŵÁàÔ µÍÏ·áÕè Ê´§ ¼Å¼‹Ò¹¤ÍÁ¾ÔÇàµÍÏÍ‹ҧ§‹ÒÂ

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

111

¡Ô¨¡ÃÃÁ·Õè 21 ¤Çº¤ØÁ·ÔÈ·Ò§¡ÒÃËÁع¢Í§ÁÍàµÍÏ俵ç ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺ¤‹Ò¨Ò¡¡ÒõÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍÏ· µÕè ͋ ÍÂÙ¡‹ ºÑ ¾Íϵ SENSOR0 áÅÐ SENSOR1 ¢Í§ SCi-BOX à¾×Íè ¤Çº¤ØÁ¡ÒÃËÁع¢Í§ÁÍàµÍÏ A áÅÐ B µÒÁÅíҴѺ â´ÂàÁ×Íè ËÁعµÑǵŒÒ¹·Ò¹ ä»·Ò§«ŒÒ ÁÍàµÍÏ¡¨ç ÐËÁع«ŒÒµÒÁ áÅШÐËÁع㹷ÔÈ·Ò§µÃ§¢ŒÒÁ àÁ×Íè ËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹ãˌ价ҧ¢ÇÒ ¡ÒäǺ¤ØÁÁÍàµÍÏ俵纹 SCi-BOX ¨Ð㪌¾Íϵ P8 áÅÐ P9 ÊíÒËÃѺ¤Çº¤ØÁ¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ A ʋǹÁÍàµÍÏ B ¨Ð¤Çº¤ØÁâ´Â P10 áÅÐ P11 â´ÂÁÕ¡Ò÷íÒ§Ò¹´Ñ§¹Õé ÁÍàµÍÏ A P8 P9 0 1 1 0 0 0 1 1

¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ ËÁع¡ÅѺ·Ò§ ËÁعµÒÁ·ÔÈ á¡¹ÍÔÊÃÐ ºÑ§¤Ñºá¡¹

ÁÍàµÍÏ B P10 P11 0 1 1 0 0 0 1 1

¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ ËÁع¡ÅѺ·Ò§ ËÁعµÒÁ·ÔÈ á¡¹ÍÔÊÃÐ ºÑ§¤Ñºá¡¹

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ᡹ËÁع Potentiometer µÑÇµÑ§é ·Ñ§é Êͧ µÑǡѺ SCi-BOX à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 áÅÐ SENSOR1 2. µ‹ÍÁÍàµÍÃä¿µÃ§à¢ŒÒ·Õ¨è ´Ø µ‹ÍÁÍàµÍÏ A 3. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé


112

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

'{$STAMP BS2sx} '{$PBASIC 2.5} '************************************************************************ ' File : ACT21.BSX ' Purpose : Running DC motor A and B ' Hardware : Jumper at MOTOR position ' Connect POTENTIOMETER (V) #1 at SENSOR0 (motor A control) ' Connect POTENTIOMETER (V) #2 at SENSOR1 (motor B control) '************************************************************************ ' System I/O and constant , please do not make change SD CON 13 ' Sci-BOX serial communication port BAUD CON 240 ' 9600bps constant VALUE SENSOR CH

VAR VAR VAR

Word Word(2) Byte

' VALUE as SENSOR variable ' SENSOR, 2 Word array ' Channel SELECT

PAUSE 1000 ' Delay 1s. FOR pheripheral initialize LOOP1: FOR CH=0 TO 1 GOSUB Get_SENSOR : SENSOR(CH)=VALUE ' GET sensor0 AND 1 DEBUG DEC SENSOR(CH)," " ' View DATA ON DEBUG NEXT DEBUG CR ' Carriage RETURN Check_A: IF SENSOR(0)>=512 THEN A_Forward LOW 8 : HIGH 9 : GOTO Check_B A_Forward: HIGH 8 : LOW 9

' Rules FOR decision ' Backward IF less than 512 ' Forward IF others

Check_B: IF SENSOR(1)>=512 THEN B_Forward LOW 10 : HIGH 11 : GOTO OK B_Forward: HIGH 10 : LOW 11 OK: GOTO LOOP1 ' DO again '***************************** ' GET sensor value subroutine '***************************** Get_SENSOR: LOW SD : PAUSE 1 : HIGH SD ' Break signal SEROUT SD,BAUD,[CH] ' Request SENSOR0 SERIN SD,BAUD,[VALUE.LOWBYTE,VALUE.HIGHBYTE] RETURN ' Return to main

4. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 5. àÅ×Í¡¨ÑÁê à»ÍϏ RELAY/MOTOR º¹ºÍÏ´ SCi-BOX ä»·Õµè Òí á˹‹§ MOTOR 6. Ãѹâ»Ãá¡ÃÁ Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ A ËÒ¡ÁÍàµÍÏËÁعµÒÁ·ÔȨÐ໚¹ÊÕà¢ÕÂÇ ¶ŒÒ¡ÅѺ·ÔȨÐ໚¹ÊÕá´§ 7. ¨Ò¡¹Ñ¹é ŒÒÂÁÍàµÍÏÁÒµ‹Í·Õè MOTOR B áŌÇÅͧ»ÃѺµÑǵŒÒ¹·Ò¹·Õµè ͋ ¡Ñº¨Ø´µ‹Í SENSOR1 Êѧࡵ¡Ò÷íÒ§Ò¹

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

113

¡Ô¨¡ÃÃÁ·Õè 22

¤Çº¤ØÁ¤ÇÒÁàÃçǢͧÁÍàµÍÏ俵紌Ǡἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡ ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺÊÑ­­Ò³ä¿¿‡Ò¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñº·Õ軇͹ࢌÒÁÒÂѧ SCi-BOX ¼‹Ò¹·Ò§¾Íϵ SENSOR0-SENSOR7 áŌǹíÒ仡íÒ˹´ËÃ×Í»ÃѺ¤ÇÒÁàÃçÇáÅзÔȷҧ㹡ÒÃËÁع¢Í§ÁÍàµÍÏ俵ç ¨Ð¤ÅŒÒ ¡ÑºµÑÇÍ‹ҧ·Õè 3 ᵋ㹵ÑÇÍ‹ҧ¹Õ¨é Ðà¾ÔÁè ¡ÒûÃѺ¤ÇÒÁàÃçÇࢌÒä»´ŒÇÂ

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍϵÑǵÑ駷Ñé§ÊͧµÑǡѺ SCi-BOX à¢ŒÒ·Õ¨è ´Ø µ‹Í SENSOR0 áÅÐ SENSOR1 2. µ‹ÍÁÍàµÍÃä¿µÃ§à¢ŒÒ·Õ¨è ´Ø µ‹ÍÁÍàµÍÏ A 3. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé '{$STAMP BS2SX} '{$PBASIC 2.5} '******************************************************************** ' File : ACT22.BSX ' Purpose : DC motor A Speed AND direction control ' HRDWARE : Jumper at MOTOR position ' Connect POTENTIOMETER #1 at SENSOR0 (speed control) ' Connect POTENTIOMETER #2 at SENSOR1 (direction control) '******************************************************************** ' System I/O AND constant , please DO NOT make change SD CON 13 ' Sci-BOX serial communication port BAUD CON 240 ' 9600bps constant ' Variable defined VALUE VAR Word SENSOR VAR Word(2) CH VAR Byte

' VALUE as SENSOR variable ' SENSOR, 2 Word array ' Channel SELECT

PAUSE 1000 LOW 8: LOW 9

' Delay 1s. FOR peripheral initialize ' Force P8-P9 TO LOW (STOP)

LOOP1 : FOR CH=0 TO 1 GOSUB Get_SENSOR : SENSOR(CH)=VALUE NEXT IF SENSOR(1)>=512 THEN A_Forward

' GET sensor 0 AND 1

' Rules FOR decision ' Backward IF less than 512

PWM 9,SENSOR(0)/4,100 : GOTO OK ' PWM P9,backward speed control


114

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

A_Forward : PWM 8,SENSOR(0)/4,100

' Forward IF others ' PWM P9,backward speed control

OK: GOTO LOOP1

' DO again

' GET sensor value subroutine '***************************** Get_SENSOR: LOW SD : PAUSE 1 : HIGH SD ' Break signal SEROUT SD,BAUD,[CH] ' Request SENSOR0 SERIN SD,BAUD,[VALUE.LOWBYTE,VALUE.HIGHBYTE] ' Received DATA 2 Byte TO 1 Word RETURN ' RETURN TO main

4. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 5. àÅ×Í¡¨ÑÁê à»ÍÏ DRIVER º¹ºÍÏ´ SCi-BOX ä»·Õµè Òí á˹‹§ MOTOR 6. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ·´Êͺ¡Ò÷íÒ§Ò¹ 7. ËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌·µÕè ͋ ÍÂÙ¡‹ ºÑ SENSOR0 Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ A ¨Ð¾ºÇ‹ÒÁÍàµÍÏÁ¡Õ ÒÃà»ÅÕÂè ¹á»Å§¤ÇÒÁàÃçǵÒÁ¡ÒÃËÁع᡹»ÃѺ¤‹Ò¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 8. ¨Ò¡¹Ñ¹é ·´ÅͧËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹·Õµè ͋ ¡Ñº¾Íϵ SENSOR1 Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§ÁÍàµÍÏ A áÅÐä¿ áÊ´§¡Ò÷íÒ§Ò¹ ÁÍàµÍϨÐÁÕ¡ÒÃà»ÅÕÂè ¹·ÔÈ·Ò§µÒÁ¡ÒÃËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 â´Â·Õ¤è ÇÒÁàÃçÇäÁ‹à»ÅÕÂè ¹á»Å§ Êѧࡵ·ÔÈ·Ò§¡ÒÃËÁع䴌¨Ò¡ä¿áÊ´§Ê¶Ò¹Ð ËÒ¡ÁÍàµÍÏËÁعµÒÁ·ÔȨÐ໚¹ÊÕà¢ÕÂÇ ¶ŒÒ¡ÅѺ·ÔȨÐ໚¹ÊÕá´§

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

115

¡Ô¨¡ÃÃÁ·Õè 23

¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺ¤‹Ò¨Ò¡¡ÒõÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍÏ· µÕè ͋ ¡Ñº¨Ø´µ‹Í SENSOR0 áÅÐ SENSOR1 ¢Í§ SCi-BOX à¾×Íè ¤Çº¤ØÁ¡ÒÃËÁع¢Í§Êàµç»à»ÍÏÁÍàµÍÏ #1 áÅÐ #2 â´ÂàÁ×Íè ËÁعµÑǵŒÒ¹·Ò¹ä» ·Ò§«ŒÒ ÁÍàµÍÏ¡¨ç ÐËÁع«ŒÒµÒÁ áÅШÐËÁع㹷ÔÈ·Ò§µÃ§¢ŒÒÁ àÁ×Íè ËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹ãˌ价ҧ¢ÇÒ ¡ÒäǺ¤ØÁÊàµç»à»ÍÏÁÍàµÍϺ¹ SCi-BOX ¹Ñ¹é ËÑÇã¨ËÅÑ¡¤×Í äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏÃNj ÁÊíÒËÃѺ¤Çº¤ØÁ ǧ¨Ã¢ÑºÊàµç»à»ÍÏÁÍàµÍÏ (Stepper motor Co-processor) ·íÒ˹ŒÒ·ÕÃè ºÑ ¢ŒÍÁÙÅã¹ÅѡɳÐ͹ءÃÁÁÒ¨Ò¡¢Ò¾Íϵ ¢Í§äÁâ¤Ã¤Í¹â·ÃÅàÅÍÏ·àÕè ª×Íè Áµ‹Í´ŒÇ «Ö§è ã¹·Õ¹è ¤Õé Í× i-Stamp â´Â¢ŒÍÁÙŤíÒÊÑ§è ¨Ò¡ i-Stamp ¨Ðʋ§¼‹Ò¹¢Ò P14 ¨ÐàÃÕ¡¢Ò¹ÕÇé ҋ SERIN ä»ÂѧÊàµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍÏ ¨Ò¡¹Ñ¹é Êàµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍϨзíÒ ¡ÒûÃÐÁǿތÍÁÙÅ·ÕÊè §‹ ÁÒ áŌÇʋ§ÊÑ­­Ò³ä»¢ÑºÊàµç»à»ÍÏÁÍàµÍÏãˌËÁعµÒÁ·Õ¡è Òí ˹´ ã¹¢³Ð·ÕÊè àµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍÏ·Òí §Ò¹ÍÂً ¨Ðʋ§ÊÑ­­Ò³¡ÅѺä»Âѧ i-Stamp ¼‹Ò¹·Ò§¢Ò¾Íϵ P15 à¾×Íè ᨌ§ãˌ·ÃÒºÇ‹Ò Âѧ¤§·íÒ¡ÒâѺÁÍàµÍÏÍÂً äÁ‹ÊÒÁÒöÃѺ¢ŒÍÁÙÅãËÁ‹ä´Œ ¨ÐàÃÕ¡¢ÒÊÑ­­Ò³¹ÕÇé ҋ BUSY ʋǹ¡ÒÃÃÕ૵ÊÒÁÒö·íÒ䴌â´Âʋ§ÊÑ­­Ò³ÁÒ·Õ¨è ´Ø RST

¡ÒÃÃѺ¢ŒÍÁÙÅ ¡ÒÃÃѺ¢ŒÍÁÙÅ͹ءÃÁà¾×è͢ѺÊàµç»à»ÍÏÁÍàµÍϨÐ㪌ºÍ´àõËÃ×ÍÍѵÃÒàÃçÇ㹡Òö‹Ò·ʹ¢ŒÍÁÙÅ 9600 ºÔµµ‹ÍÇÔ¹Ò·Õ ¨íҹǹºÔµ¢Í§¢ŒÍÁÙÅ෋ҡѺ 8 ºÔµ áÅÐäÁ‹ÁºÕ µÔ µÃǨÊͺ¢ŒÍÁÙÅ ·Ø¡¤ÃÑ§é ·ÕÁè ¡Õ ÒÃʋ§¢ŒÍÁÙÅÁÒÂѧºÍÏ´ ¨ÐÁÕÊ­ Ñ ­Ò³ BUSY µÍºÃѺ໚¹Åͨԡ “0” à¾×Íè ᨌ§ãˌ·ÃҺNjҡíÒÅѧ¡ÃзíÒ ¤íÒÊѧè ÍÂً áÅÐàÁ×Íè àÊÃç¨ÊÔ¹é ÊÑ­­Ò³ BUSY ¡ç¨Ð¶Ù¡à«µà»š¹Åͨԡ “1” â´ÂÍѵâ¹ÁÑµÔ à¾×Íè ¡ÃзíÒ¤íÒÊÑ§è µ‹Íä» â´ÂÊàµç»à»ÍÏÁÍàµÍÏâ¤â»Ãà«Êà«ÍÏÁËÕ ¹‹Ç ¤ÇÒÁ¨íҺѿà¿ÍÏÊÒí ËÃѺà¡çº¤‹Ò¤íÒÊÑ§è µ‹Íà¹×Íè §ä´ŒÃÇÁ 28 亵 Ẻ FIFO ¢ŒÍÁÙÅ·ÕÃè ºÑ áº‹§à»š¹ 2 ¡ÅØÁ‹ ¤×Í ¨íҹǹÊàµç»·Õµè ͌ §¡ÒâѺ áÅÐ ¡ÅØÁ‹ ¤íÒÊÑ§è ¤Çº¤ØÁ¡ÒâѺÁÍàµÍÏ 1. ¨íҹǹÊàµç»·Õµè ͌ §¡ÒâѺÁÍàµÍÏ ÁÕ¢¹Ò´ 2 亵 â´Â ¢ŒÍÁÙÅ亵áá໚¹¤‹Ò¢Í§Êàµç»à»ÍÏÁÍàµÍÏ·Õè 1 ¢ŒÍÁÙÅ亵·ÊÕè ͧ໚¹¢Í§Êàµç»à»ÍÏÁÍàµÍÏ·Õè 2 Áդҋ µÑ§é ᵋ 1 ¶Ö§ 127 áÅÐ –1 ¶Ö§ –127 (¡ànj¹ 128 à¾ÃÒÐ㪌·Òí §Ò¹à»š¹¡ÅØÁ‹ ¤íÒÊÑ§è ¤Çº¤ØÁ) â´Â¤‹Ò¹Õ¤é Í× ¨íҹǹÊàµç»·Õµè ͌ §¡ÒÃãˌËÁØ¹ä» ¶ŒÒ໚¹¤‹ÒºÇ¡ ¨ÐËÁعµÒÁ·ÔÈ ¶ŒÒ໚¹¤‹Òź ¨ÐËÁع¡ÅѺ·ÔÈ â´Â¤‹Ò·Õàè »š¹Åº µÑ§é ᵋ –1 ¶Ö§ –127 ¨ÐÍÂÙ㋠¹ÃÙ»¢Í§·Ù ¤ÍÁ¾ÅÕàÁ¹µ (2’ complement : $FF ¶Ö�� $81 ) 㹡óշãÕè ªŒ i-Stamp 㹡ÒÃʋ§¢ŒÍÁÙŤǺ¤ØÁÊÒÁÒöÃкؤҋ µÑÇ àÅ¢µÔ´Åºä´Œ·¹Ñ ·Õ ànj¹áµ‹·Òí ¡ÒáíÒ˹´¤‹Òâ´ÂµÑÇá»Ã¡ç¨ÐµŒÍ§¡íÒ˹´ã¹ÃÙ»¢Í§·Ù¤ÍÁ¾ÅÕàÁ¹µàª‹¹¡Ñ¹


116

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

ÃٻẺ¡ÒÃà¢Õ¹â»Ãá¡ÃÁÁմѧ¹Õé SEROUT 14,16624 [¨íҹǹÊàµç»¢Í§ÁÍàµÍÏ·Õè 1, ¨íҹǹÊàµç»¢Í§ÁÍàµÍÏ·Õè 2 ] µÑÇÍ‹ҧ·Õè 1 ¢ÑºÁÍàµÍÏËÁعµÒÁ·ÔÈ·Ñ§é ¤Ùà‹ »š¹¨íҹǹ 96 Êàµç» à¢Õ¹â»Ãá¡ÃÁ䴌´§Ñ ¹Õé SEROUT 14,240,[96,96]

µÑÇÍ‹ҧ·Õè 2 ¢ÑºÁÍàµÍÏËÁعÊǹ·Ò§¡Ñ¹à»š¹¨íҹǹ 48 Êàµç» à¢Õ¹â»Ãá¡ÃÁ䴌´§Ñ ¹Õé SEROUT 14,240,[48,-48]

ËÅѧ¨Ò¡Ê‹§¤íÒÊÑ§è ¢ÑºÁÍàµÍÏáÅŒÇ ¤ÇÃÃÍãˌÁÍàµÍÏËÁعàÃÕºÌÍÂàÊÕ¡‹Í¹ ¨Ö§¨Ð·íÒ§Ò¹µ‹Íä» â´ÂµÃǨ Êͺ䴌¨Ò¡ÊÑ­­Ò³ BUSY (P15) NjÒNjҧËÃ×ÍäÁ‹ ¶ŒÒNjҧ¨Ð໚¹Åͨԡ “1” 2. ¤íÒÊÑ§è ¤Çº¤ØÁ¡Ò÷íÒ§Ò¹¢Í§ªØ´¢ÑºÁÍàµÍÏ â´Â㹡ÒÃʋ§¢ŒÍÁÙŪش¹Õµé ͌ § 2.1 àÃÔÁè µŒ¹´ŒÇ¡ÒÃʋ§¢ŒÍÁÙÅ亵áá໚¹ 128 ËÃ×Í $80 (àÅ¢°Ò¹ÊԺˡ) 2.2 ã¹¢ŒÍÁÙÅ亵µÍ‹ 仨Ð໚¹¤íÒÊÑ§è ¤Çº¤ØÁ¡Ò÷íÒ§Ò¹¢Í§ªØ´¢ÑºÁÍàµÍÏ ÃٻẺ¡ÒÃà¢Õ¹â»Ãá¡ÃÁÁÕ´§Ñ ¹Õé SEROUT 14,240,[128,”¤íÒÊÑ§è ”,¾ÒÃÒÁÔàµÍϢͧ¤íÒÊÑ§è ¢Í§ÁÍàµÍÏ·Õè 1,¾ÒÃÒÁÔàµÍϢͧ ¤íÒÊÑ§è ¢Í§ÁÍàµÍÏ·Õè 2] ÃÒÂÅÐàÍÕ´¢Í§¤íÒÊѧè áÅоÒÃÒÁÔàµÍÏ·àÕè ¡ÕÂè Ç¢ŒÍ§ÁÕ´§Ñ ¹Õé ¤íÒÊÑ§è ¼Å¢Í§¤íÒÊѧè C àÃÔÁè µŒ¹¤‹ÒµÑÇá»ÃãËÁ‹·§Ñé ËÁ´ ÃÇÁ¶Ö§ÊÀÒÇÐÊàµç» ¡ç¨Ð¡ÅѺä»àÃÔÁè ·Õè 0 E ¡íÒ˹´ãˌ·Òí §Ò¹ã¹âËÁ´»ÃÐËÂÑ´¾Åѧ§Ò¹ »¡µÔ¨Ð¶Ù¡¡íÒ˹´ãˌ·Òí §Ò¹ã¹âËÁ´ »ÃÐËÂÑ´¾Åѧ§Ò¹ÍÂÙá‹ ÅŒÇ äÁ‹á¹Ð¹íÒãˌ㪌ã¹âËÁ´¢Ñº 0, 3 áÅÐ 4 à¹×Íè §¨Ò¡·Ñ§é 3 âËÁ´´Ñ§¡Å‹ÒǵŒÍ§¡ÒáÃÐáÊä¿¿‡ÒÁҡ໚¹¾ÔàÈÉà¾×Íè ¢ÑºÁÍàµÍÏ àÁ×Íè ·íҧҹ㹠âËÁ´¹Õ¨é Ð㪌¡ÃÐáÊä¿¿‡ÒÃÇÁäÁ‹à¡Ô¹ 100mA àÁ×Íè ᡹ÁÍàµÍÏ໚¹ÍÔÊÃÐ ã¹¢³Ð ·Õ¨è Ð㪌¡ÃÐáÊä¿¿‡ÒÃÇÁ¶Ö§ 4-500mA ã¹âËÁ´¢Ñº¡ÃÐáÊàµçÁ·Õâè ´ÂÁÕ¡Òúѧ¤Ñº ᡹ÁÍàµÍÏà¡Ô´¢Ö¹é ËÃ×ÍàÃÕÂ¡Ç‹Ò àºÃ¡ (brake) F ¡íÒ˹´ãˌἧǧ¨Ã¢ÑºÁÍàµÍÏ·Òí §Ò¹ã¹âËÁ´¢Ñº¡ÃÐáÊàµçÁ·Õè M [0..4] µÑ§é âËÁ´¡Ò÷íÒ§Ò¹¢ÑºÁÍàµÍÏ ( Default=0 ) âËÁ´ 0 ¢ÑºáººÎÒŏ¿Êàµç» âËÁ´ 1 ¢Ñºáºº 1 à¿Ê âËÁ´ 2 ¢Ñºáºº 2 à¿Ê âËÁ´ 3 ¢ÑºáººÎÒŏ¿Êàµç» ÁÕ¡Òê´àªÂẺ¤ÇÍàµÍÏÊàµç» âËÁ´ 4 ¢ÑºáººÎÒŏ¿Êàµç» ÁÕ¡Òê´àªÂẺäÁâ¤ÃÊàµç» (¤íÒÊѧè S äÁ‹Á¼Õ Åã¹âËÁ´¹Õ)é


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

117

S [0..255] µÑ§é ¤‹ÒàÇÅÒ˹‹Ç§¡Ò÷íҧҹᵋÅÐÊàµç»ËÃ×Í㪌»ÃѺ¤ÇÒÁàÃçÇã¹âËÁ´ 0-3 ¤‹ÒÁҵðҹ¡íÒ˹´änj·Õè 100 P [0..255]* µÑ§é ¤‹Ò¨íҹǹǧÃͺã¹Ë¹‹Ç§àÇÅÒã¹âËÁ´ 3 ( Default=10 ) R [0..255]* µÑ§é ¤‹Ò¨íҹǹǧÃͺ‹ÍÂ㹡ÒÃẋ§Êàµçºã¹âËÁ´ 3 ( Default=2 ) I [0..255]* µÑ§é ¤‹Ò¨íҹǹǧÃͺ㹡ÒÃẋ§Êàµçºã¹âËÁ´ 4 ( Default=75 ) ËÁÒÂà赯 : * äÁ‹á¹Ð¹íÒãˌ»ÃѺ¤‹Ò¾ÒÃÒÁÔàµÍÏàËŋҹÕé µÑÇÍ‹ҧ·Õè 3 µŒÍ§¡ÒâѺÁÍàµÍÏẺ 2 à¿Ê·Õ¤è ҋ àÇÅÒ˹‹Ç§à·‹Ò¡Ñº 150 ÊÒÁÒöà¢Õ¹â»Ãá¡ÃÁ䴌´§Ñ ¹Õé SEROUT 14,240,[128,”F”,128,”M”,2,128,”S”,150]

¶ŒÒµŒÍ§¡ÒâѺẺÎÒŏ¿Êàµç»âËÁ´ 3 ·Õ¤è ҋ àÇÅÒ˹‹Ç§à·‹Ò¡Ñº 75 à¢Õ¹â»Ãá¡ÃÁ´Ñ§¹Õé SEROUT 14,240,[128,”F”,128,”M”,3,128,”S”,75]

¶ŒÒµŒÍ§¡ÒÃàÃÔÁè µŒ¹¡Ò÷íÒ§Ò¹ãËÁ‹ËÃ×ÍÃÕ૵ ãˌà¢Õ¹â»Ãá¡ÃÁ´Ñ§¹Õé SEROUT 14,240,[128,”C”]

ËÅѧ¨Ò¡¹Õãé ˌ˹‹Ç§àÇÅÒä» 1 ÇÔ¹Ò·Õè à¾×Íè ÃÍãˌἧǧ¨Ã¾ÃŒÍÁ·íÒ§Ò¹

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍϵÇÑ µÑ§é ¡Ñº SCi-BOX à¢ŒÒ ·Õ¨è ´Ø µ‹Í SENSOR0 2. µ‹ÍÊàµç»à»ÍÏÁÍàµÍÃà¢ŒÒ·Õ¨è ´Ø µ‹Í STEPPER MOTOR #1 3. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé '{$STAMP BS2SX} '{$PBASIC 2.5} '****************************************************************** 'File : ACT23.BSX 'Purpose : Running Stepper motor 1 AND 2 'Hardware : Connect POTENTIOMETER #1 at SENSOR0 (motor 1 control) ' Connect POTENTIOMETER #2 at SENSOR1 (motor 2 control) '****************************************************************** SD CON 13 ' Sci-BOX serial communication port SO CON 14 ' Sci-BOX stepper controller serial port BUSY VAR IN15 ' Sci-BOX stepper controller busy signal BAUD CON 240 ' 9600bps constant CTRL CON $80 VALUE SENSOR CH L R

VAR Word VAR Word(2) VAR Byte VAR Byte VAR Byte

' VALUE as SENSOR variable ' SENSOR, 2 Word array ' Channel SELECT

PAUSE 1000 ' Delay 1s. for peripheral initialize ' Set full powered, half STEP, STEP delay 40 SEROUT SO,BAUD,[CTRL,"F",CTRL,"M",0,CTRL,"S",40] GOSUB Poll_BUSY ' WAIT BUSY signal


118

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

LOOP1 : FOR CH=0 TO 1 GOSUB Get_SENSOR : SENSOR(CH)=VALUE DEBUG DEC SENSOR(CH)," " NEXT DEBUG CR Check_M1 : IF SENSOR(0)>=512 THEN M1_Forward L=-1 : GOTO Check_M2 M1_Forward : L=1

' GET sensor 0 AND 1 ' View DATA ON DEBUG

' Rules FOR decision ' Backward IF less than 512

' Forward IF others

Check_M2 : IF SENSOR(1)>=512 THEN M2_Forward R=-1 : GOTO OK M2_Forward : R=1 OK : GOSUB Drive GOTO LOOP1

' Call drive ' DO again

'**************************** ' Drive stepper motor routine '**************************** Drive : SEROUT SO,BAUD,[L,R] ' Drive L & R motor -127 TO +127 range Poll_BUSY : IF BUSY=0 THEN Poll_BUSY RETURN

' RETURN TO main

'**************************** ' GET sensor value subroutine '**************************** Get_SENSOR : LOW SD : PAUSE 1 : HIGH SD ' Break signal SEROUT SD,BAUD,[CH] ' Request SENSOR0 SERIN SD,BAUD,[VALUE.LOWBYTE,VALUE.HIGHBYTE] ' Received DATA 2 Byte TO 1 Word RETURN ' RETURN TO main

4. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 5. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ·´Êͺ¡Ò÷íÒ§Ò¹ 6. ·´ÅͧËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌·µÕè ͋ ÍÂÙ¡‹ ºÑ SENSOR0 Êѧࡵ¡Ò÷íÒ§Ò¹¢Í§Êàµç»à»ÍÏÁÍàµÍÏ #1 7. ¨Ò¡¹Ñ¹é ÅͧŒÒÂÁÍàµÍÏÁÒµ‹Í·Õ¢è ÇÑé µ‹ÍÊàµç»à»ÍÏÁÍàµÍÏ #2 áŌǵ‹Íἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌ẺµÑÇ µÑ§é ࢌҡѺ¾Íϵ SENSOR1 ¨Ò¡¹Ñ¹é ·´ÅͧËÁع᡹¢§ÍµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 Êѧࡵ¡Ò÷íÒ§Ò¹ 8. ¶ŒÒËÒ¡ÊÒÁÒö¨Ñ´ËÒÊàµç»à»ÍÏÁÍàµÍÏ䴌 2 µÑÇãˌµÍ‹ ¾ÃŒÍÁ¡Ñ¹ ÃÇÁ¶Ö§µ‹Íἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌´ÇŒ  ¨Ò¡¹Ñ¹é ·íÒ¡Ò÷´ÊͺÍÕ¡¤Ãѧé

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

119

¡Ô¨¡ÃÃÁ·Õè 24

¡ÒÃà¢Õ¹â»Ãá¡ÃÁµÔ´µ‹ÍâÁ´ÙÅ SLCD ¡ÒÃàª×Íè Áµ‹Í SLCD ¡Ñº SCi-BOX ·íÒ䴌§Ò‹ ÂÁÒ¡ à¾Õ§µ‹ÍÊÒÂÊÑ­­Ò³¨Ò¡¢Ò¾Íϵ P0-P7 ¢Òã´¢ÒË¹Ö§è º¹ºÍÏ´ SCi-BOX ࢌҡѺ ¢Ò¢ŒÍÁÙŢͧ SLCD ¤íÒÊÑ§è ·Õãè ªŒ§Ò¹¤×Í SEROUT

¡ÒÃà¢Õ¹¢ŒÍÁÙÅáÅФíÒÊѧè ä»Âѧ SLCD 㹡óÕàÅ×͡㪌ª´Ø ¤íÒÊѧè Áҵðҹ ¨ÐµŒÍ‹ §Ê‹§ÃËÑÊàÃÔÁè µŒ¹àÊÕ¡‹Í¹ 㹡óÕ㪌§Ò¹ SLCD ¡ÑºàºÊÔ¡áʵÁ»Š 2SX ¨Ð㪌¤Òí Êѧè SEROUT 㹡ÒÃʋ§ ¢ŒÍÁÙÅä»Âѧ SLCD ´Ñ§ÁÕû٠Ẻµ‹Í仹Õé SEROUT ¢Ò¾Íϵ, ¤‹Ò baudmode, [$FE, ¢ŒÍÁÙŤíÒÊѧè ] ¨ÐµŒÍ§Ê‹§ÃËÑÊàÃÔÁè µŒ¹¢Í§¡ÒõԴµ‹Í¡Ñº SLCD «Ö§è ¡ç¤Í× $FE ËÃ×Í 254 ÃËÑʹÕàé »š¹ÃËÑÊÁҵðҹ¢Í§ âÁ´ÙÅ LCD ͹ءÃÁ¢Í§ Scott Edwards ¨Ò¡¹Ñ¹é ʋ§¢ŒÍÁÙŤíÒÊÑ§è ·Õµè ͌ §¡ÒõÒÁä»ä´ŒàÅ ÊíÒËÃѺ¡ÒÃà¢Õ¹¢ŒÍÁÙÅáÊ´§¼Å ÁÕû٠Ẻ´Ñ§¹Õé SEROUT ¢Ò¾Íϵ, ¤‹Ò baudmode, [$FE, 1, ¢ŒÍÁÙÅáÊ´§¼Å] ઋ¹à´ÕÂǡѺ¡ÒÃà¢Õ¹¢ŒÍÁÙŤíÒÊÑ§è µŒÍ§Ê‹§ÃËÑÊàÃÔÁè µŒ¹ $FE ¡‹Í¹ µÒÁ´ŒÇ¢ŒÍÁÙÅ 1 à¾×Íè ᨌ§ãˌµÇÑ ¤Çº¤ØÁº¹ SLCD ·ÃÒºÇ‹Ò ¢ŒÍÁÙÅËÅѧ¨Ò¡¹Õàé »š¹¢ŒÍÁÙÅÊíÒËÃѺáÊ´§¼Å

¡ÒÃà¢Õ¹¢ŒÍÁÙÅáÅФíÒÊѧè ä»Âѧ SLCD 㹡óÕàÅ×͡㪌ª´Ø ¤íÒÊѧè à¾ÔÁè àµÔÁ ÁÕû٠Ẻ·Õ¤è ŌÒ¡ѺªØ´¤íÒÊѧè Áҵðҹ ᵡµ‹Ò§¡Ñ¹à¾Õ§äÁ‹¨Òí ໚¹µŒÍ§Ê‹§ÃËÑÊàÃÔÁè µŒ¹ $FE áÅÐäÁ‹µÍŒ §Ê‹§ ¢ŒÍÁÙÅ 1 à¾×Íè á¡¢ŒÍÁÙŤíÒÊÑ§è ¡Ñº¢ŒÍÁÙÅÊíÒËÃѺáÊ´§¼Å à¾Õ§㪌ʭ Ñ Åѡɳ “ ” à¾×Íè ¡íÒ˹´¢ŒÍÁÙÅÊíÒËÃѺáÊ´§ ¼Å෋ҹѹé 㹡óÕ㪌§Ò¹¡ÑºàºÊÔ¡áʵÁ»Š 2SX ¨Ð㪌¤Òí Êѧè SEROUT ઋ¹à´ÕÂǡѹ ÊíÒËÃѺ¢ŒÍÁÙŤíÒÊѧè à¾ÔÁè àµÔÁ ÊÃØ»änjáŌÇ㹡Ãͺá¡·Õè 2 ÃٻẺ¡ÒÃà¢Õ¹¤íÒÊѧè áÅТŒÍÁÙÅã¹âËÁ´¤íÒÊѧè à¾ÔÁè àµÔÁÁÕ´§Ñ ¹Õé SEROUT ¢Ò¾Íϵ, ¤‹Ò baudmode, [ ¢ŒÍÁÙŤíÒÊѧè ]

áÅÐ

SEROUT ¢Ò¾Íϵ, ¤‹Ò baudmode, [“¢ŒÍÁÙÅáÊ´§¼Å”]

µÑÇÍ‹ҧ·Õè 1 SEROUT 8,240,[129]

·íÒ¡ÒÃʋ§¢ŒÍÁÙŤíÒÊѧè ÍÍ¡ä»·Ò§¢Ò P8 ¢Í§àºÊÔ¡áʵÁ»Š 2SX ´ŒÇºʹàõ 9600 ºÔµµ‹ÍÇÔ¹Ò·Õ áºº µ‹Íâ´ÂµÃ§ à¾×Íè à¤ÅÕÂϨÍáÊ´§¼Å


120

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

¤íÒÊÑ§è ¤Çº¤ØÁâÁ´ÙÅ LCD ẺÁҵðҹ 1. ¤íÒÊѧè à¤ÅÕÂϨÍáÊ´§¼Å Áբ͌ ÁÙŤíÒÊѧè ໚¹ $1 ໚¹¤íÒÊѧè à¢Õ¹¢ŒÍÁÙŪ‹Í§Ç‹Ò§ËÃ×Í space ࢌÒä»ã¹Ë¹‹Ç ¤ÇÒÁ¨íÒ¢ŒÍÁÙÅÊíÒËÃѺáÊ´§¼ÅËÃ×Í DDRAM ÀÒÂã¹âÁ´ÙÅ LCD àÁ×Íè à¤ÅÕÂÏ¨Í áÊ´§¼ÅáÅŒÇ ¨Ð¡íÒ˹´ãˌà¤ÍÏà«ÍÏ (cursor : ÊÑ­Åѡɳ¾àÔ ÈÉ·Õãè ªŒã¹¡ÒÃáÊ´§ µíÒá˹‹§ÊíÒËÃѺáÊ´§µÑÇÍÑ¡ÉâͧâÁ´ÙÅ LCD ºÒ§¤ÃÑé§ÁÕÅѡɳÐ໚¹ÃÙ»ÊÕè àËÅÕÂè Á¼×¹¼ŒÒ¢¹Ò´ 5x 7 ¨Ø´ËÃ×Í໚¹¢Õ´ ÊÒÁÒöÊѧè ãˌ¡Ð¾ÃÔºËÃ×ÍäÁ‹¡äç ´Œ) ¡ÅѺ ä»ÍÂÙ·‹ µÕè Òí á˹‹§«ŒÒÂÁ×ÍÊØ´¢Í§¨ÍáÊ´§¼Å 2. ¤íÒÊѧè Return Home Áդҋ ¢Í§¢ŒÍÁÙÅ෋ҡѺ $2 ËÃ×Í $3 ¡ç䴌 (á¹Ð¹íÒãˌ㪌 $2) ໚¹¡ÒáíÒ˹´ãˌ à¤ÍÏà«ÍÏä»áÊ´§ÂѧµíÒá˹‹§«ŒÒÂÊØ´¢Í§¨ÍáÊ´§¼Å â´Â¢ŒÍÁÙÅ·Õáè Ê´§ÍÂÙ㋠¹ º¹¨ÍáÊ´§¼Å¨ÐäÁ‹Á¡Õ ÒÃà»ÅÕÂè ¹á»Å§ 3. ¤íÒÊѧè àÅ×Í¡âËÁ´¡Òû‡Í¹¢ŒÍÁÙÅ (Entry mode set) ÁÕÃٻẺ¤íÒÊÑ觴ѧ¹Õé

ºÔµ 7 ºÔµ 6 ºÔµ 5 ºÔµ 4 ºÔµ 3 ºÔµ 2 ºÔµ 1 ºÔµ 0 0

0

0

0

0

1

I/D

S

ºÔµ I/D 㪌㹡ÒáíÒ˹´Ç‹Ò àÁ×Íè à¢Õ¹ËÃ×Í͋ҹ¢ŒÍÁÙÅáÅŒÇ ·íÒãˌáÍ´à´Ãʢͧ ˹‹Ç¤ÇÒÁ¨íÒáÊ´§¼Å (DDRAM) à¾ÔÁè ËÃ×ÍŴŧ “0” áÍ´à´ÃÊŴŧ 1 áÍ´à´ÃÊ “1” áÍ´à´ÃÊà¾ÔÁè ¢Ö¹é 1 áÍ´à´ÃÊ ºÔµ S 㪌¡Òí ˹´ÅѡɳСÒÃáÊ´§¼Å “0” àÁ×Íè à¡Ô´µÑÇÍÑ¡ÉÃãËÁ‹ à¤ÍÏà«ÍÏàÅ×Íè ¹ä»·Ò§¢ÇÒÁ×Í “1” àÁ×Íè à¡Ô´µÑÇÍÑ¡ÉÃãËÁ‹ à¤ÍÏà«ÍÏÍÂÙ·‹ àÕè ´ÔÁ ÍÑ¡ÉÃàÅ×Íè ¹ä»·Ò§«ŒÒ ·Õ¹è ÂÔ Á㪌ÁÒ¡·ÕÊè ´Ø ¤×Í ¢ŒÍÁÙŤíÒÊѧè $6 ËÁÒ¶֧ ¡íÒ˹´ãˌàÁ×Íè à¡Ô´¢ŒÍÁÙÅãËÁ‹ à¤ÍÏà«ÍϨÐàÅ×Íè ¹ä»·Ò§¢ÇÒÁ×Í áÅÐáÍ´à´Ãʢͧ˹‹Ç¤ÇÒÁ¨íÒÊíÒËÃѺáÊ´§ ¼Å¨Ðà¾ÔÁè ¢Ö¹é 4. ¤íÒÊÑ§è ¤Çº¤ØÁ¡ÒÃáÊ´§¼Å ÁÕÃٻẺ¤íÒÊÑ觴ѧ¹Õé

ºÔµ 7 ºÔµ 6 ºÔµ 5 ºÔµ 4 ºÔµ 3 ºÔµ 2 ºÔµ 1 ºÔµ 0 0

0

0

0

1

D

C

B

ºÔµ D 㪌¤Çº¤ØÁ¡ÒÃແ´»´¨ÍáÊ´§¼Å ¶ŒÒ໚¹ “0” ໚¹¡Òû´¨ÍáÊ´§ ¼Å ¶ŒÒ໚¹ “1” ໚¹¡ÒÃແ´¨ÍáÊ´§¼Å ºÔµ C 㪌¤Çº¤ØÁ¡ÒÃáÊ´§µÑÇà¤ÍÏà«ÍϺ¹¨ÍáÊ´§¼Å ¶ŒÒ໚¹ “0” ໚¹ ¡Òû´µÑÇà¤ÍÏà«ÍÏËÃ×ÍäÁ‹áÊ´§à¤ÍÏà«ÍÏ ¶ŒÒ໚¹ “1” ໚¹¡ÒÃáÊ´§ µÑÇà¤ÍÏà«ÍÏ ºÔµ B 㪌¤Çº¤ØÁ¡ÒáоÃÔº¢Í§à¤ÍÏà«ÍÏ ¶ŒÒµŒÍ§¡ÒÃãˌà¤ÍÏà«ÍÏ ¡Ð¾ÃÔº µŒÍ§¡íÒ˹´ãˌ໚¹ “1” ¤íÒÊÑ觷Õè㪌º‹Í¤×Í $0C ໚¹¡ÒÃÊÑè§ãˌແ´¨ÍáÊ´§¼Å ᵋäÁ‹áÊ´§ à¤ÍÏà«ÍÏ áÅÐ $0F ໚¹¡ÒÃÊѧè ãˌແ´¨ÍáÊ´§¼Å áÊ´§à¤ÍÏà«ÍÏ áÅÐ ÊÑè§ãˌà¤ÍÏà«ÍϡоÃÔº

5. ¤íÒÊÑ§è ¤Çº¤ØÁ¡ÒÃàÅ×Íè ¹à¤ÍÏà«ÍÏáÅеÑÇÍÑ¡Éà ÁÕû٠Ẻ´Ñ§¹Õé

ºÔµ 7 ºÔµ 6 ºÔµ 5 ºÔµ 4 ºÔµ 3 ºÔµ 2 ºÔµ 1 ºÔµ 0 0

0

0

1

S/C

R/L

*

*

¡ÒÃàÅ×Íè ¹à¤ÍÏà«ÍÏáÅеÑÇÍÑ¡Éâֹé ÍÂÙ¡‹ ºÑ ¡ÒáíÒ˹´ºÔµ S/C áÅÐ R/ L «Ö§è ÊÒÁÒöÊÃػ䴌´§Ñ ¹Õé S/C R/L ÅѡɳСÒÃàÅ×è͹ ¢ŒÍÁÙŤíÒÊѧè 0 0 àÅ×Íè ¹à¤ÍÏà«ÍÏ价ҧ«ŒÒ $10-$13 0 1 àÅ×è͹à¤ÍÏà«ÍÏ价ҧ¢ÇÒ $14-$17 1 0 àÅ×è͹µÑÇÍÑ¡ÉÃãËÁ‹ä»·Ò§«ŒÒ $18-$1B 1 1 àÅ×è͹µÑÇÍÑ¡ÉÃãËÁ‹ä»·Ò§¢ÇÒ $1C-$1F 6. ¤íÒÊÑ§è ¡íÒ˹´¿˜§¡ª¹Ñè ¡Ò÷íÒ§Ò¹ ໚¹¤íÒÊÑ§è ·ÕÁè ¤Õ ÇÒÁÊíҤѭÁÒ¡·ÕÊè ´Ø ÍÕ¡¤íÒÊѧè ˹֧è ÁÕû٠Ẻ¢Í§¢ŒÍÁÙŤíÒÊÑ§è ´Ñ§¹Õé

ºÔµ 7 ºÔµ 6 ºÔµ 5 ºÔµ 4 ºÔµ 3 ºÔµ 2 ºÔµ 1 ºÔµ 0 0

0

1

DL

N

F

*

*

ºÔµ DL 㪌㹡ÒáíÒ˹´¨íҹǹºÔµã¹¡ÒõԴµ‹Í¡ÑºâÁ´ÙÅ LCD “0” ¡íÒ˹´ãˌ·Òí §Ò¹ã¹âËÁ´ 4 ºÔµ “1” ¡íÒ˹´ãˌ·Òí §Ò¹ã¹âËÁ´ 8 ºÔµ ºÔµ N 㪌¡Òí ˹´¨íҹǹºÃ÷Ѵ·Õµè ͌ §¡ÒÃãˌáÊ´§¼Å “0” áÊ´§¼Å 1 ºÃ÷Ѵ “1” áÊ´§¼Å 2 ºÃ÷ѴËÃ×ÍÁÒ¡¡Ç‹�� ᵋÊÒí ËÃѺâÁ´ÙÅ LCD ¢¹Ò´ 16 µÑÇÍÑ¡Éà 1 ºÃ÷Ѵ·ÕÁè ¨Õ Òí ˹‹ÒÂã¹»ÃÐà·Èä·Â µŒÍ§¡íÒ˹´ãˌºµÔ ¹Õàé »š¹ “1” à¹×Íè §¨Ò¡Ë¹‹Ç¤ÇÒÁ¨íÒÊíÒËÃѺà¡çº¢ŒÍÁÙÅà¾×Íè ¡Òà áÊ´§¼ÅäÁ‹ä´ŒÍÂÙµ‹ ͋ à¹×Íè §¡Ñ¹ ¡Å‹ÒǤ×Í áº‹§à»š¹ 2 ª‹Ç§¤×Í ·Õáè Í´à´ÃÊ $00$07 áÅÐ $40-$47 â´Â·Õáè Í´à´ÃÊ $40 ¨Ð໚¹áÍ´à´ÃÊàÃÔÁè µŒ¹¢Í§Ë¹‹Ç¤ÇÒÁ ¨íÒÊíÒËÃѺ¡ÒÃáÊ´§¼Å㹺Ã÷Ѵ·ÕÊè ͧ¢Í§âÁ´ÙÅ LCD ·ÕÁè ÁÕ Ò¡¡Ç‹Ò 1 ºÃ÷Ѵ ¨Ö§·íÒãˌàÁ×Íè µŒÍ§¡ÒõԴµ‹Í¡ÑºâÁ´ÙÅ LCD 1 ºÃ÷Ѵ¨Ö§¨íÒ໚¹µŒÍ§¡íÒ˹´ãˌ໚¹ “1” ºÔµ F 㪌àÅ×Í¡¤ÇÒÁÅÐàÍÕ´¢Í§µÑÇÍÑ¡ÉÃ㹡ÒÃáÊ´§¼Å “0” áÊ´§¼ÅẺ 5x7 ¨Ø´ “1” áÊ´§¼ÅẺ 5x10 ¨Ø´


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

121

¤íÒÊÑ§è ¤Çº¤ØÁ SLCD ã¹âËÁ´¤íÒÊѧè à¾ÔÁè àµÔÁ ¡Ò÷íÒ§Ò¹ ¢ŒÍÁÙŤíÒÊÑè§ ÍÔ¹ÔàªÕÂÅ LCD 142 à¤ÅÕÂϨÍáÊ´§¼Å 143 ¡ÅѺÁÒµíÒá˹‹§àÃÔèÁµŒ¹ 144 à¤ÍÏà«ÍÏäÁ‹àÅ×Íè ¹àÁ×Íè ÁÕÍ¡Ñ ÉÃãËÁ‹ 145 à¤ÍÏà«ÍÏàÅ×è͹价ҧ¢ÇÒàÁ×èÍÁÕÍÑ¡ÉÃãËÁ‹ 146 à¤ÍÏà«ÍÏàÅ×è͹价ҧ«ŒÒÂàÁ×èÍÁÕÍÑ¡ÉÃãËÁ‹ 147 ແ´¨ÍáÊ´§¼Å 148 »´¨ÍáÊ´§¼Å 149 ແ´¨ÍáÊ´§¼ÅáÅÐáÊ´§à¤ÍÏà«ÍÏ 150 ແ´¨ÍáÊ´§¼ÅáÅÐà¤ÍÏà«ÍϡоÃÔº 151 àÅ×è͹à¤ÍÏà«ÍÏ价ҧ«ŒÒ 152 àÅ×è͹à¤ÍÏà«ÍÏ价ҧ¢ÇÒ 153 àÅ×è͹µÑÇÍÑ¡ÉÃãËÁ‹ä»·Ò§«ŒÒ 154 àÅ×è͹µÑÇÍÑ¡ÉÃãËÁ‹ä»·Ò§¢ÇÒ 155 156

¡Ò÷íÒ§Ò¹ à¢Õ¹ CGRAM áÍ´à´ÃÊ 0 à¢Õ¹ CGRAM áÍ´à´ÃÊ 1 à¢Õ¹ CGRAM áÍ´à´ÃÊ 2 à¢Õ¹ CGRAM áÍ´à´ÃÊ 3 à¢Õ¹ CGRAM áÍ´à´ÃÊ 4 à¢Õ¹ CGRAM áÍ´à´ÃÊ 5 à¢Õ¹ CGRAM áÍ´à´ÃÊ 6 à¢Õ¹ CGRAM áÍ´à´ÃÊ 7 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $00 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $10 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $14 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $20 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $40 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $50 àÅ×Í¡ DDRAM áÍ´à´ÃÊ $54

*See note

¢ŒÍÁÙŤíÒÊÑè§ 128 129 130 131 132 133 134 135 136 137 138 139 140 141

ÃÙ»áÊ´§¢ŒÍÁÙŢͧµÑÇÍÑ¡É÷Õàè ¡çºÍÂÙ㋠¹Ë¹‹Ç¤ÇÒÁ¨íÒÃÍÁà¡çºµÑÇÍÑ¡ÉÃËÃ×Í CGROM ¢Í§âÁ´ÙÅ LCD «Ö§è ¼Ù㌠ªŒ§Ò¹ÊÒÁÒöàÃÕ¡ÍÍ¡ÁÒ㪌§Ò¹µÒÁµŒÍ§¡ÒÃ


122

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

µÑÇÍ‹ҧ·Õè 2 SEROUT 8,240,[“Hello Stamp 2SX!”]

·íÒ¡ÒÃʋ§¢ŒÍÁÙÅáÊ´§¼ÅÍÍ¡ä»·Ò§¢Ò P8 ¢Í§àºÊÔ¡áʵÁ»Š 2SX ´ŒÇºʹàõ 9600 ºÔµµ‹ÍÇÔ¹Ò·Õ áºº µ‹Íâ´ÂµÃ§ à¾×Íè áÊ´§¢ŒÍ¤ÇÒÁ Hello Stamp 2SX!

µÑÇÍ‹ҧ·Õè 3 SEROUT 8,240,[154,”Test Line 2 LCD”]

·íÒ¡ÒÃʋ§¢ŒÍÁÙÅáÊ´§¼ÅÍÍ¡ä»·Ò§¢Ò P8 ¢Í§àºÊÔ¡áʵÁ»Š 2SX ´ŒÇºʹàõ 9600 ºÔµµ‹ÍÇÔ¹Ò·Õ áºº µ‹Íâ´ÂµÃ§ à¾×Íè àÅ×Í¡áÍ´à´Ãʢͧ DDRAM µíÒá˹‹§ $40 Íѹ໚¹áÍ´à´ÃÊàÃÔÁè µŒ¹¢Í§¨Í LCD ºÃ÷Ѵ·ÕÊè ͧ ÊíÒËÃѺáÊ´§¢ŒÍ¤ÇÒÁ Test Line 2 LCD

µÑÇÍ‹ҧ·Õè 4 SEROUT 8,240,[150,137]

·íÒ¡ÒÃʋ§¢ŒÍÁÙŤíÒÊѧè ÍÍ¡ä»·Ò§¢Ò P8 ¢Í§àºÊÔ¡áʵÁ»Š 2SX ´ŒÇºʹàõ 9600 ºÔµµ‹ÍÇÔ¹Ò·Õ áºº µ‹Íâ´ÂµÃ§ à¾×Íè àÅ×Í¡áÍ´à´Ãʢͧ DDRAM µíÒá˹‹§ $00 Íѹ໚¹áÍ´à´ÃÊàÃÔÁè µŒ¹¢Í§¨Í LCD ºÃ÷Ѵáá áÅŒÇ ·íÒ¡ÒÃແ´¨ÍáÊ´§¼Å¾ÃŒÍÁ¡ÑºáÊ´§à¤ÍÏà«ÍϡоÃÔº Í‹ҧäáçµÒÁà¹×Íè §¨Ò¡ SLCD µŒÍ§ãªŒàÇÅÒ㹡ÒûÃÐÁÇżŤíÒÊÑ§è ´Ñ§¹Ñ¹é ËÅѧ¨Ò¡¡ÒÃʋ§¢ŒÍÁÙÅã¹áµ‹ÅÐ ¤ÃÑ§é ¤Ç÷íÒ¡ÒÃ˹‹Ç§àÇÅÒ´ŒÇ¤íÒÊѧè PAUSE (㹡óÕ㪌¡ºÑ àºÊÔ¡áʵÁ»Š 2SX) »ÃÐÁÒ³ 250-500 ÁÔÅÅÔÇ¹Ô Ò·Õ ÊíÒËÃѺ¡Ã³ÕáÊ´§¢ŒÍ¤ÇÒÁÍÒ¨µŒÍ§ÁÕ¡ÒÃ˹‹Ç§àÇÅÒ¹Ò¹¡Ç‹Ò¹Ñ¹é à¾×Íè ãˌ¼ãٌ ªŒ§Ò¹ÊÒÁÒöÁͧàËç¹¢ŒÍ¤ÇÒÁ·Õáè Ê´§ ¼Å䴌·¹Ñ áÅЪѴਹ

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

123

¡Ô¨¡ÃÃÁ·Õè 25

¡ÒÃÇÑ´áÅÐáÊ´§¤‹ÒÊÑ­­Ò³ÍйÒÅÍ¡ ¼‹Ò¹âÁ´ÙÅ LCD ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺÊÑ­­Ò³ä¿¿‡Ò¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñº·Õ軇͹ࢌÒÁÒÂѧ SCi-BOX ¼‹Ò¹·Ò§¾Íϵ SENSOR0-SENSOR7 áŌǹíÒä»áÊ´§¼Å·Õè SLCD ËÃ×ÍâÁ´ÙÅ LCD Ẻ͹ءÃÁ

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍϵÇÑ µÑ§é ¡Ñº SCi-BOX à¢ŒÒ ·Õ¨è ´Ø µ‹Í SENSOR0 2. µ‹Í‹ SLCD ࢌҡѺ¾Íϵ P0 ¢Í§ SCi-BOX â´Â㪌ÊÒ PCB3A 3. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé '{$STAMP BS2sx} '{$PBASIC 2.5} '**************************************************** ' File : ACT25.BSX ' Purpose : Show voltage value on SLCD ' Hardware : Connect POTENTIOMETER at SENSOR0 ' Connect SLCD at P0 (9600bps, non-invert) '**************************************************** ' Custom I/O on this application SLCD CON 0 ' Connect SLCD here! ' System I/O and constant , please do not make change SD CON 13 ' Sci-BOX serial communication port BAUD CON 240 ' 9600bps constant CMD CON $FE ' SLCD command constant ' Variable defined VALUE VAR Word I VAR Byte PAUSE

1000

' VALUE as SENSOR0 variable ' I as counter byte ' Delay 1s. for pheripheral initialize

SEROUT SLCD,BAUD,[CMD,1] ' Clear SLCD screen LOOP1 : LOW SD : PAUSE 1 : HIGH SD ' Break signal SEROUT SD,BAUD,[0] ' Request SENSOR0 SERIN SD,BAUD,[VALUE.LOWBYTE,VALUE.HIGHBYTE] ' Received data 2 byte to 1 word SEROUT SLCD,BAUD,[CMD,2]

' Cursor home


124

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

SEROUT SLCD,BAUD,["Value=",DEC4 VALUE]

' Show data

PAUSE 100 GOTO LOOP1

' Delay 100ms. ' Do again

4. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 5. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ 6. ·´ÅͧËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌·Õ赋ÍÍÂً¡Ñº SENSOR0 Êѧࡵ¡ÒÃáÊ´§¼Å¢Í§âÁ´ÙÅ LCD à»ÃÕºà·Õº¡Ñº¼Å¡Ò÷íҧҹ㹡Ԩ¡ÃÃÁ·Õè 20

SCi-B X

Microcontroller in Science experiment


àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X

l

125

¡Ô¨¡ÃÃÁ·Õè 26

¡ÒÃÇÑ´áÅÐáÊ´§¤‹ÒÊÑ­­Ò³ÍйÒÅÍ¡¨Ò¡ ἧǧ¨ÃµÃǨ¨ÑºÊÑ­­Ò³ÍйÒÅÍ¡´ŒÇÂàÊÕ§ ໚¹µÑÇÍ‹ҧ¡ÒÃÃѺÊÑ­­Ò³ä¿¿‡Ò¨Ò¡á¼§Ç§¨ÃµÃǨ¨Ñº·Õ軇͹ࢌÒÁÒÂѧ SCi-BOX ¼‹Ò¹·Ò§¨Ø´µ‹Í SENSOR0-SENSOR7 áŌǹíÒä»ÊÌҧÊÑ­­Ò³àÊÕ§ÍÍ¡·Ò§ÅíÒ⾧ໂÂ⫺¹ SCi-BOX áÅÐáÊ´§¤‹Ò¼‹Ò¹·Ò§ ˹ŒÒµ‹Ò§ Debug Terminal ´ŒÇÂ

¢Ñ¹é µÍ¹¡Ò÷´Åͧ 1. µ‹ÍÊÒÂÊÑ­­Ò³ PCB3A ÃÐËNjҧἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻâ»à·¹ªÔâÍÁÔàµÍϵÇÑ µÑ§é ¡Ñº SCi-BOX à¢ŒÒ ·Õ¨è ´Ø µ‹Í SENSOR0 2. ແ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏáŌÇà¢Õ¹â»Ãá¡ÃÁµ‹Í仹Õé '{$STAMP BS2SX} '{$PBASIC 2.5} '************************************************ ' File : ACT26.BSX ' Purpose : Sound generated from sensor ' Hardware : Connect POTENTIOMETER at SENSOR0 '************************************************ ' System I/O AND constant , please DO NOT make change SOUND CON 12 ' ON board speaker SD CON 13 ' Sci-BOX serial communication port BAUD CON 240 ' 9600bps constant VALUE VAR FREQ VAR PAUSE

1000

Word Word

' VALUE as SENSOR0 variable ' Channel SELECT ' Delay 1s. FOR peripheral initialize

LOOP1 : LOW SD : PAUSE 1 : HIGH SD ' Break signal SEROUT SD,BAUD,[0] ' Request SENSOR0 SERIN SD,BAUD,[VALUE.LOWBYTE,VALUE.HIGHBYTE] ' Received DATA 2 Byte TO 1 Word FREQOUT

SOUND,250,VALUE*2+300

' Frequency depand ON SENSOR0 DEBUG HOME,"Freq.= ",DEC4 VALUE*5+750," Hz." ' Show frequency value GOTO LOOP1 ' DO again

3. µ‹Í SCi-BOX ࢌҡѺ¾Íϵ͹ءÃÁ¢Í§¤ÍÁ¾ÔÇàµÍÏ 4. ¡´»ØÁ† RUN ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ»ŠàÍ´ÔàµÍÏà¾×Íè ´ÒǹâËÅ´áÅÐÃѹâ»Ãá¡ÃÁ 5. ¨Ð»ÃÒ¡¯Ë¹ŒÒµ‹Ò§ Debug Terminal ¢Ö¹é ãˌ·´ÅͧËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌 ·Õµè ͋ ÍÂÙ¡‹ ºÑ SENSOR0 Êѧࡵ¡ÒÃáÊ´§¤‹Ò¢Í§Ë¹ŒÒµ‹Ò§ Debug Terminal áÅàÊÕ§¨Ò¡ ÅíÒ⾧ໂÂ⫵ÒÁ¡ÒÃËÁع᡹¢Í§µÑǵŒÒ¹·Ò¹

SCi-B X

Microcontroller in Science experiment


126

l

àÃÕ¹ÃÙጠÅз´ÅͧÇÔ·ÂÒÈÒʵÏ¡ºÑ ¡Å‹Í§ÊÁͧ¡Å SCi-B X


.


ἧǧ¨Ã¡íÒà¹Ô´áʧÍÔ¹¿ÃÒàô

ἧǧ¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô

ἧǧ¨ÃµÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô

㪌µÃǨ¨ÑºáʧÍÔ¹¿ÃÒàô·Õè¼ÊÁÊÑ­­Ò³¾Òˏ ¤ÇÒÁ¶Õè 38 kHz

㪌µÃǨ¨Ñºáʧã¹Â‹Ò¹ÍÔ¹¿ÃÒàô ãˌàÍÒµ¾Øµ ໚¹áç´Ñ¹µÒÁ¤ÇÒÁࢌÁáʧ·Õµè ÃǨ¨Ñºä´Œ

ἧǧ¨ÃµÃǨ¨Ñºáʧ

ἧǧ¨ÃµÃǨ¨ÑºáʧÊзŒÍ¹

ἧǧ¨ÃÊÇÔµª

ἧǧ¨ÃÇÑ´ÍسËÀÙÁÔ

㪌µÃǨ¨ÑºáʧÊNjҧ àÅ×Í¡àÍÒµ¾Øµä´Œ 2 Ẻ¤×Í áç´Ñ¹àÍÒµ¾µØ à¾ÔÁè ËÃ×Í Å´Å§ àÁ×Íè áʧµ¡¡Ãзº

: SWITCH

ÁÕ LED ¡íÒà¹Ô´áʧÊÕᴧ㹵ÑÇ ãªŒ LDR ÃѺáʧÊзŒÍ¹ ãˌ ¼Å໚¹áç´Ñ¹µÒÁ¤ÇÒÁࢌÁ¢Í§áʧ·ÕèÊзŒÍ¹¡ÅѺÁÒ

ãªŒÇ´Ñ ÍسËÀÙÁâÔ ´Â㪌à·ÍÏÁÊÔ àµÍÏ àÅ×Í¡àÍÒµ¾µØ 䴌 2 Ẻ¤×Í àÁ×èÍÍسËÀÙÁÔÊÙ§¢Öé¹ áç´Ñ¹ÁÒ¡¢Öé¹ ËÃ×Í àÁ×Íè ÍسËÀÙÁÊÔ §Ù ¢Ö¹é áç´Ñ¹Å´Å§

ἧǧ¨ÃµÑǵŒÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ â»à·¹ªÔâÍÁÔàµÍÏ : POTENTIOMETER

ἧǧ¨ÃµÑǵÑÒ¹·Ò¹»ÃѺ¤‹Ò䴌Ẻ ᡹àÅ×Íè ¹ËÃ×ÍÊäÅ´ : SLIDE

ἧǧ¨ÃËÅÑ¡

âÁ´ÙÅ LCD Ẻ͹ءÃÁ 16 µÑÇÍÑ¡Éà 2 ºÃ÷Ѵ «Õ´ÃÕ ÍÁâ»Ãá¡ÃÁ

ἧǧ¨Ãä¿áÊ´§¼Å

ª‹Í§ HIGH ÍÔ¹¾Øµà»š¹Åͨԡ "1" LED µÔ´à»š¹ÊÕá´§ ª‹Í§ LOW ÍÔ¹¾Øµà»š¹Åͨԡ "0" LED µÔ´à»š¹ÊÕà¢ÕÂÇ ¶ŒÒäÁ‹ãª‹Ê­Ñ ­Ò³·Õ¡è Òí ˹´ LED ¨Ð´Ñº

㪌µÃǨ¨Ñº¡ÒÃà»ÅÕÂè ¹á»Å§ÃдѺàÊÕ§ ¶ŒÒµÃǨ¨Ñº 䴌ãËŒÊ­Ñ ­Ò³Åͨԡ “1” ÍÍ¡·Ò§àÍÒµ¾µØ

㪌¡Òí ˹´áç´Ñ¹ 0 - 5 V µÒÁ¡ÒûÃѺ᡹àÅ×Íè ¹ ¹íÒä»ãªŒÇ´Ñ ÃÐÂзҧ䴌 ãˌàÍÒµ¾µØ 2 Ẻ¤×Í àÁ×Íè àÅ×Íè ¹ÁÒ·Ò§¢ÇÒ áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é àÁ×Íè àÅ×Íè ¹ÁÒ·Ò§«ŒÒ áç´Ñ¹·Õäè ´Œ¨ÐÁÒ¡¢Ö¹é

ãªŒÇ´Ñ ¤‹Ò¤ÇÒÁ¨Øä¿¿‡Òã¹Ë¹‹Ç¿ÒÃÑ´ (Farad) â´Â ÇÑ´¨Ò¡¤ÒºàÇÅÒ¤§·Õè RC

㪌ÇÑ´¤ÇÒÁࢌÁ¢Í§Ê¹ÒÁáÁ‹àËÅç¡ ãˌ¼ÅÅѾ¸à»š¹ áç´Ñ¹ºÇ¡àÁ×èÍ·ÔÈʹÒÁáÁ‹àËÅ硾؋§ÍÍ¡ áÅжŒÒ ʹÒÁáÁ‹àËÅ硾؋§à¢ŒÒ ¨Ðãˌ¼Å໚¹Åº àÁ×èÍäÁ‹ÁÕ Ê¹ÒÁáÁ‹àËÅ硨Ð䴌¤Ò‹ ¡ÅÒ§ 2.5V

ἧǧ¨Ãà»ÃÕºà·ÕºÊÑ­­Ò³ :

ἧǧ¨ÃÇÑ´áç´Ñ¹ä¿¿‡Ò¾ÃŒÍÁǧ¨Ã Å´·Í¹áç´Ñ¹ : ATTENUATOR

ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁ¨Øä¿¿‡Ò

COMPARATOR

㪌à»ÃÕºà·Õºáç´Ñ¹ÃÐËNjҧ A ¡Ñº B ãˌ¼ÅÅѾ¸ ໚¹ÊÑ­­Ò³´Ô¨µÔ ÍÅÅͨԡ "0" ¾ÃŒÍÁ¡Ñºä¿áÊ´§

ãªŒÇ´Ñ ¤‹Òáç´Ñ¹¢Í§ä¿¿‡Ò¡ÃÐáʵç â´ÂàÅ×Í¡ÍѵÃÒ Å´·Í¹ä´Œ 2 ÍѵÃÒ¤×Í 1:1 ÃѺáç´Ñ¹ÍÔ¹¾Øµ 0-5V áÅÐ 2:1 ÊíÒËÃѺÃѺáç´Ñ¹ÍÔ¹¾Øµ 0-10V

ʋǹ¤Çº¤ØÁËÅÑ¡ l 㪌 i-Stamp ἧǧ¨ÃäÁâ¤Ã¤Í¹â·ÃÅàÅÍÏàºÊÔ¡áʵÁ»Š 2SX à¢Õ¹â»Ãá¡ÃÁ ´ŒÇÂÀÒÉÒ¾ÕàºÊÔ¡ l ˹‹Ç¤ÇÒÁ¨íÒ 16 ¡ÔâÅ亵 l àª×Íè Áµ‹Í¤ÍÁ¾ÔÇàµÍÏ ¼‹Ò¹¾Íϵ͹ءÃÁà¾×Íè ´ÒǹâËÅ´â»Ãá¡ÃÁáÅÐÊ×Íè ÊÒâŒÍÁÙŠἧǧ¨ÃÇÑ´¡ÃÐáÊä¿¿‡Ò : CURRENT ¨Ø´µ‹ÍÍÔ¹¾ØµàÍÒµ¾µØ ãªŒÇ´Ñ ¡ÃÐáÊä¿¿‡Ò¡ÃÐáʵç â´Âµ‹Í͹ءÃÁ¡Ñº¨Ø´ l ÁÕ¾Íϵ´Ô¨µÔ ÍÅ 8 ª‹Í§ ¡íÒ˹´à»š¹ÍÔ¹¾ØµËÃ×ÍàÍÒµ¾µØ 䴌 ·Õ赌ͧ¡ÒÃÇÑ´ ãˌàÍÒµ¾Øµà»š¹áç´Ñ¹ã¹ÍѵÃÒʋǹ l ÍÔ¹¾ØµÃѺÊÑ­­Ò³ä¿¿‡ÒẺÍйÒÅÍ¡ÊíÒËÃѺµ‹ÍÍØ»¡Ã³µÃǨ¨Ñº 8 ª‹Í§ 5 mV/mA ÇѴ䴌ʧ٠ÊØ´ 1,000mA áç´Ñ¹ÍÔ¹¾ØµÊÙ§ÊØ´äÁ‹à¡Ô¹ 5V ¤ÇÒÁÅÐàÍÕ´¢Í§¡ÒÃá»Å§ÊÑ­­Ò³ 10 ºÔµ ἧǧ¨ÃÇÑ´¤‹Ò¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Ò : RESISTANCE ÀÒ¤ÍØ»¡Ã³àÍÒµ¾µØ ãªŒÇ´Ñ ¤ÇÒÁµŒÒ¹·Ò¹ä¿¿‡Òãˌ¼Å໚¹áç´Ñ¹ã¹ÍѵÃÒ l ÁÕ LED áÊ´§Ê¶Ò¹Ð¡Ò÷íÒ§Ò¹ 4 ´Ç§ l ÁÕǧ¨Ã¢ÑºÃÕàŏ 4 ªØ´ -ʋǹ 1mV : Ω ÇÑ´¤‹Ò䴌ʧ٠ÊØ´ 4,000Ω ËÃ×Í 4kΩ l ǧ¨Ã¢ÑºÁÍàµÍÏ俵çáÅÐÊàµç»à»ÍÏÁÍàµÍÏẺÂÙ¹âÔ ¾Å‹ÒÏ Í‹ҧÅÐ 2 ªØ´ l ÅíÒ⾧ໂÂâ«ÊíÒËÃѺ¢ÑºÊÑ­­Ò³àÊÕ§ Êàµç»à»ÍÏÁÍàµÍÏ

ÊÒµ‹Í¾Íϵ͹ءÃÁ

ἧǧ¨ÃµÃǨ¨ÑºàÊÕ§

ἧǧ¨ÃµÃǨ¨ÑºáÅÐÇѴʹÒÁáÁ‹àËÅç¡

ÁÕÊÇÔµª¾ÃŒÍÁä¿áÊ´§¼ÅãˌàÍÒµ¾µØ 2 Ẻ¤×Í ª‹Í§ HIGH ¡´ÊÇÔµªÊ§‹ Åͨԡ”1” ä¿ÊÕá´§µÔ´ ª‹Í§ LOW ¡´ÊÇÔµªÊ§‹ Åͨԡ “0” ä¿ÊÕà¢ÕÂǵԴ ¶ŒÒäÁ‹Á¡Õ Òá´ LED ´Ñº Åͨԡ·Õäè ´Œ¨Ðãˌ¼Å¡ÅѺ¡Ñ¹

㪌¡Òí ˹´áç´Ñ¹ 0-5V µÒÁ¡ÒÃËÁع᡹ ¹íÒä»ãªŒ ÇÑ´¤‹ÒÁØÁáÅÐÃÐÂзҧ䴌 ÁÕẺµÑǵѧé áÅеÑǹ͹ ãˌàÍÒµ¾µØ 2 Ẻ¤×Í áç´Ñ¹ÁÒ¡¢Ö¹é àÁ×Íè ËÁع ·Ç¹à¢çÁ¹Ò́¡ÒËÃ×Í µÒÁà¢çÁ¹Ò́¡Ò

㪌§Ò¹ä´Œ 2 Ẻ¤×Í Ê‹§áººµ‹Íà¹×Íè § ·íÒ§Ò¹àÁ×Íè ä´ŒÃºÑ Åͨԡ "1" 㪌§Ò¹Ã‹ÇÁ¡Ñºá¼§Ç§¨Ãâ¿âµŒ ·ÃÒ¹«ÔÊàµÍÏà¾×Íè ÇÑ´ÃдѺ¤ÇÒÁࢌÁ¢Í§áʧ·Õäè ´Œ ʋ§áººÊÑ­­Ò³¤ÇÒÁ¶Õè ´ŒÇ¡ÒüÊÁÊÑ­­Ò³¾Òˏ¤ÇÒÁ¶Õè 38kHz ã¹ ¡Ã³Õ¹Õé㪌ËÇÁ¡Ñºá¼§Ç§¨ÃâÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàôà¾×è͵ÃǨÊͺ¡ÒÃÃѺ ÊÑ­­Ò³

ÊÒ»ҡ¤Õº µÑǵŒÒ¹·Ò¹áÅеÑÇà¡çº»ÃШØÊÒí ËÃѺ·´Åͧ

ÍÐá´»àµÍÏ 12V

ÁÍàµÍÏ俵ç

ÊÒ��ÊÑ­­Ò³

ÃËÑÊ #8000099


SCI-BOX Manual