PM-WCS-3-USB Sesnor Moisture Sesnor

PM-WCS-3-USB sensor features USB – A type connector cable. It may be attached directly to PC or to Android phone/tablet via OTG USB host cable. Sensor supports USB CDC-ACM virtual com port with 115200 baudrate. By default sensor is configured to print readings every 2 seconds in CSV format. It is easy to dump this reading to CSV file for later processing.

 

MEASUREMENT PROPERTIES

Table 2.2.1

ID Parameter Resolution Range
1 Dielectric permittivity (ε)(Temperature corrected) 0.1ε 1 (air) to 80 (water)
2 Electrical Conductivity(dS/m) 0.01 dS/m 0 to 23 dS/m
3 Temperature (°C) 0.1°C -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

 

 ELECTRICAL PROPERTIES

Table 2.3.1

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

USB interface

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 reccomend Android mobile application for sensor setup and data reading/storage described in chapter 5.1.

USB interface 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.

USB interface data format

 

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.
ver <version> print device type and version number

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 &

 

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

 

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

 

ANDROID APPLICATIONS

SoilSensor USB configuration and monitoring application.

You may use any android phone supporting OTG host option to configure USB and LoRaWAN sensors. 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.

Get it on Google Play

source code of mobile application is located on Github there.

Leave a Reply

Your email address will not be published. Required fields are marked *