Internet of Things: LoRa Weather Station

by muitg in Circuits > Arduino

34820 Views, 104 Favorites, 0 Comments

Internet of Things: LoRa Weather Station

b090d7c4550b47d79d5c13c6061916f5.large.png
image-1508417779575.large.png
image-1508417844287.large.png
IMG_20171019_155922.jpg
photo_2017-10-23_16-25-25.jpg

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!

The Hardware

ca6dd7be-6a73-413d-aab1-e0c1f0fd5273.jpg
3d1f5aaa-991f-4ec8-b182-006168e5b848.jpg
AM2302-DHT22-Temperature-And-Humidity-Sensor-Module-For-Arduino-SCM-1.jpg
u4630_2.jpg

The Wiring

811b9b9d-8271-4e64-a113-7fa30a6935aa.png
IMG_20171017_181745.jpg
IMG_20171017_181756.jpg
IMG_20171017_182504.jpg
IMG_20171017_182511.jpg
IMG_20171017_185401.jpg

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!

The Casing

0951e494-24c0-4930-b561-32a396f7bce6.jpg
54d728d9-7c77-4ff6-b902-01cb2511bd86.jpg
2ca3ce99-b7c8-41c2-88ca-90802c851e88.jpg
4d9f4308-5b7e-4378-a862-b525c4fa67f7.jpg

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

The Software

Untitled.png

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:

Cayenne MyDevices

3591043a-3139-40f3-adaf-9c6ce576cb3f.png

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

Weather Underground

7c9ed53f-24e6-49f5-9640-83e6e950f5db.png

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); }

?>

?>

Enjoy Your Weather Station

3591043a-3139-40f3-adaf-9c6ce576cb3f (1).png
Screenshot from 2017-10-21 11-24-13.png

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