Cov txheej txheem:

Arduino Pib Nrog Hardware thiab Software & Arduino Tutorials: 11 Kauj Ruam
Arduino Pib Nrog Hardware thiab Software & Arduino Tutorials: 11 Kauj Ruam

Video: Arduino Pib Nrog Hardware thiab Software & Arduino Tutorials: 11 Kauj Ruam

Video: Arduino Pib Nrog Hardware thiab Software & Arduino Tutorials: 11 Kauj Ruam
Video: tinyML Summit 2021: Edge ML hardware for every application 2024, Hlis ntuj nqeg
Anonim
Arduino Pib Nrog Hardware thiab Software & Arduino Tutorials
Arduino Pib Nrog Hardware thiab Software & Arduino Tutorials

Tam sim no, Cov Tsim, Cov Tsim Kho xav tau Arduino rau kev txhim kho sai ntawm cov qauv ntawm cov phiaj xwm.

Arduino yog lub platform siv hluav taws xob qhib raws qhov yooj yim-rau-siv-kho vajtse thiab software. Arduino muaj zej zog neeg siv zoo heev. Arduino pawg thawj coj tsim siv ntau yam tswj hwm uas suav nrog (Tsev Neeg AVR, nRF5x Tsev Neeg thiab tsawg dua STM32 cov tswj hwm thiab ESP8266/ESP32). Pawg thawj coj muaj ntau yam Analog thiab Digital Input/Output pins. Pawg thawj coj muaj USB rau Serial Converter ib yam uas pab ua haujlwm rau tus tswj.

Hauv kab ntawv no peb yuav pom Yuav siv Arduino IDE thiab Arduino boards li cas. Arduino yog ib qho yooj yim siv thiab qhov kev xaiv zoo heev rau kev tsim cov phiaj xwm phiaj xwm. Koj yuav tau txais ntau lub tsev qiv ntawv thiab tus lej kho vajtse tsim rau arduino board uas tau txais tus pin haum rau tus pin rau lub rooj tsav xwm module thiab Arduino board.

Yog tias koj siv Arduino pawg thawj coj ces koj yuav tsis xav tau ib tus programmer lossis lwm yam cuab yeej rau program rau Arduino boards. Vim tias cov ntawv no twb tau teeb tsa nrog cov ntawv bootloader thiab npaj kom nyem dhau usb mus rau ntu txuas.

Kauj Ruam 1: Cov Ntsiab Lus Yuav Tau Txais

Cov ntsiab lus hauv qab no tau hais hauv qhov kev qhia txuas hauv Kauj Ruam #4.

1. Schematic Piav 2. Bootloader Piav 3. Yuav Siv Web Editor 4. Yuav Siv Arduino IDE 5. Piv txwv li ntawm LED Blink 6. Piv txwv ntawm Serial Interface 7. Piv txwv ntawm Hloov interface siv txoj kev pov npav 8. Piv txwv ntawm Hloov interface siv cuam tshuam txoj kev 9. Piv txwv ntawm ADC.

Kauj ruam 2: Dab tsi yog Bootloader?

Hauv Cov Lus Yooj Yim, Bootloader yog ib qho ntawm cov cai uas lees txais cov cai thiab sau nws rau peb tus kheej nyem.

Bootloader yog ib qho ntawm cov cai uas ua thawj zaug thaum twg koj tswj tau txais lub zog ON lossis rov pib dua ces pib daim ntawv thov.

Thaum bootloader tau ua tiav, nws yuav tshuaj xyuas qhov hais kom ua lossis Cov Ntaub Ntawv ntawm Kev Sib Txuas zoo li UART, SPI, CAN lossis USB. Bootloader tuaj yeem ua tiav ntawm UART, SPI, CAN lossis USB.

Thaum bootloader, peb tsis tas yuav siv tus programmer txhua lub sijhawm. Tab sis yog tias tsis muaj bootloader ntawm tus tswj hwm hauv qhov xwm txheej ntawd peb yuav tsum siv programmer/Flasher.

Thiab peb yuav tsum siv programmer/Flasherto flash bootloader. Thaum bootloader tau flashed ces tsis xav tau programmer/Flasher.

Ardiuno los nrog bootloader flashed ntawm lub nkoj

Kauj Ruam 3: LED, Qhov Tseem Ceeb thiab ADC cuam tshuam

LED, Qhov tseem ceeb thiab ADC cuam tshuam
LED, Qhov tseem ceeb thiab ADC cuam tshuam
LED, Qhov tseem ceeb thiab ADC cuam tshuam
LED, Qhov tseem ceeb thiab ADC cuam tshuam

Hom kev cuam tshuam hauv qab no tau hais hauv qhov kev qhia no.

1. Coj interface

2. Ntsiab Interface

3. lauj kaub interface

1. Coj Interface:

Led txuas nrog PC13 tus pin ntawm Arduino. Muaj feem ntawm arduino muaj ib tus neeg siv coj coj tuaj rau ntawm Pawg Thawj Coj. Yog li, Tus tsim tawm tsuas yog siv qhov piv txwv ntsais ntawm lub tsev qiv ntawv piv txwv.

2. Hloov interface:

Kev hloov pauv tuaj yeem nyeem tau ob txoj hauv kev, ib qho yog txoj kev xaiv tsa thiab lwm qhov yog cuam tshuam. Hauv txoj kev pov npav, yuav hloov mus nyeem tsis tu ncua thiab tuaj yeem ua tau.

Thiab hauv Kev cuam tshuam txoj hauv kev, Kev nqis tes ua tuaj yeem ua tau thaum nias tus yuam sij.

3. lauj kaub Interface:

Analog POT txuas nrog Analog Pin ntawm Arduino.

Kauj Ruam 4: Cov Cheeb Tsam Xav Tau

Arduino UNOArduino Uno hauv Is Nrias teb-

Arduino Uno hauv UK -

Arduino Uno hauv Asmeskas -

Arduino Nano Cov

Arduino Nano hauv Is Nrias teb-

Arduino Nano hauv UK -

Arduino Nano hauv Asmeskas -

HC-SR04HC-SR04 hauv UK-https://amzn.to/2JusLCu

HC -SR04 hauv Asmeskas -

TIAB SA 90614

MLX90614 hauv Is Nrias teb-

MLX90614 hauv UK -

MLX90614 hauv Asmeskas -

BreadBoardBreadBoard hauv Is Nrias teb-

BreadBoard hauv Asmeskas-

BreadBoard hauv UK-

16X2 LCD16X2 LCD hauv Is Nrias teb-

16X2 LCD hauv UK -

16X2 LCD hauv Asmeskas -

Kauj ruam 5: Qhia

Image
Image

Kauj ruam 6: LCD Interface

LCD Interface
LCD Interface

16x2 LCD yog 16 tus cim thiab 2 kab lcd uas muaj 16 tus pin txuas. Lub LCD no xav tau cov ntaub ntawv lossis ntawv hauv ASCII hom los tso saib.

Thawj kab Pib nrog 0x80 thiab kab thib ob pib nrog 0xC0 chaw nyob.

LCD tuaj yeem ua haujlwm hauv 4-ntsis lossis 8-ntsis. Hauv 4 hom me me, Cov Ntaub Ntawv/Cov Lus Hais tau xa hauv Nibble Format First Nibble Siab dua thiab tom qab ntawd Nibble qis dua.

Piv txwv li, xa 0x45 Thawj 4 yuav raug xa Tom qab ntawd 5 yuav xa mus.

Thov xa mus rau schematic.

Muaj 3 tus tswj hwm tus pin uas yog RS, RW, E. Yuav siv RS li cas: Thaum hais kom xa mus, tom qab ntawd RS = 0 Thaum Cov Ntaub Ntawv raug xa mus, ces RS = 1 Yuav siv RW li cas:

RW tus pin yog Nyeem/Sau. qhov twg, RW = 0 txhais tau tias Sau Cov Ntaub Ntawv ntawm LCD RW = 1 txhais tau tias Nyeem Cov Ntaub Ntawv los ntawm LCD

Thaum peb sau rau LCD cov lus txib/Cov Ntaub Ntawv, peb tau teeb tus pin li LOW. Thaum peb nyeem los ntawm LCD, peb teeb tus pin li HIGH. Hauv peb qhov xwm txheej, peb tau siv nws nyuaj rau qib LOW, vim tias peb yuav sau mus rau LCD ib txwm. Yuav siv E (Pab Tau Li Cas): Thaum peb xa cov ntaub ntawv mus rau LCD, peb muab cov mem tes rau lcd nrog kev pab ntawm E tus pin.

Qhov no yog qib siab peb yuav tsum ua raws thaum xa COMMAND/DATA mus rau LCD. Higher Nibble Enable Pulse, Tus nqi RS kom raug, Raws li COMMAND/DATA

Txo Nibble Enable Pulse, Tsim nyog tus nqi RS, Raws li COMMAND/DATA

Kauj Ruam 7: Qhia

Image
Image

Kauj Ruam 8: Ultrasonic Sensor Interface

Ultrasonic Sensor Interface
Ultrasonic Sensor Interface

Hauv ultrasonic module HCSR04, peb yuav tsum muab lub plawv dhia rau ntawm tus pin, yog li nws yuav tsim hluav taws xob ntawm zaus 40 kHz. Tom qab tsim hluav taws xob piv txwv li 8 mem tes ntawm 40 kHz, nws ua rau tus ncha pin siab. Echo tus pin tseem nyob siab kom txog thaum nws tsis tau txais lub suab ncha rov qab.

Yog li qhov dav ntawm tus ncho tus pin yuav yog lub sijhawm rau lub suab mus rau qhov khoom thiab rov qab los. Thaum peb tau txais lub sijhawm peb tuaj yeem suav nrug, raws li peb paub lub suab nrawm. HC -SR04 tuaj yeem ntsuas txog li ntawm 2 cm - 400 cm.

Ultrasonic Module yuav tsim cov nthwv dej ultrasonic uas siab dua tib neeg-kuaj pom ntau zaus, feem ntau tshaj 20, 000 Hz. Hauv peb qhov xwm txheej peb yuav kis tus zaus ntawm 40Khz.

Kauj Ruam 9: MLX90614 Kub Sensor Interface

MLX90614 Kub Sensor Interface
MLX90614 Kub Sensor Interface
MLX90614 Kub Sensor Interface
MLX90614 Kub Sensor Interface

MLX90614 yog i2c raws li qhov ntsuas kub IR ua haujlwm ntawm kev ntsuas hluav taws xob cua sov.

Sab hauv, MLX90614 yog kev sib txuas ntawm ob lub cuab yeej: lub ntsuas hluav taws xob infrared ntsuas hluav taws xob thiab lub teeb pom kev zoo daim ntawv thov txheej txheem. Raws li txoj cai Stefan-Boltzman, ib yam khoom uas tsis qis dua qhov tsis muaj pes tsawg (0 ° K) tso tawm (tsis yog tib neeg-qhov muag-pom) lub teeb nyob rau hauv cov duab hluav taws xob uas yog ncaj qha piv rau nws qhov kub. Qhov tshwj xeeb infrared thermopile sab hauv MLX90614 nkag siab ntau npaum li cas lub zog hluav taws xob infrared tau tawm los ntawm cov khoom siv hauv nws qhov kev pom, thiab tsim hluav taws xob teeb liab sib piv rau qhov ntawd. Qhov hluav taws xob uas tsim los ntawm cov thermopile tau khaws los ntawm daim ntawv thov txheej txheem 17-ntsis ADC, tom qab ntawv ua ntej dhau mus rau lub microcontroller.

Kauj ruam 10: Qhia

Pom zoo: