Cov txheej txheem:

Ua Kev Sib Tham LED System rau Stairs: 7 Cov Kauj Ruam
Ua Kev Sib Tham LED System rau Stairs: 7 Cov Kauj Ruam

Video: Ua Kev Sib Tham LED System rau Stairs: 7 Cov Kauj Ruam

Video: Ua Kev Sib Tham LED System rau Stairs: 7 Cov Kauj Ruam
Video: MJC Engineering Kata. Забавы инженеров - помогаем продать кроссовки. 2024, Kaum ib hlis
Anonim
Image
Image
Ua ib qho kev sib tham sib LED System rau Stairs
Ua ib qho kev sib tham sib LED System rau Stairs

Muaj tus ntaiv hauv tsev. Nws yog qhov nthuav heev kom pom ntau cov phiaj xwm txhim kho ntaiv hauv zej zog. Tsis yog tibneeg hu tauj coob tsis ntev los no, yog li kuv txiav txim siab siv qee qhov qhib qhov khoom siv kho vajtse los hloov pauv tus ntaiv hauv tsev thiab ntxiv qee qhov kev sib tham. Txoj haujlwm no yuav tsis nyuaj tshwj xeeb, nws siv sijhawm txog tav su. Yog tias koj tseem muaj tus ntaiv hauv koj lub tsev uas xav tau kho dua tshiab, Kuv vam tias qhov kev sib qhia no yuav pab koj.

Kauj Ruam 1: Npaj Ua Haujlwm

Npaj Ua Haujlwm
Npaj Ua Haujlwm

Ua ntej, koj yuav tsum npaj qee cov ntaub ntawv, uas suav nrog cov hauv qab no:

Module hauv:

• Lub Rooj Tswjhwm Saib Longan Core, lossis lwm lub Rooj Tswjhwm Saib Xyuas Kev Txhim Kho Arduino

• Ultrasonic sensor txhawm rau txheeb xyuas seb puas muaj ib tus neeg tau hla tus ntaiv

• LED sawb

• MOS hloov rau kev tswj LED teeb sawb

Khoom siv:

• Hlau

• DuPont Hlau

• Header

Tuam:

• Cov hlau yaj

• Cov hlua hlau

• txiab

• Rab yaj phom

Kauj Ruam 2: Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Tus Kheej

Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Cov Kauj Ruam
Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Cov Kauj Ruam
Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Cov Kauj Ruam
Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Cov Kauj Ruam
Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Tus Kheej
Txuas lub LED Bar mus rau MOS Hloov thiab Khaws Nws Hauv Qab Tus Kheej

Kev siv MOS hloov yog txhawm rau ua kom muaj zog tam sim no. Raws li Led bar xav tau txog 500mA, IO chaw nres nkoj ntawm Arduino tsis muaj txoj hauv kev ncaj qha tsav lub teeb ci LED, thiab IO tsav lub peev xwm ntawm Arduino tuaj yeem siv los ntawm MOS hloov.

MOS hloov pauv muaj 3 qhov cuam tshuam, V + thiab V- txuas nrog tus ncej zoo thiab tsis zoo ntawm LED bar, VIN thiab GND txuas nrog rau tus ncej zoo thiab tsis zoo ntawm lub hwj chim. Kuj tseem muaj 3PIN tswj tus pin. SIG txuas nrog IO ntawm Arduino, VCC txuas nrog 5V, thiab GND txuas nrog rau tus ncej tsis zoo ntawm lub hwj chim. Txij li Arduino thiab LED siv tib 5V lub zog xa khoom, peb txuas VIN ntawm MOS hloov pauv hloov mus rau VCC los ntawm xaim, yog li tsis tas yuav txuas lub hwj chim muab ob zaug.

Ua ntej, Txuas tus ncej zoo thiab tsis zoo ntawm LED bar rau V + thiab V-

Tom qab ntawd, muaj 3M daim kab xev nyob tom qab ntawm LED bar, uas tuaj yeem ncaj ncaj rau hauv qab cov ntaiv. MOS hloov kuj tseem tuaj yeem kho tau hauv qab tus ntaiv los ntawm rab phom.

Kauj Ruam 3: Txuas Lub Hwj Huam ntawm Txhua Qhov MOS Hloov Ua Ke thiab kho rau ntawm Stairs

Txuas Lub Hwj Huam ntawm Txhua Qhov MOS Hloov Ua Ke thiab Kho Rau Cov Kauj Ruam
Txuas Lub Hwj Huam ntawm Txhua Qhov MOS Hloov Ua Ke thiab Kho Rau Cov Kauj Ruam
Txuas Lub Hwj Huam ntawm Txhua Qhov MOS Hloov Ua Ke thiab Kho Rau Cov Kauj Ruam
Txuas Lub Hwj Huam ntawm Txhua Qhov MOS Hloov Ua Ke thiab Kho Rau Cov Kauj Ruam

Hauv theem no, koj yuav tsum txuas cov khoom siv hluav taws xob ntawm txhua qhov hloov pauv MOS ua ke, thiab ntawm no koj xav tau qee cov xov hlau. Daim duab qhia chaw ntawm kev txuas yog raws li qhia hauv duab 1.

Qhov no feem ntau yog txoj haujlwm nkees, tom qab ua tiav, raws li qhia hauv daim duab 2.

Kauj Ruam 4: Txhim Kho Ultrasonic Sensor thiab Arduino

Txhim kho Ultrasonic Sensor thiab Arduino
Txhim kho Ultrasonic Sensor thiab Arduino
Txhim kho Ultrasonic Sensor thiab Arduino
Txhim kho Ultrasonic Sensor thiab Arduino
Txhim kho Ultrasonic Sensor thiab Arduino
Txhim kho Ultrasonic Sensor thiab Arduino

Hauv theem no, koj yuav tsum kho lub ntsuas hluav taws xob ultrasonic mus rau qhov nkag ntawm tus ntaiv kom thaum koj taug kev nce ntaiv, ulstrsonic tuaj yeem nkag siab nws.

Lub ntsuas hluav taws xob ultrasonic tuaj yeem kho tau los ntawm cov kua nplaum, raws li qhia hauv daim duab 1.

Lub sijhawm no, kho Arduino rau sab nraum qab ntawm tus ntaiv.

Ultrasound muaj 4 tus pin uas xav tau txuas nrog Arduino.

1. VCC txuas rau 5V

2. GND to GND

3. Trig, qhov no yog xa tus pin ntawm ultrasonic sensor, txuas nrog D2 ntawm Arduino

4. Echo, qhov no yog tus lej txais ntawm ultrasonic sensor, txuas nrog D3 ntawm Arduino

Kauj Ruam 5: Txuas Lub Teeb MOS Hloov mus rau Arduino IO

Txuas lub Teeb MOS Hloov mus rau Arduino IO
Txuas lub Teeb MOS Hloov mus rau Arduino IO
Txuas lub Teeb MOS Hloov mus rau Arduino IO
Txuas lub Teeb MOS Hloov mus rau Arduino IO

Tag nrho ntawm 9 MOS hloov pauv tau siv hauv txoj haujlwm no. Peb txuas SIG ntawm 9 qhov hloov pauv mus rau D4 ~ D12 ntawm Ardino. Daim duab qhia chaw yog nyob hauv pic1.

Qhov no kuj yog txoj haujlwm tsis txaus ntseeg, uas yuav tsum tau muab tshuaj txhuam thiab kho cov xov hlau ntau thiab yuav tsum tau ua siab ntev me ntsis. Kev ua tiav yog raws li qhia hauv pic2:

Kauj Ruam 6: Fais fab thiab ntsuas

Hwj chim thiab Test
Hwj chim thiab Test

Txuas ob lub xov hluav taws xob txuas nrog MOS hloov pauv hauv STEP3 rau 5V thiab GND ntawm Arduino.

Txog tam sim no txoj haujlwm nyuaj tshaj plaws tau ua tiav. Peb yuav tsum tau txheeb xyuas seb puas muaj teeb meem nrog cov xov hlau. Qhib Arduino IDE thiab sau D4-D12 tus pin rau qib siab kom pom tias txhua lub LED ua haujlwm tau zoo. Yog tias qee qhov ntawm lawv tsis ua haujlwm, peb yuav tsum txheeb xyuas qhov thaiv.

Yog tias cov xov hlau txuas tau zoo, peb tuaj yeem pib ua cov software txaus nyiam ua haujlwm tam sim no.

Kauj Ruam 7: Programming Nrog Arduino IDE

Ntawm no peb siv Arduino IDE nto moo rau kev ua haujlwm.

Lub ntsuas hluav taws xob ultrasonic xav tau lub tsev qiv ntawv los tsav, nyem rau rub tawm.

Hauv txoj haujlwm no, kuv tsuas sau ib qho piv txwv. Thaum pom ib tus neeg, lub teeb yuav maj mam ci.

Tau kawg, koj tuaj yeem ntxiv qee qhov kev sib tham zoo raws li koj nyiam.

Pom zoo: