Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Nta
- Kauj ruam 2: PCB
- Kauj ruam 3: Sib dhos
- Kauj Ruam 4: Txheej Txheem Txheej Txheem
- Kauj ruam 5: Cov tswv yim
- Kauj Ruam 6: Cov Lus Qhia
- Kauj ruam 7: Logging
- Kauj ruam 8: Buzzer
- Kauj Ruam 9: Kev Sib Txuas IoT Sab Nraud
- Kauj ruam 10: Siv
- Kauj ruam 11: Cov phiaj xwm yav tom ntej
Video: ESP32 Ntse Tsev Hub: 11 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Tsim kom muaj cov kab ke uas tuaj yeem lis ntau cov ntaub ntawv sensor, muaj ntau yam tawm, thiab txuas rau internet lossis hauv lub network siv sijhawm ntev thiab siv zog ntau. Txhua zaus dhau los, tib neeg xav ua lawv tus kheej lub tsev ntse hauv tsev sib tw nrog kev muaj peev xwm nrhiav thiab sib sau ua ke cov khoom siv sib xyaw rau hauv cov kab ke loj dua. Tias yog vim li cas kuv xav ua lub modular thiab feature-nplua nuj platform uas yuav ua rau nws yooj yim los tsim IoT-txuas nrog cov ntsuas thiab tso tawm.
Ua tsaug rau DFRobot thiab PCBGOGO.com rau kev txhawb nqa txoj haujlwm no!
Yog xav paub cov ntaub ntawv ntxaws ntxiv, mus saib Github repo:
Khoom siv
-
DFRobot ESP32 FireBeetle
www.dfrobot.com/product-1590.html
-
DHT22 Sensor
www.dfrobot.com/product-1102.html
-
APDS9960 Lub Teeb thiab Gesture Sensor
www.dfrobot.com/product-1361.html
-
I2C 20x4 LCD Module
www.dfrobot.com/product-590.html
-
Analog RGB LED Sawb
www.dfrobot.com/product-1829.html
- DRV8825 Stepper Tsav Tsheb
- SD Card Nyeem Ntawv
- NEMA17 Stepper Tsav
Kauj ruam 1: Nta
Lub hauv paus tseem ceeb ntawm pawg thawj coj no yog ESP32 FireBeetle Development Board uas saib xyuas txhua qhov kev sib txuas lus, kev nyeem ntawv sensor, thiab kev tso tawm. Muaj ob tus neeg tsav tsheb tsav tsav uas tswj ob lub tshuab hluav taws xob bipolar.
Lub tsheb npav I2C kuj tseem tawg tawm rau siv nrog cov khoom siv xws li APDS9960 lossis LCD. Txog kev nyeem qhov kub thiab txias, muaj cov pins tawg txhawm rau txuas rau DHT22 lub ntsuas pa, nrog rau lub tshuab ntsuas hluav taws xob rau nyeem cov teeb pom kev ib puag ncig.
Muaj kev txhawb nqa rau lub teeb pom kev zoo sib xws ntawm lub rooj tsavxwm, uas muaj peb MOSFETs rau nws kom tsav lub teeb ci LED.
Kauj ruam 2: PCB
Kuv pib txheej txheem PCB tsim los ntawm kev xub tsim cov phiaj xwm hauv Eagle. Txij li thaum kuv tsis tuaj yeem nrhiav ESP32 FireBeetle lub tsev qiv ntawv, Kuv tsuas yog siv ob tus pin 1x18 tus pin headers xwb. Tom qab ntawd, kuv tsim lub zog tswj hluav taws xob uas tuaj yeem lees txais 12v dhau los ntawm DC lub tog raj kheej thiab hloov nws mus rau 5v rau lub zog ntsuas hluav taws xob thiab ESP32.
Tom qab cov phiaj xwm tau ua tiav, Kuv tau txav mus rau tsim PCB nws tus kheej.
Kuv paub tias DC lub qhov ntsaws ntsaws yuav tsum nyob ze ntawm lub hauv ntej ntawm pawg thawj coj saib, thiab 100uF lub hwj chim muab lub zog ua kom lub zog tsim nyog yuav tsum tau nyob ze rau ntawm stepper lub cev muaj zog tsav lub zog nkag. Tom qab txhua yam tau teeb tsa, kuv pib taug txoj hauv kev.
Thaum Oshpark ua cov PCBs zoo, lawv cov nqi raug siab heev. Ua tsaug, PCBGOGO.com kuj ua rau PCBs zoo ntawm tus nqi pheej yig. Kuv muaj peev xwm yuav kaum PCBs rau tsuas yog $ 5, ntau dua li them $ 52 rau tsuas yog peb lub laug cam los ntawm Oshpark.com.
Kauj ruam 3: Sib dhos
Zuag qhia tag nrho, sib dhos lub rooj tsavxwm tau yooj yim heev. Kuv pib los ntawm kev siv cov khoom siv sib txuas rau saum npoo, thiab tom qab ntawd txuas lub tog raj txuas txuas thiab tus tswj hwm. Tom ntej no, Kuv tau siv lub taub hau tus pin rau cov khoom siv xws li cov tsav tsheb thiab FireBeetle.
Tom qab qhov muag tau ua tiav lawm, Kuv tau sim lub rooj tsav xwm rau luv Circuit Court los ntawm kev tso lub multimeter rau hauv kev ntsuas-ntsuas hom thiab pom tias qhov kev tiv thaiv dhau ib qho nyiaj. Pawg thawj coj tau dhau mus, yog li kuv thiaj tuaj yeem txuas rau txhua qhov khoom siv.
Kauj Ruam 4: Txheej Txheem Txheej Txheem
Kuv xav kom cov cai rau pawg thawj coj no tau hloov pauv thiab siv tau yooj yim. Qhov no txhais tau tias muaj ntau chav kawm uas ua haujlwm tshwj xeeb, nrog rau chav kawm qhwv loj uas suav nrog qhov me me.
Kauj ruam 5: Cov tswv yim
Txog kev tuav tswv yim, kuv tsim chav kawm hu ua "Hub_Inputs", uas cia lub tsev hauv tsev sib txuas lus nrog APDS9960, nrog rau kev tsim thiab tswj cov nyees khawm thiab muaj peev xwm kov tau cuam tshuam. Nws muaj cov haujlwm hauv qab no:
Tsim khawm
Tau yog tias khawm raug nias
Tau tus lej ntawm nias lub pob
Tau txais tes taw tseeb
Tau txais tus nqi kov tau
Cov nyees khawm tau khaws cia ua tus qauv, nrog peb tus cwj pwm: is_pressed, numberPresses, thiab tus pin. Txhua lub pob, thaum tsim, txuas nrog kev cuam tshuam. Thaum qhov kev cuam tshuam ntawd cuam tshuam, Cov Kev Pab cuam cuam tshuam (ISR) tau hla lub pob ntawd tus pointer (muab raws li lub cim xeeb chaw nyob ntawm nws hauv kab ntawv khawm) thiab nce tus lej ntawm cov nias lub pob, nrog rau hloov kho is_pressed Boolean tus nqi.
Capacitive kov qhov tseem ceeb yog qhov yooj yim dua. Lawv tau khaws los ntawm kev hla tus lej kov mus rau touchRead () ua haujlwm.
Qhov kev taw qhia zaum kawg tau hloov kho tshiab los ntawm kev pov npav APDS9960 thiab tshawb xyuas yog tias tau pom lub ntsej muag tshiab, thiab yog tias ib tus tau kuaj pom, teeb tsa tus kheej piav tes piav taw sib txawv rau qhov piav tes piav taw.
Kauj Ruam 6: Cov Lus Qhia
Lub tsev ntse hauv tsev muaj ntau txoj hauv kev los tso tawm cov ntaub ntawv thiab hloov teeb. Muaj tus pin uas tsoo I2C npav, cia cov neeg siv txuas lub LCD. Txog tam sim no, tsuas yog ib qhov loj me ntawm LCD tau txais kev txhawb nqa: 20 x 4. Los ntawm kev siv lub luag haujlwm "hub.display_message ()", cov neeg siv tuaj yeem tso tawm cov lus ntawm LCD los ntawm kev hla cov khoom siv.
Kuj tseem muaj tus pin header txuas cov hlua ntawm analog LEDs. Hu rau qhov ua haujlwm "hub.set_led_strip (r, g, b)", teeb cov xim ntawm kab txaij.
Ob lub tshuab hluav taws xob stepper tau tsav siv ib khub DRV8825 tsav tsheb tsav. Kuv txiav txim siab siv Lub Tsev Qiv Ntawv BasicStepper los tswj lub cev muaj zog. Thaum lub rooj tsav nkoj tau nce, ob lub khoom siv stepper tau tsim, thiab ob lub tshuab ua haujlwm tau qhib. Txhawm rau nqis tes ua txhua lub cav, "hub.step_motor (motor_id, cov kauj ruam)" ua haujlwm, qhov twg lub cav id yog 0 lossis 1.
Kauj ruam 7: Logging
Vim tias pawg thawj coj muaj ntau lub ntsuas, kuv xav tau lub peev xwm los sau thiab teev cov ntaub ntawv hauv cheeb tsam.
Txhawm rau pib nkag mus, cov ntaub ntawv tshiab tau tsim nrog "hub.create_log (npe lub npe, lub npe)", qhov twg lub taub hau tau siv los ua CSV cov ntawv ua kab uas qhia txog kab ntawv. Thawj kab ntawv ib txwm yog timestamp hauv Xyoo Ib Hlis Hnub Teev: Min: Sec format. Txhawm rau kom tau sijhawm, hub.log_to_file () muaj nuj nqi tau txais sijhawm nrog lub hauv paus_functions.get_time () muaj nuj nqi. Lub sijhawm txheej txheem tm yog tom qab ntawd dhau los ntawm kev siv rau hauv kev ua haujlwm logging, nrog rau cov ntaub ntawv thiab cov ntaub ntawv npe.
Kauj ruam 8: Buzzer
Dab tsi yog IoT pawg thawj coj saib zoo yog tias koj tsis tuaj yeem ntaus nkauj? Tias yog vim li cas kuv suav nrog lub suab nrov nrog lub luag haujlwm los ua suab. Hu "hub.play_sounds (suab paj nruag, ntev, ntev)" pib ua ib zaj nkauj, nrog suab paj nruag yog ib qho ntawm cov ntawv ceeb toom zaus, lub sijhawm raws li kab lus ntawm kev sau tseg, thiab ntev raws li tus lej sau tseg.
Kauj Ruam 9: Kev Sib Txuas IoT Sab Nraud
Lub hauv paus tam sim no txhawb IFTTT webhooks. Lawv tuaj yeem tshwm sim los ntawm kev hu rau Hub_IoT.publish_webhook (url, cov ntaub ntawv, xwm txheej, tus yuam sij) lossis Hub_IoT.publish_webhook (url, cov ntaub ntawv) ua haujlwm. Qhov no xa POST thov mus rau URL muab nrog cov ntaub ntawv txuas nrog, nrog rau lub npe txheej xwm yog tias tsim nyog. Txhawm rau teeb tsa piv txwv IFTTT kev koom ua ke, ua ntej tsim ib qho tshiab applet. Tom qab ntawd xaiv qhov kev pabcuam webhook uas ua rau thaum thov tau txais.
Tom ntej no, hu rau qhov xwm txheej "high_temp" thiab txuag nws. Tom qab ntawv, xaiv Gmail kev pabcuam rau ntu "Ntawd", thiab xaiv "Xa email rau kuv tus kheej" xaiv. Hauv qhov teeb tsa rau qhov kev pabcuam, muab "Qhov kub siab!" rau qhov kev kawm, thiab tom qab ntawd kuv tso "Ntsuas ntsuas kub ntawm {{Tus nqi 1}} ntawm {{tshwm sim tshwm sim}}", uas qhia qhov ntsuas kub thiab lub sijhawm thaum qhov xwm txheej tau tshwm sim.
Tom qab teeb tsa nws, tsuas yog muab lub webhook URL uas tau tsim los ntawm IFTTT, thiab tso "high_temp" hauv ntu ntu.
Kauj ruam 10: Siv
Txhawm rau siv Smart Home Hub, tsuas yog hu rau cov haujlwm xav tau hauv kev teeb tsa () lossis voj (). Kuv twb tau muab piv txwv ua haujlwm hu, xws li luam tawm lub sijhawm tam sim no thiab hu rau IFTTT kev tshwm sim.
Kauj ruam 11: Cov phiaj xwm yav tom ntej
Smart Home Hub system ua haujlwm tau zoo heev rau kev siv lub tsev yooj yim thiab ua haujlwm cov ntaub ntawv. Nws tuaj yeem siv tau rau yuav luag txhua yam, xws li teeb tsa xim ntawm cov kab LED, saib xyuas qhov kub ntawm chav, txheeb xyuas yog tias lub teeb pom kev, thiab tag nrho cov tswv ntawm lwm txoj haujlwm muaj peev xwm. Yav tom ntej, Kuv xav nthuav kev ua haujlwm ntau ntxiv. Qhov no tuaj yeem suav nrog ntxiv cov vev xaib muaj zog dua, cov ntaub ntawv hauv zos, thiab txawm tias Bluetooth lossis mqtt.
Pom zoo:
DIY Ntse Qhov Rooj Qhov Rooj Qhov Rooj + Tsev Pabcuam Hauv Tsev: 5 Kauj Ruam
DIY Ntse Lub Qhov Rooj Qhov Rooj + Lub Tsev Pabcuam Kev Sib Koom: Tig koj lub qhov rooj qhov rooj ib txwm ntse siv qhov haujlwm DIY no. Kuv yuav qhia koj yuav tsim nws li cas thiab tswj nws siv Tsev Pabcuam (dhau MQTT) thiab muaj peev xwm qhib thiab kaw koj lub qhov rooj ntawm qhov chaw deb.Kuv yuav siv ESP8266 pawg thawj coj hu ua Wemos
Ua Lub Tsev Tswj Xyuas Ntse Tsev ntawm STONE HMI Disp: 23 Cov Kauj Ruam
Ua Smart Home Control System ntawm STONE HMI Disp: Kev qhia ua haujlwm Cov lus qhia hauv qab no qhia koj yuav siv STONE STVC050WT-01 kov zaub module ua kom yooj yim tswj cov cuab yeej siv hauv tsev
Yuav Ua Li Cas Ntse Tsev Siv Arduino Control Relay Module - Lub Tswv Yim Hauv Tsev Automation: 15 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Ntse Tsev Siv Arduino Control Relay Module | Lub Tswv Yim Ua Lag Luam Hauv Tsev: Hauv qhov haujlwm ua haujlwm hauv tsev no, peb yuav tsim lub tsev ntse hloov chaw uas tuaj yeem tswj tau 5 yam khoom siv hauv tsev. Qhov kev hloov pauv no tuaj yeem tswj tau los ntawm Txawb lossis smartphone, IR chaw taws teeb lossis TV nyob deb, Kev hloov pauv ntawm tes. Qhov kev tshaj tawm ntse no tseem tuaj yeem paub txog r
Lub Hnab Ntse Hnab Ntse Ntse Computer: 4 Kauj Ruam (nrog Duab)
Lub Hnab Ntse Hnab Ntse Ntse Computer: Qhov no yog "hnab looj tes ntse" nas lub computer uas tuaj yeem siv nrog ib lub PC, Mac, lossis Linux computer. Nws tau tsim los siv Binho Nova ntau tus txheej txheem USB host adapter, uas tso cai rau koj txuas cov ntsuas thiab lwm yam khoom siv rau koj lub khoos phis tawj thiab tom qab ntawd txuas ntxiv
Ntse Ruaj Ntseg Koj Lub Tsev Ntse: 14 Kauj Ruam
Ntse Ruaj Ntseg Koj Lub Tsev Ntse: Kuv tab tom sib tw rau kev sib tw nyab xeeb thiab nyab xeeb. Yog tias koj nyiam kuv cov lus qhia thov pov npav rau nws! Kuv yuav qhia koj li cas yooj yim thiab pheej yig kom ruaj ntseg koj lub tsev thiab ib puag ncig. Nws muaj ntu uas koj yuav kawm paub yuav ua li cas: 1. Configure koj