Introduction
Soil Moisture Sensor measures the Humidity at the range of 12-bit ADC, -40℃ to 85℃with capacitive method ,also with highly waterproof performance tested to IP68, making it widely applicable in agricultural environmental sensing scenarios to support the smart agricultural production.
Prerequisites
To continue with this guide we will need the following:
- Soil Moisture Sensor
- LoRaWAN® gateway (in our case UG56 LoRaWAN® Gateway)
- Configured integration on networks server and ThingsBoard
- ThingsBoard account
Device connection
Device configuration
To connect and send data we should configure the device and network server.
First, we are going to configure the device and save the required information for the network server configuration.
To add a device to the network server and retrieve data from it, you will need the following device parameters:
- Device EUI – Device identifier
- Application EUI – Application identifier
- Application Key – Application key for device authentication
Note: You can find the values of these keys on the label located on the side of the device (see example image below).
To configure the device we also need to add it to a network server, so select the network server your gateway is connected to:
Add a device on the ChirpstackWe need to add a device on the Chirpstack. To add a device, you can follow next steps:
![]() Login to Chirpstack server. ![]() Go to the Device profiles page and click on Add device profile button. ![]() Fill the fields and click on Submit button. ![]() Go to the Applications page, click on your application and press Add device button. ![]() Fill parameters with values from the device configuration. Then choose previously created device profile and click on Submit button. ![]() Put your Application key to the field and click on Submit button to save the device. Uplink converter in ThingsBoard integrationStep 1: Download the JSON file Download the JSON file with the uplink converter settings by clicking the button below. Download uplink converter for ChirpStack integration.
After downloading the file with the Uplink converter configuration, import it into ThingsBoard:
![]() Navigate to the “Data converters” page in the “Integration center” section. Click the “+” icon in the top-right corner of the page and select “Import converter” from the drop-down menu. ![]() Drag and drop the downloaded JSON file (containing the uplink converter configuration) into the import window, then click “Import”. ![]() The uplink converter is now successfully imported.
Now, let's update your ChirpStack integration to use the new uplink converter:
![]() Go to the “Integrations” page in the “Integration center” section. Click on your ChirpStack integration to open its details window. Enter edit mode by clicking the orange pencil button in the top-right corner. ![]() Replace the existing uplink converter with the imported one. ![]() Don't forget to save your changes! |
Add a device on The Things Stack Community EditionWe need to add a device on The Things Stack Community Edition. To add a device, you can follow next steps:
![]() Login to the cloud and open your console. ![]() Go to the Applications page. Then select your application and click on its name. ![]() Click on the Register end device button. ![]() Put the APP EUI value to the JoinEUI field. Press the Confirm button. ![]() Fill the rest parameters and press Register end device button. Uplink converter in ThingsBoard integrationStep 1: Download the JSON file Download the JSON file with the uplink converter settings by clicking the button below. Download uplink converter for The Things Stack integration.
After downloading the file with the Uplink converter configuration, import it into ThingsBoard:
![]() Navigate to the “Data converters” page in the “Integration center” section. Click the “+” icon in the top-right corner of the page and select “Import converter” from the drop-down menu. ![]() Drag and drop the downloaded JSON file (containing the uplink converter configuration) into the import window, then click “Import”. ![]() The uplink converter is now successfully imported.
Now, let's update your The Things Stack integration to use the new uplink converter:
![]() Go to the “Integrations” page in the “Integration center” section. Click on your The Things Stack integration to open its details window. Enter edit mode by clicking the orange pencil button in the top-right corner. ![]() Replace the existing uplink converter with the imported one. ![]() Don't forget to save your changes! |
Add a device on The Things IndustriesWe need to add a device on The Things Industries cloud. To add a device, you can follow next steps:
![]() Login to the cloud and open your console. ![]() Go to the Applications page. Then select your application and click on its name. ![]() Click on the Register end device button. ![]() Put the APP EUI value to the JoinEUI field. Press the Confirm button. ![]() Fill the rest parameters and press Register end device button. Uplink converter in ThingsBoard integrationStep 1: Download the JSON file Download the JSON file with the uplink converter settings by clicking the button below. Download uplink converter for The Things Industries integration.
After downloading the file with the Uplink converter configuration, import it into ThingsBoard:
![]() Navigate to the “Data converters” page in the “Integration center” section. Click the “+” icon in the top-right corner of the page and select “Import converter” from the drop-down menu. ![]() Drag and drop the downloaded JSON file (containing the uplink converter configuration) into the import window, then click “Import”. ![]() The uplink converter is now successfully imported.
Now, let's update your The Things Industries integration to use the new uplink converter:
![]() Go to the “Integrations” page in the “Integration center” section. Click on your The Things Industries integration to open its details window. Enter edit mode by clicking the orange pencil button in the top-right corner. ![]() Replace the existing uplink converter with the imported one. ![]() Don't forget to save your changes! |
Add a device on the LoriotWe need to add a device on the Loriot. To add a device, you can follow next steps:
![]() Login to Loriot server. We use eu2.loriot.io, but it depends on chosen region during registration. ![]() Go to the “Applications” page in left menu. ![]() Open your application, in our case it is “SampleApp”. ![]() Go to the “Enroll Device” page. Fill in the fields, with a configuration from your device. Then click the “Enroll” button. Uplink converter in ThingsBoard integrationStep 1: Download the JSON file Download the JSON file with the uplink converter settings by clicking the button below. Download uplink converter for Loriot integration.
After downloading the file with the Uplink converter configuration, import it into ThingsBoard:
![]() Navigate to the “Data converters” page in the “Integration center” section. Click the “+” icon in the top-right corner of the page and select “Import converter” from the drop-down menu. ![]() Drag and drop the downloaded JSON file (containing the uplink converter configuration) into the import window, then click “Import”. ![]() The uplink converter is now successfully imported.
Now, let's update your Loriot integration to use the new uplink converter:
![]() Go to the “Integrations” page in the “Integration center” section. Click on your Loriot integration to open its details window. Enter edit mode by clicking the orange pencil button in the top-right corner. ![]() Replace the existing uplink converter with the imported one. ![]() Don't forget to save your changes! |
Check data on ThingsBoard
After the device is connected to the network server and ThingsBoard, you can check received and converted data on the platform for this device.
To do this, open Entities menu section and select Devices.
Click on the device name to open the device details page.
Go to the Latest telemetry tab to see the latest telemetry data received from the device.
Conclusion
With the knowledge outlined in this guide, you can easily connect your Soil Moisture Sensor and send data to ThingsBoard.
Explore the platform documentation to learn more about key concepts and features. For example, configure alarm rules or dashboards.