Cov txheej txheem:

LEIDS - Tsawg Zog IOT Qhov Rooj Sensor: 8 Kauj Ruam (nrog Duab)
LEIDS - Tsawg Zog IOT Qhov Rooj Sensor: 8 Kauj Ruam (nrog Duab)

Video: LEIDS - Tsawg Zog IOT Qhov Rooj Sensor: 8 Kauj Ruam (nrog Duab)

Video: LEIDS - Tsawg Zog IOT Qhov Rooj Sensor: 8 Kauj Ruam (nrog Duab)
Video: YWJ KOJ SIAB Official music video by: Dang Thao 2024, Kaum ib hlis
Anonim
LEIDS - Tsawg zog IOT Qhov Rooj Sensor
LEIDS - Tsawg zog IOT Qhov Rooj Sensor

LEIDS yog dab tsi?

LEIDS yog IOT sensor uas yog nyob ib puag ncig ESP8266. Qhov ntsuas no ua rau siv lub rooj tsav xwm no, lub latching me me, hloov lub reed, thiab qee cov hlau nplaum los tsim lub qhov rooj sensor uas yuav xa kev ceeb toom rau koj thaum koj lub qhov rooj qhib thiab kaw. Qhov ntsuas no tuaj yeem txuas rau koj li MQTT server, IFTTT, lossis ntau lwm yam txheej txheem uas txhawb nqa ESP8266. Cov lus qhia no yuav siv IFTTT kom yooj yim tsim lub ntsuas uas yuav xa ntawv ceeb toom rau koj lub xov tooj ntawm tes tsis hais koj nyob qhov twg. Lub ntsuas kuj tseem tuaj yeem teeb tsa kom tso cai rau ntau qhov ceeb toom los ntawm qhov rooj sib cais, lub thawv xa ntawv, lub qhov cub thiab lwm yam uas muaj qhib/kaw lossis qhib/tawm ntawm lub cev. Qhov txiaj ntsig ntawm LEIDS yog nws siv lub zog me me thiab tsuas yog siv lub zog thaum lub qhov rooj qhib, tom qab ntawd thaum lub qhov rooj raug kaw nws xa lus ceeb toom rau koj lub qhov rooj raug kaw thiab tawm mus. Qhov no zoo dua li pw tsaug zog qhov qauv vim nws tsis siv lub zog yog tias lub qhov rooj tsis qhib.

Kauj Ruam 1: Cov khoom siv

Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv

Cov npe hauv qab no qhia cov cuab yeej thiab ntu uas kuv siv rau txoj haujlwm no. Lub sensor tuaj yeem rov tsim dua los siv qhov sib txawv thiab saib/ua haujlwm sib txawv thiab tsuas yog siv cov ntsiab lus zoo sib xws.

Cov Cuab Yeej:

  • Soldering Hlau
  • ESP01-UART lossis Arduino Uno (programmer rau ESP8266)
  • 3D tshuab luam ntawv (yeem)
  • Jumper cables (yeem)
  • Breadboard (yeem)

Qhov:

  • ESP8266 ESP-01S x 1
  • Reed Hloov x 1 (zoo dua NC, Kuv tsuas tuaj yeem pom ib txwm qhib yog li yuav tsum siv ob lub hlau nplaum kom nws ua haujlwm li qub raug kaw)
  • AMS1117 3.3v Tus Tswj
  • 2n3904 NPN Transistor x 1
  • P-Channel Mosfet x 1 (peb xav tau qee yam uas muaj VGS qis, nyiam dua NDP6020P)
  • 3.7v 100 mAh Lipo roj teeb x 1
  • Assorted Resistors (100k ohm, 10k ohm, 220 ohm, 3k3 Ohm)
  • 6x3mm Hlau nplaum x 2
  • Ob Chav Sided mounting daim kab xev
  • Hlau
  • Solder
  • Perfboard

3D Luam Qhov Chaw:

Case rau sensor

Kauj Ruam 2: Lub Latching Circuit ទន់ - Kho vajtse

Mos Latching Circuit - Kho vajtse
Mos Latching Circuit - Kho vajtse

Lub voj voos me me uas kuv siv yog kev hloov pauv ntawm cov txheej txheem uas kuv pom hauv online. Kuv tsis yog tus kws tshaj lij thiab kuv ntseeg tias muaj txoj hauv kev zoo dua los tsim qhov Circuit Court no tab sis rau kuv lub hom phiaj qhov Circuit no ua haujlwm!

Txoj hauv kev nws ua haujlwm yog tias thaum lub reed switched raug kaw los ntawm qhov chaw sib nqus nws tso cai rau tam sim no rau NPN transistor. NPN transistor ua rau thaj chaw PNP mosfet uas tso cai rau tam sim no ntws mus rau ESP8266. ESP8266 lub zog siv, siv ib qho ntawm nws tus pin los khaws PNP mosfet hauv av uas txuas ntxiv rau lub zog ESP8266. Tom qab ntawd thaum ESP8266 ua tiav nrog nws cov haujlwm, nws teeb tsa tus pin rau LOW uas cuam tshuam NPN transistor thiab kaw lub qhov rooj ntawm PNP mosfet.

Los ntawm kev siv hluav taws xob xws li qhov no ESP8266 tuaj yeem siv tau los ntawm kev hloov pauv, thiab tom qab ntawd tuaj yeem ua kom nws tus kheej tawm ntawm qhov teeb liab. Qhov no tso cai rau kev kos duab tsis muaj qhov tam sim no thaum lub kaw lus kaw/tawm.

Kauj Ruam 3: ESP8266 - Kho vajtse

ESP8266 - Kho vajtse
ESP8266 - Kho vajtse

ESP8266 uas kuv tab tom siv yuav xa cov lus ceeb toom thaum lub qhov rooj (lossis lwm yam) qhib thiab tom qab ntawd yuav tos lub qhov rooj kaw kom xa cov lus kaw thiab kaw nws tus kheej. ESP8266 yuav muab hluav taws xob los ntawm lub latch muag muag thiab yuav siv ib tus pin los nyeem qhov hloov pauv reed thiab lwm tus pin kom nws tus kheej ua haujlwm thiab tom qab ntawd tig nws tus kheej tawm. Kuv xaiv siv ESP-01s vim nws yog daim ntawv me. ESP yuav xa lub vev xaib thov ceeb toom rau peb thaum lub ntsuas ntsuas tau hloov mus rau "qhib" thiab "kaw". Txoj hauv kev yooj yim tshaj plaws uas kuv pom yog siv IFTTT thiab Google Sheets. Qhov no tau piav qhia hauv cov theem hauv qab no.

Kauj Ruam 4: IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1

IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 1

Hauv cov lus qhia no yuav siv IFTTT thiab siv webhooks thiab google nplooj ntawv kom tau txais cov ntawv ceeb toom nyob deb ntawm peb lub xov tooj ntawm tes. Txhawm rau siv cov kev pabcuam no koj yuav xav tau cov hauv qab no:

  • Ib tus account Google
  • Tus lej IFTTT (tuaj yeem/yuav tsum nkag mus nrog Google tus lej)
  • Daim ntawv thov IFTTT rau koj lub xov tooj ntawm tes

Thaum koj tau tsim/nkag rau hauv koj tus as khauj peb yuav tsim ob lub applets. Cov duab nyob rau sab saum toj ntawm ntu no qhia yuav ua li cas maneuver lub vev xaib. Cov theem hauv qab no yog rau thawj applet, qhov kev tshwm sim raug rho tawm haujlwm thov. Daim ntawv thov no yuav tau txais cov lus los ntawm lub ntsuas thiab khaws qhov xwm txheej hauv Google daim ntawv. Tom qab ntawd koj tuaj yeem saib keeb kwm ntawm koj lub sensor thiab pom thaum nws tau qhib thiab kaw.

  1. Mus rau qhov "Kuv Applets" txuas nyob rau saum toj
  2. Nyem rau "New Applet" khawm
  3. Nyem rau ntawm xiav "+qhov no" khawm
  4. Tshawb rau "webhooks" thiab nyem rau nws
  5. Ntawm nplooj ntawv tom ntej xaiv daim npav "Tau txais lub vev xaib thov"
  6. Tom qab ntawd teeb tsa lub npe txheej xwm rau txhua yam koj xav tau, Kuv tau xaiv lub npe nws "sensor_activated"
  7. Ntawm nplooj ntawv hauv qab no nyem qhov xiav "+ntawd" khawm
  8. Tshawb nrhiav qhov "Google nplooj ntawv" kev pabcuam thiab xaiv nws
  9. Ntawm nplooj ntawv hauv qab no xaiv qhov "Ntxiv kab rau daim ntawv nthuav qhia" ua haujlwm
  10. Sau qhov kev txiav txim raws li hauv qab no:

    • Spreadsheet Name, Kuv lub npe hu ua kuv "Sensor History"
    • Formatted row yuav tsum zoo li cov hauv qab no

      {{Tshwm sim}} ||| {{Tus nqi 1}} ||| {{Tus nqi 2}}

    • Tawm hauv thaj chaw kawg li tsuas yog koj xav hloov qhov applet yuav txuag qhov xwm txheej ntawm lub ntsuas cua
  11. Tom qab ntawd nyem "Tsim Ua"
  12. Thaum kawg nyem "Ua tiav" ntawm qhov screen kawg

Tam sim no cia sim tias nws ua haujlwm

  1. Mus rau qhov txuas no
  2. Tom qab ntawv nyem rau ntawm "Cov ntaub ntawv" khawm (peb yuav siv nplooj ntawv "Cov ntaub ntawv" dua tom qab)
  3. Tam sim no koj yuav nyob ntawm koj tus kheej ntu rau IFTTT Webhooks applet
  4. Sau rau hauv daim teb uas nws hais "{event}" nrog lub npe ntawm koj qhov xwm txheej hauv qhov xwm txheej no lub npe txheej xwm yog "sensor_activated"
  5. Tam sim no sau rau hauv "tus nqi 1" teb, qhov no yog daim teb uas yuav tuav qhov chaw ntawm koj lub sensor, Kuv yuav sau nws nrog "Hauv ntej lub qhov rooj"
  6. Tam sim no sau rau hauv "tus nqi 2" teb, qhov no yog daim teb uas yuav muaj cov xwm txheej ntawm lub ntsuas cua, Kuv yuav mus sau nws nrog "qhib" tsuas yog rau kev sim
  7. Tom qab ntawv nyem lub pob "Test it" xiav
  8. Yog tias txhua yam mus tau zoo ces koj yuav tsum tau txais ntsuab "Kev tshwm sim tau tshwm sim." lus nyob saum
  9. Tam sim no yog tias koj xav pom yuav ua li cas nws khaws koj cov lus, koj tuaj yeem qhib koj nplooj ntawv google thiab nrhiav daim ntawv nthuav tawm uas nws tau ntxiv, Kuv tau txuas daim duab los qhia tias daim ntawv nthuav tawm yuav zoo li cas

Tam sim no mus rau qib tom ntej ntxiv ib qho applet los ceeb toom rau peb ntawm kev hloov pauv xwm txheej.

Kauj Ruam 5: IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2

IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2
IFTTT rau Cov Ntawv Ceeb Toom Chaw Nyob - Ntu 2

Tam sim no peb yuav ntxiv applet los ceeb toom rau peb thaum cov xwm txheej daim ntawv nthuav tawm tau txais kab ntxiv; hauv lwm lo lus, thaum lub ntsuas hluav taws kub tawm ntawm qhov xwm txheej. Raws li ua ntej peb yuav tsim cov applet tshiab. Cov theem hauv qab no yuav qhia koj hauv kev tsim cov applet thib ob. Txij li thaum peb tau ua qee yam zoo sib xws hauv cov kauj ruam dhau los kuv tsuas yog ntxiv cov swb uas sib txawv rau cov kauj ruam no.

  1. Mus rau qhov "Kuv Applets" txuas nyob rau saum toj
  2. Nyem rau "New Applet" khawm
  3. Nyem rau xiav "+qhov no" khawm
  4. Tshawb rau "google nplooj ntawv" thiab nyem rau ntawm nws
  5. Ntawm nplooj ntawv tom ntej xaiv daim npav "Kab tshiab tau ntxiv rau daim ntawv nthuav qhia"
  6. Tom qab ntawd sau daim teb txhawm rau taw tes rau daim ntawv nthuav qhia uas lwm daim ntawv thov sau rau

    • Hauv qhov piv txwv no txoj kev yog "IFTTT/MakerWebooks/sensor_activated"
    • Cov ntaub ntawv npe yog "Keeb Kwm Sensor"
  7. Ntawm nplooj ntawv hauv qab no nyem qhov xiav "+ntawd" khawm
  8. Tshawb nrhiav qhov "ceeb toom" kev pabcuam thiab xaiv nws
  9. Tam sim no peb yuav tsum ua daim ntawv ceeb toom kev pabcuam

    • Lub npe hloov mus rau

      {{ColumnB}} yog {{ColumnC}}

    • Cov lus tau teem rau

      {{ColumnB}} yog {{ColumnC}} ntawm {{ColumnA}}

    • Qhov txuas txuas yog nyob ib leeg
  10. Tom qab ntawd nyem "Tsim Ua"
  11. Thaum kawg nyem "Ua tiav" ntawm qhov screen kawg

Txhawm rau sim ntu thib ob ntawm IFTTT qhov kev ceeb toom kom ntseeg tau tias koj tau rub tawm IFTTT app ntawm koj lub xov tooj ntawm tes thiab nkag mus nrog koj li ntaub ntawv pov thawj. Hauv kuv qhov xwm txheej kuv tau nkag nrog kuv tus lej google. Tam sim no peb tuaj yeem sim qhov no los ntawm kev rov qab mus rau nplooj ntawv "Cov ntaub ntawv" thiab tua tawm qhov kev sim nrog lub npe txheej xwm teeb tsa "sensor_activated", "tus nqi 1" teb teeb rau qhov chaw, thiab "tus nqi 2" teb teeb rau qhov xwm txheej.

Qhov no yuav tsum xa ntawv ceeb toom rau koj. Yog tias koj tsis tau txais ib qho kom paub tseeb tias koj tau nkag mus nrog tib tus as khauj thiab koj tau tso cai rau daim ntawv thov xa koj cov ntawv ceeb toom.

Kauj Ruam 6: Arduino IDE thiab Sketch

Arduino IDE thiab Sketch
Arduino IDE thiab Sketch
Arduino IDE thiab Sketch
Arduino IDE thiab Sketch

Lub software siv rau pawg thawj coj tau suav nrog siv Arduino IDE.

Logic yog raws li hauv qab no:

  • Lub qhov rooj qhib tau qhib los ntawm kev qhib lub qhov rooj
  • Tom qab ntawd ESP tau qhib thiab txuas rau WiFi
  • Thaum lub WiFi txuas tau tsim los nws xa http thov (xa cov lus txib rau hauv is taws nem) uas qhia peb tias lub qhov rooj lossis lwm yam tau qhib lawm
  • Tom qab ntawd nws nyeem lub teeb liab los ntawm tus ntoo thuv hloov los txiav txim seb lub qhov rooj puas tau raug kaw
  • Thaum ESP pawg thawj coj pom tias lub qhov rooj qhib qhib (piv txwv li lub qhov rooj raug kaw) nws xa lwm qhov http thov uas qhia peb lub qhov rooj raug kaw
  • Tom qab ntawd nws taw qhia lub latch me me kom txiav lub zog rau lub rooj tsavxwm

Rub tawm Arduino IDE

Kuv tau txuas cov lej arduino rau ntu no rau koj rub tawm. Yog tias koj tsis muaj Arduino IDE koj tuaj yeem rub nws online ntawm

Txhim kho tus thawj tswj hwm tsim nyog

Txhawm rau xa cov cai rau koj pawg ESP koj yuav tsum teeb tsa tus thawj tswj hwm hauv Arduino IDE siv cov theem hauv qab no.

  • Mus rau Cov Ntaub Ntawv> Nyiam los qhib lub qhov rai nyiam
  • Hauv qhov rai nyiam nrhiav thaj chaw uas hais tias "Tus Thawj Saib Xyuas Haujlwm Ntxiv URLs"
  • Muab cov ntawv txuas hauv qab no tso rau hauv daim teb no https://arduino.esp8266.com/stable/package_esp8266com_index.json thiab nias lub pob "OK"
  • Tam sim no qhib cov thawj coj tswj hwm los ntawm kev mus rau Cov Cuab Yeej> Pawg Thawj Coj, tom qab ntawv nkag mus thawj zaug yuav yog Tus Thawj Saib Xyuas Haujlwm
  • Ntaus "ESP8266" hauv cov ntawv qhia zaub mov thiab teeb tsa "esp8266" Kuv xaiv version 2.5.0 raws li kuv tau muaj qee qhov teeb meem nrog cov kho tshiab
  • Tam sim no rov qab thiab xaiv koj pawg thawj coj los ntawm Cov Cuab Yeej> Pawg Thawj Coj> Cov Qauv ESP8266
  • Tom qab ntawd kaw tawm thiab rov qhib lub tswv yim arduino kom paub tseeb tias qhov kev hloov pauv tshwm sim

Qhib cov duab kos hauv Arduino IDE

Peb yuav tsum hloov kho plaub kab ntawm txoj cai yog li lub sensor yuav ua haujlwm rau koj

  1. Hloov SSID rau koj li WiFi SSID aka lub npe ntawm koj lub wifi
  2. Hloov tus password kom phim tus password rau koj li wifi
  3. Hloov qhov url kom phim qhov url los ntawm nplooj ntawv "Cov Ntaub Ntawv" ntawm qhov kev pabcuam "webhook"
  4. Hloov qhov chaw ntawm lub ntsuas mus rau qhov chaw uas koj npaj yuav tso nws, qhov no tuaj yeem yog lub qhov rooj, lub qhov rooj tom qab, lub thawv xa ntawv, thiab lwm yam.

Tam sim no koj tau hloov kho cov cai kom haum rau koj cov kev xav tau peb yuav tsum thauj nws mus rau ntawm lub rooj tsavxwm. Hauv kuv qhov xwm txheej Kuv tab tom siv USB programmer thiab ua raws cov lus qhia rau nws. Qhov no tuaj yeem xav tau ntau qhov kev daws teeb meem yog li kuv hais qhia koj saib hauv online kom paub ntau ntxiv hauv kev qhia tob. Hauv kuv qhov xwm txheej kuv ntsaws ESP-01s rau tus programmer, tom qab ntawd kuv ntsaws nws rau hauv lub khoos phis tawj, tom qab ntawd kuv tig qhov hloov pauv los ntawm uart mus rau prog, thaum kawg kuv tshem tawm thiab ntsaws tus programmer rov qab rau hauv. Tam sim no tam sim no tawm ESP hauv kev ua haujlwm hom. Tam sim no kuv tsuas yog nyem rau ntawm pob upload thiab cia qhov upload tiav. Yog tias koj xav pom yog tias nws txuas nrog, koj tuaj yeem qhib lub ntsuas saib thiab saib cov xwm txheej cov lus. Thaum koj tau rub tawm daim duab peb yuav muab txhua yam sib dhos ua ke, muab tso rau hauv lub thawv ntawv, thiab teeb nws rau peb qhov chaw xav tau.

Kauj Ruam 7: Cov Ntaub Ntawv (Luam 3D)

Cov Ntaub Ntawv (Luam 3D)
Cov Ntaub Ntawv (Luam 3D)
Cov Ntaub Ntawv (Luam Tawm 3D)
Cov Ntaub Ntawv (Luam Tawm 3D)
Cov Ntaub Ntawv (Luam 3D)
Cov Ntaub Ntawv (Luam 3D)

Kuv tau tsim cov kab ntawv hauv qab no kom haum rau txhua qhov khoom siv, tso cai rau kev tso cov hlau nplaum thiab kho qhov hloov pauv. Qhov thib ob yog tsuas yog siv los tuav lub hlau nplaum thib ob uas yuav tso cai rau qhib qhov qhib thiab kaw.

Thaum tag nrho cov khoom sib dhos ua ke peb tuaj yeem nias lawv rau hauv rooj plaub, yog tias koj xav tau koj tuaj yeem ntxiv cov kua nplaum kub rau hauv qab kom tuav txhua yam hauv. tus reed hloov raws li qhov tsim nyog. Lwm lub hlau nplaum yuav tsum tau nias rau hauv lwm lub thawv. Thaum ob lub thawv ntawv ua tiav peb tuaj yeem sim nws los ntawm muab ob daim ntawv thaiv ua ke, tom qab ntawd cais lawv thiab coj rov qab los ua ke. Tam sim no peb yuav tsum tau txais ob daim ntawv ceeb toom ib qho rau qhib lub sensor, thiab ib qho rau sensor kaw. Khaws ob qho ua ke kom lub roj teeb txhob ntws.

Txuas daim kab xev rau sab nraum qab ntawm lub ntsuas cua thiab siv lawv ntawm qhov chaw xav tau. Kuv ntsia kuv ntawm kuv lub mailbox. Tam sim no sim tias qhov ua kom raug yog qhov tseeb thiab lub sensor tuaj yeem xa cov lus qhib thiab kaw.

Voila, tam sim no koj muaj koj tus kheej lub sensor los ceeb toom koj thaum nws tau qhib thiab kaw. Qhia rau kuv paub yog tias koj nyiam nws thiab yog tias muaj dab tsi uas koj xav tias tuaj yeem txhim kho.

Kuv kuj tseem xa cov lus qhia no rau IOT kev sib tw kom ntseeg tau tias nyiam thiab pov npav rau qhov no thiab lwm yam IOT cov haujlwm koj tau nyiam

Kauj Ruam 8: Kev txhim kho yav tom ntej

Txog qhov haujlwm no kuv tau ntsib ob peb yam teeb meem. Thawj qhov teeb meem kuv tau ntsib yog kev siv mosfet uas muaj Vgs siab dhau lawm yog li kuv yuav tsum hloov mus rau qhov sib txawv. Qhov thib ob, qhov hloov pauv reed kuv siv yog ib txwm qhib thiab hauv kuv qhov xwm txheej ib txwm kaw qhov hloov pauv tau yooj yim dua rau kev siv thiab yuav tau txuag chaw ntau. Thaum kawg esp 01s nyuaj heev rau ua haujlwm nrog thiab kuv yuav tsum cuam tshuam nrog gpio pins kom nws ua haujlwm tau zoo tab sis kuv tseem muaj qee qhov teeb meem. Kuv xav tias txoj haujlwm no muaj peev xwm qhia kuv ntau lub tswv yim thiab tau pab kuv los nrog cov tswv yim ntau ntxiv thiab kev coj ua siv esp8266 cov laug cam thiab IFTTT.

IoT Kev Sib Tw
IoT Kev Sib Tw
IoT Kev Sib Tw
IoT Kev Sib Tw

Khiav Tawm hauv IoT Challenge

Pom zoo: