Cov txheej txheem:

Programmable RGB LED Sequencer (siv Arduino thiab Adafruit Trellis): 7 Kauj Ruam (nrog Duab)
Programmable RGB LED Sequencer (siv Arduino thiab Adafruit Trellis): 7 Kauj Ruam (nrog Duab)

Video: Programmable RGB LED Sequencer (siv Arduino thiab Adafruit Trellis): 7 Kauj Ruam (nrog Duab)

Video: Programmable RGB LED Sequencer (siv Arduino thiab Adafruit Trellis): 7 Kauj Ruam (nrog Duab)
Video: Microbiome Research in the Bay Area (Part 1) 2024, Hlis ntuj nqeg
Anonim
Image
Image
Txhim Kho Tus Tsav Tsheb
Txhim Kho Tus Tsav Tsheb

Kuv cov tub xav tau cov xim LED coj los ua kom pom lawv lub rooj, thiab kuv tsis xav siv cov kaus poom RGB sawb tswj, vim tias kuv paub tias lawv yuav tau dhuav nrog cov qauv ruaj uas cov tswj no muaj. Kuv kuj xav tias nws yuav yog lub sijhawm zoo los tsim cov cuab yeej qhia ntawv rau lawv uas lawv tuaj yeem siv los ua kom paub cov phiaj xwm thiab khoom siv hluav taws xob uas kuv tau qhia rau lawv. Qhov no yog qhov tshwm sim.

Kuv yuav qhia koj yuav ua li cas tsim qhov yooj yim no, programmable RGB LED sawb tswj siv Arduino Uno (lossis Nano), Adafruit Trellis, thiab puv tes ntawm lwm qhov.

Adafruit Trellis yog ib qho ntawm kuv nyiam cov khoom ua si tshiab los ntawm Lady Ada thiab cov neeg coob. Ua ntej tshaj plaws, nws tsuas yog $ 9.95 rau pawg thawj coj, thiab lwm $ 4.95 rau silicone elastomer khawm ncoo (tus nqi raws li qhov sau ntawv no). Qhov ntawd zoo heev rau 16-khawm 4x4 matrix nrog LED muaj peev xwm. Nws tsis tuaj nrog ib qho LEDs teeb tsa, koj yuav tsum tau muab rau lawv, tab sis qhov ntawd ua rau koj hloov pauv xaiv cov xim koj xav tau (thiab khaws tus nqi thiab tsis yooj yim piv rau lub tsev nyob hauv LEDs). Txhawm rau tsim txoj haujlwm no zoo li kuv, koj yuav xav tau puv tes ntawm 3mm LEDs. Kuv siv 2 liab, 2 ntsuab, 2 xiav, 4 daj, thiab 6 dawb.

Trellis siv I2C los sib txuas lus, yog li nws tsuas yog siv ob lub I/O tus pin (cov ntaub ntawv thiab moos) los tswj 16 lub nyees khawm thiab 16 LEDs.

Koj tuaj yeem ua qhov kho vajtse ib feem ntawm txoj haujlwm no ntawm lub rooj sib tham me me, uas yog qhov kuv tau ua kuv li ntawv. Kuv pom tau sai tias kuv xav tau ib yam dab tsi zoo dua thiab muaj ntau ntawm lawv lub rooj (liab qab Arduino thiab lub rooj sib tham tiv thaiv ib puag ncig yuav tsis yooj yim), yog li kuv tau ua kuv tus kheej daim thaiv kom tsav cov kab hluav taws xob LED. Cov lus qhia thiab cov ntaub ntawv rau kev tsim cov ntaub thaiv npog suav nrog hauv qib kawg.

Tus tsav tsheb siv peb IRLB8721 MOSFETs thiab peb tus tiv thaiv. Thiab tau kawg, koj yuav xav tau cov hlua LED tsav; zoo nkauj npaum li cas yooj yim 12V RGB LED sawb yuav ua. Cov no yog cov LEDs yooj yim, zoo li SMD 5050s, tsis zoo nkauj ib leeg tuaj yeem hais qhia tus kheej (tsis muaj NeoPixels, thiab lwm yam.)-Qhov ntawd yog lwm txoj haujlwm! Koj kuj xav tau 12V lub hwj chim loj txaus los tsav tus lej LEDs uas koj npaj siab siv.

Yog li, txhawm rau rov ua dua, ntawm no yog qhov xav tau kho vajtse yooj yim rau txoj haujlwm no:

  • Ib Arduino Uno lossis Nano (cov lus qhia no yog rau Uno nrog poj niam lub taub hau teeb tsa, tab sis Nano ntawm lub khob cij ua haujlwm zoo) (Adafruit, Amazon, Mouser);
  • Ib Adafruit Trellis board thiab silicone khawm ncoo (Adafruit);
  • Peb IRLB8721 N-channel MOSFETs (Adafruit, Amazon, Mouser);
  • Peb 1K resistors (Amazon, Mouser);
  • Peb 220 ohm resistors (Amazon, Mouser)
  • Ib lub rooj sib tham me me (kuv thawj yog 1/4 qhov loj me-xaiv qhov loj me uas koj tuaj yeem ua haujlwm tau yooj yim) (Adafruit, Amazon);
  • A 12V RGB LED sawb (SMD 5050) (Adafruit, Amazon);
  • 12V fais fab mov - xaiv lub zog tsim nyog rau tus lej LEDs uas koj npaj yuav tsav.

Kev lees paub qhov yuav tsum tau ua: cov kev sib txuas saum toj no tau muab rau koj kom yooj yim thiab tsis yog kev pom zoo ntawm ib yam khoom lossis tus muag khoom; thiab kuv tsis tau txais txiaj ntsig los ntawm ib qho kev yuav khoom hauv cov kab ntawv no. Yog tias koj tau txais cov neeg muag khoom koj nyiam zoo dua, los ntawm txhua qhov txhais tau tias txhawb nqa lawv!

Cia peb pib…

Kauj Ruam 1: Txhim Kho Tus Tsav Tsheb

Txhim Kho Tus Tsav Tsheb
Txhim Kho Tus Tsav Tsheb

Nov yog LED tsav Circuit. Nws yooj yim heev. Nws siv IRBLxxx N-channel MOSFET rau txhua cov channel ntawm LED sawb. LED sawb yog ib qho anode, lub ntsiab lus +12V raug xa mus rau LED sawb, thiab cov xim liab, ntsuab, thiab xiav LED tau tswj los ntawm kev muab hauv av ntawm qhov sib txuas sib txuas mus rau kab txaij. Yog li, peb yuav txuas qhov ntws ntawm MOSFETs mus rau LED xim raws, thiab cov hauv paus rau hauv av. Cov rooj vag yuav txuas nrog Arduino cov txiaj ntsig digital, thiab cov neeg tawm tsam muab qhov rub tawm uas ua kom txhua MOSFET hloov mus los lossis tawm raws li xav tau.

Arduino muab cov tes taw dav dav hloov pauv ntawm qee qhov ntawm nws cov txiaj ntsig digital, yog li peb yuav siv cov txiaj ntsig ntawd (tshwj xeeb yog D9, D10, D11) kom qhov kev siv ntawm txhua cov xim xim tuaj yeem tswj tau.

Yog tias koj tsis meej pem txog dab tsi los txuas qhov twg ntawm IRLB8721 MOSFETs, tuav ib qho hauv koj txhais tes nrog rau pem hauv ntej ntsib koj raws li pom hauv daim duab saum toj no. Tus pin ntawm sab laug (tus pin 1) yog lub qhov rooj, thiab yuav txuas mus rau Arduino cov lej tso tawm tus lej thiab tus tiv thaiv (lwm qhov kawg ntawm tus tiv thaiv yuav tsum txuas rau hauv av). Tus pin nyob hauv nruab nrab (tus pin 2) yog lub qhov dej ntws, thiab txuas rau LED kab xim kab xim. Tus pin ntawm sab xis (tus pin 3) yog lub hauv paus, thiab txuas nrog hauv av. Nco ntsoov tias koj taug qab cov transistor txuas rau qhov twg LED xim channel.

Kuv yuav tsis nkag mus rau hauv cov ntsiab lus ntawm yuav ua li cas txhawm rau txhawm rau cov laug cam. Ua siab ncaj, Kuv ntxub nws, thiab kuv tsis zoo rau nws. Tab sis kom zoo dua lossis tsis zoo, nws ua haujlwm, thiab nws yog txoj hauv kev nrawm thiab qias neeg kom tau txais daim ntawv pov thawj ruaj khov lossis ib leeg ua tiav. Kuv thawj pawg thawj coj tau pom ntawm no.

Koj tseem tuaj yeem ua daim ntawv qhia no. Nws yuav yog qhov nrawm dua li qhov muag tag nrho txhua yam ntawm lub rooj sib tham proto, tab sis tsawg dua.

Thaum koj tau txais koj tus tsav tsheb txuas, txuas MOSFET lub qhov rooj nkag mus rau Arduino cov lej tso zis: D9 rau cov channel ntsuab, D10 rau channel liab, thiab D11 rau xiav channel. Txuas cov hlua LED rau koj lub rooj sib tham zoo ib yam.

Tsis tas li, nco ntsoov tias koj lub rooj tsav tsheb muaj kev sib cais sib cais los ntawm nws hauv av mus rau ib qho ntawm Arduino cov pins hauv av.

Thaum kawg, rau LED lub zog, txuas qhov tsis zoo (hauv av) ua rau 12V muab rau hauv av ntawm koj lub rooj tsav tsheb. Tom qab ntawd txuas qhov ua tau zoo ntawm 12V cov khoom siv rau anode txhuas ntawm koj cov hlua LED (qhov no yog xaim dub ntawm kuv cov kab lus qhia hauv daim duab).

Thaum kawg, Kuv tau xaus tsim lub PC daim phiaj thaiv uas nce ntawm Uno, thiab tseem muaj kev txhawb nqa rau Trellis. Qhov no tau muab ntau yam khoom tiav ua tiav. Yog tias koj xav ua qhov ntawd, koj tuaj yeem hla kev siv lub rooj sib tham proto raws li tau piav qhia ntawm no thiab tsuas yog tau txais daim thaiv npog ua. Tias txhua yam tau piav qhia hauv qib kawg.

Kauj Ruam 2: Muab LEDs tso rau ntawm Trellis

Muab cov LEDs tso rau ntawm Trellis
Muab cov LEDs tso rau ntawm Trellis

Lub Rooj Tswjhwm Saib Trellis muaj cov pawm khoob rau 3mm LEDs uas peb yuav xav tau sau. Nco ntsoov ua tib zoo cim ntawm cov ntaub qhwv-muaj qhov hloov maj mam "+" ib sab ntawm lub ncoo kom xaiv sab anode. Yog tias koj tuav lub rooj tsav xwm kom cov ntawv nyob sab xis, tseem muaj qhov cim tseg rau saum thiab hauv qab ntawm pawg thawj coj qhia tias LED anodes nyob ntawm sab laug.

Solder koj 3mm LEDs rau lub rooj tsavxwm. Saib ntawm lub hauv ntej ntawm lub rooj tsavxwm, sau ntawv sab xis, sab saud sab laug/LED txoj haujlwm yog #1, sab xis yog #4, sab laug hauv qab yog #13, thiab sab xis yog #16. Nov yog cov xim kuv siv hauv txhua txoj haujlwm (thiab muaj qhov laj thawj yog vim li cas, yog li kuv qhia koj ua raws li kuv tus qauv yam tsawg kawg rau ob kab saum toj kawg nkaus):

1 - red2 - green3 - blue4 - white5 - red6 - green7 - blue8 - white9 - white10 - white11 - yellow12 - yellow12 - yellow13 - white14 - white15 - yellow16 - daj

CC Attribution: Cov duab Trellis saum toj no yog los ntawm Adafruit thiab siv nyob hauv Creative Commons - Attribution/ShareAlike licence.

Kauj Ruam 3: Txuas Trellis rau Arduino

Txuas Trellis rau Arduino
Txuas Trellis rau Arduino

Trellis muaj tsib daim ntaub thaiv, tab sis tsuas yog plaub leeg tau siv hauv txoj haujlwm no. Trellis xav tau SDA thiab SCL los tham nrog Arduino (siv I2C), thiab 5V thiab GND rau lub zog. Lub ncoo kawg, INT, tsis siv. Cov ntaub qhwv Trellis tshwm ntawm tag nrho plaub ntug ntawm pawg thawj coj. Koj tuaj yeem siv cov txheej txheej uas koj xav tau.

Muab cov hlau txuas txuas txuas txuas rau 5V, GND, SDA thiab SCL cov ntaub qhwv. Tom qab ntawd, txuas 5V xaim rau 5V tus pin ntawm Arduino, GND rau tus pin hauv av, SDA xaim rau A4, thiab SCL xaim rau A5.

Tom ntej no, peb tab tom yuav txhawb nqa Arduino thiab xa cov duab kos rau nws. Tam sim no yog lub sijhawm zoo los tso lub pob khawm silicone rau ntawm lub Rooj Tswjhwm Saib Trellis. Nws tsuas yog zaum ntawm lub rooj tsavxwm (nco ntsoov "nubs" nyob hauv qab ntawm lub ncoo uas haum rau hauv qhov ntawm lub rooj tsavxwm), yog li koj yuav xav siv ob peb daim kab xev los tuav cov ntug ntawm lub ncoo rau lub rooj tsavxwm tam sim no

CC Qhov Cuam Tshuam: Trellis thaiv cov duab saum toj no yog cov qoob loo ntawm daim duab no los ntawm Adafruit, thiab tau siv nyob hauv Creative Commons - Attribution/ShareAlike licence.

Kauj Ruam 4: Rub tawm Qhov Project Sketch thiab Muab Xa Mus Rau Arduino

Koj tuaj yeem rub tawm daim duab los ntawm kuv Github repo rau txoj haujlwm no.

Thaum koj tau txais nws, qhib nws hauv Arduino IDE, txuas Arduino siv USB cable, thiab xa daim duab kos mus rau Arduino.

Yog tias cov duab kos tau rub tawm thiab Trellis tau txuas nrog kom raug, ib qho ntawm cov nyees khawm ntawm Trellis yuav tsum nyem nrawm peb zaug thaum nias. Qhov no yog qhov qhia tau tias koj tau nias lub pob tsis raug, vim tias lub kaw lus tuaj txog hauv nws lub xeev "tawm", yog li tsuas yog siv tus lej nias yog qhov yuav tsum tau qhib nws.

Txhawm rau qhib lub kaw lus, nyem thiab tuav lub pob hauv qab hauv qab (#13) tsawg kawg ib pliag. Thaum koj tso lub pob, tag nrho cov LEDs yuav tsum pom luv luv, thiab tom qab ntawd ob kab hauv qab yuav tawm mus, tshwj tsis yog #13 (hauv qab sab laug). Tam sim no lub kaw lus nyob rau hauv lub zog ua haujlwm thiab tsis ua haujlwm.

Koj tuaj yeem sim siv ob kab saum toj kawg nkaus kom ci thiab ua kom pom cov LED raws li kev sim thawj zaug. Yog tias ua haujlwm, koj zoo mus rau qib tom ntej. Yog tsis yog, kos:

  1. LED fais fab mov tau txuas nrog thiab qhib;
  2. Pawg tsav tsheb MOSFETs tau siv kom raug. Yog tias koj siv tib IRLB8721's kuv siv, kos:

    • Tsav tsheb teeb liab teeb liab inputs (MOSFET rooj vag, IRLB8721 tus pin 1) txuas nrog rau Arduino D9 = ntsuab, D10 = liab, D11 = xiav (saib nco hauv qab no);
    • LED sawb txuas nrog lub rooj tsav tsheb thiab cov xim LED tau txuas nrog MOSFET cov dej ntws (IRLB8721 tus pin 2);
    • MOSFET qhov chaw pins (IRLB8721 tus pin 3) txuas nrog hauv av ntawm tus tsav tsheb;
  3. Kev sib txuas hauv av ntawm tus tsav tsheb thiab Arduino tus pin pin.

Hauv cov kauj ruam tom ntej, peb yuav ua si nrog qee qhov kev ua haujlwm ntawm khawm khawm cov neeg siv cuam tshuam.

NCO TSEG: Yog tias koj tus tswj hwm ua haujlwm tab sis cov nyees khawm siv tsis tswj cov xim kom raug, tsis txhob txhawj thiab tsis txhob rov ua dua! Tsuas yog nkag mus rau Sketch hauv Arduino IDE thiab hloov kho RED, GREEN, thiab BLUE tus pin txhais cov ntsiab lus nyob ze rau saum cov ntawv.

Kauj Ruam 5: Kev Tswj Yooj Yim

Kev Tswj Haujlwm Yooj Yim
Kev Tswj Haujlwm Yooj Yim

Tam sim no tias lub kaw lus tau txhawb zog, peb tuaj yeem ua si nrog qee lub khawm thiab ua kom nws ua tau.

Raws li kuv tau hais hauv cov kauj ruam dhau los, thaum txhawb zog, lub kaw lus los txog hauv nws lub xeev "tsis ua haujlwm". Hauv lub xeev no, koj tuaj yeem siv cov nyees khawm nyob rau sab saum toj ob kab kom nce thiab txo qis xim ntawm txhua qhov liab, ntsuab, thiab xiav LED raws. Yog tias koj siv cov khawm dawb nce/txo qis, cov kab ke nce lossis txo qhov kev siv ntawm txhua peb txoj kev sib npaug thiab sib npaug.

Hauv qab ob kab yog siv los ua si rov qab ua qauv ua ntej. Cov qauv no tau khaws cia hauv Arduino's EEPROM. Thaum daim duab kos thawj zaug, nws pom tias EEPROM tsis muaj cov qauv khaws cia, thiab khaws cov txheej txheem ntawm lub neej ntawd. Tom qab ntawd, koj tuaj yeem hloov cov qauv no, thiab koj qhov kev hloov pauv tau muab khaws cia rau hauv Arduino's EEPROM, hloov qhov qauv ua ntej. Qhov no ua kom ntseeg tau tias koj cov qauv muaj sia nyob lub zog sib txuas. Lub luag haujlwm kho tau piav qhia hauv cov kauj ruam tom ntej.

Txog tam sim no, sau luv luv ib qho ntawm cov nyees khawm ua ntej (yim khawm nyob hauv qab ob kab) kom khiav cov qauv khaws cia rau lub pob ntawd. Lub khawm flashes thaum tus qauv sau. Txhawm rau tso tseg tus qauv, nias lub pob khawm luv luv dua. Thaum tus qauv tab tom khiav, cov nyees khawm nce/nqis dawb hauv kab saum toj kawg nkaus tuaj yeem siv los hloov tus qauv qauv.

Yog tias koj tawm ntawm txoj haujlwm ib leeg rau ob peb feeb yam tsis tau kov lub pob, koj yuav pom cov LEDs dim. Qhov no yog ob qho tib si rau kev txuag hluav taws xob thiab kom tsis txhob muaj Trellis dhau los ua kom pom ib qho "kev xav" LEDs tau sim tsim. Kov ib lub pob ntawm Trellis yuav ua rau nws rov qab los.

Txhawm rau kaw lub kaw lus, nias thiab tuav lub qis-sab laug (#13) khawm rau ib lossis ntau vib nas this thiab tso tawm. Trellis thiab LED sawb yuav tsaus ntuj.

Kauj Ruam 6: Kho Cov Qauv ntawm Keypad

Kho cov Qauv ntawm Keypad
Kho cov Qauv ntawm Keypad

Raws li kuv tau hais hauv cov kauj ruam dhau los, kos duab khaws cia yim qhov qauv hauv EEPROM thawj zaug nws khiav. Koj tuaj yeem hloov 7 ntawm cov qauv no mus rau lwm yam yog tias koj xav siv hom qauv hloov kho ntawm lub khawm khawm.

Txhawm rau nkag mus rau hom kev hloov kho hom, ua ntej txiav txim siab lub pob twg koj xav hloov tus qauv rau. Koj tuaj yeem xaiv ib lub pob uas tsis yog khawm sab laug hauv qab. Nkag mus rau hom kev hloov kho los ntawm nias ntev (tuav ntau dua ib pliag) ntawm koj cov qauv xaiv. Thaum tso tawm, lub khawm yuav teeb pom kev zoo, thiab ob kab sab saud yuav pib ntsais muag. Qhov no qhia tau tias koj tab tom kho hom.

Kho kom raug hom pib ntawm thawj kauj ruam ntawm tus qauv thiab txuas ntxiv mus kom txog thaum koj tawm kev kho lossis ua tiav kev kho 16 qib (16 cov kauj ruam max ib tus qauv). Ntawm txhua kauj ruam, siv cov nyees khawm siv nyob rau sab saum toj ob kab los xaiv cov xim uas koj xav tau rau cov kauj ruam ntawd. Tom qab ntawv luv-nias tus qauv ua ntej khawm kom txuag xim ntawd thiab txav mus rau theem tom ntej. Ntawm koj cov kauj ruam kawg, tsis txhob siv luv-nias, tsuas yog ntev-nias kom tawm kev kho.

Tom qab koj tawm qhov kev hloov kho, tus qauv cia li ua si.

Qhov ntawd yog nws! Tam sim no koj muaj RGB LED tus tswj hwm uas yuav ua raws cov qauv uas koj tuaj yeem ua haujlwm tau los ntawm cov keyboard. Koj tuaj yeem nres ntawm no, lossis yog tias koj xav tsim qhov kev ua haujlwm raug cai ntawm txoj haujlwm no, txuas ntxiv mus tas li ntawm cov theem.

Kauj Ruam 7: Kho Vajtse Zoo dua: RGB LED Shield Shield thiab Enclosure

Image
Image
Khoos phis tawj zoo dua: RGB LED Tsav Tsheb Shield thiab Cov Ntaub Ntawv
Khoos phis tawj zoo dua: RGB LED Tsav Tsheb Shield thiab Cov Ntaub Ntawv
Kho vajtse zoo dua: RGB LED Tsav Tsheb Shield thiab Cov Ntaub Ntawv
Kho vajtse zoo dua: RGB LED Tsav Tsheb Shield thiab Cov Ntaub Ntawv

Thaum kuv muaj daim ntawv ua haujlwm, kuv paub tias kuv tsis tuaj yeem tso Arduino liab qab thiab lub rooj sib tham ntawm kuv cov menyuam lub rooj zaum raws li kev daws mus tas li. Kuv xav tau ib lub thawv rau qhov project. Kuv kuj tau txiav txim siab tias kuv yuav ua tus tsav tsheb zoo dua, thiab kuv xav tias nws yog lub sijhawm zoo tshaj plaws los ua kuv tus kheej daim thaiv npog.

Kuv tau ntxuav kuv cov ntawv txheej txheem los ntawm kev nkag mus rau hauv ExpressSCH, cov cuab yeej pub dawb muab los ntawm ExpressPCB, pawg thawj coj tsim khoom uas muaj qhov pheej yig luv luv ntawm cov PC me me. Kuv tau siv ExpressPCB rau ntau tshaj kaum xyoo ntawm cov phiaj xwm, tab sis siv cov cuab yeej thiab cov khoom siv uas koj nyiam, los ntawm txhua txoj hauv kev.

Kuv ntxiv ob peb yam me me rau cov txheej txheem yooj yim kom nws yuav ua haujlwm zoo li daim ntaub thaiv rau txoj haujlwm no. Kuv tau ntxiv cov hlua txuas mus txuas rau Trellis, lub zog txuas, lub teeb tsav, thiab txuas rau LED sawb. Kuv kuj tau ntxiv qhov chaw rau lub tshuab hluav taws xob hla cov khoom siv hluav taws xob. Qhov kawg Circuit Court tau qhia ntawm no.

Kuv txiav txim siab tias lub zog rau txoj haujlwm yuav tsum los ntawm daim ntaub thaiv. 12V tau muab rau cov ntaub thaiv npog muaj zog ob qho tib si LED sawb thiab Arduino. Lub zog rau Arduino tau muab los ntawm kev txuas cov khoom nkag mus rau Arduino's VIN tus pin, uas yog ob txoj kev (koj tuaj yeem muab lub zog rau Arduino ntawm tus pin no, lossis yog tias koj txuas lub zog rau Arduino lwm qhov, nws yuav muab rau koj lub zog ntawm tus pin no). Kev tiv thaiv diode D1 tiv thaiv txhua lub zog txuas ncaj qha rau Arduino (piv txwv li USB) los ntawm kev sim ua lub zog LEDs.

Vim li cas ho tsis siv Arduino lub zog txuas thiab tsuas yog txuas 12V rau ntawd? Thaum kuv tuaj yeem muab 12V rau Arduino lub zog txuas thiab siv VIN tus pin txhawm rau rub lub zog ntawd rau daim ntaub thaiv, Kuv tau txhawj xeeb tias Arduino's D1 diode thiab cov cim tsis tau mus txog qhov siab tam sim no tuaj yeem tsav LED ib daim hlab Yog li, kuv txiav txim siab tias kuv daim thaiv yuav siv lub zog nkag mus thiab muab lub zog rau Arduino hloov. Kuv tseem xav tau 5V rau Trellis, tab sis Arduino txoj cai tswj hwm lub hwj chim muab 5V rau ntau tus pin, yog li kuv siv ib qho ntawm lawv Trellis. Qhov ntawd tau cawm kuv tso ib txoj cai tswj hwm ntawm daim thaiv.

Tom qab ntawd kuv tau teeb tsa PCB. Kuv siv qee qhov peev txheej uas kuv pom kom tau txais kev ntsuas meej rau kev tso cov pins kom tau raws cov kab ntawv ntawm Arduino Uno. Kev mob siab rau me ntsis thiab nws ua tiav ntawm thawj zaug sim. Tsis muaj dab tsi ntau rau daim phiaj thaiv nws tus kheej, yog li kuv muaj chav txaus. Kuv tau nthuav tawm cov ntawv dav rau LED thauj khoom, yog li yuav muaj ntau lub peev xwm nqa tam sim no rau kuv cov kev xav tau. Kuv teeb MOSFETs tawm qhov twg lawv tuaj yeem ntsia tau ncaj, nrog lossis tsis muaj cua sov. Txog tam sim no, Kuv tsis tau xav tau cov cua sov rau tus lej ntawm LEDs kuv tau siv, tab sis qhov chaw nyob yog tias xav tau.

Kuv kuj tau ntxiv qhov uas sib dhos qhov sib dhos ntawm Trellis, yog li kuv tuaj yeem siv qhov sawv ntsug los txhawm rau txhawm rau Trellis rau kuv daim ntaub thaiv. Nrog cov ntaub thaiv npog txuas rau Arduino, thiab Trellis raug tshem tawm ntawm kev sawv-tawm ntawm daim ntaub thaiv, txhua yam yuav tsum zoo thiab ruaj khov.

Tom qab ntawd kuv tau luam tawm pawg thawj coj saib thiab ua nws rau ib qho ntawm cov tub ntxhais ua npuas ncauj, thiab ntxig rau kuv ntu kom ntseeg tau tias txhua yam haum. Txhua yam zoo, yog li kuv xa qhov kev txiav txim tawm.

Tom qab ntawd kuv tau pib ua haujlwm ntawm daim thaiv. Siv Fusion 360, Kuv tsim lub thawv ntawv yooj yim kom muaj peb lub laug cam (Arduino Uno, ntaub thaiv npog, thiab Trellis). Qhov nyob hauv lub thawv tso cai txuas rau Arduino lub USB chaw nres nkoj, thiab tau kawg, nkag mus rau LED sawb txuas thiab tiv thaiv lub hwj chim txuas. Arduino lub zog fais fab tau npog los ntawm lub thaiv, kom ntseeg tau tias nws tsis siv. Tom qab ob peb tus qauv rau kev sim haum, thaum kawg kuv tau tsim tus qauv kuv txaus siab. Kuv tau tshaj tawm STL cov ntaub ntawv rau lub thawv rau Thingiverse.

Yav tom ntej, Kuv yuav ua qhov hloov pauv ntawm lub rooj tsavxwm uas Nano tuaj yeem txuas rau ncaj qha, Qhov no yuav ua rau txoj haujlwm tseem ceeb dua. Txog thaum ntawd, koj tseem tuaj yeem siv Nano rau Uno daim ntaub thaiv zoo li no.

Yog tias koj yuav ua daim ntaub thaiv, ntawm no yog yam koj yuav xav tau ntxiv rau ntu uas tau hais hauv qib 1:

  • RGB LED Driver Shield PC board (los ntawm ExpressPCB lossis lwm tus; koj tuaj yeem rub tawm cov ntawv los ntawm kuv Github repo rau txoj haujlwm);
  • 1N4002 diode;
  • 100uF 25V radial electrolytic capacitor (siv 220uF lossis 470uF yog tias thauj khoom loj);
  • Lub zog fais fab, PJ202-AH (5A tus qauv ntsuas).

Cov hauv qab no yog nyob ntawm yeem:

  • 3mm LED - xim twg, rau kev tsav teeb (tej zaum yuav raug rho tawm)
  • 1500 ohm resistor - tsuas xav tau yog tias siv LED tsav teeb

Pom zoo: