Cov txheej txheem:

IoT Hydroponics - Ntsuas EC: 6 Cov Kauj Ruam
IoT Hydroponics - Ntsuas EC: 6 Cov Kauj Ruam

Video: IoT Hydroponics - Ntsuas EC: 6 Cov Kauj Ruam

Video: IoT Hydroponics - Ntsuas EC: 6 Cov Kauj Ruam
Video: Тестер соли/метр * Тестер воды * Тестер солености 2024, Hlis ntuj nqeg
Anonim
IoT Hydroponics - Ntsuas EC
IoT Hydroponics - Ntsuas EC

Cov lus qhia no yuav qhia yuav ua li cas thiaj ua Bluetooth Tsis Muaj Hluav Taws Xob Internet ntawm Yam khoom siv los tshuaj xyuas Cov Hluav Taws Xob Hluav Taws Xob ntawm cov khoom siv tshuaj hydroponic.

Kho vajtse yuav yog ESP32 pawg thawj coj txhim kho thiab uFire Isolated EC Probe Interface.

Peb yuav nthuav tawm peb cov ntaub ntawv ntawm nplooj ntawv yooj yim uas txuas rau peb lub cuab yeej los ntawm Web Bluetooth.

Kauj Ruam 1: Yam Koj Yuav Tsum Tau

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

Kauj ruam 2: Kev sib txuas

Kev sib txuas
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 thiab ntsuas kub sib txuas 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, koj yuav pom kab no.

uFire_EC_BLE ec_ble (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. Koj lub rooj tsav xwm ESP32 yuav muaj tus pin-tawm txawv dua li daim duab.

Kauj ruam 3: 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, tau txais Sketch / suav nrog Tsev Qiv Ntawv / Tswj Tsev Qiv Ntawv… thiab tshawb nrhiav thiab teeb tsa 'Isolated EC Probe Interface'.
    2. Tshawb nrhiav thiab teeb tsa 'ESP32 BLE Arduino'

Kauj ruam 4: Sketch

Cov duab kos rau txoj haujlwm no yog nrawm thiab yooj yim.

Koj tuaj yeem pom nws ntawm nplooj ntawv github. Nws tseem yuav ua piv txwv BLE. Thiab kom ntsuas tau zoo, nws tau txuas nrog cov lus qhia no ib yam.

#suav nrog "uFire_EC_BLE.h" // Ntawm ESP32, I2C pins tuaj yeem xaiv. Hauv qhov no, sda = 19 thiab scl = 23 uFire_EC_BLE ec_ble (19, 23); tsis muaj teeb tsa teeb tsa () {// pib BLE server ec_ble.startBLE (); } void loop () {// voj hla thiab ntsuas ntsuas txuas ntxiv ec_ble.measureEC (); ec_ble.measureTemp (); }

Kauj Ruam 5: Qhia Peb Cov Ntaub Ntawv

Tam sim no tias kho vajtse tau teeb tsa, peb xav tau txoj hauv kev yooj yim los tso saib peb cov ntaub ntawv. Txog qhov ntawd, peb yuav ua lub vev xaib yooj yim uas siv Web Bluetooth. Yog tias koj tsis paub nrog nws, nws yog Javascript API uas tam sim no tsuas muaj nyob hauv Chrome. Nws tso cai rau koj txuas rau BLE lub cuab yeej los ntawm lub vev xaib.

Ua tibzoo saib ntawm github repo.

Raws li kev txheeb xyuas sai:

  • nws siv bulma.io rau styling
  • Vue rau pem hauv ntej-kawg moj khaum
  • app.js muaj tag nrho cov lej javascript
  • index.html muaj tag nrho cov html

Qee yam yuav tsum nco ntsoov, yog tias koj xav txhim kho koj tus kheej lub vev xaib:

  1. nws yuav tsum tau txais kev pabcuam los ntawm https server, koj nkag tsis tau nws los ntawm cov ntawv hauv zos (file: //). Nov yog tus nab hab sej zoo https webserver kom pib.
  2. Tsuas yog Chrome version 55+ ua haujlwm rau qhov kev siv tshwj xeeb no. Koj tuaj yeem sau ib qho app lossis program siv ntau BLE APIs ib txwm muaj.
  3. Ua kom ntseeg tau tias Kev Tshawb Fawb Web Platform nta tau qhib los ntawm kev mus rau chrome: // chij/#enable-experimental-web-platform-features thiab rov pib dua browser. Ntawm qhov tshiab ntawm Chrome, qhov no tau qhib los ntawm lub neej ntawd.

Kauj Ruam 6: Siv Lub Vev Xaib

Tam sim no txhua yam tau muab tso ua ke, programmed, thiab lub vev xaib tau txais kev pabcuam, peb tuaj yeem saib qhov kawg.

Qhib lub vev xaib, hauv peb qhov xwm txheej, nws nyob ntawm https://ufire.co/uFire_BLE/, nyem lub cim Bluetooth nyob rau sab xis thiab xaiv uFire EC ntaus ntawv. Tam sim no koj yuav tsum pom EC nyeem ntawv hauv mS thiab ntsuas kub hauv C.

Koj tseem tuaj yeem teeb tsa qee qhov kev xaiv ntsuas.

Pom zoo: