Cov txheej txheem:

Arduino Raws 3x3 LED Lub Vev Xaib: 7 Cov Kauj Ruam (nrog Duab)
Arduino Raws 3x3 LED Lub Vev Xaib: 7 Cov Kauj Ruam (nrog Duab)

Video: Arduino Raws 3x3 LED Lub Vev Xaib: 7 Cov Kauj Ruam (nrog Duab)

Video: Arduino Raws 3x3 LED Lub Vev Xaib: 7 Cov Kauj Ruam (nrog Duab)
Video: UCR EE/CS 120B Sping 2015 -- Thomas Dougherty -- RC Car Controller 2024, Kaum ib hlis
Anonim
Image
Image
Arduino Raws 3x3 LED Cube
Arduino Raws 3x3 LED Cube

Nyob zoo thiab zoo siab txais tos rau kuv Thawj Cov Lus Qhia.

Kuv nthuav qhia qhov yooj yim, tsim qauv zoo rau tus pib 3x3x3 LED lub voos xwmfab. Txhawm rau ua kom yooj yim dua los tsim, Kuv muab cov ntsiab lus ntawm PCB tus kheej, koj tuaj yeem ua rau koj tus kheej lossis yuav, cov lus qhia thiab koj tuaj yeem, zoo li kuv, rov siv software los ntawm lub tsev qiv ntawv zoo Arduino LED lub voos xwmfab thiab arduino lib.

Ib qho ntawm lub hom phiaj tsim yog tsuas yog siv los ntawm qhov ntu, lawv yooj yim dua rau tus pib siv lub tshuab ziab khaub ncaws thiab txhua yam tau npaj tau yooj yim ntawm is taws nem ntawm koj nyiam twv/chaw yuav khoom.

Tus qauv tsim tuaj yeem siv tau los ntawm USB cable lossis 7.5-12V DC lub zog hloov pauv.

Lub Circuit Court siv kev txiav Arduino core tsim thiab koj tuaj yeem ua haujlwm nws hauv Circuit Court siv ib qho pheej yig Hauv Circuit System Programmable (ICSP) programmer lossis npaj tau yooj yim USB rau TTL adapter. Tsuas yog software uas koj xav tau yog venerable Arduino IDE.

Qhov kev tsim no tsis yog kev tawm tsam nws tsuas yog tsim rau qee qhov haujlwm yav dhau los thiab kuv tau ntim nws kom zoo. Kuv vam tias koj txaus siab rau nws.

Kauj Ruam 1: Qhov Yuav Tsum Tau

Qhov kev tsim qauv no siv dav muaj los ntawm qhov ntu. Koj tus neeg muag khoom hauv zos nyiam yuav tsum khaws cov khoom koj xav tau.

Koj xav tau Atmega 168p lossis Atmega 328p nrog Arduino bootloader flashed rau hauv. Koj tuaj yeem pom cov no ntawm Ebay, tshawb rau "arduino bootloader", xyuas kom koj yuav Dual In Line (DIL) hloov pauv. Koj kuj tseem xav tau USB hom B qhov (socket), tsis tu ncua, laus dua, rog ib. Kuv xaiv qhov no vim nws yooj yim rau siv tau. Qhov transistors, T1-T3 yog lub hom phiaj dav dav NPN transistors, nrog rau cov npe teev tseg, koj tuaj yeem siv BC108, 2N2222, 2N3904 thiab lwm yam, ib txwm tshuaj xyuas lub transistor pinout tiv thaiv PCB txawm hais tias.

Rau txhua qhov tseem ceeb LEDs, xyuas kom koj yuav lub teeb ci siab lossis LED ci heev. Kuv siv 10000-12000mcd LEDs los ntawm tus muag khoom ntawm Ebay rau qhov piv txwv lub voos xwmfab pom ntawm no. Koj xav tau qhov ci zoo li ntawd koj tseem tuaj yeem pom lub voos xwmfab hauv chav teeb pom kev zoo. Yog tias cov lus piav qhia ntxaws txog kev saib lub kaum ntse ntse, feem ntau nws yog 20 degree tab sis koj tuaj yeem pom ib qho nrog qhov pom dav dua, xav txog nws. Cov ultrabright LEDs no tsis yog qhov meej tshaj plaws thaum saib ib sab rau. Koj yuav tsum tau sim ob peb LEDs los ntawm cov neeg muab khoom sib txawv ua ntej koj pom cov uas haum rau koj cov kev xav tau.

Sau cov npe ntu:

Ib feem Nqe Lus piav qhia PCB Cov PCB ntsuab zoo, ua rau nws lossis yuav nws. 27 3mm LEDs, xim uas koj xaiv. C1 100n 100nF, 25V, 7.5mm suab ceramic capacitor C2 22p 22pF, 25V, 4.4mm pitch ceramic capacitor

C3 22p 22pF, 25V, 4.4mm suab ceramic capacitor C4 100n 100nF, 25V, 7.5mm suab ceramic capacitor C5 100n 100nF, 25V, 7.5mm suab ceramic capacitor C6 10u 10uF 16V, 5.5mm rooj plaub Electrolytic capacitor, 16V C7 22u 10uF 16V, 5.5mm cov ntaub ntawv Electrolytic capacitor, 16V IC1 ATMEGA ATEMEGA168 lossis ATMEGA328 nrog Arduino bootloader IC2 L7805T L7805CV 5V, 100mA linear regulator, TO92 pob ICSP ICSP Pin header strip, 0.1 "suab, 2x3 txoj kev. J1 DCJ0202 DC lub qhov (socket), 2.1mm sab hauv lub taub JP1 Pin header strip, 0.1 "suab, 1x3 txoj kev. Q2 16MHz 16MHz, HC49 rooj plaub siv lead ua, 50ppm, qis profile R1 10k 10K 1/4W hlau zaj duab xis resistor 1% R2 1k 1K 1K 1/4W hlau zaj duab xis resistor 1% R3 1k 1K 1/4W hlau zaj duab xis resistor 1% R4 1k 1K 1/ 4W hlau zaj duab xis resistor 1% R5 470 470 1/4W hlau zaj duab xis resistor 1% R6 1k 1K 1/4W hlau zaj duab xis resistor 1% R8 100 100R 1/4W hlau zaj duab xis resistor 1% R9 100 100R 1/4W hlau zaj duab xis resistor 1% R10 470 470R 1/4W hlau zaj duab xis resistor 1% R11 470 470R 1/4W hlau zaj duab xis resistor 1% R12 470 470R 1/4W hlau zaj duab xis resistor 1% R13 470 470R 1/4W hlau zaj duab xis resistor 1% R14 470 470R 1/4W hlau zaj duab xis resistor 1% R15 470 470R 1/4W hlau zaj duab xis resistor 1% R16 470 470R 1/4W hlau zaj duab xis resistor 1% R17 470 470R 1/4W hlau zaj duab xis resistor 1% R18 1k 1K 1/4W hlau zaj duab xis resistor 1% R19 LDR Xaiv LDR S1 S1 4 tus pin, 6x6mm PCB mount PTH hloov. T1 BC547 BC547/BC548 lub zog qis NPN transistor, TO92 T2 BC547 BC547/BC548 lub zog qis NPN transistor, TO92 T3 BC547 BC547/BC548 tsis tshua muaj zog NPN transistor, TO92 X4 USB hom B qhov (socket), PCB mount los ntawm qhov. 4 x 3-5mm siab lo rau ntawm ko taw roj hmab.

Kauj Ruam 2: Daim Duab Circuit Court thiab Piav Qhia Kev Ua Haujlwm

Daim duab Circuit Court thiab piav qhia kev ua haujlwm
Daim duab Circuit Court thiab piav qhia kev ua haujlwm

Schematic tau qhia saum toj no.

Kev tsim qauv yog ua raws Arduino Duemilanove cov txheej txheem, hle tawm mus rau qhov tsis tseem ceeb. Lub USB rau cov cuab yeej txuas tau raug tshem tawm tab sis muaj cov kab ntawv txuas, JP1, uas tso cai rau USB rau TTL adapter los teeb tsa lub cuab yeej, ntau ntxiv rau kev ua haujlwm tom qab. Kuj tseem muaj ICSP lub taub hau.

Lub rooj tsav xwm tuaj yeem ua haujlwm los ntawm USB ntsaws, siv qhov yooj yim 5V muab hauv lub PC, lossis pheej yig phaus/daus las khaws lub xov tooj them lub xov tooj. Lwm qhov kev xaiv siv DC ntsaws ntsaws ntsaws, qhov no lees txais 7-15V DC cov tswv yim yog li koj tuaj yeem siv txhua qhov txuas txuas uas koj muaj. Lub Circuit Court tsuas yog siv 30mA thiaj li muab cov adapter tshem tawm ntawm lub cuab yeej tuag yuav tsum ua haujlwm, txheeb xyuas koj lub thawv tsis zoo.

Resistors R12 txog R17 teeb tsa qhov tam sim no, uas teeb tsa qhov ci ntawm LEDs. Nrog RED leds thiab 470R resistors qhia, tam sim no yog ~ 5mA rau ib qho LED. Txhawm rau laij cov LED tam sim no koj xav tau qhov hluav taws xob tso tawm ntawm Atmega ntaus ntawv (4.2V) thiab cov hluav taws xob poob qis ntawm LED, rau lub teeb liab liab nws yog 1.7V. Cov mis yog:

LED tam sim no = (Atmega tso zis hluav taws xob - LED Voltage)/Kuv Coj

Nrog rau ntu kuv siv: LED tam sim no = (4.2-1.7)/470LED tam sim no = 5.31mA

Txwv qhov tam sim no los ntawm Atmega 168/328 txog 10mA

Qee qhov sib txawv ntawm LED qhov poob qis:

Liab 1.7VYellow 2.1VOrange 2.1VGreen 2.2VBlue 3.2VSuper blue 3.6VWhite txias 3.6V

Yog li koj tuaj yeem siv lub teeb ci ci xiav LED, tus tiv thaiv yuav poob rau 270R. Koj tuaj yeem nce tam sim no rau 10mA, hauv kuv qhov kev sim kuv pom 5mA txaus.

Transistors T1-T3 feem ntau yog NPN BJT transistors, BC547/BC548/2N2222 thiab lwm yam. Lawv tswj kev hloov pauv ntawm txhua ntawm peb txheej. Resistors R2-R4 txwv lub hauv paus tam sim no ntawm tus tiv thaiv.

R6 thiab PWR LED yog xaiv tau, theej los ntawm Arduino, nws yog qhov pom tseeb yog tias lub zog nyob ntawm LED lub voos xwmfab.

C2, C3 thiab Q2 tsim lub moos txuas rau Atmega 168/328p ntaus ntawv, tau npaj ua ntej nrog lub bootloader. Xyuas kom koj haum 22pF capacitors ntawm no thiab tsis yog lwm qhov ot lub nti yuav tsis pib. C1, C4 thiab C5 yog lub hwj chim muab txiav tawm. Tsis ntau los hais txog qhov no tab sis ua kom ntseeg tau tias koj haum lub capacitors kom raug. Muaj + cov cim ntawm PCB daim duab thiab lub silkscreen.

SK1 thiab R8 thiab R9 yog cov ntawv sib txuas. Siv USB rau TTL adapter, koj tuaj yeem teeb tsa lub cuab yeej, siv qhov piv txwv ntawm no

Kauj Ruam 3: Tau Txais Cov Ntawv Tsim thiab Ua PCB

Cov ntaub ntawv tsim PCB tuaj yeem rub tawm los ntawm Github ntawm

Muaj cov txheej txheem Gerber cov ntaub ntawv xa mus rau PCB tus tsim khoom, cov phiaj xwm thiab PCB muab tso rau hauv-p.webp

PCB tuaj yeem tsim tawm hauv tsev, Kuv yuav tau ua qhov no tab sis kuv tau khiav tawm ntawm Etchant. Kev tsim qauv tuaj yeem tsim tawm siv ib sab PCB thiab txheej txheej sab saum toj (RED hauv cov duab) tuaj yeem ua tiav siv tinned tooj liab xaim txuas. Kuv siv https://pcbshopper.com/ txhawm rau nrhiav tus neeg muag khoom tsim nyog, rau cov qauv kuv tau siv Elecrow.

PCB tsim ntawm Github muaj 3 qhov hloov pauv rau cov qauv tsim qauv pom ntawm no:

  1. Tus tswj hwm 7805CV tau hloov los ntawm tus tswj hwm me 78L05.
  2. PCB tau nqes los ntawm 5 hli.
  3. Kuv tshem polyfuse los ntawm USB +5V pub.

Kauj Ruam 4: Sib dhos PCB

Sib dhos PCB
Sib dhos PCB
Sib dhos PCB
Sib dhos PCB

PCB yog qhov ncaj ncaj rau pem hauv ntej kom sib sau ua ke. Kuv tau ntxiv ib daim duab ntawm PCB sib dhos thiab teeb tsa saum toj no rau siv. Kuv ib txwm pib los ntawm qhov haum qhov me tshaj plaws ua ntej thiab ua haujlwm siab dua, tshwj xeeb tshaj yog tias koj tsis muaj PCB sawv ntsug.

  1. Pib los ntawm kev ua kom haum cov resistors ua ntej, tsis txhob solder lawv. Xyuas kom koj ntxig qhov tivthaiv raug rau qhov chaw raug. Kom yooj yim ntawm kev txheeb xyuas, haum lawv nrog cov pab pawg ua rau sab xis/hauv qab, nws ua rau nws yooj yim los tshuaj xyuas tom qab. Saib ntawm no yog tias koj xav tau kev pab txheeb xyuas tus lej tiv thaiv xim xim. Thaum koj tau txheeb xyuas qhov raug yog nyob hauv qhov chaw raug, muab cov khoom sib dhos.
  2. Solder siv lead ua Q2 nyob rau hauv qhov chaw thiab capacitors C2 thiab C3.
  3. Solder 28 tus pin qhov rau Atmega168/328 nyob rau hauv qhov chaw, xyuas kom tseeb tias koj muaj tus pin 1 nqis siab tshaj, qhov no yuav pab tiv thaiv kom tsis txhob tso lub cuab yeej rov qab.
  4. Haum rau ICSP thiab JP1 txuas.
  5. Haum lub capacitors C1, C4 thiab C5, tag nrho 100nF (ntu code 104).
  6. Linear regulator IC2.
  7. Haum cov transistors T1, T2 thiab T3. Xyuas kom koj tsis tau pauv T1/T2/T23 thiab IC1 vim lawv txhua tus nyob hauv tib lub pob.
  8. Haum S1, kev taw qhia tsis muaj teeb meem.
  9. Haum C6 thiab C7, xyuas kom koj tau txais qhov polarity raug!
  10. Haum lub USB txuas X4.
  11. Haum rau DC lub hwj chim ntsaws J1.

Qhov kawg me ntsis los ua ke yog SIL tig tus pin header. Kuv siv ob lub tshuab txiav zoo ua tib zoo tshem cov yas los ntawm txhua tus pin ntawm kab txaij, kuv rov ua qhov no kom txog thaum kuv muaj 12 tig tus pin ntsaws, tom qab ntawd siv ib khub pliers thiab 3 txhais tes, txhuam txhua tus tig mus rau PCB. Raws li cov neeg feem coob tsis muaj 3 txhais tes, tin txhua lub qhov nrog qee cov laug, los npog lub ncoo, cia nws txias. Tom qab ntawd thov cov hlau txuas kom yaj cov laug thiab ntxig tus pin, tshem cov hlau txuas rau kev sib koom ua ke. Tej zaum koj yuav xav tau qee tus tshiab solder yog tias koj muaj qhov sib koom qhuav.

Ua ntej txhawm rau txheeb xyuas koj cov laug, siv sijhawm so luv luv, tej zaum rau haus? Txheeb xyuas koj cov khoom siv tshuaj xyuas, txheeb xyuas lub USB txuas raws li cov pins tau sib ze thiab cov pins ntawm Atmega168/328 ntaus ntawv.

Thaum koj zoo siab nrog koj cov laug, sau tus kheej nplaum taw rau sab hauv qab ntawm PCB.

Kauj Ruam 5: Sib dhos LED Lub Voos Xwmfab

Sib dhos LED Cube
Sib dhos LED Cube
Sib dhos LED Cube
Sib dhos LED Cube
Sib dhos LED Cube
Sib dhos LED Cube
Sib dhos LED Cube
Sib dhos LED Cube

Nov yog qhov nyuaj tshaj plaws ntawm kev sib dhos. Siv koj lub sijhawm, tsis txhob ntshai.

Kuv tau ntxiv cov ntawv sau rau cov duab saum toj no raws li daim duab hais ib txhiab lo lus.

Ob peb lub ntsiab lus tseem ceeb.

  1. Xyuas kom muaj cov hlau lead zoo (txhais ceg ntev) cov ntsiab lus qis dua raws li tus qauv hloov pauv +V rau 9 LEDs ntawm txhua txheej.
  2. Ua kom ntseeg tau tias cov hmoov txhuas tsis zoo yog khoov ntawm 90 degrees mus rau LED, txhawm rau ua kab rov tav.
  3. Tsim txhua txheej ib tus zuj zus thiab ob zaug/peb zaug kos qhov tsim.
  4. Ua kom ntseeg tau tias cov xaim tooj liab tooj liab, thaum siv, yog ib nrab ntawm txhua kab ntawm LEDs, qhov no ua rau nws yooj yim dua rau txheej txheej txheej xaim.

Kauj Ruam 6: Kev Xeem thiab Lub Rooj Sib Tham zaum kawg

Kev Xeem thiab Lub Rooj Sib Tham zaum kawg
Kev Xeem thiab Lub Rooj Sib Tham zaum kawg

Ua ntej ntsaws rau hauv lub voos xwmfab LED sib dhos lossis Atmega168/328 ntaus ntawv, koj tuaj yeem ua ob peb qhov kev kuaj yooj yim.

Yog tias koj muaj DMM (koj yuav tsum muaj ib qho yog tias koj tsim ib qhov haujlwm zoo li no), ntsuas qhov tsis kam hla tus pin 7 (zoo) thiab 8 (tsis zoo) ntawm 28 tus pin ntsawb, koj yuav tsum muaj> 1K. Yog tias nws qis dua qhov no, txheeb xyuas koj cov laug.

Tom ntej siv 7-15V cov tswv yim rau J1, rov qab mus rau tus pin 7 & 8 ntawm 28 tus pin ntsaws, ntsuas qhov hluav taws xob, koj yuav tsum pom 5V tab sis nws yuav nyob qhov twg ntawm 4.90V thiab 5.1V, qhov no zoo. Yog tias koj siv R6 thiab PWR LED, qhov no yuav tsum tau teeb.

Unplug J1, ntsaws USB txuas rau X4, ntsaws lub cable rau hauv lub hauv paus lossis lub hauv paus rau 5V USB adapter, rov ua dua qhov nyeem hluav taws xob ntawm tus pin 7 & 8 ntawm 28 tus pin ntsawb, puas yog nyeem ib ncig 5V?

Cov tshev saum toj no yog kom ntseeg tau tias cov khoom siv hluav taws xob tau raug thiab qhov ua tau zoo.

Tom ntej no, ua tib zoo ntxig rau Atmega168p/328p ntaus ntawv. Khoov tus pin me ntsis, yog tias xav tau, kom haum rau lub qhov (socket). Siv J1 thiab koj li 7-15V cov khoom siv, hloov lub zog, saib seb IC2 tau kub sai tom qab qhib lub zog. Yog tias ua tau, tua lub hwj chim thiab tshawb xyuas qhov qhia ntawm IC1.

Tom ntej no ua tib zoo ntxig thawj kab ntawm LED teeb. Ua kom ntseeg tau tias ib qho ntawm cov kab xev tooj liab tooj liab nyob ze rau PADL1, PADL2 thiab PADL3, koj xav tau qhov no ntxiv tom qab thaum koj muab cov xaim rau txhua txheej. Nws yog qhov zoo tshaj los pib nrog tus lej kaum thiab siv ob rab koob ntawm lub qhov ntswg, ua tib zoo khoov txhua tus pin me ntsis, ua kab ib kab, kom haum lub qhov (socket) ntawm PCB. Kuv tau ntxiv daim duab ntawm thawj txheej ua ke saum toj no. Siv ib qho ntawm ib leeg xaim 1/0.6 xaim, txiav nws kom ntev haum los ntawm PADL1/PADL2 lossis PADL3 mus rau txhua txheej ntawm lub voos xwmfab. Kuv pom nws yooj yim dua los nkag thawj kab ntawm LEDs rau hauv PCB thiab txuas thawj txheej txheej tswj cov hlau (pom nyob rau hauv dawb) tom qab ntawd rov qab mus rau qib dhau los, ua lwm kab, tom qab ntawd sib sau txhua txheej mus rau PCB raws li qhov no muab kev ruaj khov puag.

Pib los ntawm kev siv txheej txheej tom ntej los ntawm kev siv ib qho ntawm cov ces kaum LEDs, Tom qab ntawd muab lub kaum sab xis rov qab. Tam sim no txheeb xyuas cov txheej txheem yog qib ua ntej koj yuav siv lwm yam ntxiv. Thaum koj tau kho cov txheej, tso rau lwm ob lub ces kaum LEDs, cov khoom yuav tsum yog qib tab sis rov txheeb xyuas nws. Solder cov LEDs seem. Rov ua dua txheej txheej rau txheej txheej kawg.

Kauj ruam 7: Programming

Nyob ntawm koj lub cuab yeej Atmega, koj yuav xav tau program bootloader lossis tsuas yog rub tawm cov cai. Yog tias koj muaj lub nti nrog lub bootloader twb tau ua haujlwm lawm, koj tuaj yeem siv USB rau TTL adapter. Ua raws li phau ntawv qhia no:

www.instructables.com/id/Program-Arduino-Mini-05-with-FTDI-Basic/

Koj tseem tuaj yeem siv 2x3 tus pin Hauv Circuit System Programmable (ICSP) txuas, koj tuaj yeem siv lwm Arduino los ua qhov no:

www.instructables.com/id/How-to-use-Arduino-Mega-2560-as-Arduino-isp/

Kuv siv tus programmer Usbasp uas ua haujlwm nrog Arduino IDE, teeb tsa qhov no los ntawm Cov Cuab Yeej-> Programmer ntawv qhia zaub mov. Koj tuaj yeem xaiv Arduino/Atmel AVR cov neeg tsim khoom pheej yig ntawm Ebay lossis lwm qhov chaw muag khoom.

Rub tawm lub tsev qiv ntawv LED lub voos xwmfab los ntawm https://github.com/gzip/arduino-ledcube, ua raws cov lus qhia ntawm Github thiab saib hauv koj cov piv txwv piv txwv rau 'arduino-led-cube-> ledcube'.

Yog tias koj tab tom siv ICSP programmer, tuav haujlwm ua ntej nyem rub tawm qhia rau Arduino IDE kom siv tus programmer. Yog tias koj siv USB-rau TTL adapter, nias thiab tso tawm pib dua thaum IDE ua tiav kev suav sau.

Thaum tus qauv piv txwv tau raug teeb tsa, koj yuav tsum muaj lub voos xwmfab LED nrog cov qauv zoo nkauj.

Nov yog kuv thawj qhov kev qhia, cov lus pom thiab cov lus pom zoo txais tos.

Pom zoo: