Cov txheej txheem:

Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE Hla Blynk Server: 4 Kauj Ruam
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE Hla Blynk Server: 4 Kauj Ruam

Video: Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE Hla Blynk Server: 4 Kauj Ruam

Video: Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE Hla Blynk Server: 4 Kauj Ruam
Video: Siv Yis Neeb Leej Cawm Seej Music Video Short 2024, Kaum ib hlis
Anonim
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server
Chaw Huab Cua DIY Siv DHT11, BMP180, Nodemcu Nrog Arduino IDE hla Blynk Server

Github: DIY_Weather_Station

Hackster.io: Chaw nres tsheb huab cua

Koj puas tau pom Daim Ntawv Thov Huab Cua txoj cai? Zoo li, thaum koj qhib nws koj yuav paub txog huab cua zoo li Kub, Vaum thiab lwm yam Cov ntawv nyeem yog tus nqi nruab nrab ntawm thaj chaw loj, yog li yog koj xav paub qhov tseeb tsis cuam tshuam nrog koj chav, koj ua tsis tau vam khom rau Daim Ntawv Thov Huab Cua. Rau lub hom phiaj no cia txav mus rau qhov ua Chaw Huab Cua uas yog tus nqi muaj txiaj ntsig, thiab tseem ntseeg tau thiab muab qhov muaj txiaj ntsig zoo rau peb.

Chaw nres tsheb huab cua yog lub chaw muaj cov twj thiab cuab yeej siv los ntsuas cov huab cua hauv ntiaj teb los muab cov ntaub ntawv qhia txog huab cua thiab kawm txog huab cua thiab huab cua. Nws yuav tsum tau siv dag zog me ntsis los ntsaws thiab code. Yog li cia pib.

Txog Nodemcu:

NodeMCU yog qhov qhib IoT platform.

Nws suav nrog cov khoom siv uas khiav ntawm ESP8266 Wi-Fi SoC los ntawm Espressif Systems, thiab kho vajtse uas yog raws li ESP-12 module.

Lub sij hawm "NodeMCU" los ntawm lub hauv paus hais txog lub firmware ntau dua li cov khoom siv dev. Lub khoos phis tawj siv Lua cov lus sau. Nws yog ua raws txoj haujlwm eLua, thiab ua rau Espressif Tsis-OS SDK rau ESP8266. Nws siv ntau qhov phiaj xwm qhib, xws li lua-cjson, thiab spiff.

Sensors thiab Software xav tau:

1. Nodemcu (esp8266-12e v1.0)

2. DHT11

3. BMP180

4. Arduino IDE

Kauj Ruam 1: Paub Koj Cov Sensors

Paub Koj Tus Kheej
Paub Koj Tus Kheej

BMP180:

Nqe lus piav qhia:

BMP180 suav nrog lub piezo-resistive sensor, qhov sib piv rau digital hloov pauv thiab tswj chav nrog E2PROM thiab ntu I2C interface. BMP180 xa cov nqi tsis suav nrog ntawm qhov siab thiab qhov kub. E2PROM tau khaws 176 me ntsis ntawm cov ntaub ntawv ntsuas tus kheej. Qhov no yog siv los them nyiaj offset, qhov ntsuas kub thiab lwm yam ntsuas ntawm lub ntsuas.

  • UP = cov ntaub ntawv siab (16 txog 19 ntsis)
  • UT = cov ntaub ntawv ntsuas kub (16 ntsis)

Kev Qhia Tshwj Xeeb:

  • Vin: 3 txog 5VDC
  • Logic: 3 txog 5V ua raws
  • Kev ntsuas qhov ntsuas siab: 300-1100 hPa (9000m txog -500m saum hiav txwv)
  • Mus txog 0.03hPa / 0.25m daws teeb meem -40 txog +85 ° C ua haujlwm ntau, +-2 ° C kub qhov tseeb
  • Pawg thawj coj/nti siv I2C 7-qhov chaw nyob 0x77.

HLB 11:

Nqe lus piav qhia:

  • DHT11 yog lub hauv paus, tus nqi qis heev cov ntsuas kub thiab cov av noo.
  • Nws siv lub ntsuas hluav taws xob muaj peev xwm thiab lub ntsuas cua ntsuas cua ib puag ncig, thiab ntuav tawm lub teeb liab digital ntawm cov ntaub ntawv tus pin (tsis xav tau cov tswv yim sib txuas pins xav tau). Nws yooj yim siv, tab sis yuav tsum tau ua tib zoo siv sijhawm txhawm rau khaws cov ntaub ntawv.
  • Tsuas yog qhov tsis zoo ntawm qhov ntsuas no tsuas yog koj tuaj yeem tau txais cov ntaub ntawv tshiab los ntawm nws ib zaug txhua 2 vib nas this, yog li thaum siv peb lub tsev qiv ntawv, kev nyeem ntawv sensor tuaj yeem ntev txog 2 vib nas this.

Kev Qhia Tshwj Xeeb:

  • 3 txog 5V lub zog thiab I/O
  • Zoo rau 0-50 ° C ntsuas kub ± 2 ° C raug
  • Zoo rau 20-80% kev nyeem cov av noo nrog 5% qhov tseeb
  • 2.5 mA max siv tam sim no thaum hloov pauv (thaum thov cov ntaub ntawv)

Kauj ruam 2: Kev sib txuas

Kev sib txuas
Kev sib txuas

DHT11 nrog Nodemcu:

Pin 1 - 3.3V

Pin 2 - D4

Pin 3 - NC

Pin 4 - Gn

BMP180 nrog Nodemcu:

Lub hwj chim - 3.3V

Gnd - Yog

TSO - D6

SDA - D7

Kauj Ruam 3: Teeb Blynk

Image
Image
Teeb tsa Blynk
Teeb tsa Blynk

Blynk yog dab tsi?

Blynk yog Platform nrog iOS thiab Android apps los tswj Arduino, Raspberry Pi thiab nyiam hauv Is Taws Nem.

Nws yog lub digital dashboard uas koj tuaj yeem tsim cov duab nraaj rau koj txoj haujlwm los ntawm kev yooj yim rub thiab nqis cov cuab yeej. Nws yooj yim heev los teeb tsa txhua yam thiab koj yuav pib tinkering hauv tsawg dua 5 feeb. Blynk tsis raug khi rau qee lub rooj tsav xwm tshwj xeeb lossis daim thaiv. Hloov chaw, nws txhawb nqa kho vajtse uas koj xaiv. Txawm hais tias koj tus Arduino lossis Raspberry Pi tau txuas rau Is Taws Nem hla Wi-nkaus, Ethernet lossis qhov tshiab ESP8266 nti, Blynk yuav tau txais koj online thiab npaj rau Is Taws Nem Ntawm Koj Yam.

Yog xav paub ntxiv hauv kev teeb tsa Blynk: Xav paub ntxiv Blynk Teeb

Kauj ruam 4: Code

Code
Code

// Cov lus pom rau txhua kab yog muab hauv.ino cov ntaub ntawv hauv qab no

#include #define BLYNK_PRINT Serial #include #include #include #include #include Adafruit_BMP085 bmp; #define I2C_SCL 12 #define I2C_SDA 13 ntab dst, bt, bp, ba; char dstmp [20], btmp [20], bprs [20], balt [20]; bool bmp085_present = muaj tseeb; char auth = "Muab koj tus yuam sij Authication los ntawm Blynk app ntawm no"; char ssid = "Koj li WiFi SSID"; char pass = "Koj Tus Password"; #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht (DHTPIN, DHTTYPE); // Txhais tus pin thiab dhttype BlynkTimer timer; void sendSensor () {if (! bmp.begin ()) {Serial.println ("Tsis tuaj yeem pom qhov ntsuas BMP085 siv tau, tshawb xyuas kab!"); thaum (1) {}} ntab h = dht.readHumidity (); ntab t = dht.readTemperature (); yog (isnan (h) || isnan (t)) {Serial.println ("Ua tsis tau tejyam nyeem los ntawm DHT sensor!"); rov qab; } ob npaug gamma = log (h / 100) + ((17.62*t) / (243.5 + t)); ob npaug dp = 243.5*gamma / (17.62-gamma); ntab bp = bmp.readPressure ()/100; ntab ba = bmp.readAltitude (); ntab bt = bmp.readTemperature (); ntab dst = bmp.readSealevelPressure ()/100; Blynk.virtualWrite (V5, h); Blynk.virtualWrite (V6, t); Blynk.virtualWrite (V10, bp); Blynk.virtualWrite (V11, yog); Blynk.virtualWrite (V12, bt); Blynk.virtualWrite (V13, dst); Blynk.virtualWrite (V14, dp); } void teeb () {Serial.begin (9600); Blynk.begin (auth, ssid, dhau); dht.begin (); Wire.begin (I2C_SDA, I2C_SCL); ncua (10); timer.setInterval (1000L, sendSensor); } tsis muaj dab tsi voj () {Blynk.run (); timer.run (); }

Pom zoo: