Cov txheej txheem:

Wind Station rau Windsurfing Raws ON MQTT & AWS: 3 Kauj Ruam (nrog Duab)
Wind Station rau Windsurfing Raws ON MQTT & AWS: 3 Kauj Ruam (nrog Duab)

Video: Wind Station rau Windsurfing Raws ON MQTT & AWS: 3 Kauj Ruam (nrog Duab)

Video: Wind Station rau Windsurfing Raws ON MQTT & AWS: 3 Kauj Ruam (nrog Duab)
Video: The Big One. Raw footage 3rd of March 2022 2024, Kaum ib hlis
Anonim
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS
Wind Station for Windsurfing Raws ON MQTT & AWS

Hauv Shenzhen, muaj ntau lub puam zoo nkauj. Nyob rau lub caij ntuj sov, kuv nyiam tshaj plaws kev ncaws pob yog caij nkoj.

Txog kev ua kis las caij nkoj, Kuv tseem yog tus pib, Kuv nyiam qhov dej hiav txwv kov kuv lub ntsej muag, thiab ntau dua, Kuv tau txais ntau tus phooj ywg tshiab nrog kev ntaus pob ncaws pob no.

Tab sis rau kev caij nkoj ua si, cua kom raug yog qhov tseem ceeb heev. Ntau zaus thaum peb mus txog ntawm ntug hiav txwv, peb pom tias tsis muaj cua, lossis cua ntau dhau rau kuv thaum pib. Thiab nrog rau kev tshaj tawm huab cua huab cua, nws tsis yooj yim sua rau lawv los kwv yees/saib xyuas cua.

Yog li kuv npaj ua lub chaw nres tsheb cua lub sijhawm tiag tiag, thiab qhia tawm nrog cov ntaub ntawv yuav txhua tus neeg caij nkoj hauv Shenzhen.

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse

Qhov kuv xav tau yog: 1. Yeej, anemometer;

2. Qhov ntsuas kub thiab av noo;

3. Cua siab sensor. Raws li lawv yog kev tshaj tawm rau huab cua/nag;

4. Kev sib txuas module rau hauv internet. Kuv siv ESP12 wifi module

5. Thiab, cov ntaub ntawv pov thawj dej, thiab lub txhab nyiaj hluav taws xob; Dhau li, kuv tsim lub hauv paus pawg thawj coj kom txhua lub tshuab hluav taws xob tuaj yeem tso tau yooj yim, raws li cov duab txuas.

Tau kawg, koj tseem tuaj yeem siv daim ntawv qhia zaub mov rau qhov no.

Tshiab: kho vajtse txheeb ze yooj yim, kuv tau ntim nws rau hauv cov khoom siv ntawm Makerfabs.

Hauv kev tsim kho vajtse, Anemometer yog cov khoom sib xws, yog li nws yuav tsum txuas nrog ESP12 ADC module, Thiab BMP180 Barometer siv I2C rau kev sib txuas lus txuas lawv rau ESP12 GPIO4/5, uas txhawb nqa I2C kev sib txuas lus, thiab DHT 11 rau digital output. Nco ntsoov tias yuav tsum muaj tus tiv thaiv rub tawm; coj cov duab siv txuas nrog.

Kauj ruam 2: Firmware

Rub tawm kuv qhov piv txwv piv txwv ntawm https://github.com/hunrypan/weatherstation?tdsourcetag=s_pcqq_aiomsg. Nco ntsoov tias qee lub tsev qiv ntawv yuav tsum tau teeb tsa ua ntej, suav nrog:

  • ESP8266WiFi.h
  • MQTT.h
  • DHT.h tau
  • Hlau.h
  • Adafruit_BMP085.h

Hloov kho qhov teeb tsa WIFI, thiab MQTT. Yog lawm, yog tias tsis yog, koj yuav tsum sau npe tus account, thiab tsim qhov piv txwv tshiab. Thiab hloov kho lawv hauv cov firmware:

const char* ssid = "xxx"; // Wi-Fi SSIDconst char* password = "xxx"; // Tus password Wi-nkaus

thiab MQTT cov ntaub ntawv (yog tias koj tsis paub txog qhov no, thov xa mus rau Makerfabs ESPwatch rau MQTT cov ncauj lus kom ntxaws siv) ntawm:

const char* hostname = "postman.cloudmqtt.com"; int chaw nres nkoj = 16265; const char* neeg siv = "xxx"; const char* user_password = "xxxx"; const char* id = "xxxx";

Thiab nyob rau hauv lub khoos phis tawj voj, ESP12 module nyeem lub sensor

lossis cua/ntsuas kub/huab cua ua ntej los ntawm:

int windspeed = analogRead (windpin); humi = dht.readHumidity (); temp = dht.readTemperature ();

Rub lub firmware rau ESP ntawm MCU pawg thawj coj saib.

Kauj ruam 3: Nodejs thiab Deploy rau AWS

Nodejs and Deploy to AWS
Nodejs and Deploy to AWS
Nodejs and Deploy to AWS
Nodejs and Deploy to AWS

Esp8266 WIFI module xa cov ntaub ntawv huab cua rau MQTT server, los ntawm kev tshaj tawm cov lus ntawm ncauj lus rau MQTT server. Kawg nodejs tau txais cov ntaub ntawv huab cua los ntawm mqtt server, los ntawm cov ncauj lus sau tseg ntawm txuag Mqtt server.

Kuv xa kuv NODE JS ntawm AWS server, yog li leej twg txaus siab rau qhov no tuaj yeem nkag mus rau kuv qhov chaw nres tsheb cua ntawm: https://34.220.205.140: 8080/cua

Pom zoo: