Mundarija:
2025 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2025-01-13 06:58
Bu yaxshi LoRa loyihasining namunasidir. Ob -havo stantsiyasida harorat sensori, havo bosimi sensori va namlik sensori mavjud. Ma'lumotlar o'qiladi va LoRa va Things Network yordamida Cayenne Mydevices va Weather Underground -ga yuboriladi.
Sizning hududingizda narsalar tarmog'ining LoRa shlyuzi borligini tekshiring!
1 -qadam: Uskuna
Ushbu loyiha uchun men quyidagi uskuna ishlatdim:
- Arduino Pro Mini 328 - 3.3V/8MGts (https://www.sparkfun.com/products/11114)
- RFM95W (https://www.hoperf.com/rf_transceiver/lora/RFM95W.html) (https://www.aliexpress.com/item/RFM95W-20dBm-100mW-868Mhz-915Mhz-DSSS-spread-spectrum-wireless -uzatuvchi-modul-SPI-SMD/32799536710.html)
- DHT22 (https://www.aliexpress.com/item/High-Precision-AM2302-DHT22-Digital-Temperature-Humidity-Sensor-Module-For-arduino-Uno-R3/32759158558.html)
- BME280 (https://www.aliexpress.com/item/I2C-SPI-BMP280-3-3-BMP280-3-3-Digital-Barometric- Pressure-Altitude-Sensor-High-Precision-Atmospheric/32775855945.html)
Umumiy narxi 10 dollardan kam.
2 -qadam: simlarni ulash
Datchiklarni non panelida sinab ko'rish oqilona. Shunday qilib, sensorlar ishlayotganiga amin bo'lishingiz mumkin. Quvvat sarfini multimetr yordamida ham o'lchash mumkin. (Minimalni o'lchash uchun past quvvatli libdan foydalaning)
Avval simlarni RFM95W moduliga, so'ngra Arduino Pro Mini -ga lehimlang. Keyin sensorlarni qo'shing. Rasm va diagrammani ko'ring!
3 -qadam: Koson
Ob -havo stantsiyasini biron joyga joylashtirish uchun men qutini chizdim va uni 3d printerda chop etdim.
Modellarni Thingiverse -da topish mumkin. Albatta, siz o'zingizning variantingizni qilishingiz mumkin.
4 -qadam: dasturiy ta'minot
Men ishlatgan kodni GitHub -da topish mumkin:
Men bu loyihani amalga oshirish uchun PlatformIO bilan Atomdan foydalandim, shuning uchun bu PlatformIO loyihasi. Men quyidagi kutubxonalardan foydalandim:
- Arduino uchun LoraMAC-in-C Tomas Telkamp va Matthijs Kooijmanga rahmat (https://github.com/matthijskooijman/arduino-lmic)
- Thai Network Arduino kutubxonasining CayenneLPP (https://github.com/TheThingsNetwork/arduino-device-lib)
- Adafruit DHT namlik va harorat birlashtirilgan sensorlar kutubxonasi (https://github.com/adafruit/DHT-sensor-library)
- Kam quvvatli: Arduino uchun kam quvvatli kutubxona (https://github.com/adafruit/DHT-sensor-library)
5 -qadam: Cayenne MyDevices
Siz o'z ilovangizni Cayenne myDevices bilan Things Network -ga qo'shishingiz mumkin
Integratsiyani qo'shish uchun:
- Things Network veb -saytidagi dastur konsoliga o'ting;
- Yuqori o'ng menyudan integratsiyani tanlang;
- Cayenne -ni tanlang;
- Ko'rsatmalarga amal qiling
6 -qadam: Er osti ob -havosi
Ma'lumotni Weather Underground -ga yuborish uchun HTTP integratsiyasini yarating. Ma'lumotlar POST yoki GET bilan URL manziliga yuboriladi. Quyidagi skript ma'lumotlarni to'playdi va ularni Weather Underground -ga yuboradi. Shaxsiy ob-havo stantsiyangizni https://www.wunderground.com/personal-weather-station/signup saytida ro'yxatdan o'tkazing.
<? php
? php echo vaqti ();
file_put_contents ('json/post'. time (). '. json', file_get_contents ('php: // input'));
$ json = file_get_contents ('php: // input'); $ ma'lumotlar = json_decode ($ json);
// ma'lumotlarni jsondan chiqarib oling
$ temperature_1 = $ data-> payload_fields-> temperatur_1; $ barometric_pressure_2 = $ data-> payload_fields-> barometric_pressure_2; $ relat_humidity_3 = $ data-> payload_fields-> nisbiy_humlik_3;
// tempf to tempf
$ tempf = ($ temperature_1 * 9/5) + 32;
// bosim
$ bosim = $ barometric_pressure_2/33.863886666667;
agar (isset ($ bosim) &&! bo'sh ($ bosim) && isset ($ tempf) &&! bo'sh ($ tempf) && isset ($ nisbiy_ namlik_3) &&! bo'sh ($ nisbiy_ namlik_3)) {file_get_contents ("https:// rtupdate.wunderground.com/weatherstation/updateweatherstation.php? ID = XXXXXXX & PASSWORD = XXXXXXXX & dateutc = now & tempf = ". $ tempf." & nem = ". $ relat_humidity_3." & baromin = ". $ bosimi);
}
?>
?>
7 -qadam: Ob -havo stantsiyangizdan zavqlaning
Ob -havo stantsiyangizdan rohatlaning
Cayenne myDevices -da siz boshqaruv paneli loyihasini baham ko'rishingiz mumkin. Fikrlaringizni sharhlarda baham ko'ring!
Bu meniki: