Cov txheej txheem:

Autonomous Plant Watering System: 4 Kauj Ruam
Autonomous Plant Watering System: 4 Kauj Ruam

Video: Autonomous Plant Watering System: 4 Kauj Ruam

Video: Autonomous Plant Watering System: 4 Kauj Ruam
Video: How to make an Automated Watering System! Automating a Greenhouse with LoRa! (Part 3) 2024, Kaum ib hlis
Anonim
Autonomous Plant Watering System
Autonomous Plant Watering System
Autonomous Plant Watering System
Autonomous Plant Watering System
Autonomous Plant Watering System
Autonomous Plant Watering System

Txoj haujlwm no nthuav tawm cov txheej txheem cog qoob loo cog qoob loo zoo. Lub kaw lus muaj kev ywj pheej hauv kev siv lub roj teeb 12v thiab lub hnub ci vaj huam sib luag, thiab ywg dej rau cov nroj tsuag thaum cov xwm txheej raug raug teeb tsa tag nrho, nrog kev xav zoo (Kuv vam tias) tsis ua pov thawj. Nws yog qhov ntse vim nws tau sib tham nrog cov neeg siv los ntawm Telegram app.

Cov kauj ruam ua raws li qhov system yog raws li hauv qab no:

  • cov dej hauv av ib txwm saib xyuas;
  • yog tias cov av cov ntsiab lus qis dua tus nqi (max_soil_moisture), cov kab ke:

    • (?) tshuaj xyuas lub tank dej tsis khoob (thiab thaum lub sijhawm) cov dej tshwm sim kom tsis txhob muaj kev puas tsuaj rau lub twj tso kua mis qhuav;
    • (?) txheeb xyuas lub sijhawm dej tsawg kawg ntawm ob qhov xwm txheej dej ntau tshaj. Qhov no yog ua kom tsis txhob ywg dej cov nroj tsuag ntau zaus nyob rau nruab hnub (zoo dua muaj qhov qhuav me ntsis ntawm qee lub sijhawm), thiab ntxiv qee qhov kev nyab xeeb yog tias cov av noo noo tau tawg lawm;
    • (?) pib dej;
    • nres dej thaum twg los xij:

      • (?) cov ntsiab lus dej hauv av nce mus txog tus nqi tshwj xeeb (max_soil_moisture) lossis;
      • (?) lub tank dej tsis muaj dab tsi, qhov dej yuav rov pib dua sai li sai tau, thiab
      • (?) lub sijhawm tso dej ntau tshaj lub sijhawm ntev tshaj plaws tso cai rau txhua qhov dej ywg dej (watering_max_time). Lub hom phiaj ntawm no yog kom tsis txhob khiav lub twj tso kua mis kom txog thaum lub tank dej tsis muaj dab tsi yog tias muaj qhov xau hauv cov kab ke uas yuav tiv thaiv kom cov av noo tuaj ntxiv;
  • (?) txheeb xyuas tias cov nroj tsuag tau ywg dej tsawg kawg txhua lub sijhawm muab sijhawm (max_wo_water), kom zam lawv kom tuag yog piv txwv. cov av noo sensor tau tawg thiab rov qab los ib txwm muaj nuj nqis;

Tus neeg siv tau ceeb toom los ntawm Telegram cov lus ntawm txhua kauj ruam tseem ceeb (qhia tau?) Tus neeg siv kuj tseem tuaj yeem ua rau tus kheej tshwm sim dej los ntawm Telegram, txawm tias cov av cov ntsiab lus dej siab dua li tus nqi muab (max_soil_moisture). Nws kuj tseem tuaj yeem tig tag nrho lub kaw lus ON thiab OFF, nug yog tias lub kaw lus tau nce thiab khiav, lossis nug tus nqi tam sim no ntawm cov av cov ntsiab lus (saib Telegram snapshot).

Khoom siv

Khoom siv

Nov yog cov npe khoom uas siv los tsim cov kab ke. Kuv yuav tsum hais tias kuv tsis tau txais kev txhawb siab los ntawm Amazon, los ntawm txhua yam khoom tau yuav.

Txhawm rau tswj cov kab ke:

  • NodeMCU board (ESP8266) rau lub hlwb, 17.99 €
  • Relay module, 11.99 €
  • 120 tsab xov xwm jumper xov hlau, 6.99 € -> kev tsim qauv
  • 3 lub rooj noj mov, 8.99 € -> qauv ua qauv
  • Lub thawv tsis muaj dej, 10.99 €
  • 525 daim resistors cov khoom siv, 10.99 €
  • Luam PCB nrog kev sib txuas zoo ib yam li lub khob cij, 9.27 €
  • Cov xov hluav taws xob xaim hluav taws xob 20, 22 lossis 24 AWG nyob ntawm koj nyiam (20 yog qhov muaj zog dua tab sis xav tau kom txo qis rau qee qhov kev sib txuas, 22 yog qhov zoo, 24 yog qhov pheej yig dua), 18.99 €

Rau kev ywj pheej hauv lub zog:

  • Roj teeb 12V, 21.90 €
  • 10W wp 12V monocrystalline hnub ci vaj huam sib luag, 23.90 €
  • 12/24V tus tswj hwm tus nqi, 13.99 €

Rau lub tank dej:

  • 12V dej twj, 16.99 €
  • DC txiv neej/poj niam txuas (txuas lub twj tso kua mis), 6.99 €

Cov sensors:

  • Dej theem dej, 7.99 €
  • Capacitive av noo sensor, 9.49 €
  • qee tus ntsia thawv txhuam rau kev tiv thaiv cov av noo noo, 7.99 €;

Thiab cov dej ntws:

Dej tso dej, 22.97 €

Rau tag nrho ntawm 237.40 €. Qhov ntawd tsis pheej yig! Tab sis nco ntsoov tias nws tseem pheej yig dua li kev tsim ua ntej, thiab muaj peev xwm ntau dua! Tsis tas li, qee qhov tsuas yog rau kev tsim qauv (15.98 €), thiab kuv tau yuav ntau yam khoom siv hauv pab pawg ntawm ntau daim rau lwm txoj haujlwm, xws li 525 tus tiv thaiv yog qhov vwm, koj tsis xav tau 3 NodeMCU cov laug cam, lossis 6 qhov txuas rau qhov haujlwm no.

Kauj ruam 1: Code

Txhawm rau rov tsim txoj haujlwm no, koj yuav xav tau qee yam cuab yeej, qee yam khoom siv, thiab cov cai los ntawm txoj haujlwm no.

Code

Txhawm rau kom tau txais txoj cai los ntawm txoj haujlwm no, yog clone nws (lossis zoo dua, diav rawg nws) los ntawm Github chaw cia khoom siv GIT, thiab yog tias koj tsis paub tias GIT yog dab tsi, clone thiab diav rawg txhais li cas, tsuas yog rub tawm nws ntawm koj lub computer siv qhov txuas no?.

Tom qab ntawd, teeb tsa nws raws li koj xav tau!

Txhawm rau siv Telegram, NodeMCU xav tau txuas nrog internet. Kuv tau ua nws siv nws WIFI module thiab kuv lub tsev WIFI. Txhawm rau teeb tsa koj tus kheej kev sib txuas, qhib tsab ntawv plant_watering.ino hauv Arduino IDE, thiab sau qhov tsis muaj txiaj ntsig rau koj li ntawv pov thawj wifi (Kuv xav tias koj muaj WiFi):

String ssid = "xxxxx"; // Lub npe ntawm koj li Wifi String pass = "xxxxx"; // Wifi Password

Tom qab ntawd, peb yuav teeb Telegram bot, uas yog tus neeg siv nyiaj me ntsis zoo li koj muaj, tab sis ua tau los ntawm tus neeg hlau (koj li NodeMCU). Txhawm rau ua qhov no, ua raws cov theem tau piav qhia ntawm no. Hauv ob peb lo lus:

  • Qhib Telegram (thiab txuas nrog koj tus lej nyiaj);
  • Tsim tus bot tshiab:

    • Tshawb BotFather hauv koj cov neeg (ntaus nws hauv kab ntawv tshawb fawb), thiab qhib kev sib tham nrog nws (zoo li koj tau ua nrog ib qho kev sib cuag tshiab);
    • Ntaus /newbot hauv kev sib tham (saib rau rooj plaub thiab suav nrog /!)
    • Npe koj tus bot raws li koj xav tau, tab sis xaus nws nrog "bot" (piv txwv li "watering_balcony_bot");
    • Botfather muab tus cim bot rau koj, khaws nws zais cia (tsis txhob qhia nws siv GIT !!), Peb yuav siv nws hauv ob peb kauj ruam;
    • Tshawb nws hauv koj cov neeg, thiab xa nws cov lus no: /pib
    • Luam theken rov qab los ntawm Botfather thiab muab nws tso rau ntawm koj cov ntawv plant_watering.ino ntawm no:

      String token = "xxxxxx: xxxxxxxxxxxxxxxxxxxxxxx"; // Telegram bot token

Koj tus bot tam sim no muaj sia nyob!

Txhawm rau muab nws lub peev xwm los sib tham nrog koj, nws yuav tsum paub koj li kev sib tham ID. Vim tias peb xav kom tuaj yeem qhia qhov bot tau hais nrog lwm tus neeg thaum peb tawm mus so, Kuv nyiam tsim cov pab pawg sib tham xwb. Yog li tsim ib (Pab Pawg Tshiab), ntxiv koj tus bot los ntawm kev tshawb nrhiav nws lub npe, thiab ntxiv thib peb lub npe hu ua IDBot ib ntus. Tom qab ntawd npe koj pawg sib tham raws li koj xav tau. Qhib koj pab pawg sib tham, thiab ntaus /getgroupid. IDBot yuav rov qab tus lej xws li -xxxxxxxxx (tsis txhob hnov qab rho tawm thaum koj luam nws!), Qhov ntawd yog koj pab pawg sib tham ID!

Koj tseem tuaj yeem nug /getid kom tau txais koj tus lej ID, yog li koj tus bot yuav xa xov ncaj qha rau koj xwb (tsis xa nws mus rau pab pawg)

Luam tus ID, thiab muab tshuaj txhuam rau ntawm koj daim ntawv cog qoob loo_watering.ino ntawm no:

int chatID = -0000000000; // Nov yog tus lej ID ntawm koj pab pawg sib tham Muab tshuaj txhuam /getid ntawm no hloov yog tias koj xav kom tus bot xa cov lus ncaj qha rau koj

Tom qab ntawd, tshem IDBot los ntawm koj pab pawg tsuas yog nyob rau hauv rooj plaub (peb tsis xav tau cov ntaub ntawv xau).

Rau cov kauj ruam kawg, koj yuav tsum teeb tsa CTBot thiab ArduinoJson cov tsev qiv ntawv. Txhawm rau ua li ntawd, ntaus ctrl+maj+I, tshawb CTBot, thiab tshawb rau CTBot los ntawm Stefano Ledda, thiab nyem rau nruab. Tom qab ntawd rov ua dua rau ArduinoJson, thiab tshawb rau ArduinoJson los ntawm Benoit Blanchon, tab sis teeb tsa lub version 5.13.5 rau tam sim no vim tias CTBot tsis sib haum nrog rau qib thib rau tsis tau (koj tuaj yeem tshawb xyuas ntawm no yog tias muaj kev hloov pauv).

Thiab qhov ntawd yog nws, koj cov cai tau npaj lawm! Tam sim no koj tuaj yeem xa nws mus rau NodeMCU! Yog tias muaj qee qhov yuam kev, txheeb xyuas tias koj tau xaiv NodeMCU 1.0 raws li pawg thawj coj saib, thiab tias koj siv cov ntawv raug rau koj lub tsev qiv ntawv.

Kauj Ruam 2: Cov Cuab Yeej

Cov cuab yeej

Cov cuab yeej yooj yim heev, Kuv siv rau qhov haujlwm no:

  • Ib lub raj hlau + tin (piv txwv li 220V 60W);
  • Multimeter (kuv yog TackLife DM01M);
  • Ib tus ntsia hlau ncaj (me me zoo dua);
  • Txiav pliers;

Yog tias koj muaj lawv koj tseem tuaj yeem ntxiv qee cov hlua hlau, tab sis lawv tsis yog qhov tseem ceeb.

Kauj ruam 3: Sib dhos

Los ua ke
Los ua ke

Koj tuaj yeem pom qhov sib dhos ntawm cov khoom siv Fritzing los qhib Fritzing qhov haujlwm hauv Github chaw cia khoom.

NB: NodeMCU txuas nrog lub hnub ci tus tswj hwm los ntawm USB cable (ib qho hauv qhov tsis muaj ib qho). Saib ntu Cov Khoom rau piv txwv ntawm kev tswj lub hnub ci nrog USB.

Kuv tau ua txhua qhov kev cai muaj nyob hauv daim nplaub tshev fritzing los ntawm Github txoj haujlwm (txhua qhov tuaj yeem pom hauv is taws nem tshwj tsis yog cov ntab dej vim kuv tau ua nws).

Kauj Ruam 4: Kev lees paub

Kuv xav lees paub kuv tus khub zoo uas cia kuv ua qhov no thaum hnub so! Thiab ntawm chav kawm txhua tus tsim khoom uas ua rau txoj haujlwm ua tau, xws li @shurillu rau lub tsev qiv ntawv super CTBot, EstebanP27 rau nws qhov kev qhia uas kuv tau kawm ntau yam rau txoj haujlwm no! Kuv kuj tseem xav ua tsaug svgrepo uas kuv siv SVGs ua lub hauv paus rau lub logo.

Pom zoo: