Cov txheej txheem:

Arduino / ESP LED Qhov Cub: 4 Kauj Ruam (nrog Duab)
Arduino / ESP LED Qhov Cub: 4 Kauj Ruam (nrog Duab)

Video: Arduino / ESP LED Qhov Cub: 4 Kauj Ruam (nrog Duab)

Video: Arduino / ESP LED Qhov Cub: 4 Kauj Ruam (nrog Duab)
Video: How I Made this Electric Car that can go Anywhere 2024, Kaum ib hlis
Anonim
Image
Image
Arduino / ESP LED Qhov Cub
Arduino / ESP LED Qhov Cub

Muaj lub qhov cub tawg uas tsis muaj tsev nyob hauv lub tsev uas kuv xaum, tsis muaj qhov kev xaiv tiag tiag rau qhov cub zoo, xis nyob. Yog li kuv txiav txim siab los ua kuv tus kheej RGB LED qhov cub, uas muab qhov kev xav zoo simulating qhov hluav taws kub tiag. Tsis zoo li qhov hluav taws kub tiag, tab sis nws muab qhov kev xav zoo sib xws.

Koj tuaj yeem ua koj tus kheej ib yam, nws yog txoj haujlwm pib yooj yim uas koj tuaj yeem ua nrog tsuas yog ob peb ntu thiab Arduino lossis ESP8266 module. Ob qho qauv ua haujlwm tau zoo, yog vim li cas kuv thiaj xaiv ESP8266 yog qhov no tseem ua rau kuv muaj lub sijhawm los tswj lub qhov cub taws, qhib/tua los ntawm kuv lub tsev siv tshuab. Tag nrho txoj haujlwm yog qhov pheej yig heev, thiab nws tsis xav tau sijhawm ntau.

Cov ntaub ntawv xav tau:

  • WS2812B RGB LED sawb (1 meter, 60 LEDs/meter) - eBay cca. 7 USD
  • NodeMCU ESP8266 ESP -12 (3.3v) lossis Arduino Nano V3.0 (5V) module (Yog tias koj xav tau WiFi, xaiv NodeMCU) - cca. 4-7 USD
  • 1 x Capacitor (1000 uF, 6.3V+) kom ruaj khov rau qhov tam sim no
  • Dawb greased ci daim ntawv
  • Qee lub rooj ntoo rau lub hauv paus (lossis duab los qhia)
  • USB cable, phab ntsa fais fab adapter (1 A lossis ntau dua)

Tsis tas li, koj yuav xav tau qee cov hlau txuas, cov cuab yeej thiab cov xov hlau.

Kauj Ruam 1: Npaj Lub Hauv Paus

Npaj Lub Hauv Paus
Npaj Lub Hauv Paus
Npaj Lub Hauv Paus
Npaj Lub Hauv Paus
Npaj Lub Hauv Paus
Npaj Lub Hauv Paus

Ua ntej tshaj plaws, koj yuav tsum tau txiav 1 meter RGB LED strip hauv ib nrab thiab xaim tus pin ua ke (GND rau GND, D rau D, +5V txog +5V). Qhov no yuav muab rau koj 50 cm ntev ob daim kab xev.

Tam sim no koj tuaj yeem nqa qee cov ntoo thiab txiav nws kom loj me, nws yuav tsum tsuas yog me ntsis ntev dua li cov hlua LED thiab tsuas yog dav me ntsis xwb. Koj tuaj yeem siv lwm yam khoom siv, tab sis kuv xav tias ntoo zoo dua.

Ruaj ntseg tsuas yog qhov xaus ntawm RGB LED sawb rau lub rooj tsavxwm nrog daim kab xev scotch lossis (kub) kua nplaum.

Kauj Ruam 2: Ntxiv Cov Nplaim Taws

Ntxiv Cov Nplaim Taws
Ntxiv Cov Nplaim Taws
Ntxiv Cov Nplaim Taws
Ntxiv Cov Nplaim Taws
Ntxiv Cov Nplaim Taws
Ntxiv Cov Nplaim Taws

Nqa daim ntawv greased thiab tshem tawm ib daim (kwv yees li 10-15 centimeters dav), ntswj nws me ntsis thiab tom qab ntawd xaub nws hauv qab LED kab txaij, quav nws thiab ncig, yog li nws ua rau "nplaim taws". Lub hom phiaj yog tsim nws siab dua cov LEDs, yog li lub teeb los ntawm LEDs tau nthuav tawm ntawm daim ntawv.

Koj tuaj yeem sim ua kom ruaj ntseg nws los ntawm ob sab. Koj yuav tsis tuaj yeem siv daim kab xev xev lossis cov kua nplaum ib txwm los tuav nws ua ke, vim tias nws tau pleev xim/ntawv tsis lo. Koj tuaj yeem khi nws ua ke nrog qee cov pob tshab uas siv rab koob.

Thaum koj tau ua thawj nplaim taws, txuas ntxiv tsim txhua qhov nplaim taws tom ntej, sib tshooj me ntsis nrog lub hauv paus.

Kauj Ruam 3: Txuas Nws

Txuas Nws
Txuas Nws
Txuas Nws
Txuas Nws
Txuas Nws
Txuas Nws

Kev xaim hluav taws xob (NodeMCU) mus rau cov kab hluav taws xob LED tau yooj yim, tab sis koj yuav tsum tau ua qee qhov txuas kom cais tawm cov xov hlau los ntawm LED sawb. Tsis tas li, nco ntsoov ntxiv 1000 uF 6.3V (lossis ntau dua) lub tshuab hluav taws xob nruab nrab ntawm + thiab GND, ze rau ntawm LED sawb, qhov no yuav pab tswj lub zog.

Kev thaiv yog:

  • Txuas +5V (USB VCC) los ntawm NodeMCU mus rau LED sawb +5V
  • Txuas GND los ntawm NodeMCU rau LED sawb GND
  • Txuas tus lej cim "D7" los ntawm NodeMCU rau "D" ntawm LED sawb

Yog tias koj tab tom siv Arduino, koj tuaj yeem txuas ib tus lej digital (D2-D13) mus rau LED sawb, tsuas yog nco ntsoov kom phim nws hauv qhov chaws.

Kauj Ruam 4: Xa Cov Cai

Xa cov Code
Xa cov Code
Xa cov Code
Xa cov Code

Koj yuav tsum siv rau Arduino IDE thiab nco ntsoov teeb tsa ESP8266 pawg thawj coj txhawb:

github.com/esp8266/Arduino

Cov peev txheej muaj nyob ntawm nplooj ntawv github:

Sau thiab xa cov cai rau NodeMCU module, thiab qhov ntawd yog nws! Nws yuav pib ntsais muag LEDs.

Muaj ib daim ntawv tshwj xeeb rau txoj cai: kev siv hluav taws xob ntawm cov cai tam sim no tau ntsuas kom nyob ib puag ncig 600-700 mA, uas yog siab dua li ib txwm 500 mA USB chaw nres nkoj zoo li muab. Vim li no, rau thawj 1 feeb, nws tsuas yog siv lub zog ib feem ntawm cov LEDs (ib ncig ib feem peb), thiab tom qab ntawd nws yuav mus thiab taws tag nrho nws. Yog tias koj tab tom siv phab ntsa txuas hluav taws xob, xyuas kom nws tuaj yeem txhawb nqa tsawg kawg 1 A thiab tsis yog hom pheej yig tshaj.

Vim tias qhov chaws muaj, xav tias dawb kuj tseem yuav sim nrog xim, sijhawm.

Txaus siab rau!

Pom zoo: