The Tinovi PM-WCS-3 family sensors is low-cost accurate moisture sensor for monitoring water content, electrical conductivity and temperature of soil.

FEATURES

  • Dust and water proof, each sensor is tested by submerging it in to the water for one day.
  • Low cost and easy to use.
  • Fairly accurate readings.
  • Arduino and Raspberry Pi client software libraries.
  • Calibration functions for EC and Dielectric permittivity
  • Setup via USB CDC-ACM virtual COM port.
  • Android application for USB setup and free online monitoring via The Things Network gateways for LoRaWAN sensor device.
  • Tinovi zerver.io cloud console for graphs and configurable event triggers.

SENSOR DEVICES

 

  • PM-WCS-3-I2C – Sensor modification with I2C wired interface

ELECTRICAL PROPERTIES (PM-WCS-3-I2C)

Min. Typical Max.
Supply voltage (VCC), V 2.5 3.3 3.5
Working current(VCC=3.3V), mA 11 14
Operating Temperature Range, Celsius -20 60

PHYSICAL PROPERTIES (PM-WCS-3-I2C)

Sensor dimensions 114 x 24 x11

Cable length 2.4m, 

 

  • PM-WCS-3-USB – Sensor modification with USB wired interface

ELECTRICAL PROPERTIES (PM-WCS-3-USB)

Min. Typical Max.
Supply voltage (VCC), V 2.5 5 6
Working current(VCC=5V), mA 11 14
Operating Temperature Range, Celsius -20 60

PHYSICAL PROPERTIES (PM-WCS-3-USB)

Sensor dimensions 114 x 24 x11

Cable length 2.4m, 3m 

 

  • PM-WCS-3-LORA – LoRaWAN wireless interface. And USB wired interface for sensor configuration.

ELECTRICAL PROPERTIES (PM-WCS-3-LW)

Min. Typical Max.
Supply voltage (VCC), V 2.5 5 6
Working current(VCC=5V), mA 25 50
Operating Temperature Range, Celsius -20 60
Recommended battery 3.6v ER14505

PHYSICAL PROPERTIES (PM-WCS-3-LW)

Sensor dimensions 114 x 24 x11

Cable length 0.6m 

 

2.2 MEASUREMENT PROPERTIES

Table 2.2.1

ID Parameter Resolution /avg Tolerance Range
1 Dielectric permittivity (ε)

(Temperature corrected)

0.1ε /5% 1 (air) to 80 (water) 
2 Electrical Conductivity

(mS/m)

0.01 mS/m /20% 0…300 mS/m
3 Temperature (°C) 0.1°C /3% -20 to 60°C 
4 Volumetric Water Content (%) calculated from dielectric permittivity by Topp equation (Topp et al, 1980):

θ = 4.3 ⋅ 10−6ε3 − 0.00055ε2 + 0.0292ε − 0.053

0.1%  0 – 100% VWC 
5 LoRaWAN only – Battery voltage percent:

measures battery voltage and calculates percentage from 2v to 5v;

To calculate actual battery voltage use formaula: 2+0.03*battery reading.

for example if battery measurement shows 50% ,then actual voltage is 2+0.03*50=3.5v

1%  2v – 0%

…..

5v – 100%

 

4.0 SENSOR CALIBRATION
Sensors are already factory calibrated, but in case needed they may be recalibrated using USB terminal interface as described for device specific commands.

Table 3.2.1 USB device interface commands

Command Response Explanation
water OK Put sesnor in to water and issue this command
air OK Hold sesnor in air and issue this command
ec <uS/m> OK EC calibration, set right sensor reading value in uS/m
We recommend Android mobile application for sensor setup and data reading/storage described in chapter  5.1.

4.1 SENSOR CALIBRATION ANDROID
1. remove battery, attach to phone
2. open application & wait for  USB connected status or connect
3. go to SETTINGS tab,
4. hold sensor in the air – click button AIR
5. submerge sensor in the water or soil with water, click button WATER
6. go to MAIN tab click read to test calibrated values

3.0 SENSOR COMMUNICATION INTERFACES

Tinovi PM-WCS-3 family sensors implements USB, I2C serial interfaces and LoRaWAN wireless interface.

3.1 I2C serial interface

Interfacing from Raspberry Pi

WARNING!!! 3.3 power and voltage levels only, more than 3.5v voltage may damage the device. Please use voltage level converter for 5v arduino:

Wire colors

  1. power 3.3v (red)
  2. I2C line SDA (green)
  3. I2C line SCL (white)
  4. power GND (black)

Wiring to Raspberry Pi connector

Raspberry Pi pin #1 – red (3.3v)

Raspberry Pi pin #3 – green (SDA)

Raspberry Pi pin #5 – white (SCL)

Raspberry Pi pin #9 – black (GND)

Raspberry Pi pin #9 – shield(GND)

Enabling i2c interface in Raspberry Pi

see this manual

Get software

This sample software demonstrates hot to make command line interface for the sensor.
Sensor default I2C address is 0x63.

To get software execute following on Raspberry Pi:

git clone https://github.com/tinovi/i2cRaspberry

cd i2cRaspberry

chmod 777 *.sh to add for scripts execute permission

./mk.sh to make demo executable

./read.sh to read data from sensor

./svcs 0x63 addr 0x65 to change default address 0x63 to new I2C address: 0x65

Interfacing from Arduino

WARNING!!! use 3.3 voltage power and i2c levels only, more than 3.5v voltage may damage the device, use voltage level converter module for 5v arduino:

wiring to Arduiono

Arduiono pin #3V3 – sensor red (3.3v)

Arduiono pin #A4 – sensor green (SDA)

Arduiono pin #A5 – sensor white (SCL)

Arduiono pin #GND – sensor black (GND)

Arduiono pin #GND – sensor shield (GND)

SDA and SCL lines requires pull-up resitors to 3.3v line, we recommend to use 1.8K resistors, because of long wiring to i2c sensor.

Get software

This sample software demonstrates hot to read data from sensor.

Sensor default I2C address is 0x63.

Download Arduino library from there.

 

3.1 LoRaWAN interface sensor 

Sensor model PM-WCS-3-LORA supports LoRaWAN 1.0.2 Class A device.

Supports Over-the-air activation (OTAA / joining) and  Activation By Personalization (ABP). Packed data is sent in binary format and is 9 bytes long. It has 4 parameters 2 byte or 16bit signed integer each and last parameter battery is 1 byte long. After converting to integer they should be divided by 100 to get actual value.

Sensor consumes max 0.3 mA in sleep mode and 12 … 150 mA it active mode. Recommended battery is 3.6v ER14505.  

Data output

Format what you are usually getting from LoRaWAN is hex string, which you have to convert to bytes.
Then data output is in binary format is total 9-byte long:

  1. 2-byte 16-bit signed integer (divide by 100) Dielectric permittivity (ε) (Temperature corrected) resolution: 0.1ε and range 1 (air) to 80 (water)
  2. 2-byte 16-bit signed integer (divide by 100) Electrical Conductivity (mS/m) resolution: 0.01 mS/m
  3. 2-byte 16-bit signed integer (divide by 100) Temperature (°C) resolution: 0.1°C and range: -20 to 60°C
  4. 2-byte 16-bit signed integer Volumetric Water Content (%) resolution:0.1% and range: 0 – 100% VWC Note: VWC is calculated from dielectric permittivity by Topp equation (Topp et al, 1980): θ = 4.3 ⋅ 10−6ε3 − 0.00055ε2 + 0.0292ε − 0.053)
  5. 1-byte Battery voltage percent: measures battery voltage and calculates percentage from 2v to 5v; To calculate actual battery voltage use equation : 2+0.03(battery reading). for example if battery measurement shows 50% ,then actual voltage is 2+0.0350=3.5v resolution: 1% and range: 2v – 0% to 5v – 100%

thethingsnetwork.org (TTN) may be used following decoding script:

var bytesToInt = function(bytes) {

 var sign = bytes[0] & (1 << 7);

 var x = ((bytes[0] & 0xFF) << 8) | (bytes[1] & 0xFF);

 if (sign) {

    x = 0xFFFF0000 | x;

 }

 return x/100;

};

function Decoder(bytes, port) {

 var decoded = {};

 decoded.e25=bytesToInt(bytes.slice(0,2));

 decoded.ec=bytesToInt(bytes.slice(2,4));

 decoded.temp=bytesToInt(bytes.slice(4,6));

 decoded.vwc=bytesToInt(bytes.slice(6,8));

 decoded.bat=bytes[8];

 return decoded;

}

LoRaWAN configuration may be done via USB CDC-ACM virtual com port with 115200 baudrate. Before configuration you need to switch off device and then connect to usb port of your computer. On linux it will be detected as /dev/ttyACM0 .

For linux permission settings please consult.

On Linux you may use minicom utility to configure sensor.

For windows PuTTY may be used.

We recommend Android mobile application for sensor setup and data reading/storage described in chapter 5.1.

Table 3.1.1 LoRaWAN device configuration commands

Command Response Explanation
int <val> <interval> OK Setup data sens interval in seconds
appeui <val> OK Sets Device EUI for OTAA activation.
deveui <val> OK Sets Application EUI for OTAA activation.
devkey <val> OK Sets App Key for OTAA activation.
devaddr <val> <val> OK Sets Device Address for ABP activation.
nwks <val> OK Sets Network Session Key for ABP activation.
apps <val> OK Sets App Session Key for ABP activation.
check <0/1> ok 0-Disable/1-Enable OTAA link check mode EU868 (helps reconnect device on gateway outage)
info config vals print this parameter setup values.
ver <version> print device type and version number

 

LoRaWAN Downlink message to update data sending interval

Device supports LoRaWAN downlink message for device sleep time (data sending interval) adjustment. Message should contain 5 bytes, 1st byte is Ox01 and following 4 bytes is unsigned 32-bit integer time in seconds to sleep. For example sending HEX 010000000A will set interval to 10 seconds, but 0100000E10 will set interval to 3600 secs = 1 hour.

Power supply

Sensor consumes max 0.3 mA in sleep mode, 12 mA in active mode and 150 mA in transmitting mode. Recommended battery is 3.6v ER14505. Sensor also may be powered from any 5v Micro-USB power source. After power up sensors wait 10 seconds for USB configuration session connection from android application or USB CDC terminal, if none is connected sensors turns off USB hardware and starts normal operation.

4.0 SENSOR CALIBRATION

Sensors are already factory calibrated, but in case needed they may be recalibrated using USB terminal interface as described for device specific commands.

 

Table 3.2.1 USB device interface commands

Command Response Explanation
water OK Put sesnor in to water and issue this command
air OK Hold sesnor in air and issue this command
ec <uS/m> OK EC calibration, set right sensor reading value in uS/m

We recommend Android mobile application for sensor setup and data reading/storage described in chapter  5.1.

4.1 SENSOR CALIBRATION ANDROID

1. remove battery, attach to phone
2. open application & wait for  USB connected status or connect
3. go to SETTINGS tab,
4. hold sensor in the air – click button AIR
5. submerge sensor in the water or soil with water, click button WATER
6. go to MAIN tab click read to test calibrated values

5.0 ANDROID APPLICATION

5.1 LoRaWAN/USB SoilSensor configuration and monitoring application.

You may use any android phone supporting OTG host option to configure USB and LoRaWAN sensors.

For LoRaWAN sensors data is streamed online via LoRaWAN gateways connected to TTN.

To enable online monitoring you should:

  • Click login in application main page, to signup with your google account.
  • Attach LoRaWAN sensor to phone’s USB OTG port, wait for status USB Connected and go to soil sensor application’s settings tab.
  • Click READ to read address data from sensor.
  • Input your device’s name without white spaces and click REGISTER OTAA button, to register device to cloud.
  • Your device should appear on main tabs sensor list. Chose your sensor in list to see data from sensor.

Tinovi Soilsensor Android application receives LoRaWAN sensors data via https://zerver.io/graph IoT cloud application. You may login to this dashboard tool using your googles account and create nice dashboards to monitor your sensor data.

For USB sensor modification this application may be used as data logger, because it stores data readings to android flash memory and displays them to graphs. Data displayed in graphs may be copied to clipboard in CSV format and shared or saved to file.

Features
* Online LoRaWAN sensor monitoring via TTN connected gateways.
* Setup USB and LoRaWANTinovi soil sensors
* Write USB and LoRaWAN sensor data to phone memory
* View data on charts and export to CSV
* Source code is located there

Get it on Google Play

This android application allows easy to configure and monitor soil moisture sensors.

source code of mobile application is located on Github there.

!WARNING please remove device battery before attaching device to USB port for configuration. Leaving battery with attached USB power supply may damage battery or your device’s USB port.

!WARNING device waits for 10 seconds after power up for configuration terminal software connection. After terminal connection it remains in configuration mode until terminal software is disconnected.

!WARNING device joining mode OTAA or ABP is switched automatically on configuration when you setup OTAA or ABP parameter.

 

3.2 USB interface sensor

Sensor model PM-WCS-3-USB supports USB CDC-ACM virtual com port with 115200 baudrate.

Sensor is equipped with standard USB 2.0 cable.

On linux it will be detected as /dev/ttyACMx .

For linux permissions settings please consult:https://playground.arduino.cc/Linux/All#Permission

On Linux you may use minicom utility to configure sensor.

For windows PuTTY may be used.

We recommend Android mobile application for sensor setup and data reading/storage described in chapter 5.1.

3.2.1 USB interface sensor data format

PM-WCS-3-USB data output prints comma separated values (CSV) sequenced as described in  Table 2.2.1 (Chapter 2 MEASUREMENT PROPERTIES). Optionally you may setup EPOCH time (Table 3.2.1 command: “time”) in seconds and there will be time parameter added in front.

Table 3.2.1 USB device interface commands

Command Response Explanation
read sesnor data request response sensor data reading
millis <period> sesnor data sensor will start report data  repeated by setup period in milliseconds, this option may be used to redirect data to log file.
time <Epoch> OK setup current Epoch time in seconds – need to setup after any power loss of the sensor.
int <int. sec.> OK set USB odffline memory write interval in seconds
mem <data> get offline data accumulated (max 320dp)
ver <version> print device type and version number
info <info> infoUSB,millis,off-Interval,appId, devId
appid <appId> OK set appId
devid <devId> OK set devId

3.2.2 Redirecting sensor reading data to file on Linux systems

You can write simple script to start log sensor USB data to CSV file.

This sample is written for Raspberry Pi, Debian, Ubuntu linux, before executing script you have to install minicom: sudo apt-get install minicom

 

#!/bin/bash

#sensor serial port name

PT=”/dev/ttyACM0″

sudo stty -F $PT speed 115200 cs8 -cstopb -parenb -echo raw

#setup current time

echo -ne “time $(date +%s)\r” > $PT

#set time period 5 seconds in milliseconds and start logging

echo -ne “millis 5000\r” > $PT

#flush some output

timeout 2s cat $PT

#print output to file

cat $PT > swout.csv 2>&1 &

 

Go to shop

Share on social networks