Cov txheej txheem:

Smart Pill Box (IDC2018IOT): 8 Kauj Ruam
Smart Pill Box (IDC2018IOT): 8 Kauj Ruam

Video: Smart Pill Box (IDC2018IOT): 8 Kauj Ruam

Video: Smart Pill Box (IDC2018IOT): 8 Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
Image
Image
Ntse Pill Box (IDC2018IOT)
Ntse Pill Box (IDC2018IOT)

Nov yog Jonathan Braslaver thiab Maor Stamati qhov haujlwm kawg hauv IDC's IOT chav kawm xyoo 2018.

Hauv Cov Lus Qhia no koj yuav taug kev hla cov kauj ruam los tsim IoT ntse lub thawv tshuaj ntsiav. Nov yog daim ntawv ua haujlwm tiav nrog cov yam ntxwv hauv qab no:

1. Nws xa SMS mus rau tus neeg siv yog tias qhov ntsuas kub lossis av noo hauv lub thawv siab dhau.

2. Nws taws teeb coj hauv qhov tshuaj ntsiav zoo thaum nws txog sijhawm rau tus neeg siv tshuaj nws cov tshuaj.

3. Kev hloov pauv thaum tus neeg siv khoom noj nws cov tshuaj los ntawm qhov chaw.

4. Yog tias tus neeg siv tsis nco qab noj nws cov tshuaj, tom qab ib teev ceeb toom SMS tau xa.

5. Xa ntawv ceeb toom rau hnub Saturday kom rov ntim lub thawv dua.

Peb cia siab tias cov khoom no tuaj yeem ceeb toom tib neeg kom noj lawv cov tshuaj raws sijhawm, thiab pab lawv khaws nws kom raug.

Kauj Ruam 1: Qhov:

1. Node MCU board.

2. dht22 kub thiab av noo sensor

3. MPR121, Kev Sib Thooj Capacitive Touch Sensor Controller

4.7 leds yooj yim.

6. Tin Ntawv Nyiaj

9. Cov Kab Xev.

10. Ib lub thawv nrog 7 qhov sib piv.

Kauj Ruam 2: Tsim Ntsiav Tshuaj Siv Cov Ntawv Scheudle

Tsim Ntsiav Tshuaj Siv Scheudle Cov Ntaub Ntawv
Tsim Ntsiav Tshuaj Siv Scheudle Cov Ntaub Ntawv

Cov ntaub ntawv yog nyob rau hauv hom json, nws cov array ntawm arrays, txhua array yog ib hnub ntawm lub lim tiam, txhais tau tias cov array ntawm 0 yog hnub sunday thiab cov array ntawm 5 yog Friday.

Cov kev hloov pauv ntawm cov kab yog cov hlua ntawm daim ntawv "HH: MM" zoo li "14:00".

Koj tuaj yeem tsim cov ntaub ntawv mannauly lossis programmatticaly nrog koj txoj kev nyiam.

khaws txoj hauv kev ntawm cov ntawv hauv koj lub khoos phis tawj raws li peb yuav xav tau rau yav tom ntej.

Kauj Ruam 3: Txuas Lub Rooj Tsav Xwm thiab Cov Cheeb Tsam:

Txuas lub Rooj Tswjhwm Saib thiab Cheebtsam
Txuas lub Rooj Tswjhwm Saib thiab Cheebtsam
Txuas lub Rooj Tswjhwm Saib thiab Cheebtsam
Txuas lub Rooj Tswjhwm Saib thiab Cheebtsam
Txuas lub Rooj Tswjhwm Saib thiab Cheebtsam
Txuas lub Rooj Tswjhwm Saib thiab Cheebtsam

1. Cover sab hauv ntawm txhua lub ntsiav tshuaj sib piv nrog cov ntawv ci, kom ntseeg tau tias lawv tsis kov ib leeg.

Cov ntawv ci tin yuav ua tus coj, yog li thaum koj noj ib ntsiav tshuaj thiab kov lub qhov me me qhov sib xyaw ua ke yuav ua.

2. ua raws cov txheej txheem txuas nrog:

(tam sim no nws txhawb tsuas yog 5 leds, koj tuaj yeem ntxiv ntxiv nrog mux)

3. muab cov leds tso tom qab txhua qhov chaw.

4. txuas cov ntaub ntawv 0-6 ntawm MPR121 rau txhua qhov chaw ntim cov ntawv ci.

Kauj Ruam 4: Tsim Io.adafruit Account

Tsim Io.adafruit Account
Tsim Io.adafruit Account

io.adafuit yuav cia koj siv lawv MQTT server dawb!

Mus rau https://accounts.adafruit.com/users/sign_up thiab sau npe, tsim cov txau hauv qab no raws li pom hauv daim duab.

tshaj li luam koj li AIO KEY.

Kauj Ruam 5: Ntsuas Code Rau Hauv Koj Lub Rooj Tswjhwm Saib

nco ntsoov teeb tsa koj adafruit mqtt server cov ntsiab lus ntawm no:

// MQTT SERVER CONFIG

#define AIO_USERNAME "koj lub npe siv"

#define AIO_KEY "koj tus yuam sij"

thiab koj cov ntsiab lus wifi:

// WIFI teeb tsa#txhais WLAN_SSID "lub npe network"

#define WLAN_PASS "tus password"

Kauj Ruam 6: IFTT

IFTT
IFTT
IFTT
IFTT
IFTT
IFTT

IFTTT (YOG Qhov No Yog Li No) yog qhov kev pabcuam pub dawb hauv web los tsim cov saw ntawm cov lus yooj yim raws li txoj cai, hu ua applets. Ib qho applet tau tshwm sim los ntawm kev hloov pauv uas tshwm sim hauv lwm qhov kev pabcuam hauv web xws li Gmail, Facebook, Telegram, Instagram, lossis Pinterest.

Peb yuav siv IFTT los tsim webhook uas thaum hu los ntawm HTTP so yuav xa SMS rau tus neeg siv.

1. tsim kuv tus lej IFTT.

2. Nyem rau "Kuv Applets" thiab dua li ntawm Applet tshiab, thiab chooe Webhooks ua thawj ntu, rau qhov siv SMS thib ob.

3. saib cov teeb tsa los ntawm daim duab.

Kauj ruam 7: NodeRed

NodeRed
NodeRed

Node-RED yog lub cuab yeej rau kev txuas ua ke cov cuab yeej kho vajtse, APIs thiab kev pabcuam online hauv txoj hauv kev tshiab thiab nthuav.

Nws muab qhov browser-based editor uas ua rau nws yooj yim rau xaim ua ke siv ntau yam ntawm cov nodes hauv cov xim uas tuaj yeem xa mus rau nws lub sijhawm ua haujlwm hauv ib-nias.

Thawj:

  1. Rub tawm thiab ua raws cov lus qhia teeb tsa los ntawm
  2. Tua tawm ntawm-liab los ntawm
  3. Rub cov ntawv nodes.json thiab hloov cov hauv qab no:
  • IFTTT_KEY nrog koj tus lej IFTTT
  • IFTTT_USER nrog koj li IFTTT lub npe neeg siv
  • PATH_TO_File nrog txoj hauv kev ntawm cov ntawv teev sijhawm.

nyem rau ntawm lub kaum sab xis saum toj -> ntshuam -> ntawv los xij thiab paster cov ntsiab lus ntawm cov ntawv txuas nj.json

Qhov tshwm sim yuav tsum zoo li daim duab txuas.

5 ntws yuav raug tsim:

1. khiav txhua 10 feeb -> nyeem cov ntawv teev sijhawm -> hloov mus rau js cov khoom -> txheeb xyuas yog tias koj xav tau tshuaj ntsiav nyob rau 10 feeb tom ntej -> txwv rau 1 msg rau 10 feeb -> xa hnub code -> mqtt tshaj tawm rau tus coj noj.

2. tau txais hnub ntawm lub lim tiam -> yog hnub Saturday HTTP hu rau IFTT kom xa SMS rau tus neeg siv los sau cov tshuaj ntsiav.

3. mloog ntawm mqtt cov av noo pub -> txwv rau ib qho lus txhua 3 teev -> ntxiv cov av noo mus rau IFTTT url -> hu rau IFTTT kom xa SMS.

4. 3. mloog ntawm mqtt qhov ntsuas kub -> txwv rau ib qho lus txhua 3 teev -> hu rau IFTTT kom xa SMS.

5. Mloog mqtt tsis hnov qab pub -> hu rau IFTTT kom xa SMS.

Kauj Ruam 8: Cov Teeb Meem & Kauj Ruam Tom ntej

Peb muaj qee qhov kev cov nyom siv mqttt server, thawj zaug peb tau sim khiav ib qho hauv zos uas tsis zoo li ua haujlwm (thaiv cov chaw nres nkoj) yog li peb siv huab ib.

Tsis tas li peb tam sim no txwv rau 5 leds qhov peb xav tau 7, peb tau sim siv lub mux tab sis nws kuj tsis zoo li ua haujlwm.

Kauj Ruam Ntxiv:

Ua haujlwm zoo UI kom teem sijhawm noj tshuaj.

Tau txais lub thawv tshuaj ntsiav tshuaj uas tsis muaj cov ntawv ci thiab cov laug cam zais.

Peb vam tias koj pom peb cov kev txwv muaj txiaj ntsig thiab txaus siab tsim lub phiaj xwm no!

Pom zoo: