LoRa Weather Station 2019

About This Project

Weather Station 2019 is a device to monitor temperature and humidity, that sends all the results to the
Cayenne server with LoRa radio modulation. Weather Station 2019 is built around an Arduino MKRWAN
1300 board.
It’s powered by an Ansmann 3.7V 5200mAh battery connected to Microchip MIC5201 3,3V fixed voltage regulator
in order to guarantee low quiescent currents.
The chosen sensor is I2C interface version of SENSIRION SHT35-DIS. It has a
resolution of ± 0.1% ° C and ± 1.5% RH. SHT35-DIS consumptions are 45μA in idle
state and 6mA in measurement. It’s assembled on a special PCB and placed into
waterproof cap.
Weather Station 2019 is wired inside an Hammond’s Polycarbonate box with 160x90x60,5mm dimensions
and IP66 protection’s degree.

What’s Connected

Arduino MKRWAN1300
Sensirion SHT35-DIS
Microchip MIC5201
Ansmann 3,7V 5200mAh
5dB gain LoRa Antenna 868MHz

Triggers & Alerts

I am not using triggers or alerts, now.
I’ll enable battery status alert in future.

Dashboard Screenshots

Photos of the Project

2 Likes

Great project, thanks for sharing!

Awesome project @franx74it. will be great if you add the code used for it.

1 Like

Thanks, i’m now testing theory, specially hardware tricks about power saving and deep sleep stateWeatherStation2019.txt (6.4 KB)

You appear to have room for a solar panel charger. I would consider adding this to improve your battery life.

yup, adding a solar panel is good option.

in next revision i’ll try, thanks

how do you use the location widget? i cant find it

are you referring to lora device or arduino devices?

i am using a node mcu, ESP8266. and i want to track the device with the location widget, like the map on the screenshot. but i cant find it. how can i use that widget?

you need to send data using Cayenne.virtualWrite(20, buffer, "gps", "m"); to create a map widget where the buffer is in the format [lat, lon, alt]

but where can i find the widget to put on the project?. i cant find it on the custom widgets.

can i send you my full code to help me with the map widget please?

when you upload the code line, the map widget will be created automatically.

i have this code

    /*
This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.

The CayenneMQTT Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

Steps:
1. If you have not already installed the ESP8266 Board Package install it using the instructions here: https://github.com/esp8266/Arduino#installing-with-boards-manager.
2. Select your ESP8266 board from the Tools menu.
3. Set the Cayenne authentication info to match the authentication info from the Dashboard.
4. Set the network name and password.
5. Compile and upload the sketch.
6. A temporary widget will be automatically generated in the Cayenne Dashboard. To make the widget permanent click the plus sign on the widget.
*/

//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 5
#define DHTTYPE DHT11
DHT_Unified dht(DHTPIN, DHTTYPE);

// WiFi network info.
char ssid[] = "";
char wifiPassword[] = "";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "";
char password[] = "";
char clientID[] = "";

unsigned long lastMillis = 0;
#define VIRTUAL_CHANNEL 1
#define ACTUATOR_PIN 4 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
void setup() {
	Serial.begin(9600);
  pinMode(ACTUATOR_PIN, OUTPUT);
	Cayenne.begin(username, password, clientID, ssid, wifiPassword);
  dht.begin();
  sensor_t sensor;
}

void loop() {
	Cayenne.loop();
  //Publish data every 1 seconds (1000 milliseconds). Change this value to publish at a different interval.
  if (millis() - lastMillis > 1000) {
    lastMillis = millis();
    //Write data to Cayenne here. This example just sends the current uptime in milliseconds.
    Cayenne.virtualWrite(0, lastMillis);

    sensors_event_t event;  
    dht.temperature().getEvent(&event);
    Cayenne.celsiusWrite(3, event.temperature);
    dht.humidity().getEvent(&event);
    Cayenne.virtualWrite(2, event.relative_humidity, "rel_hum", "p");
  }
}

// Default function for sending sensor data at intervals to Cayenne.
// You can also use functions for specific channels, e.g CAYENNE_OUT(1) for sending channel 1 data.
CAYENNE_OUT_DEFAULT()
{
	// Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
	Cayenne.virtualWrite(0, millis());
  Cayenne.virtualWrite(20, buffer, "gps", "m");
	// Some examples of other functions you can use to send data.
	//Cayenne.celsiusWrite(1, 22.0);
	//Cayenne.luxWrite(2, 700);
	//Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);
}

// Default function for processing actuator commands from the Cayenne Dashboard.
// You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_IN(VIRTUAL_CHANNEL)
{
  int value = getValue.asInt();
  CAYENNE_LOG("Channel %d, pin %d, value %d", VIRTUAL_CHANNEL, ACTUATOR_PIN, value);
  // Write the value received to the digital pin.
  digitalWrite(ACTUATOR_PIN, value);
}

in that code there is nothing related to tracking.

thats the thing, i want to add the tracking map to add it. how can i do it?

this is the code to send gps data to cayenne, but where is the code to get the data from sensor?

i have another problem, ive send an email requesting the license with you to know the pricing plans and info about. i havent get a reply from you…

cayenne is free to use and there are no pricing plans. if you have a hardware which you want to integerate with cayenne then you can check this IoT Ready Program - myDevices and this Work with Us - myDevices