Cov txheej txheem:

Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib: 17 Cov Kauj Ruam (nrog Duab)
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib: 17 Cov Kauj Ruam (nrog Duab)

Video: Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib: 17 Cov Kauj Ruam (nrog Duab)

Video: Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib: 17 Cov Kauj Ruam (nrog Duab)
Video: Simple Programming, Amazing Results: DIY Bluetooth Speaker with #ESP32 and 2 Speakers 2024, Kaum ib hlis
Anonim
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib
Tsim DIY Arduino ntawm PCB thiab Qee Cov Lus Qhia rau Cov Pib

Qhov no yog txhais raws li kev qhia rau txhua tus neeg siv lawv tus kheej Arduino los ntawm cov khoom siv, uas tuaj yeem yuav los ntawm A2D Electronics. Nws muaj ntau cov lus qhia thiab cov lus qhia txhawm rau txhim kho nws kom ua tiav. Koj tseem yuav kawm paub txog txhua yam khoom sib txawv ua.

Nyeem thiab kawm paub yuav siv dab tsi los tsim koj tus kheej Arduino!

Koj tseem tuaj yeem pom txoj haujlwm no ntawm kuv lub vev xaib no.

Kauj ruam 1: Mini USB Txuas

Mini USB Txuas
Mini USB Txuas
Mini USB Txuas
Mini USB Txuas
Mini USB Txuas
Mini USB Txuas

Thawj ntu rau cov laug yog lub mini USB txuas. Qhov no yuav muab lub zog rau koj cov arduino thaum ua tiav, tab sis RS232 / USB rau Serial adapter yuav xav tau rau kev ua haujlwm nws. Lub qhov me me USB nkag mus ua ntej kom koj tuaj yeem tso nws, tig lub rooj tsavxwm hla kom cov pins tig mus rau sab saud, tom qab ntawd muab nws tso rau ntawm lub rooj. Ua ntej muab tso rau hauv, khoov lub teeb me me ntawm 2 tus pin me ntsis mus rau pem hauv ntej ntawm lub rooj tsavxwm kom nws yuav haum rau hauv qhov ntawm PCB zoo. Qhov hnyav ntawm PCB yuav tuav tus txuas rau hauv qhov chaw, thiab koj tuaj yeem muab nws tso rau ntawd.

Kauj ruam 2: Pin Headers

Tus Pin Headers
Tus Pin Headers
Tus Pin Headers
Tus Pin Headers
Tus Pin Headers
Tus Pin Headers

Pin headers yog cov txuas ntxiv mus. Koj yuav tsum muaj poj niam lub taub hau hauv 6pin x2, 8pin x2, thiab 10pin x1. Tus txiv neej lub taub hau ntawm 3 × 2 kuj tseem yuav tsum tau ua rau ICSP (Hauv Circuit Serial Programming) header. Tag nrho cov no mus nyob sab nraud ntawm lub rooj tsavxwm, thiab yuav haum zoo nyob hauv lawv qhov chaw tsim nyog. Muab lawv nrog tib txoj hauv kev raws li lub qhov (socket) USB, ua ib lub taub hau ib zaug. Lub taub hau yuav tsum yog txhua qhov zoo sib xws rau PCB. Txhawm rau ua tiav qhov no, tsuas yog siv ib tus pin ntawm lub taub hau, tom qab ntawd thaum tuav lub taub hau nrog koj txhais tes, yaj cov laug dua thiab rov hloov lub taub hau rau nws txoj haujlwm perpendicular. Nco ntsoov tias nws tseem tso dej yaug tawm tsam lub rooj tsavxwm rau tag nrho qhov ntev. Tuav nws nyob rau hauv txoj hauj lwm kom txog thaum cov tawv tawv tawv, tom qab ntawd txuas ntxiv cov seem ntawm cov pins.

Kauj ruam 3: IC Qhov (Socket)

IC qhov (socket)
IC qhov (socket)
IC qhov (socket)
IC qhov (socket)
IC qhov (socket)
IC qhov (socket)

Cov lus qhia ceev rau kev siv cov khoom seem: Tag nrho cov khoom siv ua haujlwm tuaj yeem tso rau ntawm pawg thawj coj ua, tom qab ntawd khoov mus rau sab kom cov khoom yuav nyob hauv pawg thawj coj thaum tig nws hla. Qhov no yuav ua kom yooj yim dua rau cov laug vim cov khoom siv yuav tuav lawv tus kheej.

Pib los ntawm kev tso 28pin IC qhov (socket). Nco ntsoov ua kab sib faib ntawm ib kawg nrog daim duab ntawm PCB. Qhov no cia koj paub txoj hauv kev ntxig rau AtMega328P microcontroller. Txawm hais tias cov pins ntawm lub qhov (socket) no luv dua cov resistors lossis cov capacitors, lawv tseem tuaj yeem khoov kom tuav cov khoom tiv thaiv nyob hauv qhov chaw thaum koj muab nws tso rau.

Kauj ruam 4: Resistors

Resistors
Resistors
Resistors
Resistors
Resistors
Resistors

Lub 3 resistors tuaj yeem mus tom ntej. Nws tsis muaj teeb meem txoj hauv kev uas lawv tau tso - cov neeg tawm tsam tsis muaj qhov sib txawv. Muaj 2 1K ohm resistors raws li tam sim no-txwv resistors rau LEDs, thiab 10K ohm resistors raws li rub-up resistor ntawm kab rov pib dua. 1K ohm resistors tau xaiv rau LED hloov ntawm 220 ohm ib leeg kom cov LEDs yuav muaj qis dua tam sim no dhau los ntawm lawv, yog li ua haujlwm ntau dua li qhov ntsuas dua li lub teeb nyem.

Kauj ruam 5: LEDs

LEDs
LEDs
LEDs
LEDs
LEDs
LEDs

Muaj 2 LEDs, ib qho yog lub zog ntsuas, thiab lwm qhov ntawm tus pin 13 ntawm Arduino. Cov ceg ntev dua ntawm LEDs cim rau qhov zoo (anode). Nco ntsoov muab tus ceg ntev dua nyob rau sab sab cim + hauv PCB. Cov hmoov txhuas tsis zoo ntawm LED kuj tseem ua rau sab ib sab, yog li koj tseem tuaj yeem txiav txim siab qhov zoo (anode) thiab tsis zoo (cathode) ua yog tias lawv raug txiav.

Kauj ruam 6: Oscillator

Oscillator
Oscillator
Oscillator
Oscillator
Oscillator
Oscillator

Tom ntej no yog cov siv lead ua oscillator thiab 2 22pF ceramic capacitors. Nws tsis muaj teeb meem txoj hauv kev ib qho ntawm cov no tau muab tso rau hauv - cov khoom siv hluav taws xob thiab cov siv lead ua oscillators tsis yog polarized. Cov khoom siv no yuav muab Arduino ua 16MHz teeb liab moos sab nraud. Arduino tuaj yeem tsim 8MHz lub moos sab hauv, yog li cov khoom no tsis tsim nyog nruj me ntsis, tab sis cia nws ua haujlwm nrawm.

Kauj ruam 7: Pib dua Hloov

Pib dua Hloov
Pib dua Hloov
Pib dua Hloov
Pib dua Hloov
Pib dua Hloov
Pib dua Hloov

Kev rov pib dua tuaj yeem mus tom ntej. Ob txhais ceg ntawm qhov hloov pauv tsis tas yuav khoov, nws yuav tsum tuav nws tus kheej hauv qhov qhib.

Kauj Ruam 8: Cov Khoom Siv Hluav Taws Xob

Cov Khoom Siv Hluav Taws Xob
Cov Khoom Siv Hluav Taws Xob
Cov Khoom Siv Hluav Taws Xob
Cov Khoom Siv Hluav Taws Xob
Cov Khoom Siv Hluav Taws Xob
Cov Khoom Siv Hluav Taws Xob

4 100nF (nano Farad) ceramic capacitors tuaj yeem mus tom ntej. C3 thiab C9 pab ua kom yooj yim tawm qhov hluav taws xob me me rau ntawm 3.3V thiab 5V kab kom xa lub zog huv rau Arduino. C7 yog nyob rau hauv kab nrog kab rov pib dua sab nraud kom tso cai rau lwm lub cuab yeej (USB rau Serial Converter) rov pib dua Arduino ntawm lub sijhawm kom ua haujlwm nws. C4 nyob ntawm Arduino's AREF (Analog Reference) tus pin thiab GND kom ntseeg tau tias Arduino ntsuas qhov ntsuas qhov tseeb ntawm nws qhov sib piv. Tsis muaj C4, AREF yuav raug txiav txim siab 'ntab' (tsis txuas rau lub zog lossis hauv av), thiab yuav ua rau tsis raug cai hauv kev nyeem analog vim tias tus pin ntab yuav siv qhov ntsuas hluav taws xob nyob ib puag ncig nws, suav nrog cov cim AC me me hauv koj lub cev uas tau los los ntawm cov xov nyob ib puag ncig koj. Ib zaug ntxiv, cov khoom siv hluav taws xob tsis yog polarized, yog li nws tsis muaj teeb meem qhov twg koj tso lawv rau hauv.

Kauj Ruam 9: PTC Fuse

PTC Fuse Cov
PTC Fuse Cov
PTC Fuse Cov
PTC Fuse Cov
PTC Fuse Cov
PTC Fuse Cov
PTC Fuse Cov
PTC Fuse Cov

Tam sim no koj tuaj yeem teeb tsa PTC (qhov kub zoo coefficient) fuse. PTC fuse tsis yog polarized, yog li tuaj yeem muab tso rau hauv ob qho tib si. Qhov no mus tom qab lub qhov (socket) USB. Yog tias koj lub Circuit sim kos ntau dua 500mA ntawm tam sim no, PTC fuse no yuav pib ua kom sov thiab ua rau muaj zog tiv thaiv. Qhov kev nce ntxiv hauv kev tiv thaiv no yuav txo qis tam sim no, thiab tiv thaiv USB chaw nres nkoj. Qhov kev tiv thaiv no tsuas yog hauv Circuit thaum Arduino tab tom siv USB, yog li thaum ua kom lub zog Arduino dhau ntawm DC nkaus lossis los ntawm lub zog sab nraud, nco ntsoov tias koj lub Circuit raug. Nco ntsoov rub ob txhais ceg txhua txoj kev los ntawm lub qhov, txawm tias dhau los khoov. Ib khub pliers yuav pab tau ntawm no.

Kauj Ruam 10: Cov Hluav Taws Xob Hluav Taws Xob

Electrolytic Capacitors
Electrolytic Capacitors
Electrolytic Capacitors
Electrolytic Capacitors
Electrolytic Capacitors
Electrolytic Capacitors
Electrolytic Capacitors
Electrolytic Capacitors

Lub 3 47uF (microFarad) electrolytic capacitors tuaj yeem tso rau tom ntej. Cov ceg ntev dua ntawm cov no yog cov ceg zoo, tab sis kev txheeb xyuas ntau dua yog cov xim ntawm cov hlua ntawm ib sab ntawm cov ceg tsis zoo. Ua kom ntseeg tau tias thaum koj muab lawv tso rau, cov ceg zoo mus rau ntawm + cim rau ntawm lub rooj tsavxwm. Cov khoom siv hluav taws xob no ua kom pom qhov tsis sib xws loj ntawm qhov hluav taws xob nkag, nrog rau 5V thiab 3.3V kab, yog li koj Arduino tau txais qhov ruaj khov 5V/3.3V hloov pauv qhov hluav taws xob hloov pauv.

Kauj ruam 11: DC Jack

DC Jack
DC Jack
DC Jack
DC Jack
DC Jack
DC Jack

Tom ntej no yog DC input nkaus. Zoo ib yam li txhua lwm yam khoom siv, muab tso rau hauv thiab tig lub rooj tsavxwm hla nws kom nws nyob hauv qhov chaw thaum koj muab nws tso rau. Khoov ob txhais ceg yuav nyuaj me ntsis, vim tias lawv tuab, yog li koj ib txwm tuaj yeem khaws qhov no tso rau hauv tib txoj kev ib yam li lub mini USB txuas uas tau muab muag ua ntej. Qhov no tsuas yog mus rau hauv ib txoj kev - nrog lub ntsej muag tig rau sab nrauv ntawm lub rooj tsavxwm.

Kauj Ruam 12: Cov Tswj Hluav Taws Xob

Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob
Cov Hluav Taws Xob Hluav Taws Xob

Tam sim no ob qhov ntsuas hluav taws xob. Nco ntsoov muab lawv tso rau hauv qhov chaw raug. Lawv ob leeg tau sau npe, yog li tsuas yog sib phim sau ntawm lub rooj tsavxwm nrog kev sau ntawv ntawm tus tswj hwm. Tus tswj hwm 3.3V yog LM1117T-3.3 thiab tus tswj hwm 5V yog LM7805. Ob qho no yog cov ntsuas hluav taws xob tawm ncaj qha, txhais tau tias cov tswv yim tam sim no thiab cov zis tam sim no yuav zoo ib yam. Hais tias qhov hluav taws xob nkag yog 9V, thiab qhov hluav taws xob tso tawm yog 5V, ob qho tib si ntawm 100mA ntawm tam sim no. Qhov sib txawv ntawm qhov tawm tswv yim thiab cov hluav taws xob tawm hluav taws xob yuav tawg tawm raws li cua sov los ntawm tus tswj hwm. Hauv qhov xwm txheej no, (9V-4V) x 0.1A = 0.4W ntawm cua sov yuav tsum tau yaj los ntawm tus tswj hwm. Yog tias koj pom tias tus tswj hwm kub thaum siv, uas yog ib txwm, tab sis yog teeb duab loj thiab muaj qhov sib txawv qhov hluav taws xob loj, tom qab ntawd lub rhaub dej kub ntawm tus tswj hwm yuav tsim nyog. Tam sim no txhawm rau muab lawv tso rau ntawm lub rooj tsavxwm, cov hlau hlau ntawm ib sab yuav tsum mus rau sab ntawm lub rooj tsavxwm uas muaj kab ob. Kom ruaj ntseg lawv nyob rau hauv qhov chaw kom txog thaum koj muab lawv tso rau hauv, khoov ib txhais ceg ntawm ib txoj kev thiab lwm yam ob txoj hauv kev. Thaum soldered nyob rau hauv qhov chaw, khoov 5V tus tswj hwm rau sab nrauv ntawm lub rooj tsavxwm thiab 3.3V tus tswj hwm sab hauv ntawm pawg thawj coj saib.

Kauj Ruam 13: Ntxig rau AtMega328P IC

Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC
Ntxig rau AtMega328P IC

Qhov kawg yog muab microcontroller tso rau hauv nws lub qhov (socket). Kab kab sib faib hauv lub qhov (socket) thiab ntawm IC, tom qab ntawd kab txhua tus koob. Ib zaug hauv qhov chaw, koj tuaj yeem thawb nws. Nws yuav siv zog me ntsis ntau dua li qhov koj xav tau, yog li nco ntsoov siv lub zog sib npaug kom koj tsis txhob khoov ntawm ib tus pin.

Kauj Ruam 14: Cov Lus Ceeb Toom Ntawm Kev Ceev Nrog Koj Arduino

  • TSIS TXHOB txuas USB lub zog thiab lub zog sab nraud rau Arduino tib lub sijhawm. Txawm hais tias ob qho no yuav raug ntsuas ntawm 5V, feem ntau lawv tsis yog raws nraim 5V. Qhov sib txawv me me ntawm ob qhov peev txheej ua rau luv Circuit Court dhau ntawm koj lub rooj tsavxwm.
  • TSIS TXHOB kos ntau dua 20mA ntawm tam sim no los ntawm txhua tus pin tso tawm (D0-D13, A0-A5). Qhov no yuav kib lub microcontroller.
  • TSIS TXHOB kos ntau dua 800mA los ntawm 3.3V tus tswj hwm, lossis ntau dua 1A los ntawm 5V tus tswj hwm. Yog tias koj xav tau lub zog ntau dua, siv lub zog txuas sab nraud (USB lub txhab nyiaj fais fab ua haujlwm zoo rau 5V). Feem ntau Arduinos tsim lawv lub zog 3.3V los ntawm USB rau Serial nti ntawm lub nkoj. Cov no tsuas yog muaj peev xwm ntawm 200mA tso tawm, yog li yog tias koj siv Arduino sib txawv, nco ntsoov tias koj tsis tau kos ntau dua 200mA los ntawm tus pin 3.3V.
  • Tsis txhob muab ntau tshaj 16V tso rau hauv DC nkaus. Electrolytic capacitors siv tau ntsuas rau tsuas yog 16V.

Kauj Ruam 15: Ib Qho Lus Qhia / Cov Lus Tseeb

  • Yog tias koj pom tias koj txoj haujlwm xav tau ntau tus pin, analog pins kuj tseem tuaj yeem siv ua tus lej pin. A0 = D14, txog A5 = D19.
  • AnalogWrite () hais kom ua yog PWM teeb liab, tsis yog qhov hluav taws xob sib piv. PWM cov cim muaj nyob ntawm tus pin 3, 5, 6, 9, 10, thiab 11. Cov no muaj txiaj ntsig zoo rau kev tswj lub teeb ci ntawm LED, tswj lub cav, lossis tsim lub suab. Txhawm rau kom tau txais lub teeb liab ntawm PWM tso tawm pins, siv lub suab () ua haujlwm.
  • Cov pins 0 thiab 1 yog TX thiab RX cov cim rau AtMega328 IC. Yog tias ua tau, tsis txhob siv lawv hauv koj cov haujlwm, tab sis yog tias koj xav tau, koj yuav xav tau tshem tawm cov ntu los ntawm cov koob ntawd thaum ua haujlwm Arduino.
  • SDA thiab SCL pins rau i2c kev sib txuas lus yog tus pin tiag A4 thiab A5 feem. Yog tias siv i2c kev sib txuas lus, tus pin A4 thiab A5 tsis tuaj yeem siv rau lwm lub hom phiaj.

Kauj ruam 16: Programming Koj Arduino

Ua ntej tshem tawm txhua lub zog sab nraud kom tsis txhob luv 2 qhov khoom siv sib txawv. Tam sim no txuas USB rau Serial adapter rau lub header tom qab lub zog USB mini. Txuas nws raws li cov hauv qab no:

Arduino USB rau Serial adapter

GND GND (hauv av)

VCC VCC (hwj chim)

DTR DTR (pib tus pin)

TX RX (data)

TXX (data)

Yog, TX thiab RX pins tau tig. TX yog tus pin kis tau tus mob, thiab RX yog tus pin tau txais, yog li yog tias koj muaj 2 tus pin txuas txuas ua ke, tsis muaj ntau yuav tshwm sim. Qhov no yog ib qho ntawm qhov tsis txaus ntseeg tshaj plaws rau cov pib tshiab.

Nco ntsoov tias lub jumper ntawm USB rau Serial adapter tau teeb tsa rau 5V.

Txuas USB rau Serial adapter rau hauv lub khoos phis tawj, xaiv qhov tsim nyog COM chaw nres nkoj (yuav nyob ntawm koj lub khoos phis tawj) thiab Pawg Thawj Coj (Arduino UNO) hauv Cov Ntawv Qhia Cuab Yeej ntawm Arduino IDE (rub tawm los ntawm Arduino.cc), tom qab ntawv suav thiab xa koj cov haujlwm.

Kauj Ruam 17: Kev Xeem Nrog Blink Sketch

Thawj qhov koj yuav tsum tau ua yog ntsais lub LED. Qhov no yuav paub koj nrog Arduino IDE thiab cov lus programming, thiab xyuas kom koj pawg thawj coj ua haujlwm tau zoo. Mus rau qhov piv txwv, nrhiav Blink piv txwv, tom qab ntawv suav sau thiab xa mus rau Arduino pawg thawj coj kom paub tseeb tias txhua yam ua haujlwm. Koj yuav tsum pom LED txuas rau tus pin 13 pib ntsais muag thiab tawm ntawm qhov sib nrug ntawm 1 thib ob.

Pom zoo: