Cov txheej txheem:

IoT Hydroponics - Siv Adafruit IO rau EC, PH thiab Kev ntsuas kub: 6 kauj ruam
IoT Hydroponics - Siv Adafruit IO rau EC, PH thiab Kev ntsuas kub: 6 kauj ruam

Video: IoT Hydroponics - Siv Adafruit IO rau EC, PH thiab Kev ntsuas kub: 6 kauj ruam

Video: IoT Hydroponics - Siv Adafruit IO rau EC, PH thiab Kev ntsuas kub: 6 kauj ruam
Video: Siv HD - Best Moments #59 - BUG TRILOGY 2024, Kaum ib hlis
Anonim
IoT Hydroponics - Siv Adafruit IO rau EC, PH thiab ntsuas kub
IoT Hydroponics - Siv Adafruit IO rau EC, PH thiab ntsuas kub

Cov lus qhia no yuav qhia saib yuav ua li cas saib xyuas EC, pH, thiab ntsuas kub ntawm kev teeb tsa hydroponics thiab xa cov ntaub ntawv mus rau Adafruit qhov kev pabcuam IO.

Adafruit IO yog pub dawb los pib nrog. Muaj cov phiaj xwm them nyiaj, tab sis txoj phiaj xwm pub dawb ntau dua li txaus rau txoj haujlwm no.

Kauj Ruam 1: Yam Koj Yuav Tsum Tau

  • Txhua lub rooj tsav xwm txhim kho ESP32. Qhov no zoo li tsim nyog, tab sis ib qho twg yuav ua haujlwm.
  • Isolated EC Probe Interface board thiab K1 conductivity probe. Koj tuaj yeem tau txais ob qho ntawm ufire.co.
  • Isolated ISE Probe Interface board thiab pH sojntsuam kuj los ntawm ufire.co.
  • Qee qhov txawv thiab xaus zoo li xov hlau thiab USB cables.

Kauj ruam 2: Software

  1. Kuv yuav xav tias koj paub nrog Arduino, Arduino IDE, thiab nws tau teeb tsa lawm. Yog tsis yog, ua raws cov kab ntawv txuas.
  2. Yam tom ntej yog tau txais ESP32 lub platform teeb tsa. Vim qee qhov, qhov no tsis tau yooj yim los ntawm kev muaj lub platform tswj hwm tus IDE tau muab, yog li koj yuav tsum tau mus rau nplooj ntawv github thiab ua raws cov lus qhia teeb tsa tsim nyog.
  3. Tam sim no rau cov tsev qiv ntawv:

    1. Los ntawm hauv Arduino IDE, nkag mus kos duab / suav nrog Lub Tsev Qiv Ntawv / Tswj Cov Tsev Qiv Ntawv … thiab tshawb nrhiav thiab teeb tsa 'EC_Salinity'.
    2. Tshawb nrhiav thiab teeb tsa 'Isolated ISE Probe Interface'.
    3. Tshawb nrhiav thiab teeb tsa 'Adafruit MQTT Library'.
    4. Tshawb nrhiav thiab teeb tsa 'ArduinoHttpClient'.
    5. Thiab thaum kawg tshawb nrhiav rau nruab 'Adafruit IO Arduino'.

Kauj Ruam 3: Ua Kev Sib Txuas

ESP32 peb tab tom siv muaj WiFi thiab BLE cuam tshuam, yog li tsuas yog xav tau lub zog siv. Tej zaum koj yuav xav tau USB cable muab lub zog hluav taws xob, tab sis roj teeb yog lwm txoj kev xaiv. Ntau ESP32s tuaj yeem yuav nrog lub roj teeb them hluav taws xob hluav taws xob twb nyob ntawm lub rooj tsavxwm.

Cov cuab yeej uFire uas peb yuav ntsuas EC, pH thiab qhov kub thiab txias txuas mus rau ESP32 los ntawm I2C npav. Nrog ESP32, koj tuaj yeem xaiv ob qho pins rau I2C. Ob lub cuab yeej yuav nyob ntawm tib lub npav, yog li SCL thiab SDA tus pin yuav zoo ib yam. Yog koj saib cov cai (kauj ruam tom ntej), koj yuav pom ob kab no.

ISE_pH pH (19, 23);

EC_Salinity mS (19, 23);

Kuv txiav txim siab siv tus pin 19 rau SDA thiab tus pin 23 rau SCL. Yog li Txuas ESP32's 3.3v (lossis xijpeem tus pin tuaj yeem hu rau ntawm koj lub rooj tshwj xeeb) mus rau EC uFire ntaus ntawv 3.3/5v tus pin, GND rau GND, 19 rau SDA, thiab 23 rau SCL. Tam sim no txuas lub uFire pH board rau EC board, tus pin rau tus pin. Tus pinout ntawm koj ESP32 yuav txawv ntawm daim duab.

Kauj Ruam 4: Ua Tus Adafruit Account

Koj yuav tsum tau ua tus account ntawm io.adafruit.com. Ua raws qhov txuas rau 'Pib Pib Dawb'.

Thaum qhov ua tiav lawm, rov qab mus rau io.adafruit.com thiab koj yuav tsum tau saib ntawm koj daim ntawv teev npe khoob. Ntawm sab laug koj yuav pom cov ntawv qhia zaub mov hu ua 'View AIO Key', nyem rau nws thiab cov lus sib tham yuav qhib. Koj yuav pom lub thawv ntawv sau tias 'Username' thiab 'Active Key'. Koj yuav xav tau ob qho ntawm cov kauj ruam tom ntej.

Kauj ruam 5: Sketch

Cov duab kos rau qhov no yog qhov tsawg kawg nkaus kom tau txais peb cov ntaub ntawv thiab xa nws. Muaj ntau yam los txhim kho qhov no, kev tswj hwm lub zog, kev teeb tsa huab cua, ntsuas ntsuas … ntau yam, tab sis qhov no tsuas yog ua qauv qhia thiab pib ua haujlwm, yog li peb yuav ua kom yooj yim.

Tshaj tawm qhov no rau hauv Arduino IDE, nco ntsoov tias koj xaiv lub rooj tsav xwm raug cai los ntawm Cov Ntawv Qhia Cuab Yeej. ESP32 Dev Module yuav ntau dua li yuav ua haujlwm. Qee cov laug cam yuav ua haujlwm ntawm tus nqi baud siab dua, tab sis yuav luag txhua ntawm lawv yuav ua haujlwm ntawm 115, 200. Hloov kab AdafruitIO_WiFi io rau koj cov ntaub ntawv tshwj xeeb. Tus 'Username' thiab 'Active Key' yog Adafruit cov ntaub ntawv koj nyuam qhuav pom, WiFi SSID yog lub npe ntawm koj li Wi -nkaus network, thiab WiFi lo lus zais yog lo lus zais rau lub network ntawd.

#include "AdafruitIO_WiFi.h" #include "ISE_pH.h" #include "uFire_EC.h" ISE_pH pH (19, 23); uFire_EC mS (19, 23); AdafruitIO_WiFi io ("Username", "Active Key", "WiFi SSID", "Wifi password"); AdafruitIO_Feed *ph = io.feed ("pH"); AdafruitIO_Feed *temp = io.feed ("C"); AdafruitIO_Feed *ec = io.feed ("mS"); teeb tsa tsis muaj dabtsis () {io.connect (); mS.setK (1.0); } tsis muaj dab tsi voj () {io.run (); ph-> txuag (pH.measurepH ()); ncua (3000); temp-> txuag (pH.measureTemp ()); ncua (3000); ec-> txuag (mS.measureEC ()); ncua (3000); }

Kauj Ruam 6: Adafruit Dashboard

Yog tias txhua yam tau ua tiav zoo, koj tau txuas nrog txhua yam, xa cov duab kos, thiab ua tus account, koj yuav tsum muaj peev xwm saib cov ntaub ntawv nkag los.

Mus rau io.adafruit.com dua thiab xaiv 'Feeds' cov ntawv qhia zaub mov ntawm sab laug. Nov yog cov npe ntawm txhua yam ntawm koj cov ntaub ntawv xov xwm. Koj yuav tsum pom tag nrho peb daim ntawm cov ntaub ntawv hloov kho, ib qho txhua peb vib nas this.

Tam sim no koj tuaj yeem hloov cov ntaub ntawv ntawd mus rau hauv Dashboard. Kuv yuav tawm qhov tshwj xeeb ntawm qhov ntawd rau koj, Adafruit lub vev xaib yuav tsum muaj txhua cov ntaub ntawv koj xav tau.

Pom zoo: