Cov txheej txheem:

Ntse Tsiaj Feeder: 9 Kauj Ruam
Ntse Tsiaj Feeder: 9 Kauj Ruam

Video: Ntse Tsiaj Feeder: 9 Kauj Ruam

Video: Ntse Tsiaj Feeder: 9 Kauj Ruam
Video: 6 Nqi Lus Qhia Kev Ua neej ( leej twg mloog lub neej yuav zoo tuaj) 2024, Kaum ib hlis
Anonim
Image
Image
Ntse Tsiaj Feeder
Ntse Tsiaj Feeder

Koj puas muaj tus tsiaj?

  • Tsis yog: txais ib qho! (thiab rov qab los rau cov lus qhia no).
  • Yog: txoj haujlwm zoo!

Nws yuav tsis zoo yog tias koj tuaj yeem pub mis thiab muab dej rau koj tus hlub uas tsis tau tso tseg txoj kev npaj kom tau mus tsev raws sijhawm? Peb hais tsis txhawj ntxiv lawm.

Hauv txoj haujlwm no peb tau ua cov chaw taws teeb tswj (los ntawm lub vev xaib) khoom noj thiab dej faib.

Los ntawm cov dashboard online koj tuaj yeem saib cov ntaub ntawv thiab tswj cov dispensers:

  • Saib cov zaub mov thiab qib dej hauv cov tso tsheb hlau luam.
  • Saib cov qib zaub mov thiab dej hauv lub tais.
  • Puas yog tsiaj noj lossis haus tam sim no?
  • Teem sijhawm pub mis (ntaus ntawv yuav tsis faib zaub mov yog tias muaj zaub mov txaus hauv lub tais).
  • Muab cov dej tso rau thaum lub tais khoob.
  • Muab cov zaub mov/dej tso nrog nias lub pob.
  • Tau txais cov ntawv ceeb toom laub rau koj lub xov tooj (los ntawm Telegram app).

Peb Yog Leej Twg?

Tsim los ntawm Tom Kaufman thiab Katya Fichman, Computer Science cov tub ntxhais kawm ntawm IDC Herzliya.

Qhov haujlwm no tau ua rau chav kawm IOT.

Khoom siv

Electronics

  • 2 X ESP8266 (Wemos d1 mini).
  • Jumper xov hlau.
  • 2 X Breadboard.
  • 4 X Ultrasonic sensor.
  • 2 X Load cell.
  • 2 X Load cell amplifier (HX711).
  • Servo (180 °).
  • Servo (kev sib hloov tas li).
  • 2 X 6V fais fab mov.

Qhov

  • Cornflakes dispenser (Amazon txuas).
  • 3D luam tawm lub tshuab xa zaub mov lub taub hau (https://www.thingiverse.com/thing:3998805).
  • 3D luam tawm lub tshuab xa zaub mov xa mus rau servo txuas (https://www.thingiverse.com/thing:3269637).
  • 3D luam cov zaub mov muag zaub lub rooj muag zaub (tsim los rau txoj haujlwm no:
  • 3D luam tawm load cell puag thiab phaj (tsim rau txoj haujlwm no:
  • Lub tshuab xa dej (Amazon txuas rau qee yam zoo sib xws).
  • Hlau (txhawm rau txuas lub taub dej ntawm lub pob qhov rooj mus rau servo).
  • 3 X Ultrasonic sensor tus sawv.

Kauj Ruam 1: Nws Ua Haujlwm Li Cas?

Nws Ua Haujlwm Li Cas?
Nws Ua Haujlwm Li Cas?

ESP8266 cov laug cam xa cov cim nyeem rau Node-RED los ntawm Mosquitto (MQTT broker).

Node-RED txheej txheem cov ntaub ntawv, ua qhov ua raws (tseem xa cov lus txib xa mus rau ESP8266 cov laug cam los ntawm Mosquitto) thiab nthuav qhia cov ntaub ntawv ntawm lub dashboard.

Txhua qhov kev suav suav tau ua hauv Node-RED yog li nws yuav yooj yim dua qhov haujlwm no thiab hloov kev ua cov ntaub ntawv raws li koj qhov chaw thiab kev nyiam yam tsis tau txais koj txhais tes qias neeg nrog coding.

Kauj ruam 2: Softwares

Softwares
Softwares

Arduino IDE Cov

Rub tawm thiab teeb tsa (txuas:

Yoov Tshaj Lij

Rub tawm thiab teeb tsa (txuas:

Node.js

Rub tawm thiab teeb tsa (txuas:

Node-RED

Ua raws cov lus qhia:

ngrok

Rub tawm:

Xov tooj

Nruab lub app ntawm koj lub smartphone.

Kauj Ruam 3: Txheej Txheem Circuit

Circuit Layout
Circuit Layout

* Ob lub cuab yeej muaj cov khoom siv sib xws

Dej Tso Dej

  • Ultrasonic sensor (rau lub tank dej)

    • GND -G
    • VCC - 5V
    • NCO - D5
    • TRIGGER - D0
  • Ultrasonic sensor (rau tus tsiaj nyob deb ntawm lub tais)

    • GND -G
    • VCC - 5V
    • NCO - D6
    • TRIGGER - D7 Cov
  • Load cell

    • GREEN - A+ (HX711)
    • WHITE - A- (HX711)
    • BLACK - E- (HX711)
    • Liab - E+ (HX711)
  • HX711 (load cell amplifier)

    • GND -G
    • VCC - 5V
    • TSI - D4
    • TSO - D3
  • Kev pabcuam (180 °)

    • GND -G
    • VCC - 5V

Zaub Mov Zaub Mov

  • Ultrasonic sensor (rau lub tank khoom noj)

    • GND -G
    • VCC - 5V
    • NCO - D5
    • TRIGGER - D0
  • Ultrasonic sensor (rau tus tsiaj nyob deb ntawm lub tais)

    • GND -G
    • VCC - 5V
    • NCO - D6
    • TRIGGER - D7 Cov
  • Load cell

    • GREEN - A+ (HX711)
    • WHITE - A- (HX711)
    • BLACK - E- (HX711)
    • Liab - E+ (HX711)
  • HX711 (load cell amplifier)

    • GND -G
    • VCC - 5V
    • TSI - D4
    • TSO - D3
  • Servo (kev sib hloov tas li)

    • GND -G
    • VCC - 5V
    • Tswj - D8

Kauj ruam 4: Khoom siv tes ua

Paj ntaub
Paj ntaub
Paj ntaub
Paj ntaub
Paj ntaub
Paj ntaub

Lub taub dej tso dej

  1. Kaw cov servo mus rau sab saum toj hauv qab ntawm lub dispenser (raws li qhia hauv daim duab).
  2. Laum ib lub qhov me me hauv lub taub dej ntawm lub qhov taub.
  3. Txuas lub taub hau servo mus rau lub pob qhov rooj nrog xaim (xyuas kom tseeb tias lub taub hau servo nyob ntawm txoj haujlwm 0 thiab xyuas kom tseeb tias xaim nruj).
  4. Kuaj ib qho ultrasonic sensor mus rau sab sab hauv ntawm lub tank, ze nws sab saum toj (lub ntsej muag lub ntsej muag qis).
  5. Kuaj ib qho ultrasonic sensor hauv qab lub pob qhov dej mus rau sab nraud (xyuas kom nws siab txaus kom lub tais dej yuav tsis cuam tshuam rau nws nyeem).

Khoom noj khoom haus

  1. Ntsia lub servo rau nws tus tuav (3D luam ib feem).
  2. Kua nplaum lub raj (3D luam ib feem) rau lub tank (3D luam ib feem).
  3. Txuas tus tuav lub tank rau lub chaw tso khoom faib khoom (3D luam ib feem) thiab muab lub tank tso rau hauv qhov chaw.
  4. Ntxig qhov sib tw (luam tawm 3D) rau nws qhov chaw thiab dhau los ntawm cov khoom siv roj hmab tig ntawm lub tshuab xa khoom.
  5. Ntsia tus neeg tuav lub tog raj kheej rau lub chaw faib khoom.
  6. Kuaj ib qho ultrasonic sensor mus rau sab sab hauv ntawm lub tank lub hau (lub ntsej muag tig mus rau hauv qab).
  7. Kuaj ib qho ntsuas ultrasonic mus rau sab ntawm lub tank lub taub hau tig mus rau qhov chaw uas koj tus tsiaj yuav noj.

Load Cells

Kaw txhua lub xovtooj ntawm tes mus rau 3D luam tawm hauv paus thiab phaj (ntsaws tes lub xub xub tig rov qab)

Kauj ruam 5: Mosquitto

Yoov Tshaj Lij
Yoov Tshaj Lij

Qhib Mosquitto (cov neeg siv windows: mus rau Mosquitto nplaub tshev, qhib cmd thiab nkag mus rau: "mosquitto -v").

* Txhawm rau kom tau txais IP chaw nyob sab hauv ntawm lub computer, khiav cmd thiab nkag mus rau "ipconfig".

Kauj Ruam 6: Arduino IDE

Arduino IDE Cov
Arduino IDE Cov
Arduino IDE Cov
Arduino IDE Cov

Qhib Arduino IDE thiab ua raws li "Nruab ESP8266 Ntxiv-hauv Arduino IDE" ib feem ntawm phau ntawv qhia no:

Mus rau Cov Cuab Yeej-> Pawg thawj coj thiab xaiv "LOLIN (WEMOS) D1 R2 & mini".

Mus rau Sketch-> Suav nrog Tsev Kawm Ntawv-> Ntxiv. ZIP Library … thiab ntxiv 3 lub tsev qiv ntawv hauv "Libraries.rar" cov ntaub ntawv.

Qhib "HX711Calibration" kos duab, rub nws mus rau ob qho ESP8266's, khiav nws thiab ua raws cov lus qhia (thaum pib ntawm cov cai thiab hauv cov lej saib xyuas) txhawm rau ntsuas lub zog thauj khoom (nco ntsoov tias tus lej baud ntawm tus lej saib xyuas tau teeb tsa 115200 (ib.

* Sau qhov ntsuas qhov ntsuas thiab xoom offset (rau siv tom qab).

Qhib "FoodDispenser" thiab "WaterDispenser" kos duab los ntawm IDE thiab hloov pauv qhov hauv qab no nrog koj cov chaw (hauv cov ntawv "Settings.h"):

  • WIFI_SSID
  • WIFI_PASSWORD
  • MQTT_SERVER
  • LOAD_CELL_CALIBRATION_FACTOR
  • LOAD_CELL_ZERO_OFFSET

* Hauv MQTT_SERVER nkag mus rau tus IP sab hauv los ntawm "Mosquitto" kauj ruam.

Muab cov duab kos rau koj ob ESP8266 (ib tus lej rau txhua lub rooj tsavxwm).

* Daim ntawv ceeb toom tias peb tau siv "AsyncMqttClient" lub tsev qiv ntawv thiab tsis yog ntau lub tsev qiv ntawv "pubsubclient" txij li esp8266 sib tsoo thaum ua ke nrog "HX711" lub tsev qiv ntawv.

* Yog tias koj xaiv hloov pauv txoj cai, nco ntsoov tsis txhob siv "ncua" thiab "tawm" cov haujlwm hauv kev hu rov qab vim nws yuav ua rau muaj kev sib tsoo.

Kauj ruam 7: Qhib

Ngrok
Ngrok
Ngrok
Ngrok

Unzip cov ntawv rub tawm (los ntawm qhov txuas hauv "Softwares" kauj ruam).

Qhib "ngrok.exe" thiab khiav cov lus txib "ngrok http 1880".

* Koj tuaj yeem xaiv cheeb tsam ze koj (au, eu, ap, peb, jp, hauv, sa). Lub neej ntawd yog peb.

Piv txwv li khiav qhov hais kom ua: "ngrok http --region = eu 1880" (teeb tsa cheeb tsam rau Europe).

Tam sim no koj yuav pom koj lub vev xaib rau sab nrauv siv (peb yuav xa mus rau qhov chaw nyob no yog YOUR_NGROK_ADDRESS).

Kauj Ruam 8: Node-RED

Node-RED
Node-RED
Node-RED
Node-RED
Node-RED
Node-RED

Qhib Node-RED (cov neeg siv windows: qhib cmd thiab nkag mus rau "node-red") thiab mus rau https:// localhost: 1880 (yog tias nws tsis ua haujlwm, tshawb nrhiav qhov chaw nyob hauv cmd qhov rai uas nws tau sau "Server tam sim no khiav ntawm ").

Qhib cov ntawv qhia zaub mov (nyob rau sab xis saum toj) thiab nias "Manage palette".

Mus rau "Nruab" tab, tshawb thiab teeb tsa cov qauv no:

  • node-red-contrib-persist.
  • ntawm-liab-contrib-cron-ntxiv.
  • ntawm-liab-tshab-ui-coj.
  • ntawm-liab-dashboard.
  • node-red-contrib-telegrambot.

Mus rau cov ntawv qhia zaub mov-> Ntshuam thiab xa cov ntaub ntawv ntws (rho tawm cov ntawv RAR uas txuas nrog thiab xa cov ntaub ntawv json).

Saib cov duab txuas rau kev piav qhia txog qhov ntws.

Koj yuav tsum tau hloov kho cov no nrog koj cov chaw:

  • Hloov kho qhov "Telegram sender" node's profile nrog koj tus bot lub npe siv thiab token (siv phau ntawv qhia no: https://www.iotwithus.com/send-messages-using-tel …)
  • Hauv qab ntawm qhov hloov pauv qhov them nyiaj ntawm "Ngrok Chaw Nyob" thiab "Telegram Chat Id" nodes (tau txais koj tus lej sib tham los ntawm kev siv Telegram phau ntawv qhia hauv qhov txuas saum toj no).
  • Hauv qab ntu ntawm qhov ntws muaj cov chaw teeb tsa - hloov kho lawv raws li koj xav tau:

    • Qhib tsiaj yog noj/haus ceeb toom.
    • Txheeb xyuas qhov deb li cas rau qhib kev ceeb toom noj/haus.
    • Txhais cov tais thiab tso tsheb hlau luam ua cov ntaub ntawv.
    • Hloov kho lub sijhawm xa tawm (rau qhov ntev npaum li cas qhov kev faib tawm tshwm sim - pib hom thiab nias lub pob).
    • Txheeb xyuas lub tais zaub mov qhov feem pua dhau los (tshem tawm cov khoom noj tsis siv neeg yog tias muaj zaub mov txaus hauv lub tais).

Tso cov dej ntws (nyob rau sab xis saum toj).

* Tsuas yog thawj qhov kev xa tawm, koj yuav pom cov lus ceeb toom hauv lub qhov rais debug txog qhov ploj 'persistance.json' cov ntaub ntawv. Tsis txhob txhawj xeeb txog nws txij li lub sijhawm koj yuav teem sijhawm pub mis lossis hloov pauv dej pib, nws yuav pib ua cov ntawv no thiab koj yuav tsis muaj lus ceeb toom no ntxiv lawm.

Koj tuaj yeem saib koj lub dashboard ntawm https:// NODE-RED_PC'S_INTERNAL_IP_ADDRESS: 1880/ui (yog tias koj txuas nrog tib LAN li server) lossis YOUR_NGROK_ADDRESS/ui (los ntawm txhua qhov chaw).

Kauj ruam 9: Qhib

Qhwv
Qhwv

Peb vam tias qhov kev qhia no tau qhia thiab yooj yim nyeem, nkag siab thiab siv.

Xav tias dawb nug peb dab tsi.

Pom zoo: