Cov txheej txheem:

HC-SR04 Reader Module los daws Arduino: 6 Cov Kauj Ruam (nrog Duab)
HC-SR04 Reader Module los daws Arduino: 6 Cov Kauj Ruam (nrog Duab)

Video: HC-SR04 Reader Module los daws Arduino: 6 Cov Kauj Ruam (nrog Duab)

Video: HC-SR04 Reader Module los daws Arduino: 6 Cov Kauj Ruam (nrog Duab)
Video: Arduino Adventskalender Verlosung + Up2Date Talk 2024, Kaum ib hlis
Anonim
Image
Image
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe

HC-SR04 ultrasonic nrug deb sensor yog nrov heev hauv neeg hlau. Yeej, txhua yam khoom siv zam tus neeg hlau siv lub ntsuas no. Thiab nws yog qhov zoo kawg, yooj yim siv pheej yig thiab raug tab sis thaum koj pib tsim cov neeg hlau nyuaj dua koj tuaj yeem pib pom teeb meem thiab qhov teeb meem no yog lub sijhawm. Nws siv sijhawm ntau los ntsuas nrug nrog lub ntsuas no, muaj qee qhov kev xaiv zoo li cov ntsuas ntse uas tuaj yeem tshawb pom cov khoom nrawm tab sis cov zis ntawm lawv yog binary yog li koj tuaj yeem tshawb pom yog tias muaj cov khoom hauv thaj tsam tshwj xeeb tab sis koj tsis paub nyob deb npaum cas. Rau qee tus neeg hlau cov ntsuas no zoo kawg tab sis muaj lwm qhov teeb meem - tus nqi. Lawv yuav luag 10 npaug kim tshaj li HC-SR04. Yog li ntawm no kuv pib xav txog kev txuas ob qho no ua ke. Thiab kuv los nrog lub tswv yim rau tus qauv uas koj tuaj yeem txuas rau HC-SR04 thiab xa cov haujlwm ntawm kev nyeem qhov nrug mus rau Attiny microcontroller, cov zis tuaj yeem yog binary thiab koj lub microprocessor tseem ceeb tau tso tseg! Kev daws yooj yim tab sis zoo nkauj thiab pheej yig tib lub sijhawm:) Xav paub qhov twg koj tuaj yeem siv qhov ntsuas no? Mus nyeem ntawv lossis saib video.

JLCPCB 10 cov laug cam rau $ 2:

Kauj Ruam 1: Daim Ntawv Teev Npe

Cov npe ntawm ntu tsis ntev heev, koj tuaj yeem pom lawv feem ntau ntawm txhua lub khw hluav taws xob hauv zos, tseem muaj qhov txuas mus rau cov khw hauv online yog tias kuv pom qee yam:

  • HC-SR04
  • Txoj Cai 45/85
  • Potentiometer
  • Breakaway headers Poj niam thiab txiv neej
  • 1206 SMD resistor (zoo dua yuav hauv ib pob)
  • 1206 LED teeb

Koj tseem yuav xav tau qee yam cuab yeej xws li:

  • Soldering hlau/chaw nres tsheb
  • USBasp programmer ua

Yog tias koj xav yuav PCB rau txoj haujlwm no, txheeb xyuas kuv lub khw Tindie:

Kuv muag ntawm Tindie
Kuv muag ntawm Tindie

Kauj Ruam 2: PCB, Schematic thiab Cov Ntaub Ntawv

PCB, Schematic thiab Cov Ntaub Ntawv
PCB, Schematic thiab Cov Ntaub Ntawv

Saum toj no koj tuaj yeem pom tag nrho cov ntaub ntawv suav nrog cov qauv thiab PCB tsim, kuj tseem muaj cov ntaub ntawv Gerber uas koj tuaj yeem siv los tsim cov PCB no. Xav tias dawb los hloov cov ntaub ntawv rau koj tus kheej xav tau nco ntsoov tias txhua qhov ntawm kuv cov phiaj xwm tau muab faib ua yam tsis yog lag luam yog li koj tsis tuaj yeem muag lawv.

Schematic yog qhov yooj yim heev, tsuas muaj qee qhov khoom siv, koj tuaj yeem siv nws los txhim kho txhua yam ntawm PCB kom raug.

Yog tias koj tsis xav siv PCB rau txoj haujlwm no koj tuaj yeem txuas tag nrho cov ntawd ntawm lub khob cij, nws yuav loj dua me ntsis tab sis yog tias koj tsis tuaj yeem siv cov laug uas yog txoj hauv kev yooj yim rau koj!

Kauj ruam 3: Soldering

Soldering
Soldering
Soldering
Soldering
Soldering
Soldering

Soldering yog qhov yooj yim heev. Pib nrog cov khoom me tshaj plaws (tus tiv thaiv thiab LED) thiab tom qab ntawd txav mus rau qhov loj dua thiab loj dua, txoj kev ntawd nws yuav yooj yim dua rau koj kom txhuam tag nrho cov ntawd. Xyuas kom meej tias polarity yog qhov zoo rau txhua qhov khoom siv thiab tsis muaj ib qho luv. Yog tias koj tsis xav siv PCB rau txoj haujlwm no thiab koj xav txuas txhua yam ntawm lub khob cij tsuas yog hla cov kauj ruam no thiab ua raws cov txheej txheem los ntawm cov kauj ruam saum toj no.

Kauj ruam 4: Upload Code

Upload ib Code
Upload ib Code
Upload ib Code
Upload ib Code
Upload ib Code
Upload ib Code

Thaum txhua yam tau muab muag ntawm PCB peb tuaj yeem tso qhov program mus rau Attiny. Txhawm rau ua li ntawd peb yuav tsum txuas USBasp programmer (lossis lwm yam uas ua haujlwm nrog Arduino IDE) rau lub microcontroller. Cov lej tuaj yeem pom ntawm kuv Github. Txhawm rau upload nws koj yuav tsum ntxiv Attiny cov laug cam rau koj Arduino IDE, koj tuaj yeem pom ntau yam kev qhia hauv online txog qhov ntawd, yog li kuv yuav tsis piav qhia nws nyob ntawd. Tau kawg, koj tuaj yeem hloov qhov tseem ceeb hauv txoj cai lossis txawm tias nws ua haujlwm kom haum rau koj cov kev xav tau.

Kauj Ruam 5: Kuaj thiab Kho

Kuaj thiab Kho
Kuaj thiab Kho
Kuaj thiab Kho
Kuaj thiab Kho
Kuaj thiab Kho
Kuaj thiab Kho

Thaum koj qhov program tau npaj tiav koj tuaj yeem ntsaws rau hauv HC-SR04 module (saib cov duab saum toj no los ntsaws nws kom raug, txwv tsis pub koj tuaj yeem ua rau lub rooj tsavxwm puas tsuaj).

Koj tuaj yeem siv nws nrog qhov ntsuas hluav taws xob ntawm 4V thiab 5V. LED ntawm lub rooj tsavxwm yuav ci thaum qhov kev nrug deb me dua qhov uas koj tau teeb tsa nrog lub hwj chim. Txhawm rau hloov qhov nrug koj tuaj yeem siv tus ntsia hlau. Thaum txhua yam ua haujlwm tau zoo koj tuaj yeem txav mus rau kauj ruam tom ntej. Yog tias nws tsis yog, txheeb xyuas koj cov laug thiab xyuas kom tseeb tias koj lub Circuit Court thiab kuv cov phiaj xwm sib tw.

Kauj Ruam 6: Cov Ntawv Thov Tau

Cov Ntawv Thov Tau
Cov Ntawv Thov Tau
Cov Ntawv Thov Tau
Cov Ntawv Thov Tau
Cov Ntawv Thov Tau
Cov Ntawv Thov Tau

Nrog koj zoo siab uas koj tau ua nws mus rau theem kawg! Txhawm rau siv tus qauv no nrog Arduino koj yuav tsum txuas VCC ntawm tus qauv rau Arduino's 5V, GND ntawm tus qauv rau Arduino's GND thiab tawm tus pin ntawm tus qauv rau ib qho ntawm Arduino pins.

Koj tuaj yeem siv nws li cas? Zoo, qhov muaj peev xwm tsis muaj qhov kawg. Koj tuaj yeem siv nws rau koj txoj haujlwm neeg hlau, raws li kuv yuav ua rau kuv txoj haujlwm tom ntej, xav paub ntau ntxiv txog qhov sai sai no:) Koj tuaj yeem hloov kho cov cai, txuas ib lub servo rau nws thiab tswj cov servo ncaj qha los ntawm pawg thawj coj no. Koj tuaj yeem hloov kho nws thiab siv nws yam tsis muaj ib qho ntxiv, sab nraud microcontroller. Nws yog lub rooj tsav xwm me me uas muaj peev xwm ntau thiab nws yuav ua rau kuv txoj haujlwm tom ntej yooj yim dua.

Kuv vam tias koj nyiam nyeem qhov kev qhia no:) Tsis txhob hnov qab mus saib kuv cov vis dis aus txog qhov haujlwm no thiab sau npe yuav rau kuv channel! Tsaug rau kev nyeem ntawv, zoo siab ua!

Pom zoo: