Cov txheej txheem:

Sensors Box rau Tsev Cog Khoom: 5 Kauj Ruam
Sensors Box rau Tsev Cog Khoom: 5 Kauj Ruam

Video: Sensors Box rau Tsev Cog Khoom: 5 Kauj Ruam

Video: Sensors Box rau Tsev Cog Khoom: 5 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom
Sensors Box rau Tsev Cog Khoom

Hav. Kuv xav nthuav qhia ib txoj haujlwm ntxiv ntawm kuv rau lub zej zog dav.

Txoj haujlwm no tsom mus rau siv lub tsev cog khoom uas kuv tau tsim hauv kuv lub tiaj nraum qaum tsev. Nov yog thawj kauj ruam-kev tsim cov txheej txheem ntawm cov khoom siv rau lub tsev cog khoom. Tom qab yav tom ntej, raws li cov ntaub ntawv los ntawm cov ntsuas hluav taws xob, Kuv npaj yuav siv dej thiab siv lub tshuab ua pa kom zoo. Cov cuab yeej ua raws Wemos D1 mini Pro. Software rau txoj haujlwm no tau sau hauv MicroPython. Cov ntaub ntawv los ntawm cov ntsuas ntws mus rau Domoticz server khiav ntawm Raspberry Pi Zero.

Tam sim no cia mus tob rau hauv cov ntsiab lus.

Khoom siv

Rau qhov haujlwm no koj xav tau:

1. Wemos D1 mini Pro

2. Wemos trippler puag

3. Lub hwj huam muab ntaub thaiv npog (Yeem tau, koj tuaj yeem siv fais fab D1 ntawm USB).

4. OLED zaub

5. DHT22 sensor

6. SOIL sensor

7. 18b20 ntsuas kub

8. Vaj Tsev

9. Dupont cables

10. Khiav Domoticz server (Kuv siv Raspberry Pi Zero)

11. Pyhon cov ntaub ntawv. Txhua cov ntaub ntawv koj xav tau nyob ntawm no.

Kauj ruam 1: Firmware thiab Micropython Drivers

Kuv yuav tsis delve rau hauv yuav ua li cas firmware tau teeb tsa ntawm lub cuab yeej. Cov txheej txheem tau piav qhia ntxaws hauv ib ntawm kuv cov ntawv dhau los ntawm no.

Txawm hais tias muaj ib yam uas koj yuav tsum paub txog kev txhim kho firmware ntawm WemosD1 mini Pro. Feem ntau thaum kuv txhim kho firmware kuv siv cov lus txib hauv qab no:

nab hab sej esptool.exe --port COM5 --baud 460800 write_flash --flash_size = ntes 0 C: / path_to_firmware

Tab sis nws tsis ua haujlwm nrog D1 mini Pro version. Nws ua haujlwm nrog D1 mini, tab sis tsis nrog Pro. Tom qab txhim kho firmware hauv txoj kev no, D1 nkag mus rau qhov tsis muaj qhov kawg - nws rov pib dua tas li. Ib qhov twg hauv is taws nem kuv pom tias nws yog qhov tsim nyog los piav txog lub cim xeeb flash loj nws yuav siv. Koj yuav tsum siv cov lus txib hauv qab no:

nab hab sej esptool.exe -p COM8 write_flash -fs 4MB 0 C: / path_to_firmware

Yog li tom qab koj tau teeb tsa firmware, upload cov ntaub ntawv hais los saum no hauv 11.) tshwj tsis yog main.py, los ntawm kev siv ampy piv txwv. Koj yuav tsum tau kho qhov main.py tom qab, yog li tsis txhob upload tam sim no:).

Kauj ruam 2: Kev sib txuas

Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas

Txuas txhua yam khoom siv kho vajtse.

1. Av sensor:

Cov hlau liab ======> +3.3V

Dub ======> GND

Daj (cov ntaub ntawv) ===> A0

2. OLED zaub:

GND ======> GND

VCC ======> +5V

SCL ======> D1

SDA ======> D2

3. TSA 18x20:

Liab ======> +3.3V

Dub ======> GND

Dawb (cov ntaub ntawv) ==> D6, kuj ntawm rub tawm 4.7kOhm resistor txuas rau +3.3V

4. HLW 22:

GND ======> GND

VCC ======> +3.3V

OUT ======> D3

Kauj Ruam 3: Ntxiv Sensors rau Domoticz

Ntxiv Sensors rau Domoticz
Ntxiv Sensors rau Domoticz
Ntxiv Sensors rau Domoticz
Ntxiv Sensors rau Domoticz
Ntxiv Sensors rau Domoticz
Ntxiv Sensors rau Domoticz

Ntxiv cov sensors rau koj Domoticz server.

1. Xaiv SETUP/HARDWARE ntxiv hardware.

2. Ntxiv "Dummy" los ntawm cov ntawv qhia zaub mov nco. Thaum kho vajtse ntxiv, cov ntsiab lus ntawm txhua qhov kho vajtse tau hais tseg yuav raug qhia.

Kho vajtse tshiab yuav tsum muaj nyob hauv cov npe thiab yuav tsum muaj lub pob "Tsim Cov Kev Pom Zoo Virtual". Nyem rau lub pob no. Xaiv hom sensor uas koj tau tsim. Thov nco ntsoov IDX tus lej ntawm koj lub sensor.

Nkag mus rau tus lej IDx rau txhua lub sensor rau hauv main.py cov ntaub ntawv. Koj xav tau nws hauv koj tsab ntawv Python txhawm rau hais cov ntaub ntawv los ntawm cov ntsuas mus rau lub ntsuas cua virtual.

Txhawm rau pom cov npe khoom siv, nyem rau SETUP tab thiab tom qab ntawd xaiv DEVICES.

Tsis tas li, sau tus IP chaw nyob ntawm koj Domoticz server rau main.py cov ntaub ntawv.

Tam sim no koj tuaj yeem tso main.py rau Wemos D1 mini Pro.

Kauj Ruam 4: Qhov tshwm sim

Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim

Fais fab ntawm lub cuab yeej.

Tom qab ESP pib, nrhiav WiFi network tshiab hu ua "Wifimanager". Txuas nws nrog koj lub PC lossis xov tooj los ntawm kev siv tus password: "tayfunulu", tom qab ntawd mus rau IP chaw nyob 192.168.4.1.. Ntawm no koj tuaj yeem txuas koj li ESP mus rau WiFi network hauv zos. Xaiv WiFi network koj yuav siv, ntaus tus password, ntaus "Xa". Yog tias txhua yam raug, koj yuav pom cov lus "ESP ua tiav txuas nrog XXXX network". Koj ESP tam sim no txuas nrog koj lub network WiFi thiab npaj tau. Thaum nws txuas nrog WiFi nws yuav txuas rau Domoticz server thiab pib xa cov ntaub ntawv los ntawm cov ntsuas. Koj tuaj yeem taug qab cov txheej txheem hauv "Teeb"/"Log". Tso cov cim tshiab tsim los ntawm txhaj rau "Kub" tab. Cov duab sensor yuav pom.

Cov av sensor yuav pom nyob rau hauv "Utility" tab.

Kos cov cim zoo li "nyiam" los ntawm txhaj rau lub hnub qub kos npe, kom pom tag nrho ntawm "Dashboard" tab.

Txij li kev ua yuam kev tau ua tiav hauv cov cai, lub cuab yeej yuav tsis tsoo, tab sis tsuas yog rov pib dua thaum muaj qhov ua yuam kev.

Yog li tam sim no koj yuav paub, kuv yuav mus dab tsi hauv koj lub Tsev Cog Khoom.

Hmoov zoo:)

Pom zoo: