IOT

How to design a LoRa Based Wireless Weather Station with Arduino & ESP32

We’ll learn how to create a LoRa-based wireless weather station with an Arduino Pro Mini and an ESP32 Wifi Module in this project. The Weather Station Node can be placed on the top of your house or at any remote location within a few kilometers of your home. The BME280 Barometric Pressure Sensor, as well as a BH1750 Light Sensor and a Rain Sensor, can be used. Temperature, Humidity, Pressure, Altitude, Dew Point, Rainfall, and Light Intensity are some of the environmental factors that this weather station can measure.

You may monitor data from a few kilometers away with the LoRa Module SX1278/RFM95 (up to 5Km). The device is powered by a 3.7V lithium-ion battery with low power consumption.

Proposed System

The Gateway can either be put inside the house or at a specified height to obtain a great distance. Lora SX1278/RFM95 and ESP32 Wifi Module are used to build the gateway. The data from the sender or Sensor Node is collected by the receiver and uploaded to the server.

Weather Station

The received data can be viewed in a variety of ways. I’ll show you three different methods to present the data. The first approach is to keep an eye on the data on a Web server. You may monitor data on the Webpage using the ESP32 Board’s local IP. You can submit the data to Thingspeak Server and observe the logged data in a graphical style using the second technique. The third method is to use the Blynk Application to monitor the data online. You can monitor weather data using any of the techniques available. You can make this fantastic wireless weather station by yourself.

Components Required

  • ESP32 ESP-32S Development Board
  • Arduino Pro Mini
  • LoRa Module
  • Barometric Pressure Sensor-BME280
  • BH1750 Light Sensor
  • Rain Sensor
  • 7V 1000mAh Lithium-Ion Battery

Sensors for Weather Station

  • BME280 Barometric Pressure Sensor

Temperature, Humidity, and Atmospheric Pressure may all be measured with the BME280 Barometric Pressure Sensor. The sensor uses an I2C bus and is powered by a 3.3V supply. The unit has excellent linearity and precision sensors and is ideal for low current consumption, long-term stability, and EMC resilience.

The sensor is best for measuring humidity with a precision of 3%, barometric pressure with a precision of 1 hPa, and temperature with a precision of 1.0°C. You can also use it as an altimeter with a 1 meter or higher precision because pressure fluctuates with altitude and the pressure measurements are so good!

  • Rain Sensor

Rain sensors are used in the detection of water beyond what a humidity sensor can detect.

Rain Sensor

The rain sensor detects water, which completes the circuits on the printed leads on its sensor boards. When wet, the sensor board operates as a variable resistor, changing from 100k to 2M ohms when dry. In other words, the wetter the board is, the more current is conducted.

  • BH1750 Ambient Light Sensor

The BH1750 light intensity sensor has an I2C bus interface and is a digital Ambient Light Sensor. This sensor is ideal for obtaining ambient light data. The LUX value of light may be reliably measured with this sensor up to 65535. 

The sensor runs on 3.3V and may be readily interfaced with any microcontroller through its I2C pins. Anemometer sensors can be added to this project in addition to all of these sensors. The anemometer is a device that monitors wind speed and informs you of the current state of the air moving speed.

LoRa Weather Station Node & Gateway Circuit

To connect wirelessly, the Wireless Weather Station requires a Sender and Receiver circuit. As a result, the Sender Circuit is referred to as a Sensor Node, while the Receiver Circuit is referred to as a Gateway.

Sensor Node Circuit

A low-power Arduino board must be chosen. As a result, the Arduino Pro Mini is the finest 3.3V board with an 8 MHz clock frequency. Ai-LoRa Thinker’s Module SX1278 can be used. The I2C protocol is used by the BH1750 and BME280 sensors. The SPI protocol is used by the LoRa Module SX1278. The gadget is attached to the RAW pin of the Pro Mini and is powered by a 3.7V Lithium-Ion battery.

Lora Arduino Based Weather Station

The Rain Sensor, BH1750 Ambient Light Sensor, BME280 Barometric Sensor & LoRa Module is connected to the 3.3V of Arduino Pro Mini. You can use an additional TP4056 Battery charging Module to charge the Battery. Apart from this adding a Solar Panel and harvesting Solar energy to the Circuit would be the best option.

Wireless Weather Station

The circuit is built on a breadboard, however, a bespoke PCB can be designed for this project. Okay, except for the rain sensor, which must be placed outside to monitor rainfall, all of the sensors may be placed in a small waterproof box. The Sensor Node consumes relatively little power, thus putting it to sleep will extend its battery life. Also, by removing the superfluous voltage regulator and replacing it with a low-power LDO or buck converter IC, the power consumption can be further reduced.

The LoRa Module uses the 433MHz frequency, however, you can choose between 868MHz and 915MHz depending on your location. You can use any other Lora module with a different antenna depending on your region’s availability. Keep in mind that the LoRa Based Weather Station is not waterproof, therefore keep it within the waterproof enclosure.

Wifi Gateway Circuit

Only the LoRa Module SX1278 and the ESP32 Wifi Module are available on the gateway side. The LoRa is connected to the ESP32 board through SPI pins. This device is also powered via a USB cable.

The Gateway unit can be positioned inside or outside of the room, as long as it is close to the WiFi network. The local wifi network is connected to the ESP32 Wifi module. The data from the sensor node is received by the LoRa. The data is uploaded to the server using the esp32 wifi module.

Library Installation on Arduino IDE

You must first install Libraries in the Arduino IDE before proceeding to the programming section. The following is a list of libraries that are referenced in the code.

1. LoRa Library

LoRa radios are used to send and receive data, and the LoRa library is utilized to do so. This library directly exposes the LoRa radio, allowing you to send data to any radio in range using the same radio parameters. There is no addressing and all data is broadcast.

Download: LoRa Library

2. BME280 Library

The Adafruit BME280 Library connects to an Arduino or any other microcontroller through an I2C interface and reads the temperature, humidity, and pressure values from the sensor.

Download: BME280 Library

3. BH1750 Library

This package offers an Arduino library for BH1750FVI IC-based digital light sensor breakout boards. The I2C bus must be configured in user code to communicate between the Arduino and the sensor.

Download: BH1750 Library

4. Blynk Library

Blynk is the most widely used Internet of Things platform for connecting any gear to the cloud, creating apps to control it, and scaling up your deployed products. With the Blynk Library, you can connect over 400 hardware models to the Blynk Cloud, including the ESP8266, ESP32, NodeMCU, and Arduino.

Download: Blynk Library

Source Code/Program for Sensor Node

The LoRa Weather Station Sensor Node program or code is listed below. The code can be copied and pasted onto the Arduino Pro Mini Board. If you’re using several sensor nodes, ensure sure the device ID in the code is changed.

#include <Wire.h>
#include <SPI.h>
#include <LoRa.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <BH1750.h> // adds BH1750 library file

//#define SS 10
//#define RST 9
//#define DI0 2

//#define TX_P 17
//#define ENCRYPT 0x78

#define BAND 433E6
#define rain_sensor A0

#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme;

BH1750 lightMeter;

String LoRaMessage = “”;
char device_id[12] = “MyDevice123”;


void setup()
{
Serial.begin(115200);
Wire.begin();
lightMeter.begin();

pinMode (rain_sensor, INPUT);
while (!Serial);

Serial.println(F(“LoRa Sender”));

//LoRa.setPins(SS, RST, DI0);
//LoRa.setTxPower(TX_P);
//LoRa.setSyncWord(ENCRYPT);

if (!LoRa.begin(BAND))
{
Serial.println(F(“Starting LoRa failed!”));
while (1);
}
if (!bme.begin(0x76))
{
Serial.println(“Could not find a valid BME280 sensor, check wiring!”);
while (1);
}
}

void loop()
{
float temperature = bme.readTemperature();
float pressure = bme.readPressure() / 100.0F;
float altitude = bme.readAltitude(SEALEVELPRESSURE_HPA);
float humidity = bme.readHumidity();

double dewPoint = dewPointFast(temperature, humidity);

int rainfall = map(analogRead(rain_sensor), 780, 0, 0, 100);
if (rainfall >= 100)
{
rainfall = 100;
}
if (rainfall <= 0)
{
rainfall = 0;
}

float lux = lightMeter.readLightLevel();

Serial.print(F(“Device ID: “));
Serial.println(device_id);

Serial.print(F(“Temperature = “));
Serial.print(temperature);
Serial.println(F(“*C”));

Serial.print(F(“Pressure = “));
Serial.print(pressure);
Serial.println(F(“hPa”));

Serial.print(F(“Approx. Altitude = “));
Serial.print(altitude);
Serial.println(F(“m”));

Serial.print(F(“Humidity = “));
Serial.print(humidity);
Serial.println(F(“%”));

Serial.print(F(“Dew point = “));
Serial.print(dewPoint);
Serial.println(F(” *C”));

Serial.print(F(“Rainfall = “));
Serial.print(rainfall);
Serial.println(F(“%”));

Serial.print(F(“Light = “));
Serial.print(lux);
Serial.println(F(” lx”));


Serial.println();

LoRaMessage = String(device_id) + “/” + String(temperature) + “&” + String(pressure)
+ “#” + String(altitude) + “@” + String(humidity) + “$” + String(dewPoint)
+ “^” + String(rainfall) + “!” + String(lux);

// send packet
LoRa.beginPacket();
LoRa.print(LoRaMessage);
LoRa.endPacket();
delay(10000);
}


double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity * 0.01);
double Td = (b * temp) / (a – temp);
return Td;
}

Source Code/Program for Gateway: WebServer

A gateway code for the ESP32 board can be found here. This code can be used to view weather station data in a web browser. The ESP32 Webserver generates a webpage with all of the data from the Weather Station.



#include <SPI.h>
#include <LoRa.h>
#include <WiFi.h>
#include <WebServer.h>


#define SS 5
#define RST 14
#define DI0 2

//#define TX_P 17
#define BAND 433E6
//#define ENCRYPT 0x78

String device_id;
String temperature;
String pressure;
String altitude;
String humidity;
String dewPoint;
String rainfall;
String lux;

const char* ssid = “Bynark_Airtel”;
const char* password = “bynark@123”;

WebServer server(80);

void setup()
{
Serial.begin(115200);
Serial.println(“LoRa Receiver”);
//LoRa.setTxPower(TX_P);
//LoRa.setSyncWord(ENCRYPT);

LoRa.setPins(SS, RST, DI0);
if (!LoRa.begin(BAND))
{
Serial.println(“Starting LoRa failed!”);
while (1);
}

Serial.println(“Connecting to “);
Serial.println(ssid);

//Connect to your local wi-fi network
WiFi.begin(ssid, password);

//check wi-fi is connected to wi-fi network
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(“.”);
}
Serial.println(“”);
Serial.println(“WiFi connected..!”);
Serial.print(“Got IP: “); Serial.println(WiFi.localIP());

server.on(“/”, handle_OnConnect);
server.onNotFound(handle_NotFound);

server.begin();
Serial.println(“HTTP server started”);
}

void loop()
{
// try to parse packet
int pos1, pos2, pos3, pos4, pos5, pos6, pos7;

int packetSize = LoRa.parsePacket();
if (packetSize)
{
// received a packet
Serial.print(“Received packet: “);
String LoRaData = LoRa.readString();
Serial.print(LoRaData);
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print(“‘ with RSSI “);
Serial.println(LoRa.packetRssi());

pos1 = LoRaData.indexOf(‘/’);
pos2 = LoRaData.indexOf(‘&’);
pos3 = LoRaData.indexOf(‘#’);
pos4 = LoRaData.indexOf(‘@’);
pos5 = LoRaData.indexOf(‘$’);
pos6 = LoRaData.indexOf(‘^’);
pos7 = LoRaData.indexOf(‘!’);

device_id = LoRaData.substring(0, pos1);
temperature = LoRaData.substring(pos1 + 1, pos2);
pressure = LoRaData.substring(pos2 + 1, pos3);
altitude = LoRaData.substring(pos3 + 1, pos4);
humidity = LoRaData.substring(pos4 + 1, pos5);
dewPoint = LoRaData.substring(pos5 + 1, pos6);
rainfall = LoRaData.substring(pos6 + 1, pos7);
lux = LoRaData.substring(pos7 + 1, LoRaData.length());

Serial.print(F(“Device ID = “));
Serial.println(device_id);

Serial.print(F(“Temperature = “));
Serial.print(temperature);
Serial.println(F(“*C”));

Serial.print(F(“Pressure = “));
Serial.print(pressure);
Serial.println(F(“hPa”));

Serial.print(F(“Approx. Altitude = “));
Serial.print(altitude);
Serial.println(F(“m”));

Serial.print(F(“Humidity = “));
Serial.print(humidity);
Serial.println(F(“%”));

Serial.print(“Dew point = “);
Serial.print(dewPoint);
Serial.println(” *C”);

Serial.print(F(“Rainfall = “));
Serial.print(rainfall);
Serial.println(F(“%”));

Serial.print(F(“Light = “));
Serial.print(lux);
Serial.println(F(” lx”));

Serial.println();

server.handleClient();
}
}

void handle_OnConnect()
{
server.send(200, “text/html”, SendHTML(temperature.toFloat(), humidity.toFloat(), pressure.toFloat(), altitude.toFloat(), dewPoint.toFloat(), rainfall.toFloat(), lux.toFloat()));
}


void handle_NotFound()
{
server.send(404, “text/plain”, “Not found”);
}

String SendHTML(float temperature, float humidity, float pressure, float altitude, float dewPoint, float rainfall, float lux)
{
String ptr = “<!DOCTYPE html> <html>\n”;
ptr += “<head><meta name=\”viewport\” content=\”width=device-width, initial-scale=1.0, user-scalable=no\”>\n”;
ptr += “<title>Wireless Weather Station</title>\n”;
ptr += “<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}\n”;
ptr += “body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;}\n”;
ptr += “p {font-size: 24px;color: #444444;margin-bottom: 10px;}\n”;
ptr += “</style>\n”;
ptr += “</head>\n”;
ptr += “<body>\n”;
ptr += “<div id=\”webpage\”>\n”;
ptr += “<h1>Wireless Weather Station</h1>\n”;

ptr += “<p>Temperature: “;
ptr += temperature;
ptr += “&deg;C</p>”;

ptr += “<p>Humidity: “;
ptr += humidity;
ptr += “%</p>”;

ptr += “<p>Pressure: “;
ptr += pressure;
ptr += “hPa</p>”;

ptr += “<p>Altitude: “;
ptr += altitude;
ptr += “m</p>”;

ptr += “<p>Dew Point: “;
ptr += dewPoint;
ptr += “&deg;C</p>”;

ptr += “<p>Rainfall: “;
ptr += rainfall;
ptr += “%</p>”;

ptr += “<p>Light: “;
ptr += lux;
ptr += “lx</p>”;

ptr += “</div>\n”;
ptr += “</body>\n”;
ptr += “</html>\n”;
return ptr;
}

The code can now be uploaded to the Arduino Pro Mini and ESP32 Board. Open the serial monitor for both the transmitter and receiver parts after the code has been uploaded. The sender will initialize and begin sending data if all connections are correct. On the receiver’s side, the receiver will establish a network connection and print the IP address.

Copy and paste the IP address into the Web browser. You can paste and push enter on your computer’s Chrome browser or on your smartphone.

LoRa Weather Station WebServer

The data from the weather station will be presented on a web browser. You can refresh the weather data by reloading the page. You can also refresh the data without restarting the page by utilizing the AJAX function in the code.

Source Code/Program for Gateway: Thingspeak Server

Now we’ll use  Thingspeak Server to monitor the data from the LoRa Weather Station. To do so, either establish an account on Thingspeak Server or log in if you already have one. Then add the following details to a new channel: temperature, humidity, pressure, altitude, dew point, rainfall, and light intensity.

Then copy the write API Key from the API Key. Change the API Key, WiFi SSID, and Password in the code below.

#include <SPI.h>
#include <LoRa.h>
#include <WiFi.h>

String apiKey = “************”; // Enter your Write API key from ThingSpeak
const char* ssid = “************”;
const char* password = “************”;
const char* server = “api.thingspeak.com”;

#define SS 5
#define RST 14
#define DI0 2

//#define TX_P 17
#define BAND 433E6
//#define ENCRYPT 0x78

String device_id;
String temperature;
String pressure;
String altitude;
String humidity;
String dewPoint;
String rainfall;
String lux;

WiFiClient client;


void setup()
{
Serial.begin(115200);
Serial.println(“LoRa Receiver”);
//LoRa.setTxPower(TX_P);
//LoRa.setSyncWord(ENCRYPT);

LoRa.setPins(SS, RST, DI0);
if (!LoRa.begin(BAND))
{
Serial.println(“Starting LoRa failed!”);
while (1);
}

Serial.println(“Connecting to “);
Serial.println(ssid);

//connect to your local wi-fi network
WiFi.begin(ssid, password);

//check wi-fi is connected to wi-fi network
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(“.”);
}
Serial.println(“”);
Serial.println(“WiFi connected..!”);
Serial.print(“Got IP: “);
Serial.println(WiFi.localIP());

}

void loop()
{
// try to parse packet
int pos1, pos2, pos3, pos4, pos5, pos6, pos7;

int packetSize = LoRa.parsePacket();
if (packetSize)
{
// received a packet
Serial.print(“Received packet: “);
String LoRaData = LoRa.readString();
Serial.print(LoRaData);
// read packet
while (LoRa.available())
{
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print(“‘ with RSSI “);
Serial.println(LoRa.packetRssi());

pos1 = LoRaData.indexOf(‘/’);
pos2 = LoRaData.indexOf(‘&’);
pos3 = LoRaData.indexOf(‘#’);
pos4 = LoRaData.indexOf(‘@’);
pos5 = LoRaData.indexOf(‘$’);
pos6 = LoRaData.indexOf(‘^’);
pos7 = LoRaData.indexOf(‘!’);

device_id = LoRaData.substring(0, pos1);
temperature = LoRaData.substring(pos1 + 1, pos2);
pressure = LoRaData.substring(pos2 + 1, pos3);
altitude = LoRaData.substring(pos3 + 1, pos4);
humidity = LoRaData.substring(pos4 + 1, pos5);
dewPoint = LoRaData.substring(pos5 + 1, pos6);
rainfall = LoRaData.substring(pos6 + 1, pos7);
lux = LoRaData.substring(pos7 + 1, LoRaData.length());

Serial.print(F(“Device ID = “));
Serial.println(device_id);

Serial.print(F(“Temperature = “));
Serial.print(temperature);
Serial.println(F(“*C”));

Serial.print(F(“Pressure = “));
Serial.print(pressure);
Serial.println(F(“hPa”));

Serial.print(F(“Approx. Altitude = “));
Serial.print(altitude);
Serial.println(F(“m”));

Serial.print(F(“Humidity = “));
Serial.print(humidity);
Serial.println(F(“%”));

Serial.print(“Dew point = “);
Serial.print(dewPoint);
Serial.println(” *C”);

Serial.print(F(“Rainfall = “));
Serial.print(rainfall);
Serial.println(F(“%”));

Serial.print(F(“Light = “));
Serial.print(lux);
Serial.println(F(” lx”));

Serial.println();

if (client.connect(server, 80)) // “184.106.153.149” or api.thingspeak.com
{
String postStr = apiKey;
postStr += “&field1=”;
postStr += String(temperature);
postStr += “&field2=”;
postStr += String(pressure);
postStr += “&field3=”;
postStr += String(altitude);
postStr += “&field4=”;
postStr += String(humidity);
postStr += “&field5=”;
postStr += String(dewPoint);
postStr += “&field6=”;
postStr += String(rainfall);
postStr += “&field7=”;
postStr += String(lux);
postStr += “r\n”;

client.print(“POST /update HTTP/1.1\n”);
client.print(“Host: api.thingspeak.com\n”);
client.print(“Connection: close\n”);
client.print(“X-THINGSPEAKAPIKEY: ” + apiKey + “\n”);
client.print(“Content-Type: application/x-www-form-urlencoded\n”);
client.print(“Content-Length: “);
client.print(postStr.length());
client.print(“\n\n”);
client.print(postStr);

Serial.println(“Data Send to Thingspeak”);
delay(500);
}
client.stop();
Serial.println(“Waiting…”);

}
}

Open the Serial Monitor once more. So, if you observe data being transferred and received, your node and gateway are both functioning properly.

Go to Thingspeak’s Private view now. The data will be displayed in a graphical way here. After a 15-second period, the data is received.

Source Code/Program for Gateway: Blynk Application

Blynk Application is a Blynk Code for monitoring Wireless Weather Station data. Blynk Cloud Server will log the data from the ESP32 LoRa Gateway.

Change the Blynk Authentication Token generated by your Blynk Application in the following code. Change the WiFi SSID and password as well.

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <LoRa.h>
#include <WiFi.h>
#include <Blynk.h>
#include <BlynkSimpleEsp32.h>

char auth[] = “**********************”; // You should get Auth Token in the Blynk App.
char ssid[] = “************”; // Your WiFi credentials.
char pass[] = “************”;

#define SS 5
#define RST 14
#define DI0 2

//#define TX_P 17
#define BAND 433E6
//#define ENCRYPT 0x78

String device_id;
String temperature;
String pressure;
String altitude;
String humidity;
String dewPoint;
String rainfall;
String lux;

void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
Serial.println(“LoRa Receiver”);
//LoRa.setTxPower(TX_P);
//LoRa.setSyncWord(ENCRYPT);

LoRa.setPins(SS, RST, DI0);
if (!LoRa.begin(BAND))
{
Serial.println(“Starting LoRa failed!”);
while (1);
}

Serial.println(“Connecting to “);
Serial.println(ssid);

//connect to your local wi-fi network
WiFi.begin(ssid, pass);

//check wi-fi is connected to wi-fi network
while (WiFi.status() != WL_CONNECTED)
{
delay(1000);
Serial.print(“.”);
}
Serial.println(“”);
Serial.println(“WiFi connected..!”);
Serial.print(“Got IP: “);
Serial.println(WiFi.localIP());

}

void loop()
{
// try to parse packet
int pos1, pos2, pos3, pos4, pos5, pos6, pos7;

int packetSize = LoRa.parsePacket();
if (packetSize)
{
Blynk.run();
// received a packet
Serial.print(“Received packet: “);
String LoRaData = LoRa.readString();
Serial.print(LoRaData);
// read packet
while (LoRa.available())
{
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print(“‘ with RSSI “);
Serial.println(LoRa.packetRssi());

pos1 = LoRaData.indexOf(‘/’);
pos2 = LoRaData.indexOf(‘&’);
pos3 = LoRaData.indexOf(‘#’);
pos4 = LoRaData.indexOf(‘@’);
pos5 = LoRaData.indexOf(‘$’);
pos6 = LoRaData.indexOf(‘^’);
pos7 = LoRaData.indexOf(‘!’);

device_id = LoRaData.substring(0, pos1);
temperature = LoRaData.substring(pos1 + 1, pos2);
pressure = LoRaData.substring(pos2 + 1, pos3);
altitude = LoRaData.substring(pos3 + 1, pos4);
humidity = LoRaData.substring(pos4 + 1, pos5);
dewPoint = LoRaData.substring(pos5 + 1, pos6);
rainfall = LoRaData.substring(pos6 + 1, pos7);
lux = LoRaData.substring(pos7 + 1, LoRaData.length());

Serial.print(F(“Device ID = “));
Serial.println(device_id);

Serial.print(F(“Temperature = “));
Serial.print(temperature);
Serial.println(F(“*C”));

Serial.print(F(“Pressure = “));
Serial.print(pressure);
Serial.println(F(“hPa”));

Serial.print(F(“Approx. Altitude = “));
Serial.print(altitude);
Serial.println(F(“m”));

Serial.print(F(“Humidity = “));
Serial.print(humidity);
Serial.println(F(“%”));

Serial.print(“Dew point = “);
Serial.print(dewPoint);
Serial.println(” *C”);

Serial.print(F(“Rainfall = “));
Serial.print(rainfall);
Serial.println(F(“%”));

Serial.print(F(“Light = “));
Serial.print(lux);
Serial.println(F(” lx”));

Serial.println();

Blynk.virtualWrite(V1, temperature);
Blynk.virtualWrite(V2, humidity);
Blynk.virtualWrite(V3, pressure);
Blynk.virtualWrite(V4, altitude);
Blynk.virtualWrite(V5, dewPoint);
Blynk.virtualWrite(V6, rainfall);
Blynk.virtualWrite(V7, lux);

}
}

The ESP32 will connect to the Blynk server once the code is uploaded. You may now check out the Blynk App on your smartphone. The data from the Wireless LoRa Weather Station will be sent to the cell phone.

Conclusion

I hope all of you understand how to design  LoRa Based Wireless Weather Station with Arduino & ESP32. We MATHA ELECTRONICS will be back soon with more informative blogs.

Leave a Reply

Your email address will not be published.