Close
0%
0%

LORAWAN SOIL MOISTURE SENSOR

Evaluation of a ready-to-use Arduino-based device for wireless measurement of soil moisture, temperature and humidity over LORAWan

Public Chat
Similar projects worth following
The LORA soil moisture sensor (V2) is a compact ready-to-use sensor device for wireless measurements distributed by MAKERFABS. It is battery powered and has long range communication (up to 10km from gateway). The device is based on ATmega328P microprocessor and has sensors for measuring air temperature, air humidity and soil moisture.

Schematic, tutorial, wiki and sourcecode for realization of a LORA-based network are available.

The primary goal of this project is to evaluate the device with regard to its possible uses with LORAWan applications. For this purpose, several sensors are to be used in my garden, the data of which can be evaluated after transmission and processing via web interface and on mobile devices.

Since the corresponding source codes and instructions are not yet available, the functionalities for LORAWan must be implemented separately on the hard way.

Device

The Lora Soil Moisture Sensor is a nice combination with the following components on a single circuit board:

  • ATMEL AVR 8-bit Atmega328P with Arduino Pro Mini (3.3V/8M bootloader pre-loaded)
  • LORA module RFM95W with coil antenna
  • Soil moisture sensor V1.2
  • Air humidity and temperature sensor AHT10
  • Battery holder for 2 AAA batteries
  • MOSFET-based sensor power control
  • Optional 3D-printed case (not waterproof)

LORAWan Node
The following additional libraries are used in the ARDUINO IDE for a first prototype:

The basic framework for the sketch is the OTAA example from the LMIC library. Of course, special attention should be paid to the regional adaptation of the lmic_project_config.h file. The correct pin mapping can be derived by the circuit diagram. The source code for reading out the soil moisture sensor and the AHT10 was taken from Makerfabs' project documentation. The low power library is intended to reduce the energy requirement between each measurement and transmission. In addition, the battery voltage is determined via the bandgap voltage of the processor. The individual sensors are only supplied with energy for measurement.

Some difficulties with the AHT10 could be reduced with an additional queue, but could not be completely resolved. The cause here may be the AHT10 itself, the sleep mode and the control of the supply voltage. Due to the utilization of the flash memory with 92% and the dynamic memory with 85%, various unpredictable instabilities and runtime errors can be caused by the sketch. Perhaps a more efficient LMIC library can be used later.  At the moment the device seems to be running stable, but I will be happy to share my long-term experiences.

LORAWan TTN integration
For the integration in TTN V3, an application with a device is usually created. The values for APPEUI, DEVEUI and APPKEY specified for the device are entered in the sketch (note the bit order according to the example, TTN generates the necessary character strings for copy-paste at the push of a button). The preparation of the payload for the integration, e.g. of Thingspeak, takes place via a payload converter in Javascript.

Sensor calibration
The AHT10 is inherently imprecise and is subject to a good spread, so calibration is not required here. Since the sensor is used close to the ground, the measured temperature is likely to be a mixture of ground and air temperature. The air humidity cannot be evaluated anyway if the housing is sealed watertight (necessary outdoors and in a greenhouse ...).

The soil moisture sensor can be calibrated by recording the measured values in the air (0%) and in clear water (100%). A series of experiments with soil that is moistened in a defined manner is more complex. Here you can consider whether the effort is worthwhile, since ultimately the measured values in the real environment depend on the actual soil composition, water type and also on the positioning in the bed. Realistically, I consider the measured values as a rough guide as to whether it is necessary to water. I'd better leave everything else to scientists.

The battery voltage sensor is calibrated by a form factor calculated by the measured value of the insight and outsight voltage.

Later objectives

  • Change of the open TTN LORWan server to a private LORAWan server
    (Chirpstack, already set up on a Cubietruck, but not yet put into operation). This is already planned for the LORAWan devices already in use (Dragino LHT65 / LDS01 / DLOS8, Adafruit Feather M0 RFM95, etc.).
  • Establishment of a private toolchain for processing the sensor data via a
    Mosquitto MQTT Broker (already set up on a/the Cubietruck, but not yet put into operation) including the evaluation and display of the data (web-based, databases, smartphone app).
  • Waterproof case, - especially for outdoor areas and greenhouses.
  • Expansion by...
Read more »

1 - 13.48 kB - 07/15/2021 at 14:14

Download

20210715 lmic_project_config.h

LMIC config file for Europe

x-chdr - 385.00 bytes - 07/15/2021 at 13:57

Download

20210715 Payload Formatter Uplink TTNV3 V0.1

TTN V3 payload formatter for uplink for transmission to Thingspeak

1 - 2.41 kB - 07/15/2021 at 13:54

Download

  • 1 × LORA temperature/ humidity/ soil moisture sensor 868MHz (V2) Distributor: Makerfabs
  • 1 × USB to TTL serial adapter converter with DTR and 3,3/5V Needed to program the sensor device.
  • 2 × Battery Type AAA To give life to the sensor device.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates