Tomas Urbanavičius
Published © GPL3+

Monitoring UV index, ground temperature and humidity

UMonitoring UV index, ground temperature and humidity readings using RAK12035 (LTR390-UV), Rak12023/12035 sensors and LoRa

BeginnerWork in progress4 hours91
Monitoring UV index, ground temperature and humidity

Things used in this project

Hardware components

RAKwireless - RAK11300
×1
RAKwireless - RAK19001_VB
×1
PCB Antenna for LoRa 863-870MHz
×1
WisGate Edge Lite 2 RAK7268\RAK7268C  Gateway for LoRaWAN
RAKwireless WisGate Edge Lite 2 RAK7268\RAK7268C Gateway for LoRaWAN
×1
UV Light Sensor Lite-On LTR-390UV-01 RAK12019
×1
Rak12023/12035 soil sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE
The Things Stack
The Things Industries The Things Stack

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Code

TTN decoder

JavaScript
Decodes the readings sent by sensors and interprets the values.
function decodeUplink(input) {
    var bytes = input.bytes;

    // UV
    var uvi = ((bytes[0] | (bytes[1]<<8) | (bytes[2]<<16) | (bytes[3]<<24)) >>> 0);
    uvi = new DataView(new Uint32Array([uvi]).buffer).getFloat32(0, true);

    // Apvalinam iki 2 skaitmenų po kablelio
    uvi = parseFloat(uvi.toFixed(2));

    var uvEmergency = bytes[4];

    // Soil
    var soilHumidity = bytes[5];
    var soilTemp = (bytes[6]<<8) | bytes[7];

    return {
        data: {
            uv: uvi,
            uvEmergency: uvEmergency,
            soilHumidity: soilHumidity,
            soilTemp: soilTemp
        }
    };
}

Credits

Tomas Urbanavičius
7 projects • 8 followers
Teacher at Kaunas Education Center of Technologies (Kautech) & Erasmus+ project member: "DSIoT" (2022-1-PT01-KA220-VET-000090202)

Comments