Cov txheej txheem:

Wireless Distance Sensor DIY: 7 Kauj Ruam
Wireless Distance Sensor DIY: 7 Kauj Ruam

Video: Wireless Distance Sensor DIY: 7 Kauj Ruam

Video: Wireless Distance Sensor DIY: 7 Kauj Ruam
Video: 4 Simple Inventions With 7 Segment Display #sr_electric 2024, Hlis ntuj nqeg
Anonim
Wireless nrug Sensor DIY
Wireless nrug Sensor DIY

Lub peev xwm los ntsuas qhov nrug deb ntawm lub ntsuas hluav taws xob ultrasonic hauv tus nqi ntawm ob peb duas las yog qhov zoo heev, ua siab ncaj, thiab ntxiv qhov ua haujlwm tsis siv neeg yog txawm tias txaus siab, koj tuaj yeem siv nws ua lub chaw nres tsheb sensor hauv lub tsheb qub uas qhov deb yuav yuav tsum tso tawm ntawm koj lub xov tooj tsis yog siv sab nrauv.

Yog li cia peb pib nrog kev tsim! Nov yog cov vis dis aus qhia rau tib yam uas tseem suav nrog nws ua haujlwm hauv lub sijhawm tiag.

Kauj Ruam 1: Yam Yuav Tsum Tau

Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau

1.) HC-SR04 (Qhov no yog ultra-cheap Ultrasonic Distance Sensor)

2.) HC-06 (Bluetooth Module)

3.) Arduino (Kuv siv Nano)

4.) USB (Rau Arduino)

5.) Cov Hluav Taws Xob

Kauj Ruam 2: Txuas HC-SR04 rau Arduino raws li hauv qab no:

Txuas HC-SR04 rau Arduino raws li hauv qab no
Txuas HC-SR04 rau Arduino raws li hauv qab no
Txuas HC-SR04 rau Arduino raws li hauv qab no
Txuas HC-SR04 rau Arduino raws li hauv qab no

Tswv yim - 5V

Trig - Pin 13

ECO - Pin 12

Gnd - Yog

Kauj Ruam 3: Txuas Bluetooth Module HC-06 rau Arduino Nano raws li hauv qab no:

Txuas Bluetooth Module HC-06 rau Arduino Nano raws li hauv qab no
Txuas Bluetooth Module HC-06 rau Arduino Nano raws li hauv qab no
Txuas Bluetooth Module HC-06 rau Arduino Nano raws li hauv qab no
Txuas Bluetooth Module HC-06 rau Arduino Nano raws li hauv qab no

Tswv yim - 3.3V

Gnd - Yog

Txx - Rx

Rx - Txi

Kauj Ruam 4: Lub Tsev Qiv Ntawv

Lub Tsev Qiv Ntawv
Lub Tsev Qiv Ntawv

Txog lub tsev qiv ntawv, koj yuav tsum rub lub HC-SR04 Library rau qhov no, sab hauv Arduino IDE, mus rau Cov Cuab Yeej-> Tswj Cov Tsev Qiv Ntawv thiab tom qab ntawd tshawb nrhiav HC-SR04 thiab teeb tsa los ntawm Martin Sosic.

Kauj ruam 5: Upload Code

Upload cov Code !!
Upload cov Code !!
Upload cov Code !!
Upload cov Code !!

Txog qhov no kom ntseeg tau tias Tx thiab Rx pins ntawm Bluetooth Module thiab Arduino raug txiav tawm ua ntej rub tawm cov cai, tom qab ua tiav xa koj tuaj yeem txuas tau dua.

Txog tus lej, mus rau File-> Piv txwv-> Cuab Yeej-> HC-SR04-> Yooj Yim, Hloov nws mus rau Arduino. Yog tias koj qhib qhov ntsuas ntawm 9600 Baud tus nqi tom qab xa cov cai, koj yuav pom qhov kev ntsuas nrug los ntawm lub ntsuas hluav taws xob ultrasonic. Tam sim no nws yog lub sijhawm ntxiv Bluetooth module

Kauj Ruam 6: Lub Serial Monitor App

Lub Serial Monitor App
Lub Serial Monitor App

Nov yog daim ntawv thov siv dav hauv Android uas ua raws li kev saib xyuas ntawm Bluetooth, koj tuaj yeem pom cov apps zoo sib xws ntawm IOS.

Tsuas yog mus rau khawm txuas thiab nyem HC-06 kom tau txais kev sib txuas.

Kauj ruam 7: Ua tiav

Ua tiav!
Ua tiav!

Tom qab Pairing thiab txuas Bluetooth Module rau lub app, koj yuav yooj yim tuaj yeem nyeem cov ntaub ntawv uas ntsuas qhov nrug nruab nrab ntawm qhov khoom thiab ntsuas hauv hli, nws pom zoo tias koj tsis ntsuas qhov nrug tsawg dua 3 centimeters thiab ntau dua 3 meters.

Ua Tsaug Ntau Rau Kev Nyeem!

Hais txog, Tanishq

Pom zoo: