Cov txheej txheem:

Boe-Bot Nrog Kev Tshawb Fawb Infrared: 12 Cov Kauj Ruam (nrog Duab)
Boe-Bot Nrog Kev Tshawb Fawb Infrared: 12 Cov Kauj Ruam (nrog Duab)

Video: Boe-Bot Nrog Kev Tshawb Fawb Infrared: 12 Cov Kauj Ruam (nrog Duab)

Video: Boe-Bot Nrog Kev Tshawb Fawb Infrared: 12 Cov Kauj Ruam (nrog Duab)
Video: TERFs and Tampons 2024, Hlis ntuj nqeg
Anonim
Boe-Bot Nrog Infrared Detectors
Boe-Bot Nrog Infrared Detectors

Cov lus qhia no yuav qhia txog yuav tsim thiab cim lub Boe-Bot uas tuaj yeem taug kev tshawb nrhiav siv lub tshuab ntsuas hluav taws xob kom tsis txhob muaj teeb meem. Nov yog qhov yooj yim ua raws cov lus qhia uas tso cai rau hloov kho yooj yim kom haum rau koj cov kev xav tau. Qhov no xav tau kev nkag siab yooj yim ntawm Circuitry thiab cov phiaj xwm. Koj yuav tsum muaj BASIC Stamp IDE software rau txoj haujlwm no. Dawb rau download ntawm no. Ib yam li Boe-Bot Neeg Hlau

Kauj Ruam 1: Cov peev txheej

Cov Khoom Siv Hluav Taws Xob

Boe -Bot nrog txuas txuas Parallax Khw - BoeBot Cov Khoom

5 Infrared LED's Parallax Store - IR Cov Khoom Sib Txuas Sib Txuas

5 Cov Khoom Siv Hluav Taws Xob Infrared

5 infrared Detectors Parallax Store - BoeBot IR Txais

Resistors

  • (2) 4.7 kΩ ABRA Electronics - 4.7 kΩ
  • (5) 220 Ω ABRA Electronics - 220 Ω
  • (2) 1 kΩ ABRA Electronics - 1 kΩ
  • (5) 2 k ABRA Electronics - 2 kΩ

Cov khoom siv sib txuas ABRA Electronics - 22 Gauge Wire

3 LED's ABRA Electronics - 5mm Liab LED

Txhawb nqa

Khoos phis tawj

BASIC Stamp Editor - (Freeware)

Cov cuab yeej

Hlau Cutter ABRA Electronics - Hlau Cutter (Tsis teb los tau)

Hlau Stripper ABRA Electronics - Hlau Stripper

Lwm yam

Phab ntsa (los tsim tshawb nrhiav)

Kauj Ruam 2: Nkag Siab Li Cas Kev Tshawb Nrhiav Infrared Ua Haujlwm (Yeem Tau)

Nkag Siab Li Cas Kev Tshawb Fawb Infrared Ua Haujlwm (Yeem Xaiv)
Nkag Siab Li Cas Kev Tshawb Fawb Infrared Ua Haujlwm (Yeem Xaiv)

Infrared Teeb

Lub teeb pom kev pom ntawm lub ntsej muag peb yuav tsim rau ntawm Boe-Bot yog zoo li lub tsheb taws nyob rau ntau qhov. Thaum lub teeb pom kev ntawm lub tsheb teeb pom kev tawm ntawm cov teeb meem, koj lub qhov muag pom cov teeb meem thiab koj lub paj hlwb ua haujlwm rau lawv thiab ua rau koj lub cev coj lub tsheb kom haum. Boe-Bot yuav siv infrared LEDs rau lub teeb taub hau. Lawv tso tawm infrared, thiab qee qhov, lub teeb pom kev zoo tawm ntawm cov khoom thiab thaws rov qab rau hauv kev coj ntawm Boe-Bot. Lub qhov muag ntawm Boe-Bot yog lub tshuab ntes hluav taws xob. Cov ntsuas hluav taws xob xa hluav taws xob xa cov cim qhia pom seb puas pom lossis tsis pom cov duab hluav taws xob pom los ntawm ib yam khoom. Lub hlwb ntawm Boe-Bot, BASIC Stamp, txiav txim siab thiab ua haujlwm ntawm servo motors raws li lub tswv yim ntsuas no. Daim duab 7-1 Kev Tshawb Nrhiav Lub Hom Phiaj nrog IR Lub Teeb Lub IR ntes tau teeb tsa hauv cov lim dej uas tso cai rau lub teeb pom kev me me tshwj tsis yog lub 980 nm infrared uas peb xav kom kuaj nrog nws lub photodiode sensor sab hauv. Lub tshuab ntsuas hluav taws xob kuj tseem muaj lub tshuab lim hluav taws xob uas tsuas tso cai teeb tsa ib puag ncig 38.5 kHz kom dhau mus. Hauv lwm lo lus, lub ntsuas ntsuas tsuas yog nrhiav lub teeb pom kev zoo uas qhib rau thiab tawm 38, 500 zaug hauv ib pliag. Qhov no tiv thaiv IR cuam tshuam los ntawm ntau qhov chaw xws li tshav ntuj thiab teeb pom kev hauv tsev. Tshav ntuj yog DC cuam tshuam (0 Hz), thiab teeb pom kev sab hauv tsev zoo li nyem rau thiab tawm ntawm 100 lossis 120 Hz, nyob ntawm seb lub zog tseem ceeb hauv cheeb tsam. Txij li 120 Hz yog sab nraum lub tshuab lim hluav taws xob 38.5 kHz band dhau zaus, nws tsis quav ntsej kiag li los ntawm IR ntsuas.

-Paralax Student Guide

Kauj Ruam 3: Sib dhos IR LED's

Sib dhos IR LED's
Sib dhos IR LED's

Ntxig lub IR LED rau hauv qhov loj dua ntawm lub casing

Muab qhov pom tseeb ntawm LED tso nrog qhov me me ntawm lub casing

Kauj Ruam 4: Kuaj Cov Duab Infrared - Circuit

Kuaj Cov Teeb Pom Kev Sib Txuas - Circuit
Kuaj Cov Teeb Pom Kev Sib Txuas - Circuit
Kuaj Cov Teeb Pom Kev Sib Txuas - Circuit
Kuaj Cov Teeb Pom Kev Sib Txuas - Circuit

Ua ntej peb nkag mus tob rau ib yam dab tsi, peb yuav sim ua kom ntseeg tau tias IR khub ua haujlwm (Ib qho infrared LED thiab ib lub ntsuas hluav taws xob pom).

Pib los ntawm kev tsim cov phiaj xwm saum toj no ntawm lub khob cij txuas rau saum koj lub Boe-Bot

Kauj Ruam 5: Kuaj Cov Duab Infrared - Txoj Cai Yooj Yim

Yog lawm, peb yuav tsum tau sau cov cai rau peb IR khub ua haujlwm

Txhawm rau ua qhov no, yuav siv FREQOUT hais kom ua. Cov lus txib no tau tsim los rau lub suab nrov, txawm li cas los xij nws tuaj yeem siv los tsim cov zaus hauv cov duab infrared. Rau qhov kev xeem no peb yuav siv qhov hais kom ua:

FREQOUT 8, 1, 38500

qhov no yuav xa 38.5 kHz zaus uas kav ntev 1 ms rau P8. Cov duab hluav taws xob infrared LED txuas nrog P8 yuav tshaj tawm qhov zaus no. Yog tias lub teeb hluav taws xob pom tau rov qab mus rau Boe-Bot los ntawm cov khoom hauv nws txoj hauv kev, lub ntsuas hluav taws xob xa hluav taws xob yuav xa BASIC Stamp lub teeb liab los qhia rau nws paub tias lub teeb pom kev pom pom pom tau pom.

Tus yuam sij los ua IR khub ua haujlwm yog xa 1 ms ntawm 38.5 kHz FREQOUT thiab tam sim khaws cov IR ntes cov zis hauv qhov sib txawv.

Qhov piv txwv no qhia pom khaws cia tus IR Ntes tus nqi hauv qhov sib txawv me ntsis npe irDectectLeft

FREQOUT 8, 1, 38500

irDetectLeft = IN9

IR lub ntsuas hluav taws xob lub xeev tso tawm thaum nws pom tsis muaj IR teeb liab siab. Thaum lub ntsuas hluav taws xob IR pom 38500 Hz kev sib raug zoo los ntawm ib yam khoom, nws cov zis tsawg. IR lub ntsuas hluav taws xob tso tawm tsuas yog qis rau ib feem ntawm lub millisecond tom qab FREQOUT cov lus txib tau ua tiav xa cov lus sib haum, yog li nws yog qhov tseem ceeb los khaws IR lub ntsuas hluav taws xob tso tawm hauv qhov sib txawv tam sim tom qab xa FREQOUT hais kom ua. Tus nqi khaws cia los ntawm qhov sib txawv tuaj yeem muab tso rau hauv Debug Terminal lossis siv rau kev txiav txim siab los ntawm Boe-Bot.

Kauj Ruam 6: Kuaj Cov Duab Infrared - Hardware + Software

Kuaj Infrared Pairs - Kho vajtse + Software
Kuaj Infrared Pairs - Kho vajtse + Software

Tam sim no koj paub qhov pib, peb tuaj yeem muab kho vajtse thiab Software ua ke los ntsuas ib khub ua ke thiab tau txais cov lus tawm ntawm lub sijhawm tiag tiag los ntawm qhov IR Pair tab tom kuaj pom.

Koj tuaj yeem sim thiab ua tus lej koj tus kheej, lossis siv cov cai hauv qab no

'{$ STAMP BS2}

'{$ PBASIC 2.5} irDetectLeft VAR Bit DO FREQOUT 8, 1, 38500 irDetectLeft = IN9 DEBUG HOME, "irDetectLeft =", BIN1 irDetectLeft PAUSE 100 LOOP

  1. Tawm ntawm Boe-Bot txuas nrog cov xov txuas, vim tias koj yuav siv DEBUG Terminal los ntsuas koj li IR khub.
  2. Muab ib yam khoom, xws li koj txhais tes lossis ib daim ntawv, kwv yees li ib nti los ntawm sab laug IR khub
  3. Txheeb xyuas tias thaum koj tso ib qho khoom nyob rau hauv pem hauv ntej ntawm IR khub Debug Terminal qhia txog 0, thiab thaum koj tshem tawm cov khoom los ntawm pem hauv ntej ntawm IR khub, nws qhia txog 1.
  4. Yog tias Debug Terminal tsis pom qhov txiaj ntsig xav tau, sim cov kauj ruam hauv Cov Teeb Meem-Shooting Step.

Kauj Ruam 7: Teeb Meem-Shooting (Rau Teeb Meem Nrog Kauj Ruam Kawg)

DEBUG Terminal qhia pom qhov txiaj ntsig tsis tau xav txog

Txheeb xyuas Circuit Court kom luv, tso tsis raug lossis ploj mus, cov khoom puas, tiv thaiv tsis raug, lossis lwm yam teeb meem pom

Txheeb xyuas qhov kev zov me nyuam los ntawm cov laj thawj lossis cov lus yuam kev - Yog tias koj siv koj tus lej rau qib kawg, txiav txim siab siv cov cai muab

Ib txwm tau 0, txawm tias thaum tsis muaj cov khoom raug muab tso rau ntawm xub ntiag ntawm Boe-Bot

Txheeb xyuas yog tias muaj cov khoom nyob ze uas cuam tshuam lub teeb liab infrared. Cov lus nyob rau pem hauv ntej ntawm Boe-Bot tuaj yeem yog qhov ua rau. Tsiv lub Boe-Bot mus rau qhov chaw qhib kom IR LED thiab lub ntsuas tsis tuaj yeem cuam tshuam txog ib qho khoom nyob ze.

Kev nyeem ntawv yog 1 feem ntau ntawm lub sijhawm thaum tsis muaj qhov khoom nyob rau ntawm xub ntiag ntawm Boe-Bot, tab sis flickers rau 0 qee zaus

Tej zaum yuav muaj kev cuam tshuam los ntawm lub teeb fluorescent nyob ze; Tua ib lub teeb fluorescent nyob ze thiab rov ua koj qhov kev xeem. Yog tias qhov teeb meem tseem nyob, qib 9 yuav qhia qhov teeb meem

Kauj Ruam 8: Thib Ob IR

Thib Ob IR
Thib Ob IR

Tam sim no koj muaj qhov haujlwm rau sab laug IR, nws yog koj li tig los ua lub Circuit thiab teeb tsa txoj cai IR Pair

  1. Hloov DEBUG nqe lus, lub npe thiab lus pom kom xa mus rau tus khub IR raug.
  2. Hloov lub npe hloov pauv los ntawm irDetectLeft rau irDetectRight. Koj yuav tsum ua qhov no hauv plaub qhov chaw hauv txoj haujlwm.
  3. Hloov FREQOUT cov lus txib tus Pin cav los ntawm 8 txog 2.
  4. Hloov cov ntaub ntawv sau npe saib xyuas los ntawm irDetectRight sib txawv los ntawm IN9 rau IN0.
  5. Rov ua cov kauj ruam sim hauv qhov haujlwm no rau IR txoj cai; nrog IR LED Circuit txuas nrog P2 thiab lub ntsuas ntsuas txuas nrog P0.

Kauj Ruam 9: Tshawb Pom Kev cuam tshuam Infrared (Tsis teb los tau)

Txheeb Xyuas Kev cuam tshuam ntawm Infrared (Tsis teb los tau)
Txheeb Xyuas Kev cuam tshuam ntawm Infrared (Tsis teb los tau)

Txawm hais tias koj tab tom ntsib teeb meem nrog kuaj pom cov cim uas yuav tsum tsis raug kuaj pom lossis koj npaj yuav ua kom pom koj li IR pom nyob rau lwm qhov chaw, koj yuav xav sim rau cuam tshuam.

Lub tswv yim ntawm qhov kev tshuaj ntsuam xyuas no yog qhov yooj yim zoo nkauj, koj kuaj pom lub teeb liab infrared tsis xa tawm.

Koj tuaj yeem siv qhov xwm txheej zoo ib yam tab sis koj yuav tsum hloov kho txoj cai. koj tuaj yeem xaiv sau koj tus lej, tab sis koj tuaj yeem siv cov cai hauv qab no:

'{$ STAMP BS2}

'{$ PBASIC 2.5} irDetectLeft VAR Bit DO irDetectLeft = IN9 irDetectRight = IN0 YOG IN9 = 0 LOS YOG IN0 = 0 THIAB DEBUG "cuam tshuam pom" PAUSE 100 LOOP

Yog tias koj tau ntsib kev cuam tshuam, txiav txim siab qhov yuav tshwm sim thiab tua nws/tshem nws lossis hloov chaw uas koj ua haujlwm rau koj li Boe-Bot.

Kauj Ruam 10: Ntxiv IR khub

Ntxiv Ntau IR Pairs
Ntxiv Ntau IR Pairs

Yog tias koj xav tau qhov tseeb hauv kev txav ntawm koj li Boe-Bot, koj yuav xav ntxiv IR Pairs ntau dua. 3 Txhim kho kev ua tau zoo piv rau ob; koj tuaj yeem siv tus khub nruab nrab txhawm rau tshuaj xyuas qhov cuam tshuam ncaj qha, thiab siv ob sab IRs los txiav txim seb yuav tig li cas. Txawm li cas los xij, qhov poob ntawm 3 IR khub tsim yog tias koj tuaj yeem paub thaum koj swb rau ntawm phab ntsa, vim tias qhov nruab nrab IR khub tau siv los txheeb xyuas cov teeb meem. Txhawm rau daws qhov teeb meem no, koj tuaj yeem ntxiv IR khub rau txhua sab nrog qhov muaj peev xwm tiv taus siab-yog li ntawd thiab cov duab hluav taws xob yuav pom tsuas yog tias Boe-Bot nyob ze rau ib sab lossis phab ntsa ntawm lub kaum ntse ntse.

Kauj Ruam 11: Tsib IR Pairs - Circuit

Tsib IR Pairs - Circuit
Tsib IR Pairs - Circuit

Ua tib zoo saib xyuas thaum coj ob IR LEDs ntawm ib sab vim ntswj lawv yuav ua rau cov coj mus kov thiab ua rau luv Circuit Court.

Kauj Ruam 12: Tsib IR Pairs - Code

Tsib IR Pairs - Txoj Cai
Tsib IR Pairs - Txoj Cai

Tej zaum koj yuav xav sim teeb tsa koj li Boe-Bot ua ntej siv cov cai no:

'{$ STAMP BS2}' {$ PBASIC 2.5} 'Tsib IR Pair Deatection Code' Matthew Shaw 'Tsib Hlis 8 2019 (Version 7)' Kev kuaj pom rau cov khoom thiab cov txheej txheem ua kom yooj yim daws cov mazes

irDetectLeft VAR Bit 'Hloov pauv rau sab laug

irDetectCentre VAR Bit 'Hloov pauv rau nruab nrab irDetectRight VAR Bit' Hloov pauv rau sab xis irDetectLSide VAR Bit 'Hloov pauv rau sab laug irDetectRSide VAR Bit' Hloov pauv rau sab xis irDetectLSideFar VAR Bit 'Hloov pauv rau sab laug tsis kam tiv thaiv irDetectRSideFar VAR Me

mLoop VAR Lo Lus

Lmotor PIN 15 'Sab laug lub cev muaj txuas nrog tus pin 14, mem tes mus los ntawm no

Rmotor PIN 14 'txoj cai = 15

'nrawm yog-> 650-750-850

LFast CON 850 'Conastant rau sab laug lub cev ntawm qhov nrawm RFast CON 650' Conastant rau lub cev muaj zog ntawm lub nrawm

LStop CON 750 'Conastant rau sab laug lub cev kom nrawm

RStop CON 650 'Conastant rau lub cev muaj zog ntawm qhov nrawm

LMid CON 830 'Conastant rau sab laug lub cev ntawm qhov nrawm

RMid CON 700 'Conastant rau lub cev muaj zog ntawm qhov nrawm

LSlow CON 770 'Conastant rau sab laug lub cev ntawm qhov nrawm

RSlow CON 730 'Conastant rau lub cev muaj zog ntawm qhov nrawm

LRev CON 650 'Conastant rau sab laug lub cev muaj zog ntawm kev thim rov qab

RRev CON 850 'Conastant rau sab laug lub cev muaj zog ntawm kev nrawm rov qab

FREQOUT 7, 1, 38500 'sab laug

irDetectLeft = IN8

FREQOUT 6, 1, 38500 'chaw

irDetectCentre = IN5

FREQOUT 3, 1, 38500 'sab xis

irDetectRight = IN2

FREQOUT 10, 1, 38500 'Sab laug Kaw

irDetectLSide = IN11

FREQOUT 1, 1, 38500 'txoj cai Kaw

irDetectRSide = IN0

FREQOUT 9, 1, 38500

irDetectLSideFar = IN11

FREQOUT 4, 1, 38500 'sab xis

irDetectRSideFar = IN0

YOG irDetectLSide = 0 THIAB irDetectRSide = 0 THIAB lub ntsiab 'Pib COMMAND yoj koj ob txhais tes dhau los ntawm ob sab ntsuas kom pib qhov program

Lub ntsiab:

PAUSE 1000 DO

PULSOUT Lmotor, LFast 'sab laug lub cev muaj zog ua haujlwm nrawm

PULSOUT Rmotor, RFast 'Txoj cai lub cev muaj zog ua haujlwm nrawm

FREQOUT 6, 1, 38500 'chaw

irDetectCentre = IN5

FREQOUT 10, 1, 38500 'Sab laug Kaw

irDetectLSide = IN11

FREQOUT 1, 1, 38500 'sab xis

irDetectRSide = IN0

YOG irDetectLSide = 0 THIAB irDetectRSide = 1 THEN

Ua PULSOUT Lmotor, LFast

FREQOUT 6, 1, 38500 'chaw

irDetectCentre = IN5 YOG irDetectCentre = 0 THEN cent

FREQOUT 10, 1, 38500 'Sab laug Kaw

irDetectLSide = IN11

FREQOUT 3, 1, 38500 'sab xis

irDetectRight = IN2

LOOP UNTIL irDetectLSide = 1 LOS YOG irDetectRSide = 0

ELSEIF irDetectLSide = 1 THIAB irDetectRSide = 0 THEN

Ua PULSOUT Rmotor, RFast

FREQOUT 6, 1, 38500 'chaw

irDetectCentre = IN5 YOG irDetectCentre = 0 THEN cent

FREQOUT 10, 1, 38500 'Sab laug Kaw

irDetectLSide = IN11

FREQOUT 3, 1, 38500 'sab xis

irDetectRight = IN2

LOOP UNTIL irDetectLSide = 0 LOS YOG irDetectRSide = 1

'ENDIF

YOG irDetectCentre = 0 THIAB 'Pib

FREQOUT 7, 1, 38500 'sab laug irDetectLeft = IN8

FREQOUT 6, 1, 38500 'chaw

irDetectCentre = IN5

NQE 3, 1, 38500

irDetectRight = IN2

PAUSE 1000 'ncua kom qhia pom lub teeb liab pom

YOG (irDetectLeft = 1 THIAB irDetectRight = 0) THIAB 'ntsuas lub sijhawm

GOSUB turnLeft

ELSEIF (irDetectLeft = 0 THIAB irDetectRight = 1) THEN

GOSUB turnRight

ELSEIF (irDetectLeft = 1 THIAB irDetectRight = 1) THEN

GOSUB turnDecide

ELSE

GOSUB turnReverse

ENDIF

ENDIF 'END

LOOP

KAWG

tigLeft:

PULSOUT Lmotor, LRev FREQOUT 8, 1, 38500 irDetectLeft = IN9 FREQOUT 5, 1, 38500 irDetectCentre = IN4 FREQOUT 2, 1, 38500 irDetectRight = IN0 LOOP UNTIL IN0 = 1 RETURN

tig txoj cai:

PULSOUT Rmotor, RRev FREQOUT 8, 1, 38500 irDetectLeft = IN9 FREQOUT 5, 1, 38500 irDetectCentre = IN4 FREQOUT 2, 1, 38500 irDetectRight = IN0 LOOP UNTIL IN9 = 1

Rov qab

tig rov qab:

FOR mLoop = 0 TO 50 PULSOUT Rmotor, RRev PULSOUT Lmotor, LRev PAUSE 20 PULSOUT Lmotor, LRev PAUSE 20 NEXT DO PULSOUT Rmotor, RRev FREQOUT 8, 1, 38500 irDetectLeft = IN9 FREQOUT 5, 4, 5, 1, 38, 38500 irDetectRight = IN0 LOOP UNTIL IN9 = 1

Rov qab

turnDecide: 'siv qis qis los saib ntxiv

FREQOUT 9, 1, 38500

irDetectLSideFar = IN11

FREQOUT 4, 1, 38500 'sab xis

irDetectRSideFar = IN0

YOG (irDetectLSideFar = 1 THIAB irDetectRSideFar = 0) THIAB 'ntsuas lub sijhawm

GOSUB turnLeft

ELSEIF (irDetectLSideFar = 0 THIAB irDetectRSideFar = 1) THEN

GOSUB turnRight

ELSEIF (irDetectLSideFar = 1 THIAB irDetectRSideFar = 1) THEN

GOSUB turnLeft

ELSE

GOSUB turnReverse

ENDIF

Rov qab

Pom zoo: