Temperature & Humidity sensor LR-MU-TH-IP65

TTN version: TTNv3
Frequency: Europe 863-870 MHz (SF9 for RX2 – recommended)
Activation: OTAA / ABP
Device Class: Class A
Last updated: December 6, 2023

One of the commercial products we use is the temperature and humidity sensor LR-MU-TH-IP65 from Solidus TECH. At the device’s heart is a RHF76-052DM, which can be used for transmission/reception in the 434 – 915 MHz range. To measure temperature and humidity, the device uses a temperature and humidity sensor SHT31. The sensor measures temperatures in the range of -40 ºC to 85 ºC and humidity in the range of 0 to 100%. The accuracy of temperature measurement is ± 0.5 ºC and humidity ± 3%. The device is available on the company’s website with the code LOR-MU-TH-IP65.Temperature and humidity sensor

Prepare

 

Serial Monitor setup

  1. Download Visual Studio Code.
  2. Run Visual Studio Code.
  3. In the VS Code Extensions -> search Serial Monitor by Microsoft -> Install.Serial monitor installation
  4. Open a new terminal via Terminal -> New Terminal.New Terminal
  5. In the SERIAL MONITOR tab, set the parameters according to the following image:

 

Activation

Over The Air Activation (OTAA) – the most secure and recommended activation method for end devices. Devices perform a join procedure with the network, during which a dynamic device address is assigned and security keys are negotiated with the device.

Activation By Personalization (ABP) – requires hardcoding the device address as well as the security keys in the device. ABP is less secure than OTAA and also has the downside that devices can not switch network providers without manually changing keys in the device.

See the documentation for more information on activation.

 

Over The Air Activation (OTAA)

Add LR-MU-TH-IP65 into The Things Stack

  1. Create an account on The Things Network if you don’t have one.
  2. Login on The Things Network.
  3. Click on your username and choose Console.
  4. Select a network cluster.
Add application
  1. Go to applications.
  2. Click on button + Create application.
  3. Write something into Application ID.
  4. Click on button Create application.
Add end device
  1. In your application click on button + Register end device.
  2. Input Method – Choose Enter end device specifics manually.
  3. Frequency plan – Europe 863-870 MHz (SF9 for RX2 – recommended)
  4. LoRaWAN version – LoRaWAN Specification 1.0.3
  5. Click on Show advanced activation, LoRaWAN class and cluster settings
  6. Activation mode – Over the air activation (OTAA)
  7. Additional LoRaWAN class capabilities – None (class A only)
  8. Deselect – Use network’s default MAC settings
  9. Rx2 data rate = 3
  10. Rx2 frequency = 869,525 MHz
  11. JoinEUI – 0000000000000000
  12. Click on Confirm.
  13. DevEUI – Generate
  14. AppKey – Generate
  15. End device ID – here you can name your device
  16. After registration – View registered end device
  17. Click on button Register end device
  18. Click on General settings
  19. Network layer – Expand
  20. Click on Advanced MAC settings
  21. Desired Rx1 delay = 1
  22. Rx1 data rate offset = 0
  23. Add Frequency = 868100000
  24. Add Frequency = 868300000
  25. Add Frequency = 868500000
  26. Add Frequency = 867100000
  27. Add Frequency = 867300000
  28. Add Frequency = 867500000
  29. Add Frequency = 867700000
  30. Add Frequency = 867900000
  31. Adaptive data rate (ADR) – Dynamic mode
  32. Click on button Save changes

 

Payload formatters
  1. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Payload formatters -> Uplink change Formatter type to Custom Javascript formatter and to Formatter code copy and paste code bellow:
    function decodeUplink(input) {
      let payload = input.bytes;
      let voltage = payload[0];
      let temperature = (payload[1] << 8) | payload[2];
      let humidity = (payload[3] << 8) | payload[4];
       
      let decodedVoltage = voltage * 30 / 1000;
      let decodedTemperature = temperature / 10;
      let decodedHumidity = humidity / 10;
    
      let decodedPayload = {
        'voltage': decodedVoltage,
        'temperature': decodedTemperature,
        'humidity': decodedHumidity
      };
    
      return {
        data: decodedPayload,
        warnings: [],
        errors: []
      };
    }
  2. Save changes

 

LR-MU-TH-IP65 setup

  1. Connect LR-MU-TH-IP65 using USB TTL UART converter – 3,3 V and USB cable to your computer. (Pin order in the image is from left to right – GND, CTS, VCC, TX, RX, DTR).Connected USB TTL UART converter
  2. In VS Code, in SERIAL MONITOR, select Port and press the Start Monitoring button.Serial Monitor port and start monitoring button
  3. To set up LR-MU-TH-IP65, enter the following individual commands line by line into SERIAL MONITOR and send them to the device. Replace AppEui, DevEui and APPKEY with keys in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Overview -> Activation information:
    show
    AT+FDEFAULT
    AT+CLASS=A
    AT+MODE="OTAA"
    AT+ID=AppEui, "0000000000000000"
    AT+ID=DevEui, "0000000000000000"
    AT+KEY=APPKEY, "00000000000000000000000000000000"
    AT+POWER=14
    AT+ADR=on
    message:1
    sleep:10
    scan:10
    reset
  4. After entering and submitting the last command, you should see a listing similar to the one in the following image:readout
  5. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should every 10 minutes see this:console

 

Subsequent setup using a downlinks

A1XXXX – Periodic sleep setting, where XXXX is the decimal value of the sleep parameter. For example, A10005 sets the periodic mode to 5 min., A10120 sets the periodic mode to 120 min.

A2XX – Uplink message type setting, where XX is either 01 for UNCONFIRMED messages and 02 for CONFIRMED messages.

A3XX – DR type setting where XX is 00 to 05 which corresponds to SF12 to SF7.

A4XX – ADR enable/disable where XX is either 01 for ADR enable type messages and 02 for ADR disable.

 

Other optional AT commands

You can find more commands in the module documentation.

 

Data visualization

If you want to visualize your measured data, continue with the following tutorial:

 

 


Activation By Personalization (ABP)

Add LR-MU-TH-IP65 into The Things Stack

  1. Create an account on The Things Network if you don’t have one.
  2. Login on The Things Network.
  3. Click on your username and choose Console.
  4. Select a network cluster.
Add application
  1. Go to applications.
  2. Click on button + Create application.
  3. Write something into Application ID.
  4. Click on button Create application.
Add end device
  1. In your application click on button + Register end device.
  2. Input Method – Choose Enter end device specifics manually.
  3. Frequency plan – Europe 863-870 MHz (SF9 for RX2 – recommended)
  4. LoRaWAN version – LoRaWAN Specification 1.0.3
  5. Click on Show advanced activation, LoRaWAN class and cluster settings
  6. Activation mode – Activation by personalization (ABP)
  7. Additional LoRaWAN class capabilities – None (class A only)
  8. Deselect – Use network’s default MAC settings
  9. Rx1 data rate offset = 0
  10. Rx1 delay = 1
  11. Resets frame counters – Enabled
  12. Rx2 data rate = 3
  13. Rx2 frequency = 869,525 MHz
  14. Add Frequency = 868100000
  15. Add Frequency = 868300000
  16. Add Frequency = 868500000
  17. Add Frequency = 867100000
  18. Add Frequency = 867300000
  19. Add Frequency = 867500000
  20. Add Frequency = 867700000
  21. Add Frequency = 867900000
  22. DevEUI – Generate
  23. Device address – Generate
  24. AppSKey – Generate
  25. NwkSKey – Generate
  26. End device ID – here you can name your device
  27. After registration – View registered end device
  28. Click on button Register end device
  29. Click on General settings
  30. Network layer – Expand
  31. Click on Advanced MAC settings
  32. Desired Rx1 delay = 1
  33. Adaptive data rate (ADR) – Dynamic mode
  34. Click on button Save changes

 

Payload formatters
  1. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Payload formatters -> Uplink change Formatter type to Custom Javascript formatter and to Formatter code copy and paste code bellow:
    function decodeUplink(input) {
      let payload = input.bytes;
      let voltage = payload[0];
      let temperature = (payload[1] << 8) | payload[2];
      let humidity = (payload[3] << 8) | payload[4];
       
      let decodedVoltage = voltage * 30 / 1000;
      let decodedTemperature = temperature / 10;
      let decodedHumidity = humidity / 10;
    
      let decodedPayload = {
        'voltage': decodedVoltage,
        'temperature': decodedTemperature,
        'humidity': decodedHumidity
      };
    
      return {
        data: decodedPayload,
        warnings: [],
        errors: []
      };
    }
  2. Save changes

 

LR-MU-TH-IP65 setup

  1. Connect LR-MU-TH-IP65 using USB TTL UART converter – 3,3 V and USB cable to your computer. (Pin order in the image is from left to right – GND, CTS, VCC, TX, RX, DTR).Connected USB TTL UART converter
  2. In VS Code, in SERIAL MONITOR, select Port and press the Start Monitoring button.Serial Monitor port and start monitoring button
  3. To set up LR-MU-TH-IP65, enter the following individual commands line by line into SERIAL MONITOR and send them to the device. Replace NWKSKEY, APPSKEY and DEVADDR with keys of your end device registred in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Overview -> Session information:
    show
    AT+FDEFAULT
    AT+CLASS=A
    AT+MODE="ABP"
    AT+KEY=NWKSKEY, "00000000000000000000000000000000"
    AT+KEY=APPSKEY, "00000000000000000000000000000000"
    AT+ID=DEVADDR, "00000000"
    AT+POWER=14
    AT+ADR=on
    message:1
    sleep:10
    scan:10
    reset
  4. After entering and submitting the last command, you should see a listing similar to the one in the following image:Serial monitor
  5. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should every 10 minutes see this:TTS console

 

Subsequent setup using a downlinks

A1XXXX – Periodic sleep setting, where XXXX is the decimal value of the sleep parameter. For example, A10005 sets the periodic mode to 5 min., A10120 sets the periodic mode to 120 min.

A2XX – Uplink message type setting, where XX is either 01 for UNCONFIRMED messages and 02 for CONFIRMED messages.

A3XX – DR type setting where XX is 00 to 05 which corresponds to SF12 to SF7.

A4XX – ADR enable/disable where XX is either 01 for ADR enable type messages and 02 for ADR disable.

 

Other optional AT commands

You can find more commands in the module documentation.

 

Data visualization

If you want to visualize your measured data, continue with the following tutorial: