Cov txheej txheem:
- Kauj Ruam 1: Kauj Ruam 1: Cov Cheeb Tsam
- Kauj Ruam 2: Kauj Ruam 2: Circuit
- Kauj Ruam 3: Kauj Ruam 3: Txoj Cai
Video: 12V LED PWM Dimmer Nrog ESP8266: 3 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Thaum sim ua kom kuv tsev neeg muaj kev nyab xeeb dua qub, kuv tau hloov cov qij halogen rau coj teeb. Muaj ntau txoj kev xaiv muaj, los hloov txhua hom teeb pom kev zoo. Thaum ua qhov no, Kuv tau hla cov teeb meem hauv qab no: Kuv muaj lub teeb pom kev zoo uas siv 7 12 volt halogen qij, txhua 10 Watts. Lub teeb no tau tswj los ntawm tus dimmer, uas ua haujlwm tau zoo. Thaum kuv pauv lub qhov muag rau 12 volt coj teeb, txhua 1 Watt, lub dimmer ua haujlwm tsis zoo: lub teeb tau flickering, thiab qhov dimming me ntsis tsis zoo. Qhov no yog teeb meem nrog ntau qhov dimmer classical: lawv muaj qhov ntsuas hluav taws xob tsawg, uas lawv xav tau txhawm rau ua haujlwm.
Yog li, raws li kuv tus txheej txheem domotics, Kuv txiav txim siab los pauv phau ntawv dimmer los ntawm tus tshiab, uas yuav muaj qhov zoo ntxiv ntawm kev tuaj yeem tswj tau nyob deb. Kuv twb tau tsim lub dimmer siv N-channel MOSFET (IRF540), uas yog qhov zoo tshaj plaws rau yam zoo li no: nws tuaj yeem tswj tau los ntawm PWM teeb liab, thiab nws yog qhov tsis tsim nyog, nrog qhov ntsuas siab tshaj ntawm 100 volts thiab 33 Amps, ua kom txaus rau lub hom phiaj no (kuaj nrawm: 7 x 1 Watt = 7 Watts, faib los ntawm 12 volts muab qhov siab tshaj tam sim no txog. 58 Amps). Kuv xav siv lub dimmer no rau lwm lub teeb uas muaj 12 lub qhov muag, txhua 2 watts, uas muab qhov siab tshaj ntawm 2 Amps, yog li ntawd tseem txaus. Tsuas yog saib xyuas nws qhov zaus ntawm PWM teeb liab, tab sis qhov ib txwm muaj txiaj ntsig rau Arduino lossis ESP8266 (500 Hz lossis 1kHz) tsis muaj teeb meem.
Kauj Ruam 1: Kauj Ruam 1: Cov Cheeb Tsam
- LED Tsav Tsheb (230 volts AC rau 12 volts DC hloov pauv) Rau kuv lub hom phiaj, kuv xav siv qhov siab tshaj 24 Watts, yog li kuv pib tawm nrog tus tsav LED ntawm 12 volts thiab 2 Amps. Kuv pom ib qho ntawm Suav chaw faib khoom. Tus tsav tsheb no tau ntsuas 12 volts, 28 Watts, yog li nws txaus los tsav lub teeb ntawm nws tus kheej. Rau koj tus kheej qhov xwm txheej, koj tuaj yeem siv qhov sib dua lossis hnyav dua, nyob ntawm koj lub teeb.
- IRF540 n-channel MOSFET
- Adafruit Huzzah ESP8266 Breakout Vim tias kuv xav siv WiFi, thiab kuv nyiam Adafruit cov khoom, kuv xaiv lub rooj tsavxwm no: nws muab rau kuv ESP8266 nrog rau txoj haujlwm yooj yim pinout, tus tswj hwm lub hwj chim nyob hauv, thiab cov qauv zoo nkauj. Nws yog me ntsis overkill rau txoj haujlwm no, tab sis nws ua rau kev sim thiab debugging yooj yim dua.
- LM2596 raws DC-DC hloov pauv Yuav kom tau txais lub zog rau ESP pawg thawj coj los ntawm 12 volt, Kuv xav tau tus tswj hwm; cov hloov pauv me me no ua tau zoo heev, thiab pheej yig heev.
-
Rotary Encoder nrog khawm ua haujlwm, nrog teeb tsa coj:
www.sparkfun.com/products/10596
Txhua tus lej nkag teb chaws yuav ua, tab sis kuv nyiam qhov zoo ntxiv ntawm tus ua-hauv LED.
-
Pob tshab yas pob qhov rooj
www.sparkfun.com/products/10597
- Resistor 4k7
- Resistor 1k ib
Kauj Ruam 2: Kauj Ruam 2: Circuit
Nov yog lub Circuit Court kuv tau siv: Kuv siv tus pin 4 & 5 ua cov tswv yim rau tus lej nkag teb chaws, thiab tus pin 0 rau khawm. Pin 0 kuj tseem txuas nrog rau ntawm lub rooj tsav xwm liab coj, yog li kuv tuaj yeem tshawb xyuas qhov ua haujlwm ntawm lub pob ntawm qhov ntsuas los ntawm saib cov coj no.
Pin 16 tau siv rau PWM tso tawm, thiab kuv txuas qhov no ncaj qha rau ntsuab coj ntawm Sparkfun encoder. ESP8266 yog 3, 3 volts, thiab txawm tias muaj 100%, kuv ntsuas tsuas yog 2, 9 volts tso tawm, yog li kuv txuas nws ncaj qha yam tsis muaj qhov cuam tshuam. Qhov kev tso tawm tib yam no mus rau Lub Rooj vag ntawm n-channel MOSFET, los ntawm txoj kev ntawm 1kOhm resistor. Qhov Rooj no tau rub siab rau 12 volts los ntawm 4.7 kOhm resistor.
Kuv siv DC-DC hloov pauv hloov 12 volts rau 5.5 volts, qhov no txuas nrog V+ cov tswv yim ntawm Adafruit breakout. Kuv tuaj yeem siv 3.3 volts thiab txuas nws ncaj qha, tab sis qhov no muaj kev nyab xeeb me ntsis.
12 V LED Teeb nyob hauv Circuit Court yog kuv lub teeb.
Kauj Ruam 3: Kauj Ruam 3: Txoj Cai
Kuv tso cai rau GitHub:
Sketch for ESP8266 LED PWM dimmer
Nws yog raws li lub tswv yim lwm qhov qhia tau:
www.instructables.com/id/Arduino-PWM-LED-D…
Tab sis qhov no tsuas yog kev tswj hwm hauv nroog, yog li kuv ntxiv kuv tus kheej MQTT-based domotics daws. Nws yeej ua tib yam nkaus, tab sis qhov sib txawv tseem ceeb yog:
- tus naj npawb PWM ua ntej nrog Arduino yog 255, nrog ESP8266 nws yog 1023 (raws li kuv pom tom qab, tag nrho sim txiav txim siab vim li cas kuv cov teeb pom kev zoo LED tsis nce mus rau 100% ci ntsa iab …)
- Kuv tsis tau siv 'Totempole' Circuit nrog 2 transistors, txij li PWM yog DC lawm, thiab ua haujlwm tau zoo nrog IRF 540.
- Kuv tsis tau siv lub 10k rub-up resistors rau tus encoder, Kuv ntseeg qhov rub tawm ntawm ESP8266.
- ESP8266 siv 3.3 volt logic siv 5 volt rau Arduino, uas ua pov thawj tsis muaj teeb meem rau IRF540
Lub software muaj cov yam ntxwv hauv qab no:
- tig lub encoder yuav dim lub teeb (CW) lossis qis (CCW), los ntawm 0 txhua txoj hauv kev mus rau 100%, hauv 1023 cov kauj ruam, nrog qee qhov ua kom nrawm dua hauv qib qis.
- nias lub pob yuav qhib lub teeb thaum nws tawm, siv qib kawg ci ci ci, lossis tua nws thaum nws nyob.
- nias lub pob kom ntev dua thaum lub teeb ci yuav txuag qhov ci tam sim no raws li qib pib.
- nias lub pob kom ntev dua thaum lub teeb tawm yuav tig lub teeb mus rau 100% qhov ci, tsis hloov pauv qib pib.
- Nws yuav txuas rau WiFi teeb tsa txhais los ntawm 'SECRET_SSID' thiab 'SECRET_PASS' cov hlua, uas tau khaws tseg hauv cov ntawv cais hauv kuv daim duab, hu ua 'secrets.h'
- Nws yuav txuas rau MQTT server hauv WiFi network, siv 'MQTTSERVER' thiab 'MQTTPORT' cov hlua hauv tib cov ntawv.
- Koj tuaj yeem siv MQTT cov ncauj lus nkag 'domus/esp/in' los teeb tsa cov lus txib: 'ON' lossis 'OFF' kom qhib lub teeb lossis tua, lossis tus nqi ntawm 0 txog 1023 txhawm rau hloov qhov ci ci.
- Nws yuav tshaj tawm lub xeev ntawm MQTT cov ncauj lus 'domus/esp/uit' (ON lossis OFF status) thiab 'domus/esp/uit/brightness' (tus nqi ci ci).
Pom zoo:
PWM ESP32 - Dimming LED Nrog PWM ntawm ESP 32 Nrog Arduino IDE: 6 Kauj Ruam
PWM With ESP32 | Dimming LED Nrog PWM ntawm ESP 32 Nrog Arduino IDE: Hauv cov lus qhia no peb yuav pom yuav tsim PWM cov cim nrog ESP32 siv Arduino IDE & PWM feem ntau yog siv los tsim cov txiaj ntsig sib piv los ntawm ib qho MCU thiab cov txiaj ntsig sib piv tuaj yeem yog txhua yam ntawm 0V txog 3.3V (thaum esp32) & los ntawm
Arduino Cov Khoom Siv Hluav Taws Xob Nrog 3.3v, 5v thiab 12v Cov Kev Xaiv Tso Tawm (Ntu-2): 3 Cov Kauj Ruam
Arduino Power Supply Shield Nrog 3.3v, 5v thiab 12v Cov Kev Xaiv Tso Tawm (Ntu-2): Hav! Yog tias koj tsis tau nyeem Tshooj-1, NYEM QHOV NO.Peb pib … Thaum tsim cov phiaj xwm hluav taws xob, lub zog hluav taws xob yog ib qho tseem ceeb tshaj plaws
Hloov Lub Teeb + Ntxuam Dimmer hauv Ib Pawg Nrog ESP8266: 7 Cov Kauj Ruam (nrog Duab)
Teeb Hloov + Ntxuam Dimmer hauv Ib Pawg Nrog ESP8266: Hauv qhov kev qhia no koj yuav kawm paub tsim koj tus kheej lub teeb hloov thiab kiv cua dimmer hauv tsuas yog ib lub rooj tsavxwm nrog lub microcontroller thiab WiFi module ESP8266 Qhov no yog qhov haujlwm zoo rau IoT.Cautions : Lub voj voog no tswj hwm AC qhov hluav taws xob tseem ceeb, yog li ua tib zoo saib xyuas
Arduino Cov Khoom Siv Hluav Taws Xob Nrog 3.3v, 5v thiab 12v Cov Kev Xaiv Tso Tawm (Ntu-1): 6 Cov Kauj Ruam
Arduino Power Supply Shield Nrog 3.3v, 5v thiab 12v Cov Kev Xaiv Tso Tawm (Ntu-1): Nyob zoo cov phooj ywg! Kuv rov qab los nrog lwm Cov Lus Qhia.Thaum tsim kho cov phiaj xwm hluav taws xob, lub zog siv hluav taws xob yog ib qho tseem ceeb tshaj plaws ntawm tag nrho txoj haujlwm thiab ib txwm xav tau ntau lub zog hluav taws xob tso tawm. Qhov no yog vim qhov sib txawv
Yuav Tsim Li Cas 2d Tus Cwj Pwm Nrog Tus Cwj Pwm Tus Cwj Pwm hauv Unreal Engine 4 Siv Cov Ntawv Pom Zoo rau PC: 11 Kauj Ruam
Yuav Ua Li Cas Tsim Tus 2d Tus Cwj Pwm Nrog Tus Tswj Tus Cwj Pwm hauv Unreal Engine 4 Siv Cov Ntawv Pom Zoo rau PC: Yuav ua li cas los tsim 2d Tus Cwj Pwm nrog tus cwj pwm tswj hauv Unreal cav 4 siv cov ntawv pom rau PC Nyob zoo, Kuv yog Jordan Steltz. Kuv tau tsim kho cov vis dis aus ua si txij li thaum kuv muaj 15. Phau ntawv qhia no yuav qhia koj li cas los tsim tus yam ntxwv yooj yim nrog rau hauv