Cov txheej txheem:

Totoro Project - IoT & MQTT & ESP01: 7 Cov Kauj Ruam (nrog Duab)
Totoro Project - IoT & MQTT & ESP01: 7 Cov Kauj Ruam (nrog Duab)

Video: Totoro Project - IoT & MQTT & ESP01: 7 Cov Kauj Ruam (nrog Duab)

Video: Totoro Project - IoT & MQTT & ESP01: 7 Cov Kauj Ruam (nrog Duab)
Video: Totoro project - IoT - 2024, Kaum ib hlis
Anonim
Totoro Project - IoT & MQTT & ESP01
Totoro Project - IoT & MQTT & ESP01
Totoro Project - IoT & MQTT & ESP01
Totoro Project - IoT & MQTT & ESP01

Totoro Project nws yog qhov zoo IoT project koj tuaj yeem luam tawm hauv ntau lwm daim ntawv sib txawv.

Siv ESP01 pawg thawj coj, nrog MQTT raws tu qauv, koj tuaj yeem sib tham txog cov xwm txheej ntawm khawm mus rau MQTT Broker (hauv kuv rooj plaub AdafruitIO).

Phau ntawv qhia muaj txiaj ntsig zoo rau MQTT thiab Adafruit:

Koj tuaj yeem siv txhua tus MQTT Broker koj xav tau thiab zoo ib yam rau khawm ua haujlwm.

Nws ua haujlwm li cas?

Txhua lub cuab yeej hauv network txuas nrog ntawm MQTT Broker thiab nyeem cov channel hu ua "love_box".

Thaum koj nias lub pob ntawm ib lub cuab yeej, nws xa cov lus ntawm cov channel, thiab lwm yam khoom siv ntsais tus coj. Txog thaum koj tsis nias lub pob, lub cuab yeej ntsais muag.

Nrog rau cov kab ke no koj tuaj yeem xa me ntsis "blare" mus rau lwm lub cuab yeej.

Kauj Ruam 1: Cov Khoom Siv

Cov Khoom
Cov Khoom
Cov Khoom
Cov Khoom
Cov Khoom
Cov Khoom

Txhawm rau tsim txoj haujlwm no koj xav tau qee yam khoom:

  1. ESP01 pawg thawj coj saib

    Pab tau - Tus programmer rau ESP01 (DIY)

  2. 3D qauv

    1. Totoro - https://goo.gl/n3mAsi -
    2. Meshmixer - https://goo.gl/qqMzh - rau kev ua qauv txhua yam qauv 3D
  3. Cov khoom siv hluav taws xob

    1. LM317 tus tswj hluav taws xob
    2. Resistors: 150ohm, 270ohm, 10K thiab 68ohm.
    3. Capacitors: 10 uF
    4. Coj - lossis coj sab hauv -
    5. Mini Pushbutton Hloov
  4. Solder
  5. Protoboard
  6. Poj Niam Headers
  7. Pob tshab 3D filament
  8. Fais fab mov

    BNC txuas - https://goo.gl/DrD8k2 -

  9. Qee Cov Xov

Kauj ruam 2: Ua Protoboard

Ua tus Protoboard
Ua tus Protoboard
Ua tus Protoboard
Ua tus Protoboard
Ua tus Protoboard
Ua tus Protoboard
Ua tus Protoboard
Ua tus Protoboard

Lub zog rau pawg thawj coj saib:

Coj tus protoboard thiab muab cov khoom sib txuas ua ke raws li thawj daim duab.

Qhov teeb tsa no tau tso cai LM317 - https://goo.gl/VtzNz -to tsim nyob ib puag ncig 3.4 volt rau ESP01.

Lus Nug: vim li cas kuv thiaj siv tsis tau LM7805?

Teb: LM780x series tsis ua haujlwm qis dua 5 volt, thiab nws tsis tuaj yeem tsim 3.3 volt.

Thaum koj ua tiav, txheeb xyuas qhov hluav taws xob tso tawm nrog lub multimeter. Nws yuav tsum nyob ib puag ncig 3.4 volt thiab 4.3 volt.

Rau lub zog siv hluav taws xob koj tuaj yeem siv 5V fais fab mov lossis loj dua. Kuv pom zoo kom koj tsis txhob siv ntau dua 9 volts, nws ua kom sov ntau - lub zog poob -!

Pawg thawj coj:

ESP01 yog pawg thawj coj ntawm koob ESP, nws me me thiab siv tau, tab sis tsis yog tus neeg siv zoo heev.

Nco ntsoov, koj siv tsis tau Arduino pins los sib tham ncaj qha rau ESP01, vim tias nws yog 3.3 volt pins kam rau ua.

Nws yog qhov muaj txiaj ntsig zoo ua tus programmer rau kev tsim lub ESP01 nrog FTDI:

Siv daim duab thib ob los ua phau ntawv qhia thiab nco tshwj xeeb tus lej ua haujlwm, duab thib peb, pom hauv phau ntawv qhia saum toj no.

Yog xav paub ntxiv nyeem 1 ° cov kauj ruam ntawm phau ntawv qhia no:

Yog tias koj yog neeg Italis, koj tuaj yeem nyeem kuv phau ntawv qhia rau ESP01 thiab FTDI DIY:

Ua kom tiav Protoboard:

Cov duab plaub yog qhov ua tiav ntawm txoj haujlwm ntawm daim ntawv tiv thaiv.

Kuv pom zoo kom Tus Poj Niam Headers rau txuas lub rooj tsavxwm mus rau lub protoboard. Tsuas yog qee yam ua tsis raug, koj tuaj yeem txuas dua lwm lub rooj tsavxwm.

Tsis txhob txuas lub pob thiab nws tus tiv thaiv, peb yuav ua nws tom qab.

Kauj Ruam 3: MQTT Broker - Adafruit IO

MQTT Broker - Adafruit IO
MQTT Broker - Adafruit IO
MQTT Broker - Adafruit IO
MQTT Broker - Adafruit IO

MQTT Broker yog "server" rau tag nrho koj cov lus, los ntawm thiab rau cov khoom siv. Ua tib zoo saib thawj daim duab.

Yog xav paub ntxiv, siv phau ntawv qhia muaj txiaj ntsig no:

Hauv kuv qhov xwm txheej, kuv siv Adafruit IO, tab sis koj tuaj yeem siv txhua MQTT Broker koj xav tau.

Mus rau Adafruit IO thiab sau npe.

Tam sim no koj yuav tsum tsim lub dashboard tshiab thiab:

  • Ntxiv Pub - https://goo.gl/z2Npto -

    Rau kuv tus lej yog "love_box"

  • Ntxiv cov thaiv - https://goo.gl/YJsCqX -

    • Momentary Button: txuas rau "love_box" nrog Nias Tus Nqi = 1 thiab Tso Tus Nqi = 0
    • Kab Kab: txuas rau "love_box" nrog Y-Axis Yam tsawg kawg = 0 thiab Y-Axis Max = 2

Thaum kawg koj yuav muaj qee yam zoo li daim duab thib ob.

Lus Nug: vim li cas thiaj tseem ceeb heev lub npe "love_box" hauv lub dashboard?

Teb: hauv MQTT Broker - Ada IO - koj tau tsim cov channel hu ua "love_box", thiab yog tias hauv txoj cai koj siv lwm cov channel, MQTT yuav tsis ua haujlwm.

Kauj ruam kawg ntawm MQTT Broker - Ada IO - yog "AIO KEY". Ntawm lub dashboard, nyem rau ntawm sab xis sab xis tseem ceeb me me.

Tam sim no theej "Tus Neeg Siv Npe" thiab "Tus yuam sij nquag" thiab sau lawv rau ntawm Arduino Code.

Kauj ruam 4: Arduino Code

Arduino Txoj Cai
Arduino Txoj Cai
Arduino Txoj Cai
Arduino Txoj Cai

Nruab ESP Core rau Arduino IDE:

Cov lus qhia tseem ceeb yog qhov no: https://goo.gl/yAqlU4 thiab ua raws li "Txhim Kho nrog Tus Thawj Tswj Xyuas Haujlwm".

Tam sim no saib ntawm thawj daim duab. Cov Dub version ntawm ESP01 muaj 1MB flash disk loj thiab version xiav muaj 512k. Txhais li cas? Saib ntawm daim duab thib ob, koj yuav tsum xaiv qhov tseeb "Flash loj".

Arduino Code nyob hauv qhov chaw cia khoom no: Txoj cai kom meej meej nyeem.

Nco ntsoov kho:

  • AIO_USERNAME
  • AIO_KEY
  • Wifi_number

Yog tias koj txiav txim siab kho qhov "Adafruit_MQTT_Publish" thiab "Adafruit_MQTT_Subscribe" channel, koj yuav tsum kho tib kab thiab hu ua hauv txoj cai.

Kauj Ruam 5: Meshmixer thiab 3D Luam

Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam
Meshmixer thiab 3D Luam

3D qauv

Rau kuv qhov project kuv xav tau tus qauv 3D ntawm Totoro.

Kuv pom nws nyob ntawm ntau yam, ntawm qhov txuas no:

Koj tuaj yeem siv txhua tus qauv 3D koj xav tau, cov kauj ruam tom ntej yog tib yam.

Plhaub

Nws yog lub sijhawm los teeb tsa Meshmixer. Nrog cov cuab yeej muaj zog no, koj tuaj yeem ua lub plhaub rau koj txoj haujlwm.

Ntshuam hauv Meshmixer Totoro STL, thiab siv Hollow tool:

Hauv tib lub cuab yeej, nco ntsoov ua Qhov Qhov Hiav Txwv nyob tom qab.

Tam sim no koj yuav tsum txiav tus qauv ib nrab siv Plane Cut tool:

Siv lub pob export kom xa tawm qhov qis dua.

Thaum kawg, koj yuav tsum txiav tawm pob ntseg. Xaiv lub pob ntseg thiab siv cov cuab yeej cais - tsib daim duab -.

Siv lub pob ntshuam xa tawm pob ntseg.

Rov qab mus rau ib nrab tus qauv saum toj kawg nkaus thiab siv Erase & Fill tool: https://goo.gl/d4LR76 - rau daim duab -.

3D luam tawm

Kuv nyiam luam cov ntawv ib zaug, nco ntsoov siv cov ntsiab lus 3D pob tshab!

Kauj Ruam 6: Sib dhos

Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke

Laum ib lub qhov rau saum taub hau. Lub qhov no yog qhov yuav tsum tau muab tso rau sab hauv lub pob.

Thaiv lub pob nrog cov kua nplaum kub, thiab ntsuas qhov kev sib txuas nrog lub multimeter hauv hom txuas ntxiv mus.

Nqa pob ntseg thiab ntxiv ib qho me me rau hauv qab, siv kub xiav lossis super nres. Txiav daim yog nws siab dhau.

Tam sim no koj tuaj yeem txuas lub pob thiab nws tus tiv thaiv raws li cov txheej txheem ntawm theem 2.

Thawj xeem

Nco ntsoov tsis txhob kaw tus qauv 3D ua ntej ntsuas qhov ua haujlwm raug!

Nias lub pob ntawm Adafruit IO thiab sab hauv coj yuav tsum ntsais muag, kom txog thaum koj nias lub pob ntawm pob ntseg.

Rov ntsuas dua nrog khawm ntawm pob ntseg.

Kauj ruam 7: Npaj Mus

Image
Image
Npaj Mus
Npaj Mus

Thaum kawg qhov no yog qhov txiaj ntsig kawg.

- Nqe lus nug: koj puas tau siv sab hauv coj los sab nrauv liab coj?

- Teb: hauv daim duab thiab yees duab no kuv tau siv sab hauv coj. Txhawm rau kom meej dua, LED liab yog lub zog coj - koj tsis tuaj yeem kaw - thiab xiav LED yog sab hauv coj. Sab hauv coj thiab coj sab nraud, hauv kuv lub tswv yim, yog tus pin tib yam.

- Lus nug: Kuv puas tuaj yeem siv nws ntawm lub network tsis paub?

- Teb: tsis yog koj ua tsis tau. Koj yuav tsum rov tsim dua ESP01, vim tias pawg thawj coj no tsis muaj chaw rau OTA.

Cov ntaub ntawv ntau ntxiv rau OTA:

Tab sis koj tuaj yeem ua qhov tuab: ntxiv qhov tshwj xeeb txuas ID thiab tus lej rau koj tus kheej Hotspot ntawm koj lub xov tooj!

Pom zoo: