Introduction: Internet of Things: LoRa Weather Station
This is an example of a nice LoRa project. The weather station contains a temperature sensor, air pressure sensor and humidity sensor. The data is read out and sent to Cayenne Mydevices and Weather Underground using LoRa and The Things Network.
Check if there is LoRa Gateway of the The Things Network in your area!
Step 1: The Hardware
For this project I used the following hardware:
- Arduino Pro Mini 328 - 3.3V/8MHz (https://www.sparkfun.com/products/11114)
- RFM95W (http://www.hoperf.com/rf_transceiver/lora/RFM95W.html) (https://www.aliexpress.com/item/RFM95W-20dBm-100mW-868Mhz-915Mhz-DSSS-spread-spectrum-wireless-transceiver-module-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)
Total costs less than 10 dollars.
Step 2: The Wiring
It is wise to first test the sensors on a breadboard. So you can be sure that the sensors works. You can also measure the power consumption with a multimeter. (Use the Low-Power lib to measure the minimum)
First solder wires to the RFM95W module and then solder them to the Arduino Pro Mini. Then add the sensors. View the images and the diagram!
Step 3: The Casing
To place the weather station somewhere, I drew a case and printed it with the 3d printer.
The models can be found on Thingiverse. Of course you can of course make your own variant. https://www.thingiverse.com/thing:2594618
Step 4: The Software
The code I have used can be found on GitHub: https://github.com/henri98/LoRaWanWeatherStation
I used Atom with PlatformIO to realize this project, so this is a PlatformIO project. I used the folowing libarys:
- LoraMAC-in-C for Arduino thank to Thomas Telkamp and Matthijs Kooijman (https://github.com/matthijskooijman/arduino-lmic)
- CayenneLPP of The Things Network Arduino Library (https://github.com/TheThingsNetwork/arduino-device-lib)
- Adafruit DHT Humidity & Temperature Unified Sensor Library (https://github.com/adafruit/DHT-sensor-library)
- Low-Power: Lightweight low power library for Arduino (https://github.com/adafruit/DHT-sensor-library)
Step 5: Cayenne MyDevices
You can integrate your application in The Things Network with Cayenne myDevices
To add the integration:
- Go to the application console on The Things Network website;
- Select integrations from the top-right menu;
- Select Cayenne;
- Follow the instructions
Step 6: Weather Underground
To send data to Weather underground, create an HTTP integration. The data will be sent to the URL with a POST or a GET. The following script captures the data and sends it to Weather Underground. Register your own Personal Weather Station on https://www.wunderground.com/personal-weather-station/signup
?><?php
echo time();
file_put_contents('json/post'.time().'.json', file_get_contents('php://input')); $json = file_get_contents('php://input'); $data = json_decode($json);
// take the data out of the json $temperature_1 = $data->payload_fields->temperature_1; $barometric_pressure_2 = $data->payload_fields->barometric_pressure_2; $relative_humidity_3 = $data->payload_fields->relative_humidity_3;
// tempc to tempf $tempf = ($temperature_1 * 9/5) + 32;
// pressure $pressure = $barometric_pressure_2/33.863886666667;
if( isset($pressure) && !empty($pressure) && isset($tempf) && !empty($tempf) && isset($relative_humidity_3) && !empty($relative_humidity_3)){ file_get_contents("https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?ID=XXXXXXX&PASSWORD=XXXXXXXX&dateutc=now&tempf=" . $tempf . "&humidity=" . $relative_humidity_3 . "&baromin=" . $pressure); }
?>
Step 7: Enjoy Your Weather Station
Enjoy Your Weather Station
In Cayenne myDevices you can share a project Dashboard. Share yours in the comments!
This is mine: https://cayenne.mydevices.com/shared/59e9c7612d218c587ba531c4

Participated in the
Wireless Contest
13 Comments
Question 3 years ago on Step 1
I have a spare UNO. I can just map the pins from the mini to the UNO, right? Is there any reason an UNO would not work?
Question 3 years ago on Introduction
Thank you for everything. How can ı learn lora gateway ?
If ıt doesnt have gate way my near ,Shoul I do myself?
4 years ago
Okay, I'm excited by this!
I am new to arduino projects and I've been brainstorming as to how I might get very localized weather data from a nearby park boardwalk that seems to have unique weather compared to the local, surrounding area. I would HIDE my little weather station somewhere in the park. I never know how to dress if I wish to go for a walk/hike there. I was surmising that I would have to use a more expensive option, like a cellular breakout board and "call" my weather station to get the info.
This seems much more doable. Very cool!
I would like to add some kind of wind-speed mechanism if there was one that did not spin around saying "hear I am, come vandalize me!" I'm imagining something that bends in the wind, providing a piezo-electric output to the arduino, that would be easier to hide. hmmmmm.
4 years ago
Hello ! Why my result when I uploaded to my node on serial monitor is "Enter do_send" and after that there isn't happening on my serial monitor.
4 years ago
I've try the similar setup with the open IoT - www.i4things.com / https://github.com/i4things - with Heltec LoRa32 hardware, but the power consumption of the ESP32 is not small , switched to Feather 32u4 LoRa and now seems to be OK :)
Question 5 years ago
Hi, Nice project. I have 5v Arduino Pro Mini boards already in my possession and am hesitant about investing into 3.3v/8mhz, would 5v be applicable with this project? Thanks!
5 years ago
Hello,
Page not found on the link:
(https://github.com/adafruit/DHT-sensor-librar)
Thank you
Reply 5 years ago
Thnx! just put an "y" after the link.
5 years ago
Just one (hopefully easy) question.
I have multiple nodes sending data to thingspeak and cayenne, but would like Weather Underground as an option.
Where do you use the script you have posted in the HTTP integration of TTN?
cheers
mutton
Reply 5 years ago
Hi mutton,
I put the PHP script on a private webserver, in TTN I added the http integration, so all the data is posted to the script on my private webserver.
Regards,
Henri
5 years ago
very nice wifi module. I looking for low power wifi sending, I check that maximum current can be 20 mA. Using esp and regulator it takes a little bit more time to connect everything correct. I looking for something like this: arduino pro mini + low power wifi module + sensors, 1. arduino sleep for 15 minutes 2. measure some values and send to thingspeak 3. sleep again. This module help me, thanks
5 years ago
Nice diy weather station. Any plans to add more weather sensors like wind speed.
Reply 5 years ago
Thank you very much! Maybe in the future. I added a script to read the battery voltage today.