Cov txheej txheem:

Tsim Koj Tus Kheej Arduino: 6 Kauj Ruam (nrog Duab)
Tsim Koj Tus Kheej Arduino: 6 Kauj Ruam (nrog Duab)

Video: Tsim Koj Tus Kheej Arduino: 6 Kauj Ruam (nrog Duab)

Video: Tsim Koj Tus Kheej Arduino: 6 Kauj Ruam (nrog Duab)
Video: Computer Vision with Python! Resizing Images 2024, Hlis ntuj nqeg
Anonim
Tsim Koj Tus Kheej Arduino
Tsim Koj Tus Kheej Arduino

Teeb tsa Arduino ntawm lub khob cij tau dhau los ua txheej txheem uas kuv tau loj hlob los hlub.

Tsis pub dhau ob peb feeb koj tuaj yeem ua tiav Arduino platform ua haujlwm nrog raws li koj yuav pom hauv qhov kev qhia no. Muaj ntau zaus thaum kuv nyob hauv tsev kawm ntawv thiab muab tso ua ke ib qho ntawm qhov no los ntsuas qee lub tswv yim rau txoj haujlwm. Ntxiv rau nws tsuas yog zoo li zoo nkauj nrog txhua cov khoom tso tawm hla lub khob cij.

Arduino yog lub hauv paus qhib hluav taws xob tsim qauv ua qauv raws kev hloov pauv tau, siv tau yooj yim kho vajtse thiab software. Nws tau npaj rau cov kws ua yeeb yam, cov tsim qauv, cov nyiam ua haujlwm, thiab txhua tus neeg nyiam tsim cov khoom sib tham lossis ib puag ncig.

Arduino tuaj yeem nkag siab ib puag ncig los ntawm kev tau txais cov tswv yim los ntawm ntau yam kev ntsuas thiab tuaj yeem cuam tshuam nws ib puag ncig los ntawm kev tswj teeb, lub cav, thiab lwm yam ua haujlwm. Tus tswj hwm microcontroller ntawm lub rooj tsav xwm tau teeb tsa siv Arduino cov lus programming (raws li Kev Txuas) thiab Arduino kev txhim kho ib puag ncig (raws li Kev Ua Haujlwm). Arduino cov haujlwm tuaj yeem sawv ib leeg lossis lawv tuaj yeem sib tham nrog software ntawm kev khiav ntawm lub khoos phis tawj (piv txwv li Flash, Ua, MaxMSP). [1] www.arduino.cc

Kauj Ruam 1: Cheeb Tsam

Cheebtsam
Cheebtsam
Cheebtsam
Cheebtsam

Nrog rau ob peb qhov tsis kim thiab lub khob cij tsis muaj kuab paug koj tuaj yeem tsim sai thiab yooj yim tsim koj tus kheej Arduino. Lub tswv yim no ua haujlwm zoo thaum koj xav ua tus qauv tsim lub tswv yim tshiab, lossis koj tsis xav kom sib cais koj tus qauv tsim txhua lub sijhawm koj xav tau koj Arduino. Qhov piv txwv hauv qab no qhia yuav ua li cas txhawm rau sib txuas cov khoom ntawm koj lub khob cij. Peb yuav mus rau qhov nthuav dav thoob plaws hauv txoj haujlwm no. Daim duab 1-1: Breadboard Arduino nrog USB lub peev xwm ua haujlwm tau zoo. Ua ntej peb pib, xyuas kom tseeb tias koj muaj txhua yam khoom tsim nyog hauv lub thawv npe khoom. Yog tias koj xav yuav cov khoom koj tuaj yeem ua tau los ntawm kuv tus xaib ntawm www. ArduinoFun.com lossis saib hauv qab no rau lwm lub khw muag khoom online* Saib ceeb toom txog TTL-232R cable hauv kev xaiv ua ntej yuav khoom. 10% OFF Tag nrho Kev Txiav Txim ntawm ArduinoFun.com, siv Daim Coupon Code: INSTRUCTABLES thaum kos tawm. Koj tuaj yeem yuav cov khoom ntawm www. ArduinoFun.com lossis www. SparkFun.com lossis www. CuriousInventor.com lossis www. FunGizmos.com lossis www. Adafruit.com tsuas yog rau npe qee qhov chaw tawm ntawm tes. Origninal tutorial los ntawm:

Kauj Ruam 2: Teeb Lub Hwj Huam

Teem Sij Hawm
Teem Sij Hawm
Teem Sij Hawm
Teem Sij Hawm
Teem Sij Hawm
Teem Sij Hawm

Thawj qhov koj yuav tsum tau ua yog teeb tsa lub zog. Nrog koj daim ntawv qhia zaub mov thiab cov khoom ua ntej koj … cia peb pib! Nrog cov kauj ruam no, koj yuav teeb tsa lub khob cij Arduino nce mus tas li +5Volts lub zog siv 7805 tus tswj hluav taws xob. Daim duab 1-2: Teeb lub zog nrog LED qhia. Txhawm rau kom tus tswj hwm hluav taws xob ua haujlwm, koj yuav tsum tau muab ntau dua 5V lub zog. Lub roj teeb 9V raug nrog lub khawm txuas yuav ua haujlwm zoo rau qhov no. Lub zog yuav los rau hauv lub khob cij uas koj pom liab thiab dub + thiab - plaub fab. Tom qab ntawd ntxiv ib qho ntawm 10uF capacitors. Cov ceg ntev dua yog Anode (Zoo) thiab ceg luv dua yog Cathode (Tsis Zoo). Feem ntau cov capacitors tseem tau cim nrog kab txaij hauv qab qhov tsis zoo. Hla qhov chaw khoob ntawm lub khob cij (cov channel) koj yuav tsum tso ob txoj hlua sib txuas rau qhov zoo (liab) thiab hauv av (dub) kom dhia lub zog los ntawm ib sab ntawm lub khob cij mus rau lwm qhov. Tam sim no ntxiv 7805 qhov ntsuas hluav taws xob. 7805 muaj peb txhais ceg. Yog tias koj tab tom saib nws ntawm sab xub ntiag, sab laug yog rau qhov hluav taws xob hauv (Vin) nruab nrab txhais ceg yog rau hauv av (GND) thiab thib peb txhais ceg yog rau qhov hluav taws xob tawm (Vout). Nco ntsoov tias sab laug sab tau teeb nrog koj lub zog zoo hauv, thiab tus pin thib ob rau hauv av. Tawm los ntawm tus tswj hwm qhov hluav taws xob thiab mus rau txoj kev tsheb nqaj hlau ntawm ib sab ntawm lub khob cij koj yuav tsum ntxiv GND xaim rau hauv av tsheb nqaj hlau thiab tom qab ntawd Vout xaim (3rd ua ceg ntawm tus tswj hluav taws xob) mus rau txoj kev tsheb nqaj hlau zoo. Ntxiv qhov thib ob 10uF capacitor rau lub tsheb ciav hlau. Them nyiaj mloog mus rau sab Zoo thiab Tsis zoo. Nws yog lub tswv yim zoo kom suav nrog qhov qhia txog xwm txheej LED uas tuaj yeem siv rau kev daws teeb meem. Txhawm rau ua qhov no koj yuav tsum txuas txoj kab hluav taws xob sab xis nrog txoj kab hluav taws xob sab laug. Ntxiv qhov zoo rau qhov zoo thiab tsis zoo rau cov xov tooj tsis zoo nyob hauv qab ntawm koj lub khob cij. Daim duab 1-3: Kev Txuas Hluav Taws Xob Sab laug thiab Txoj Cai. Muaj lub zog ntawm sab laug thiab sab xis txoj kev tsheb nqaj hlau tseem yuav pab ua kom koj lub rooj noj mov sib koom ua ke thaum muab lub zog rau ntau yam khoom. Daim duab 1-4: Rau qhov ntsuas qhov xwm txheej LED, txuas 220 & tus tiv thaiv (xim zoo li: liab, liab, xim av) los ntawm lub zog mus rau anode ntawm LED (sab zoo, ntev dua ceg) thiab tom qab ntawd GND xaim mus rau sab cathode. Nrog koj zoo siab, tam sim no koj lub khob cij tau teeb tsa rau +5V lub zog. Koj tuaj yeem txav mus rau kauj ruam tom ntej hauv kev tsim hluav taws xob.

Kauj Ruam 3: Arduino Pin Mapping

Arduino Pin Kav
Arduino Pin Kav

Tam sim no peb xav npaj ATmega168 lossis 328 nti. Ua ntej peb pib, cia saib seb txhua tus pin ntawm lub nti ua dab tsi hauv kev sib raug zoo rau Arduino ua haujlwm. NCO TSEG: ATmega328 khiav zoo ib yam nrawm, nrog tib pinout, tab sis nta ntau dua ob zaug ntawm lub cim xeeb flash (30k vs 14k) thiab ob zaug EEPROM (1Kb vs 512b). Daim duab 1-5: Arduino Pin Mapping Lub ATmega168 nti yog tsim los ntawm Atmel. Yog tias koj saib cov ntawv teev npe koj yuav tsis pom tias cov lus hais saum toj no zoo ib yam. Qhov no yog vim tias Arduino muaj nws tus kheej lub luag haujlwm rau cov pins no, thiab kuv tau muab lawv tsuas yog ntawm qhov piv txwv no. Yog tias koj xav sib piv lossis xav paub qhov tseeb cov ntaub ntawv hais txog lub nti, koj tuaj yeem rub tawm ib daim ntawv theej ntawm www.atmel.com. Tam sim no koj paub tus txheej txheem ntawm tus pin, peb tuaj yeem pib nqes mus rau qhov seem ntawm cov khoom.

Kauj Ruam 4: Kev Koom Tes Sib Koom

Cheeb Tsam Nqe
Cheeb Tsam Nqe
Cheeb Tsam Nqe
Cheeb Tsam Nqe

Txhawm rau pib, peb yuav tsim cov phiaj xwm txhawb nqa rau ib sab ntawm lub nti thiab tom qab ntawd txav mus rau lwm sab. Pin ib ntawm cov chips feem ntau muaj tus cim cim cim. Saib ntawm ATmega168 lossis 328 koj yuav pom lub ntsej muag zoo li tus nyob rau sab saum toj nrog rau qhov me me. Qhov me me qhia tias qhov no yog tus pin 1. Daim duab 1-6: Txhawb nqa cov kab hluav taws xob txuas 15-28 Los ntawm GND lub tsheb npav fais fab, ntxiv lub jumper xaim rau tus pin 22. Tom ntej no, los ntawm lub npav zoo zog, ntxiv jumper xov hlau rau tus pin 20 (AVCC - Cov khoom siv hluav taws xob rau ADC hloov pauv. Xav tau txuas nrog lub zog yog tias ADC tsis tau siv thiab ua kom muaj zog ntawm lub lim qis dhau yog tias nws yog (lub lim qis dhau yog lub voj voog uas tshem tawm suab nrov los ntawm lub zog siv hluav taws xob., peb tsis siv ib qho) Tom qab ntawd ntxiv lub jumper hlau los ntawm lub npav zoo rau tus pin 21 (Tus lej sib piv rau ADC). Ntawm Arduino, tus pin 13 yog tus pin LED. Nco ntsoov tias ntawm tus lej tiag tus pin yog tus lej 19 Thaum rub koj cov duab kos thiab rau txhua qhov haujlwm koj tseem yuav siv qhov no ua tus Pin 13. Txhawm rau txuas tus LED, ntxiv 220 & resistor los ntawm GND mus rau cathode ntawm LED. Tom qab ntawd los ntawm anode ntawm LED ntxiv jumper hlau rau tus pin 19. Tam sim no peb tuaj yeem txav mus rau lwm sab ntawm lub nti. Koj yuav luag tiav! tus lej 1 tus cim, tso qhov hloov pauv me me. Qhov kev hloov no yog siv rau rov pib dua Arduino. Txoj cai ua ntej koj rub daim duab tshiab rau lub nti koj yuav xav nias qhov no ib zaug. Tam sim no ntxiv cov hlua jumper me me los ntawm tus pin 1 mus rau hauv qab ceg ntawm qhov hloov pauv tom qab ntawd ntxiv 10K tus tiv thaiv los ntawm lub zog rau tus pin 1 kab ntawm lub khob cij. Thaum kawg ntxiv GND jumper xaim rau sab saum toj ntawm tus tes hloov qhov. Ntxiv lub zog thiab GND dhia mus rau tus pin 7 (VCC) thiab tus pin 8 (GND). Ntxiv 16MHz moos siv lead ua rau tus pin 9 thiab 10 thiab tom qab ntawd ob lub.22pF capacitors los ntawm tus pin 9 thiab 10 rau GND. (Saib daim ntawv hauv qab no rau lwm txoj hauv kev). Koj daim ntawv qhia zaub mov yooj yim arduino tam sim no tiav. Koj tuaj yeem nres tam sim no yog tias koj xav tau thiab pauv ib qho txheej txheem uas twb muaj lawm los ntawm koj lub Rooj Tswjhwm Saib Arduino mus rau lub khob cij, tabsis txij li thaum koj los txog tam sim no, koj kuj tseem yuav ua tiav los ntawm kev ntxiv qee qhov kev ua haujlwm pins. Qhov no yuav tso cai rau koj los teeb tsa lub nti los ntawm lub khob cij. NCO TSEG: Tsis txhob siv lub moos 16MHz siv lead ua, koj tuaj yeem siv 16 MHz ceramic resonator nrog lub tshuab ua hluav taws xob built-in, peb lub davhlau ya nyob twg SIP pob. Koj yuav tau npaj koj daim ntawv qhia zaub mov sib txawv me ntsis, tus resonator muaj peb txhais ceg. Cov ceg nruab nrab yuav mus rau hauv av thiab lwm ob txhais ceg yuav mus rau tus pin 9 & 10 ntawm ATmega168 nti. Xa mus rau daim duab 1-7, nrhiav ib qho chaw uas koj muaj 6 kab nyob rau ntawm lub khob cij uas tsis muaj kev sib cuag nrog lwm yam. Muab ib kab ntawm rau tus txiv neej header pins ntawm no. Nrog lub khob cij ci rau koj, kev sib txuas yog raws li hauv qab no: GND, NC, 5V, TX, RX, NC, Kuv kuj tseem hu cov pins no 1, 2, 3, 4, 5, 6. Los ntawm koj lub tsheb npav fais fab, ntxiv rau GND xaim rau tus pin 1 thiab xaim los ntawm lub zog rau tus pin 3. NC txhais tau tias tsis txuas nrog, tab sis koj tuaj yeem txuas cov no rau GND yog tias koj xav tau. Los ntawm tus pin 2 ntawm ATmega168 nti, uas yog Arduino RX tus pin, koj yuav txuas xov hlau rau tus pin 4 (TX) ntawm koj lub caj dab lub cajmeem. Ntawm ATmega168 nti, tus pin 3 Arduino TX tau txuas nrog tus pin 5 (RX) ntawm koj tus pin header. Kev sib txuas lus zoo li qhov no: ATmega168 RX rau Header Pin TX, thiab ATmega168 TX rau Header Pin RX. Tam sim no koj tuaj yeem npaj koj daim ntawv qhia zaub mov Arduino.

Kauj Ruam 5: Txoj Haujlwm Xaiv

Programming Options
Programming Options

Thawj qhov kev xaiv yog yuav lub TTL-232R 3.3V USB-TTL Qib Serial Cable. Cov no tuaj yeem yuav tau ntawm www.adafruit.com lossis www.ftdichip.com Ob qhov kev xaiv, uas kuv nyiam yog yuav ib qho ntawm ob lub rooj sib cais los ntawm www. SparkFun.com. Lawv yog:

  • FT232RL USB rau Serial Breakout Board, SKU: BOB-00718 (Qhov kev xaiv no yuav siv ntau qhov chaw ntawm koj lub khob cij)
  • FTDI Basic Breakout - 3.3V SKU: DEV -08772 (Qhov kev xaiv no, thiab siv txoj cai kaum tus txiv neej lub taub hau ua haujlwm zoo tshaj plaws ntawm txhua qhov peb vim tias nws muaj kev nyab xeeb zoo dua ntawm lub khob cij)

Ob zaug txheeb xyuas koj cov kev sib txuas, xyuas kom tseeb tias koj lub roj teeb 9V tsis txuas nrog thiab txuas koj li kev xaiv ua haujlwm. Qhib Arduino IDE thiab hauv Cov Piv txwv kos duab cov ntaub ntawv, hauv qab Digital, thauj Blink sketch. Hauv qab cov ntawv xaiv Serial Port, xaiv COM chaw nres nkoj uas koj siv nrog koj lub USB cable. xws li COM1, COM9, thiab lwm yam.

  • Arduino Duemilanove w/ATmega328
  • Arduino Decimila, Duemilanove lossis Nano w/ATmega128

(nyob ntawm seb qhov twg koj tab tom siv nrog koj daim ntawv qhia zaub mov Arduino) Tam sim no nyem lub cim rub tawm thiab tom qab ntawd nyem lub pob pib dua ntawm koj lub khob cij. Yog tias koj tab tom siv ib qho ntawm SparkFun breakout boards, koj yuav pom RX thiab TX teeb ntsais ntsais. Qhov no qhia rau koj paub tias cov ntaub ntawv raug xa mus. Qee zaum koj yuav tsum tau tos ob peb feeb tom qab nias lub pob upload ua ntej nyem qhov pib dua. Yog tias koj muaj teeb meem, tsuas yog sim me ntsis nrog koj nrawm npaum li cas ntawm ob. Cov duab kos no yog muab tso kom raug yuav ntsais lub LED ntawm tus pin 13 rau ib ob, tawm rau ib pliag, nyob rau ib pliag … txog thaum koj rub ib daim duab tshiab los yog tua lub zog. Thaum koj tau tshaj tawm cov cai, koj tuaj yeem tshem tawm cov phiaj xwm phiaj xwm thiab siv koj lub roj teeb 9V rau lub zog. Teeb meem

  • Tsis Muaj Lub Hwj Chim - Xyuas kom tseeb tias koj lub zog muaj peev xwm siab dua 5V.
  • Lub zog tab sis tsis muaj dab tsi ua haujlwm - tshuaj xyuas tag nrho koj cov ntsiab lus sib txuas.
  • Kev xa khoom yuam kev - Xa mus rau www.arduino.cc thiab tshawb nrhiav ntawm cov lus yuam kev tshwj xeeb uas koj tau txais. Kuj xyuas cov rooj sab laj vim tias muaj kev pab zoo heev nyob ntawd.

Kauj Ruam 6: PCB Cov Ntaub Ntawv

Cov ntaub ntawv PCB
Cov ntaub ntawv PCB
Cov ntaub ntawv PCB
Cov ntaub ntawv PCB

Yog tias leej twg txaus siab rau kev kos lawv tus kheej PCB (luam tawm Circuit board) Kuv tau suav nrog cov khoom siv thiab sab laug sab pcb cov ntaub ntawv. Kuv tau ntxiv cov ntawv zip uas muaj 300dpi-j.webp

Pom zoo: