Cov txheej txheem:

Arduino HC-SR04 + LED: 5 Kauj Ruam (nrog Duab)
Arduino HC-SR04 + LED: 5 Kauj Ruam (nrog Duab)

Video: Arduino HC-SR04 + LED: 5 Kauj Ruam (nrog Duab)

Video: Arduino HC-SR04 + LED: 5 Kauj Ruam (nrog Duab)
Video: arduino ultrasonic sensor projects | led project 2024, Kaum ib hlis
Anonim
Arduino HC-SR04 + LED
Arduino HC-SR04 + LED

Hauv qhov kev qhia no, kuv yuav qhia koj yuav ua li cas koj tuaj yeem tsim lub suab-pom LED siv lub ntsuas hluav taws xob ultrasonic (HC-SR04). Cov ntu rau qhov kev tsim no yog muab los ntawm KumanTech, koj tuaj yeem pom lawv hauv lawv Arduino UNO Kit.

Kauj Ruam 1: Qhov Yuav Tsum Tau

Qhov Yuav Tsum Tau
Qhov Yuav Tsum Tau

1 x Arduino board (Kuv siv Arduino Uno)

1 x LED (Cov xim tsis muaj teeb meem)

1 x 220 ohm resistor

1 x Breadboard

1 x Arduino USB Cable

1 x 9V roj teeb nrog clip (yeem)

6 x Jumper xov hlau

Allchips yog cov khoom siv hluav taws xob hauv online pabcuam platform, koj tuaj yeem yuav txhua yam khoom siv los ntawm lawv

Kauj Ruam 2: Muab Qhov Chaw

Muab Qhov Chaw
Muab Qhov Chaw

Ua ntej tshaj, ntsaws rau hauv lub ntsuas hluav taws xob ultrasonic thiab LED ntawm lub khob cij. Txuas lub LED cov hlau lead luv (cathode) mus rau GND tus pin ntawm lub sensor. Tom qab ntawd, tso tus tiv thaiv kab ib yam ib yam li LED ntev ua cov hmoov txhuas (anode) yog li lawv tau txuas nrog.

Kauj Ruam 3: Txuas Qhov Chaw

Txuas Qhov Chaw
Txuas Qhov Chaw
Txuas Qhov Chaw
Txuas Qhov Chaw

Tam sim no, koj yuav tsum tau ntsaws qee cov xov hlau nyob tom qab ntawm lub sensor. Muaj plaub tus pin - VCC, TRIG, ECHO thiab GND. Tom qab tso cov xov hlau, koj yuav tsum ua cov kev txuas hauv qab no:

Tus tiv thaiv qhov kawg rau tus lej digital ntawm koj xaiv, tsuas yog nco ntsoov hloov nws tom qab hauv cov cai!

Sensor | Cov Arduino

VCC -> 5V

TSI -> 5*

ECHO -> 4*

GND -> GND

* - Muaj peev xwm txuas nrog rau ob tus lej digital ntawm Arduino, tsuas yog xyuas kom koj hloov lawv hauv cov lej tom qab!

Kauj Ruam 4: Xa Cov Cai

Xa cov Code
Xa cov Code

Tam sim no, koj tuaj yeem ntsaws koj Arduino rau koj lub computer siv USB cable. Qhib Arduino software thiab xa cov cai uas koj tuaj yeem pom ntawm no. Cov xwm txheej tau tawm tswv yim, yog li koj paub tseeb tias lawv ua dab tsi thiab tej zaum hloov pauv lawv.

Pom zoo: