Cov txheej txheem:

Hnub Ci Av Moisture Meter Nrog ESP8266: 10 Cov Kauj Ruam (nrog Duab)
Hnub Ci Av Moisture Meter Nrog ESP8266: 10 Cov Kauj Ruam (nrog Duab)

Video: Hnub Ci Av Moisture Meter Nrog ESP8266: 10 Cov Kauj Ruam (nrog Duab)

Video: Hnub Ci Av Moisture Meter Nrog ESP8266: 10 Cov Kauj Ruam (nrog Duab)
Video: Arduino project ๐Ÿ˜Ž^ Arduino #arduino #2022 #2021 #2023 #dc #arduinoproject #diy #foryou 2024, Kaum ib hlis
Anonim

Hauv Phau Ntawv Qhia no, peb tab tom ua lub hnub ci siv av noo noo saib xyuas. Nws siv ESP8266 wifi microcontroller khiav lub zog qis, thiab txhua yam tsis muaj dej kom nws tuaj yeem tawm sab nraud. Koj tuaj yeem ua raws daim ntawv qhia no raws nraim, lossis coj los ntawm nws cov txheej txheem muaj txiaj ntsig rau koj tus kheej cov haujlwm.

Yog tias koj yog tus tshiab rau kev tswj hwm microcontroller, thov txheeb xyuas kuv Arduino Chav Kawm thiab Is Taws Nem ntawm Yam Chav Kawm kom paub txog cov hauv paus ntawm thaiv, coding, thiab txuas rau internet.

Txoj haujlwm no yog ib feem ntawm kuv Chav Kawm Hnub Ci dawb, uas koj tuaj yeem kawm paub ntau ntxiv txog kev siv lub hnub ci zog los ntawm kev kos duab thiab cov hnub ci ci.

Txhawm rau ua raws qhov kuv tab tom ua haujlwm, ua raws kuv hauv YouTube, Instagram, Twitter, Pinterest, thiab sau npe yuav rau kuv tsab ntawv xov xwm.

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau

Koj yuav xav tau lub hnub ci them lub roj teeb thiab ESP8266 kev tawg xws li NodeMCU ESP8266 lossis Huzzah, ntxiv rau cov ntsuas av, roj teeb, hloov hluav taws xob, qee qhov xaim, thiab ib qho thaiv kom tso koj lub Circuit Court sab hauv.

Nov yog cov khoom siv thiab cov khoom siv rau kev saib xyuas cov av noo:

  • ESP8266 NodeMCU microcontroller (lossis zoo sib xws, Vin yuav tsum ua siab ntev txog 6V)
  • Adafruit lub hnub ci them nyiaj txiag nrog xaiv lub ntsuas cua thiab 2.2K ohm resistor
  • 2200mAh li-ion roj teeb
  • Perma-proto pawg thawj coj saib
  • Av noo noo/ntsuas kub
  • 2 cev kl
  • Waterproof thaiv
  • Waterproof DC fais fab cable khub
  • Thaum tshav kub kub ntsws tubing
  • 3.5W hnub ci vaj huam sib luag
  • Laub khawm hloov lub zog
  • Muab ob daim nplaum ua daim kab xev

Nov yog cov cuab yeej koj yuav xav tau:

  • Soldering hlau thiab solder
  • Pab txhais tes
  • Cov hlua hlau
  • Yaug snips
  • Tweezers (yeem)
  • Tshav kub lossis sib zog
  • Multimeter (xaiv tau tab sis siv tau rau kev daws teeb meem)
  • USB A-microB cable
  • Txiab
  • Kauj ruam laum

Koj yuav xav tau nyiaj pub dawb ntawm huab cov ntaub ntawv chaw io.adafruit.com thiab IFTTT.

Raws li Amazon Kev Koom Tes Kuv khwv tau los ntawm kev tsim nyog yuav khoom koj ua siv kuv cov koom nrog txuas.

Kauj Ruam 2: Breadboard Prototype

Breadboard Prototype
Breadboard Prototype

Nws yog ib qho tseem ceeb los tsim cov ntawv tsis muaj khob cij ua qauv rau cov haujlwm zoo li no, yog li koj tuaj yeem ua kom ntseeg tau tias koj lub ntsuas cua thiab tus lej ua haujlwm ua ntej ua ib qho kev sib txuas tas mus li.

Duab
Duab
Duab
Duab
Duab
Duab
Duab
Duab

Hauv qhov no, cov av hauv av tau xaim cov xov hlau rau nws yog qhov tsim nyog yuav tsum tau muab cov taub hau ruaj khov mus rau qhov kawg ntawm lub xov tooj cua siv lub tshuab ziab khaub ncaws, pab txhais tes, thiab qee qhov cua sov ntsws.

Duab
Duab

Ua raws daim duab qhia kab hluav taws xob txhawm rau xaim lub ntsuas hluav taws xob lub zog, hauv av, moos, thiab cov ntaub ntawv pins (cov ntaub ntawv tseem tau txais 10K rub tawm qhov kev tawm tsam uas los nrog cov ntsuas av).

  • Sensor ntsuab xaim rau GND
  • Sensor liab xaim rau 3.3V
  • Sensor daj hlau rau NodeMCU tus pin D5 (GPIO 14)
  • Sensor xiav xaim rau NodeMCU tus pin D6 (GPIO 12)
  • 10K rub tawm tus tiv thaiv ntawm cov ntaub ntawv xiav tus pin thiab 3.3V

Koj tuaj yeem txhais qhov no rau qhov koj xav tau microcontroller. Yog tias koj siv Arduino Uno lossis zoo sib xws, koj pawg thawj coj twb tau txhawb los ntawm Arduino software. Yog tias koj siv ESP8266, thov txheeb xyuas kuv li Is Taws Nem ntawm Yam Chav Kawm rau ib qib zuj zus pab teeb tsa nrog ESP8266 hauv Arduino (los ntawm kev ntxiv URLs ntxiv rau Tus Thawj Saib Xyuas Ntxiv URLs hauv Arduino qhov nyiam, tom qab ntawd tshawb rau thiab xaiv cov laug cam tshiab los ntawm tus thawj tswj hwm pawg thawj coj saib). Kuv zoo li siv Adafruit ESP8266 Huzzah pawg thawj coj los ua haujlwm rau NodeMCU ESP8266 pawg thawj coj, tab sis koj tseem tuaj yeem teeb tsa thiab siv Generic ESP8266 kev txhawb nqa pawg thawj coj. Koj tseem yuav xav tau SiLabs USB kev sib txuas lus nti tsav (muaj rau Mac/Windows/Linux).

Txhawm rau kom tau txais lub ntsuas cua thiab ua haujlwm nrog kuv lub Rooj Tswjhwm Saib Arduino-sib xws, kuv rub tawm SHT1x Arduino Library los ntawm Kev Ua Haujlwm Arduino's github nplooj ntawv, tom qab ntawd unzipped cov ntawv thiab txav cov ntawv tais ceev tseg rau kuv Arduino/cov tsev qiv ntawv, tom qab ntawd hloov nws SHT1x. Qhib tus piv txwv kos duab ReadSHT1xValues thiab hloov tus lej tus lej rau 12 (dataPin) thiab 14 (clockPin), lossis luam theej duab hloov kho ntawm no:

#suav nrog

#define dataPin 12 // NodeMCU pin D6 #define clockPin 14 // NodeMCU tus pin D5 SHT1x sht1x (dataPin, clockPin); // instantiate SHT1x object void setup () {Serial.begin (38400); // Qhib qhov txuas txuas mus qhia qhov tseem ceeb rau host Serial.println ("Pib li"); } tsis muaj dab tsi voj () {ntab temp_c; ntab temp_f; ntab dej; temp_c = sht1x.readTemperatureC (); // Nyeem qhov tseem ceeb ntawm lub ntsuas cua temp_f = sht1x.readTemperatureF (); vaum = sht1x.readHumidity (); Serial.print ("Kub:"); // Luam qhov tseem ceeb rau ntawm qhov chaw nres nkoj Serial.print (temp_c, DEC); Serial.print ("C /"); Serial.print (temp_f, DEC); Serial.print ("F. Humidity:"); Serial.print (av noo); Serial.println ("%"); ncua (2000); }

Muab cov lej no tso rau hauv koj lub rooj tsavxwm thiab qhib lub koos pij tawj saib kom pom cov ntaub ntawv sensor ntws hauv.

Yog tias koj cov cai yuav tsis suav thiab yws txog SHT1x.h tsis pom, koj tsis tau txais lub tsev qiv ntawv sensor uas xav tau teeb tsa kom raug. Txheeb xyuas koj li Arduino/cov tsev qiv ntawv rau ib qho hu ua SHT1x, thiab yog tias nws nyob lwm qhov, zoo li koj cov ntawv rub tawm, txav nws mus rau koj li Arduino cov tsev qiv ntawv cov ntawv tais ceev tseg, thiab hloov npe yog tias tsim nyog.

Yog tias koj cov cai sau ua ke tab sis yuav tsis tso rau hauv koj lub rooj tsavxwm, rov xyuas ob zaug ntxiv koj lub rooj teeb tsa, nco ntsoov tias koj lub rooj tsav xwm tau ntsaws, thiab xaiv qhov chaw nres nkoj raug los ntawm cov cuab yeej ntawv qhia zaub mov.

Yog tias koj cov cai tso tawm tab sis koj cov ntawv tso tawm hauv xov tooj cua tsis tuaj yeem lees paub, ua ob zaug xyuas koj tus nqi sib tw uas tau teev tseg hauv koj daim duab (38400 hauv qhov no).

Yog tias koj lub xov tooj ntawm tes saib tsis zoo li qhov tseeb, ob zaug xyuas koj cov xov hlau tiv thaiv daim duab hluav taws xob. Puas yog koj tus 10K rub tawm tus neeg tawm tsam nyob ntawm qhov chaw tus pin thiab 3.3V? Puas yog cov ntaub ntawv thiab moos txuas nrog tus pin raug? Puas yog lub zog thiab hauv av txuas nrog raws li lawv yuav tsum muaj thoob plaws hauv Circuit Court? Tsis txhob ua mus txog thaum daim duab yooj yim no ua haujlwm!

Cov kauj ruam tom ntej yog qhov tshwj xeeb rau ESP8266 thiab teeb tsa qhov kev xaiv wireless sensor qhia ib feem ntawm qhov piv txwv. Yog tias koj siv tus qauv (tsis yog wireless) Arduino-tau tshaj microcontroller, txuas ntxiv txhim kho koj daim duab Arduino zaum kawg thiab hla mus Npaj Hnub Ci Charging Board.

Kauj ruam 3: Teeb Software

Teeb Software
Teeb Software

Txhawm rau suav cov cai rau txoj haujlwm no nrog ESP8266, koj yuav tsum tau teeb tsa ob peb lub tsev qiv ntawv Arduino ntxiv (muaj los ntawm tus thawj tswj tsev qiv ntawv):

  • Adafruit IO Arduino
  • Adafruit MQTT Cov
  • ArduinoHttpClient

Rub tawm cov cai txuas rau cov kauj ruam no, tom qab ntawd rub daim ntawv thiab qhib Solar_Powered_Soil_Moisture_Monitor_Tutorial hauv koj li software Arduino.

#suav nrog

#include #include #include #include // Qhia kom meej cov ntaub ntawv thiab moos sib txuas thiab tam sim ntawd SHT1x khoom #define dataPin 12 // NodeMCU pin D6 #define clockPin 14 // NodeMCU pin D5 SHT1x sht1x (dataPin, clockPin); // teeb tsa pub AdafruitIO_Feed *av noo = io.feed ("av noo"); AdafruitIO_Feed *kub = io.feed ("kub"); const koj sleepTime = 15; // 15 feeb

void teeb tsa ()

{Serial.begin (115200); // Qhib qhov txuas txuas mus qhia qhov tseem ceeb rau host Serial.println ("Pib li"); // txuas rau io.adafruit.com Serial.print ("Txuas rau Adafruit IO"); io.connect (); // tos kev txuas thaum (io.status () <AIO_CONNECTED) {Serial.print ("."); ncua (500); } // peb txuas nrog Serial.println (); Serial.println (io.statusText ()); }

void lub voj ()

{io.run (); // io.run (); khaws cov neeg siv khoom sib txuas thiab xav tau rau txhua qhov kev kos duab. ntab temp_c; ntab temp_f; ntab dej; temp_c = sht1x.readTemperatureC (); // Nyeem qhov tseem ceeb ntawm lub ntsuas cua temp_f = sht1x.readTemperatureF (); ya raws = sht1x.readHumidity (); Serial.print ("Kub:"); // Luam qhov tseem ceeb rau ntawm qhov chaw nres nkoj Serial.print (temp_c, DEC); Serial.print ("C /"); Serial.print (temp_f, DEC); Serial.print ("F. Humidity:"); Serial.print (ya raws); Serial.println ("%"); av noo-> txuag (noo noo); kub-> txuag (temp_f); Serial.println ("ESP8266 tsaug zog โ€ฆ"); ESP.deepSleep (pw tsaug zog * 1000000 * 60); // Tsaug zog}

Cov cai no yog mashup ntawm tus lej ntsuas los ntawm ua ntej hauv qhov kev qhia no thiab piv txwv yooj yim los ntawm huab cov ntaub ntawv pabcuam Adafruit IO. Qhov kev zov me nyuam nkag mus rau lub zog qis thiab pw ntau lub sijhawm, tab sis sawv txhua 15 feeb los nyeem qhov ntsuas kub thiab av nyob hauv av, thiab tshaj tawm nws cov ntaub ntawv rau Adafruit IO. Nkag mus rau qhov teeb tsa config.h thiab sau koj li Adafruit IO lub npe siv thiab tus lej tseem ceeb, nrog rau koj lub npe wifi network thiab tus lej zais, tom qab ntawd xa cov lej rau koj li ESP8266 microcontroller.

Duab
Duab

Koj yuav tsum tau npaj me ntsis ntawm io.adafruit.com. Tom qab tsim cov khoom noj rau qhov kub thiab txias, koj tuaj yeem tsim lub dashboard rau koj lub ntsuas saib nrog lub teeb ntawm lub ntsuas qhov ntsuas thiab ob qho tib si tuaj txau cov ntaub ntawv. Yog tias koj xav tau kev kho dua tshiab thaum pib nrog Adafruit IO, txheeb xyuas cov lus qhia no hauv kuv li Internet ntawm Yam Kawm.

Kauj Ruam 4: Npaj Hnub Ci Charging Board

Npaj Solar Charging Board
Npaj Solar Charging Board

Npaj lub hnub ci them nyiaj los ntawm kev siv lub tshuab hluav taws xob ntawm nws lub peev xwm thiab qee cov xov hlau mus rau cov khoom tso tawm. Kuv tau kho kuv tus kheej kom them tus nqi nrawm dua nrog rau kev xaiv ntxiv rau ntawm tus tiv thaiv (2.2K soldered hla PROG) thiab ua rau nws muaj kev nyab xeeb kom tawm mus yam tsis tau saib xyuas los ntawm kev hloov lub ntsej muag mount resistor nrog 10K thermistor txuas nrog lub roj teeb nws tus kheej. Qhov no yuav txwv kev them nyiaj kom nyab xeeb qhov kub thiab txias. Kuv tau them cov kev hloov pauv no kom ntxaws hauv kuv qhov Solar Solar Charger project.

Kauj Ruam 5: Tsim Microcontroller Circuit

Tsim Microcontroller Circuit
Tsim Microcontroller Circuit
Duab
Duab
Duab
Duab

Solder li lub microcontroller board thiab lub zog hloov mus rau perma-proto board.

Duab
Duab

Txuas lub hnub ci them hluav taws xob tso tawm rau lub tswv yim ntawm koj qhov kev hloov pauv, uas yuav tsum tau ntsuas qis kawg 1 amp.

Duab
Duab

Tsim thiab muab cov kab sib txuas sib txuas ua ke tau piav qhia hauv daim duab kab lus saum toj no (lossis rau koj tus kheej cov lus tshwj xeeb), suav nrog 10K rub tawm tus neeg tawm tsam ntawm lub sensor cov ntaub ntawv kab.

Lub hnub ci them lub roj teeb yuav muab 3.7V roj teeb thaum tsis muaj lub hnub ci siv hluav taws xob, tab sis yuav siv ncaj qha los ntawm lub hnub ci vaj huam sib luag yog tias nws tau ntsaws thiab tshav ntuj. Yog li tus microcontroller yuav tsum muaj peev xwm zam ntau yam hluav taws xob, qis li 3.7V thiab txog 6V DC. Rau cov uas xav tau 5V, PowerBoost (500 lossis 1000, nyob ntawm qhov xav tau tam sim no) tuaj yeem siv los hloov kho qhov ntsuas hluav taws xob rau 5V (raws li qhia hauv Solar Solar Charger project). Nov yog qee cov laug cam thiab lawv qhov hluav taws xob qhov sib txawv:

  • NodeMCU ESP8266 (siv ntawm no): 5V USB lossis 3.7V-10V Vin
  • Arduino Uno: 5V USB lossis 7-12V Vin
  • Adafruit Huzzah ESP8266 Breakout: 5V USB lossis 3.4-6V VBat

Txhawm rau kom ua tiav lub roj teeb tau ntev tshaj plaws, koj yuav tsum siv qee lub sijhawm los txiav txim siab thiab ua kom zoo dua tag nrho koj cov nyiaj tam sim no. ESP8266 muaj lub ntsej muag tsaug zog uas peb siv hauv Arduino kos duab los txo nws lub zog siv zog. Nws sawv los nyeem lub sensor thiab kos ntau dua tam sim no thaum nws txuas rau lub network los tshaj tawm lub ntsuas tus nqi, tom qab ntawd rov qab mus pw tsaug zog rau lub sijhawm tshwj xeeb. Yog tias koj lub microcontroller rub ntau lub zog thiab tsis tuaj yeem ua kom tsaug zog yooj yim, txiav txim siab xa koj cov phiaj xwm mus rau lub rooj tsav xwm sib xws uas rub lub zog tsawg. Tso cov lus nug hauv cov lus hauv qab no yog tias koj xav tau kev pab txheeb xyuas lub rooj tsav xwm twg tuaj yeem yog rau koj txoj haujlwm.

Kauj Ruam 6: Nruab Cable Glands

Duab
Duab

Txhawm rau ua cov ntsiab lus nkag mus rau huab cua tsis zoo rau lub hnub ci vaj huam sib luag cable thiab lub teeb pom kev zoo, peb yuav teeb tsa ob txoj kab hluav taws xob txuas rau sab ntawm lub thawv tiv thaiv huab cua.

Duab
Duab
Duab
Duab

Ntsuas kom haum koj cov khoom txhawm rau txheeb xyuas qhov kev tso kawm zoo tshaj plaws, tom qab ntawv kos thiab xaum qhov hauv qhov thaiv dej uas tsis siv lub qhov xyaum xyaum. Nruab ob txoj kab txuas kab.

Duab
Duab

Kauj Ruam 7: Ua kom tiav Circuit Court Assembly

Ua kom tiav Circuit Court Assembly
Ua kom tiav Circuit Court Assembly

Ntxig qhov chaw nres nkoj sab ntawm cov hlua hluav taws xob tsis muaj dej nkag rau hauv ib qho thiab txuas nws mus rau lub hnub ci them nyiaj DC lub tswv yim (liab rau + thiab dub rau -).

Duab
Duab

Ntxig cov av ntsuas los ntawm lwm lub qog, thiab txuas nws mus rau perma-proto raws li daim duab qhia chaw.

Duab
Duab

Kaw daim kab xev thermistor rau lub roj teeb. Qhov no yuav txwv kev them nyiaj rau qhov ntsuas kub nyab xeeb thaum lub phiaj xwm tsis muaj neeg saib xyuas sab nraud.

Duab
Duab

Kev them nyiaj thaum kub lossis txias dhau tuaj yeem ua rau lub roj teeb puas lossis pib hluav taws. Raug rau qhov kub heev tuaj yeem ua rau puas thiab ua rau lub roj teeb lub neej luv, yog li nqa nws sab hauv yog tias nws qis dua lossis siab dua 45 โ„ƒ/113F.

Duab
Duab

Ceev cov kab hluav taws xob ua kom muaj huab cua tsis zoo nyob ib puag ncig lawv cov kab hluav taws xob.

Kauj Ruam 8: Npaj Hnub Ci Vaj Huam Sib Luag

Npaj Hnub Ci Vaj Huam Sib Luag
Npaj Hnub Ci Vaj Huam Sib Luag

Ua raws li kuv Cov Lus Qhia txhawm rau txuas lub cable rau koj lub hnub ci vaj huam sib luag nrog sab ntsaws ntawm cov dej tsis sib haum DC fais fab cable teeb.

Kauj Ruam 9: Xeem Nws

Kuaj Nws
Kuaj Nws

Txuas koj lub roj teeb thiab qhib lub Circuit Court los ntawm nias lub hwj huam hloov.

Duab
Duab

Kuaj nws thiab paub tseeb tias nws tau tshaj tawm rau hauv is taws nem ua ntej kaw lub thawv ntawv thiab teeb tsa lub ntsuas pa hauv koj lub vaj zaub ntsuab, cov paj ntoo zoo nkauj, lossis lwm yam av hauv thaj tsam ntawm koj lub network wifi.

Duab
Duab

Thaum cov ntaub ntawv los ntawm lub ntsuas tau nkag rau hauv online, nws yooj yim los teeb tsa daim ntawv qhia rau email lossis ntawv ceeb toom ntawm API lub rooj vag qhov rooj Yog Qhov No Yog Li No. Kuv teeb tsa kuv tus email rau kuv yog tias cov av ya raws qis dua 50.

Txhawm rau sim nws yam tsis tau tos kuv cov nroj tsuag kom qhuav, kuv tau nkag mus rau hauv cov ntaub ntawv taw qhia rau kuv cov av noo ntawm Adafruit IO uas poob qis dua qhov pib. Ob peb lub sijhawm tom qab, email tuaj txog! Yog tias cov av qib qis dua li kuv tau teev tseg, Kuv yuav tau txais email txhua lub sijhawm hloov kho kom txog thaum kuv ywg dej rau hauv av. Rau kuv qhov kev xav, Kuv hloov kho kuv cov cai txhawm rau ua piv txwv cov av ntau dua li txhua 15 feeb.

Kauj ruam 10: Siv Nws Sab Nraud

Siv Nws Sab Nraud!
Siv Nws Sab Nraud!
Siv Nws Sab Nraud!
Siv Nws Sab Nraud!

Qhov no yog qhov haujlwm lom zem los kho raws li koj cov nroj tsuag xav tau kev ywg dej, thiab nws yooj yim los pauv lossis ntxiv cov ntsuas lossis sib txuas lub hnub ci zog ua haujlwm rau hauv koj lwm qhov haujlwm Arduino.

Tsaug rau ua raws nrog! Kuv yuav nyiam hnov qhov koj xav; thov tso tawm hauv cov lus. Txoj haujlwm no yog ib feem ntawm kuv Chav Kawm Hnub Ci Dawb, qhov uas koj tuaj yeem pom cov haujlwm yooj yim hauv vaj hauv tsev thiab qhia ntau ntxiv txog kev ua haujlwm nrog cov hnub ci ci. Txheeb nws thiab sau npe!

Yog tias koj nyiam txoj haujlwm no, tej zaum koj yuav txaus siab rau qee qhov ntawm kuv:

  • Dawb Internet ntawm Yam Kawm
  • YouTube Tus Neeg Sau Npe Suav nrog ESP8266
  • Social Stats Tracker Zaub nrog ESP8266
  • WiFi Huab Cua Qhia nrog ESP8266
  • Internet Valentine

Txhawm rau ua raws qhov kuv tab tom ua haujlwm, ua raws kuv ntawm YouTube, Instagram, Twitter, Pinterest, thiab Snapchat.

Pom zoo: