Mapping of IoT LoRa network coverage at PUC Campus and the first prototype of Temperature and Humidity sensor

Today I would like to share with you a little more of my progress in developing an IoT network for the university campus where I work, which is PUC Rio.

Today we already have a LoRa Gateway installed at the top of the main building of PUC Rio and during these last days I have been performing a LoRa network coverage mapping on Campus.

The PUC Rio is located in the neighborhood of Gávea in Rio de Janeiro and here the topology is of a valley.

The PUC campus is spread throughout the Gávea neighborhood.

The coverage measures were carried out around the campus because the university has as its goal an environmental agenda in which there are goals for a sustainable campus.

The objectives are to create ecologically sound systems.

And these goals have as their theme the Campus Biodiversity, Water, Energy, Atmosphere, Waste and an environmental education.

We need to deploy a set of sensors throughout the university to make this plane real.

Implement meteorological stations throughout the campus and its surroundings, as in the case of the Gávea valley.

Monitor the quality and amount of the waters of the Queen River that crosses the PUC campus.

Monitor water consumption by department at university.

Monitor the rainfall of the Gávea valley and the climatic effects in the hydrological regime of the campus and the Gávea valley.

Map campus electromagnetic fields.

Monitor energy consumption by department at university.

Monitor the climatic conditions of classrooms.

Monitor noise pollution on campus and in the valley of the Gávea.

Monitor Air Quality on campus.

Monitor temperature and pressure on campus.

Monitor the winds on campus.

Monitor in detail the gases produced in different campus laboratories.

In the images below you will see all the mapping done.

A Seeduino LoRa Hat was used.

You’ll also see a prototype model of the first Node with temperature and humidity sensor.

I also took advantage of the coverage test in other districts such as Lagoa, Ipanema, Leblon, Humaita and Jardim Botânico.

You can view these coverage measures on the map. Temperature and Humidity were sent in all points.

Share My Code for my node:

#include <TheThingsNetwork.h>
#include <LoRaWan.h>
#include “DHT.h”

#define DHTPIN 7
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

unsigned char data[4];

char buffer[256];

void setup(void)
{
dht.begin();

//SerialUSB.begin(115200);
//while(!SerialUSB);

lora.init();
memset(buffer, 0, 256);
lora.getVersion(buffer, 256, 1);
SerialUSB.print(buffer); 

memset(buffer, 0, 256);
lora.getId(buffer, 256, 1);
SerialUSB.print(buffer);
lora.setId("XXXXXXXXXXXXX", "XXXXXXXXXXX","XXXXXXXXXXXXXXXX" );        
lora.setKey(NULL, NULL, "XXXXXXXXXXXXXXXXXXXXXXXXXXXX");

lora.setDeciveMode(LWOTAA);    

lora.setDataRate(DR5, EU868);

lora.setAdaptiveDataRate(true);    

lora.setChannel(0, 868.1);
lora.setChannel(1, 868.3);
lora.setChannel(2, 868.5);
lora.setChannel(3, 867.1);
lora.setChannel(4, 867.3);
lora.setChannel(5, 867.5);
lora.setChannel(6, 867.7);

lora.setReceiceWindowFirst(1, 868.3);
lora.setReceiceWindowSecond(869.525, DR0);

lora.setPower(14);

while(!lora.setOTAAJoin(JOIN));

}

void loop(void)
{

bool result = false;
delay(2000);
SerialUSB.println("-- LOOP");

// Aqui esta lendo o dado do sensor e multiplicando por 100 para tornar o envio eficiente com 2 decimais

// Lendo a umidade do sensor
uint32_t humidity = dht.readHumidity(false) * 100;

// Lendo a temperatura do sensor / Valor falso (false) para Celsius e Verdadeiro (true)  para Farenheit
uint32_t temperature = dht.readTemperature(false) * 100;


// Dividindo em 2 palavras (32 bits) para dois bytes de 16
byte payload[4];

payload[0] = highByte(temperature);
payload[1] = lowByte(temperature);
payload[2] = highByte(humidity);
payload[3] = lowByte(humidity);


// Exibir no terminal serial a Temperatura e Umidade lida do sensor
SerialUSB.print("Temperatura: ");
SerialUSB.println(temperature);
SerialUSB.print("Umidade: ");
SerialUSB.println(humidity);

// Nesta parte abaixo a função transfer packet pega o dado do payload o prepara para enviar via rede LoRa
result = lora.transferPacket(payload, 4, 10);

if(result)
{
    short length;
    short rssi;
    
    memset(buffer, 0, 256);
    length = lora.receivePacket(buffer, 256, &rssi);
    
    if(length)
    {
        
        SerialUSB.print("Length is: ");
        SerialUSB.println(length);
        SerialUSB.print("RSSI is: ");
        SerialUSB.println(rssi);
        SerialUSB.print("Data is: ");
        for(unsigned char i = 0; i < length; i ++)
        {
            
            SerialUSB.print("0x");
            SerialUSB.print(buffer[i], HEX);
            SerialUSB.print(" ");
        }
        SerialUSB.println();
        
    }
}
delay(5000);

}

05Mapa%20maior%20distanciamedidas-lora
05(1)1601

TTN MAPPER LINK:

https://ttnmapper.org/special.php?node=01d823c1&date=2018-07-17&gateways=on

a little about me

1 Like

maybe a little explanation ? :wink:

2 Likes