Cov txheej txheem:

500 LEDs Phab Ntsa Nrog ESP32: 16 Cov Kauj Ruam
500 LEDs Phab Ntsa Nrog ESP32: 16 Cov Kauj Ruam

Video: 500 LEDs Phab Ntsa Nrog ESP32: 16 Cov Kauj Ruam

Video: 500 LEDs Phab Ntsa Nrog ESP32: 16 Cov Kauj Ruam
Video: High lumen pob kws qij, kev lag luam LED pob kws qij, Tuam Tshoj zoo tshaj plaws Hoobkas 2024, Hlis ntuj nqeg
Anonim
500 LEDs Phab Ntsa Nrog ESP32
500 LEDs Phab Ntsa Nrog ESP32

Nyob zoo sawv daws! Thaum kawg ntawm qhov kev qhia no koj yuav paub tsim koj tus kheej phab ntsa LED.

Qhov kev qhia no yog ua raws lub caij ntuj sov muaj nyob hauv Tsev Kawm Ntawv Dawb Huv Lub Plawv.

Muaj kev lom zem!

Khoom siv

Cov khoom siv muaj npe hauv qab no.

Kauj Ruam 1: Cov khoom siv

Khoom siv
Khoom siv

Cia peb pib los ntawm kev sau txhua yam peb xav tau kom ua tiav Peb Cov Phab Ntsa Led:

(Cov ntawv txuas tau tsim los ntawm 7/10/2019)

Arduino IDE Software

ESP32 Micro Controller

LED Pixel Lub Teeb

Hwj chim Mov

Fais fab Qaum

Hlau Stripping Tool

Breadboard Jumper Cables

Cov xov hluav taws xob

Kauj Ruam 2: Txheeb Xyuas Txoj Cai Fais Fab Rau Koj LedWall

Muaj ib txoj hauv kev ua lej yooj yim kom paub seb lub hwj chim twg yog qhov zoo tshaj rau koj siv.

Peb tab tom siv Ohm txoj cai lij choj lub zog: P = IxV (Lub zog = Siv zog x Voltage)

Kev ntsuas hluav taws xob tau txiav txim siab los ntawm peb cov coj: hauv qhov no 5V.

Kev siv zog nyob ntawm qhov kho vajtse, ib leeg coj los siv 30mA.

Txhua kab ntawm 50 Leds yog li haus 50 x 30mA = 1250mA = 1.25A.

Peb 500 Led phab ntsa yog li siv 10 zaug uas (10 kab ntawv): 12.5A.

Kev siv fais fab yog 5V x 12.5A = 62.5W rau Leds.

Tau kawg, nyob rau sab saum toj ntawm Leds koj yuav tsum tau suav nrog rau ESP thiab txhua lwm yam khoom ntawm koj qhov Circuit.

Peb muaj 60A fais fab mov, peb muaj ntau ntau tshaj qhov peb xav tau.

Kauj Ruam 3: Lub Hwj Huam Hluav Taws Xob

Image
Image

Peb lub zog xa khoom tuaj nrog cov xaim txuas. Peb yuav tsum hloov kho lub hwj huam qaum los txuas nws rau 110V ntsaws.

- Txiav tus poj niam txuas ntawm lub hwj chim qaum. Peb yuav khaws tus txiv neej, txwv tsis pub paub zoo li NEMA 5-15P.

- Siav kab kom muaj txog 3 hli tooj liab pom ntawm txhua lub xov hlau.

Nov yog cov vis dis aus qhia nrawm yuav ua li cas kom tshem cov xov hlau:

Kauj Ruam 4: Txuas Cov Khoom Siv Hluav Taws Xob

Hwj chim rau ESP32S
Hwj chim rau ESP32S

Tam sim no peb tau npaj los xaim peb cov khoom siv hluav taws xob!

Nco ntsoov tshem lub hwj huam hluav taws xob thaum ua haujlwm rau nws.

Thaiv

  • Cov xaim dub (Phase) txuas rau lub zog hluav taws xob 'L' tus pin
  • Cov xaim dawb (Neutral) txuas rau lub zog hluav taws xob 'N' tus pin
  • Cov xaim ntsuab txuas rau lub zog hluav taws xob tus pin 'Hauv av'

(Yog tias koj lub xov tooj hluav taws xob sab hauv tsis zoo ib yam li peb li kev nyab xeeb thiab saib cov duab hauv online.)

Kev Xeem

Txuas lub tshuab fais fab hauv lub computer mus rau txhua lub qhov hluav taws xob. Lub ntsuab LED ntawm lub hwj chim yuav tsum qhib.

Kauj Ruam 5: Hwj chim rau ESP32S

Saib ntawm koj li ESP yuav tsum muaj daim ntawv lo nyob ib sab ntawm txhua tus pin.if nws tsis muaj daim ntawv lo koj tuaj yeem saib 'pinout' ntawm koj tus kheej ESP online.

Siv tus txiv neej mus rau poj niam lub rooj noj mov jumper xaim lossis xaim hluav taws xob, txuas:

  • Tus '5V' ESP32S tus pin rau '+V' ntawm lub hwj chim (txiv kab ntxwv hauv daim duab saum toj no)
  • 'GND' ESP32S tus pin rau ntu '-V' ntawm lub hwj chim (dub hauv daim duab saum toj no)

(Ntawm qee qhov ESPs tus '5V' tus pin tau sau tias 'VCC' hloov chaw, ob qho tib si txhais tib yam nkaus.)

Thov nco ntsoov tias koj li ESP yuav muaj qhov sib txawv 'pinout' dua li qhov peb siv. Yog li koj tuaj yeem txuas koj cov xov hlau mus rau qhov chaw sib txawv dua li ntawm daim duab saum toj no. Tsuav koj txuas mus rau tus pin raug (5V & GND), qhov chaw nyob ntawm lub rooj tsavxwm tsis muaj teeb meem.

TestingPlug hauv koj lub zog txuas ntxiv, thiab yog tias koj li ESP muaj qhov taw qhia LED (feem ntau ua), nws yuav ci kom pom lub zog tau xa mus rau ESP. Nrog koj zoo siab!

Kauj Ruam 6: Ua kom lub teeb ci LED

Ua kom muaj zog ntawm cov teeb ci LED
Ua kom muaj zog ntawm cov teeb ci LED

Siv cov xov hluav taws xob:

- Txuas cov xaim liab ntawm LED Teeb Sawb rau V+ ntawm lub hwj chim.

- Txuas cov xaim xiav ntawm LED Teeb Sawb mus rau V- ntawm lub hwj chim.

Kauj Ruam 7: Txuas ESP32 mus rau LED Teeb Sawb

Peb ESP32 qhia rau WS2811 tus neeg tsav tsheb txuas nrog rau txhua tus coj cov xim thiab ci ci uas lawv xav tau kom ua.

Leds strips tuaj nrog 3 xaim txuas:

- Liab: Hwj chim- Xiav: Neutral- Dawb: Cov ntaub ntawv

Wb txuas Cov Hluav Taws Xob Dawb coj mus rau tus lej digital ntawm ESP. Thov nco ntsoov tus lej PIN xaiv raws li peb yuav xav tau xaiv nws hauv tus lej tom qab. Peb txuas peb tus lej rau tus pin 13.

Kauj Ruam 8: Npaj Khoos Phis Tawj: C2102 Driver

Tam sim no tias peb lub khoos phis tawj muaj xov txuas, peb xav xa peb thawj tus lej los sim nws. Los ntawm lub neej ntawd, Windows lossis MacOs tsis tuaj yeem sib txuas lus nrog peb ESP32. Ua li ntawd, peb yuav tsum rub tawm "tus tsav tsheb" rau ESP USB kev sib tham nti: ua c2102.

Tus tsav tsheb no yuav tsum rub tawm thiab teeb tsa:

- Windows 10: https://www.silabs.com/documents/public/software/C…- Windows 7/8/8.1:

(Txuas li ntawm 7/10/2019)

Kauj Ruam 9: Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 1

Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 1
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 1
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 1
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 1

Ua ntej peb tuaj yeem siv peb ESP32 nrog Arduino software, peb yuav tsum ua kom ntseeg tau tias nws tau lees paub.

Kauj ruam 1: Ntxiv cov laug cam rau tus thawj tswj

1 - Nyem rau hauv Arduino qhov kev xaiv Cov Ntaub Ntawv >> Nyiam

2- Hauv qhov "Tus Thawj Saib Xyuas Ntxiv URLs" teb, luam qhov txuas hauv qab no:

Kauj Ruam 10: Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 2

Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 2
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 2
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 2
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 2

Tam sim no tias Arduino software "paub" ntau cov laug cam, cia peb nruab peb ESP32 kev txhawb nqa

Kauj Ruam 2: Txhim kho ESP32 kev txhawb nqa

1 - Hauv cov ntawv qhia zaub mov saum toj kawg nkaus, xaiv: Cov Cuab Yeej >> Pawg Thawj Coj >> Tus Thawj Saib Xyuas Haujlwm

2 - Ib lub qhov rai yuav tshwm sim. Siv lub npov tshawb nrhiav, nyob hauv kaum sab xis saum toj, txhawm rau nrhiav "ESP32".

3 - Nrhiav tus ua los ntawm espressif. Nruab nws. (Saib duab)

Kauj Ruam 11: Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 3

Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 3
Arduino Software - Ntxiv ESP32 Support - Kauj Ruam 3

Tam sim no tias Arduino software tuaj yeem sib tham nrog peb ESP32, cia peb ntsaws nws rau hauv computer thiab txheeb xyuas tias txhua yam ua haujlwm.

1 - Cia peb paub tseeb tias peb ua haujlwm ntawm ESP32 platform:

Nyem rau ntawm Tools >> Board >> ESP32 Dev Module

1- Cia peb paub tseeb tias Arduino software paub yuav sib txuas lus rau peb li ESP li cas:

Nyem rau Cov Cuab Yeej >> Chaw nres nkoj thiab xaiv qhov uas tshwm sim los ntawm kev ntsaws rau hauv kab no.

Tseem ceeb:

Yog tias koj muaj teeb meem xa cov cai mus rau koj li ESP, kos ob daim ntawv qhia ua ntej. Yog tias qhov chaw nres nkoj tsis raug xaiv nrog kos cim, tshaj li Arduino software yuav tsis sib tham nrog nws.

Kauj Ruam 12: Ntxiv Cov Tsev Qiv Ntawv rau Arduino IDE

Ntxiv Tsev Qiv Ntawv rau Arduino IDE
Ntxiv Tsev Qiv Ntawv rau Arduino IDE

Tam sim no peb tab tom yuav ntxiv lub tsev qiv ntawv uas yuav tso cai rau peb sim peb Led Wall!

1- Nyem rau Cov Cuab Yeej >> Tswj Tsev Qiv Ntawv.

2- Nyob rau sab xis saum toj, tshawb rau NeoPixelBus. Nrhiav "NeoPixelBus los ntawm Makuna", nruab nws (saib duab)

Muaj peev xwm lwm cov tsev qiv ntawv txaus siab: (Tsis xav tau rau qhov kev qhia no)

- NeoMatrix

- FastLed

- Artnet

-GFX

Kauj Ruam 13: Thawj Txoj Cai: Strand Test

Peb thawj tus lej yog piv txwv los ntawm Lub Tsev Qiv Ntawv.

Koj tuaj yeem theej / luam cov cai hauv qab no lossis nyem rau:

Cov Ntaub Ntawv >> Piv Txwv >> Adafruit NeoPixelBus >> Strandtest

Thov nco ntsoov hloov koj li LED_PIN rau ib qho uas koj tau siv los txuas rau koj lub cev. Peb siv 13 thoob qhov kev qhia no.

Kuj nco ntsoov hloov kho qhov loj me me nrog LED_COUNT sib txawv.

// Ib qho yooj yim niaj hnub LED Striptest program.

#suav nrog #ifdef _AVR_ #suav nrog // Yuav tsum tau rau 16 MHz Adafruit Trinket #endif // Tus pin twg ntawm Arduino txuas nrog NeoPixels? #define LED_PIN 13 // Muaj pes tsawg NeoPixels txuas rau Arduino? #define LED_COUNT 500 // Tshaj tawm peb NeoPixel strip object: Adafruit_NeoPixel strip (LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); // Cov lus sib cav 1 = Tus lej pixels hauv NeoPixel strip // Argument 2 = Arduino tus lej tus lej (feem ntau siv tau) // Cov lus sib cav 3 = Pixel hom chij, ntxiv ua ke raws li xav tau: // NEO_KHZ800 800 KHz bitstream (feem ntau NeoPixel cov khoom w/ WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (tsis v2) FLORA pixels, WS2811 tsav tsheb) // NEO_GRB Pixels tau txuas rau GRB bitstream (feem ntau NeoPixel khoom) // NEO_RGB Pixels tau txuas rau RGB bitstream (v1 FLORA pixels, tsis yog v2) // NEO_RGBW Pixels tau xaim rau RGBW bitstream (NeoPixel RGBW cov khoom) // teeb tsa () muaj nuj nqi-khiav ib zaug thaum pib -------------------- ------------ tsis muaj teeb tsa () {// Cov kab no tshwj xeeb los txhawb Adafruit Trinket 5V 16 MHz. // Lwm lub rooj tsavxwm, koj tuaj yeem tshem tawm ntu no (tab sis tsis muaj teeb meem tawm nws): #if txhais (_ AVR_ATtiny85_) && (F_CPU == 16000000) clock_prescale_set (clock_div_1); #endif // Xaus ntawm Trinket-tshwj xeeb cov cai. strip.begin (); // INITIALIZE NeoPixel strip object (REQUIRED) strip.show (); // Kaw tag nrho cov pixels ASAP strip.setBrightness (50); // Teeb tsa qhov kaj txog li 1/5 (max = 255)} // loop () muaj nuj nqi-ua haujlwm ntau dua tsuav lub rooj tsavxwm nyob ntawm --------------- tsis muaj dab tsi voj () {// Sau raws qhov ntev ntawm kab txaij hauv ntau yam xim… colorWipe (strip. Color (255, 0, 0), 50); // Liab ximWipe (strip. Color (0, 255, 0), 50); // Green colorWipe (strip. Color (0, 0, 255), 50); // Xiav // Ua yeeb yam ua yeeb yam hauv ntau xim … theatreChase (strip. Color (127, 127, 127), 50); // Dawb, ib nrab ci ntsa iab theatreChase (strip. Color (127, 0, 0), 50); // Liab, ib nrab ci ntsa iab theatreChase (strip. Color (0, 0, 127), 50); // Xiav, ib nrab ci ntsa iab zaj sawv (10); // Flow zaj sawv los ntawm tag nrho cov kab ua yeeb yam TheatreChaseRainbow (50); // Zaj sawv-txhim kho kev ua yeeb yamChase sib txawv} // Qee lub luag haujlwm ntawm peb tus kheej rau kev tsim cov yeeb yaj kiab ----------------- // Sau kab txaij pixels ib qho tom qab ib qho nrog xim. Sawb tsis tau tshem // thawj; txhua yam yuav muaj npog pixel los ntawm pixel. Dhau xim // (raws li ib leeg 'ntim' 32-ntsis tus nqi, uas koj tuaj yeem tau txais los ntawm kev hu rau // strip. Color (liab, ntsuab, xiav) raws li qhia hauv lub voj () ua haujlwm saum toj no), // thiab ncua sijhawm (hauv milliseconds) ntawm pixels. void colorWipe (uint32_t xim, int tos) {rau (int i = 0; kuv strip.setPixelColor (i, xim); // Teeb pixel cov xim (hauv RAM) strip.show (); // Hloov kho kab kom phim ncua (tos); // Ncua ib ntus}} // Theatre-marquee-style chasing lights. Pass in a color (32-bit value, // a la strip. Color (r, g, b) as mentioned above), thiab ncua sijhawm (hauv ms) // nruab nrab ntawm cov thav ntawv. void theatreChase (uint32_t xim, tos tos) {rau (int a = 0; a <10; a ++) {// Rov ua dua 10 zaug… rau (int b = 0; b <3; b ++) {// 'b' suav los ntawm 0 rau 2 … strip.clear (); // Teem tag nrho cov pixels hauv RAM rau 0 (tawm) // 'c' suav los ntawm 'b' mus txog qhov kawg ntawm strip nyob rau hauv cov kauj ruam ntawm 3… rau (int c = b; c strip.setPixelColor (c, xim); // Teeb pixel 'c' rau tus nqi 'xim'} strip.show (); // Hloov kho sawb nrog cov ntsiab lus tshiab ncua (tos); // Pause rau ib pliag}}} // Lub voj voog zaj sawv nrog tag nrho cov kab txaij. Dhau lub sijhawm ncua (hauv ms) ntawm cov ntas. tsis muaj dab tsi zaj sawv (int tos) {// Hawj txawm ntawm thawj pixel khiav 5 ua tiav loops los ntawm lub log xim. // Xim lub log muaj ntau yam ntawm 65536 tab sis nws yog OK yog tias peb yob hla, yog li // tsuas suav los ntawm 0 txog 5*65536. Ntxiv 256 rau firstPixelHue txhua lub sijhawm // txhais tau tias peb yuav ua 5*65536/256 = 1280 dhau los ntawm lub voj sab nraud no: rau (ntev firstPixelHue = 0; firstPixelHue <5*65536; firstPixelHue += 256) {rau (int i = 0; Kuv // Offset pixel hue los ntawm tus nqi los ua ib qho kev hloov pauv ntawm // xim log (thaj tsam ntawm 65536) raws qhov ntev ntawm kab txaij // (strip.numPixels () cov kauj ruam): int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels ()); // strip. ColorHSV () tuaj yeem siv 1 lossis 3 qhov kev sib cav: cov xim (0 txog 65535) lossis // xaiv tau ntxiv qhov saturation thiab tus nqi (ci ci) (txhua 0 txog 255). // Ntawm no peb tsuas yog siv qhov sib cav sib cav ib leeg dhau ib qho xwb. (strip. ColorHSV (pixelHue))))}} strip.show (); // Hloov kho kab txaij nrog cov ntsiab lus tshiab ncua (tos); // Pause rau ib pliag}} // Zaj sawv-txhim kho kev ua yeeb yam marquee. Dhau sijhawm ncua (hauv ms) ntawm cov thav ntawv. void theatreChaseRainbow (tos tos) {i nt firstPixelHue = 0; // Thawj pixel pib ntawm liab (hue 0) rau (int a = 0; a <30; a ++) {// Rov ua dua 30 zaug… rau (int b = 0; b RGB strip.setPixelColor (c, xim); / / Teeb pixel 'c' kom muaj nuj nqis 'xim'} strip.show (); // Hloov kho sawb nrog cov ntsiab lus tshiab ncua (tos); // Ncua ib pliag ua ntejPixelHue += 65536/90; // Ib lub voj voog ntawm cov xim log tshaj 90 ntas}}}

Kauj Ruam 14: SHU Qauv Cai

Image
Image

Peb cov cai hloov pauv txhua Leds ib tus los ntawm ib qho kom ntseeg tau tias lawv ua haujlwm:

// Qhov piv txwv no yuav hloov pauv ntawm kev qhia 500 pixels li Liab

#includeconst uint16_t PixelCount = 500; // qhov piv txwv no kwv yees 4 pixels, ua rau nws me dua yuav ua rau qhov ua tsis tiav uint8_t PixelPin = 13; // nco ntsoov teeb tsa qhov no rau tus pin raug, tsis quav ntsej rau Esp8266

#define colorSaturation 128 // peb lub cim pixel, hauv kev txiav txim sib txawv thiab nrawm

NeoPixelBus sawb (PixelCount, PixelPin);

// NeoPixelBus sawb (PixelCount, PixelPin); RgbColor liab (0, colorSaturation, 0); RgbColor ntsuab (colorSaturation, 0, 0); RgbColor xiav (0, 0, colorSaturation); RgbColor dawb (colorSaturation); RgbColor dub (0); HslColor hslRed (liab); HslColor hslGreen (ntsuab); HslColor hslBlue (xiav); HslColor hslWhite (dawb); HslColor hslBlack (dub); tsis muaj teeb tsa teeb tsa () {Serial.begin (115200) thaum (! Serial); // tos rau txuas txuas Serial.println (); Serial.println ("Initializing …"); Serial.flush (); // qhov no rov pib dua txhua lub neopixels mus rau lub xeev tawm sawb. Pib (); strip. Show (); Serial.println (); Serial.println ("Khiav …"); } void loop () {ncua (100); Serial.println ("Xim R, G, B, W …"); rau (int i = 0; i <= 499; i ++) {// teeb tsa cov xim, // yog tias lawv tsis sib xws, koj yuav tsum siv NeoGrbFeature feature strip. SetPixelColor (i, liab); strip. Show (); ncua (100); strip. SetPixelColor (kuv, hslRed); strip. Show (); ncua (100); }}

Kauj Ruam 15: Tshaj Tawm Txoj Cai rau ESP32

Tseem ceeb:

Yuav kom tuaj yeem xa cov cai rau txhua tus tswj hwm micro, nws yuav tsum tau nyob hauv hom kev ua haujlwm. Most ua qhov no tau thiab txhua yam koj yuav tsum ua yog nyem upload hauv software.

Peb ESP32 xav kom koj tuav lub program programming khawm thaum tus lej raug xa mus. Koj kuj yuav tsum tau rov pib dua nws tom qab tus lej tau xa los ntawm nias ib zaug khawm rov pib dua.

Peb ESP32 txoj haujlwm lub khawm nyob ntawm sab laug, khawm rov pib dua ntawm sab xis. Please xa mus rau koj phau ntawv yog tias koj muaj lwm tus tswj hwm micro.

Kauj Ruam 16: Cov lus piav qhia

Cov lus qhia no tau ua nrog kev pab los ntawm cov lus qhia hauv qab no:

randomnerdtutorials.com/installing-the-esp…

Siv los teeb tsa ESP32 rau hauv Arduino IDE.

Sau:

Nathaniel BaroneGabriel Castro

Editor:

Cedric Bleimling

Pom zoo: