Forum

FloraPulse stem wat...
 
Notifications
Clear all

FloraPulse stem water potential sensors

1 Posts
1 Users
0 Likes
91 Views
Posts: 5
Admin
Topic starter
(@liudr)
Member
Joined: 14 years ago

I often get questions of "Will SDI-12 sensor X work with your SDI-12 adapter?"

In general, all SDI-12 sensors should work with my adapters. But there are always some variations in the implementations of the SDI-12 standard by different vendors. Here is one brand of sensors that was recently confirmed working with my adapter. Thanks Michael!

According to the website below, FloraPulse sensors are "the most accurate irrigation guidance for orchards and vineyards".

https://www.florapulse.com/

The only slight modification that Michael found was that a delay of 1 second is needed before sending each command to the adapter. You can delay with time.sleep(1)

Here is a snippet courtesy of Dr. Michael Santiago:

#!/usr/local/opt/python-3.5.1/bin/python3.5
# Simple SDI-12 Sensor Reader Copyright Dr. John Liu
import serial.tools.list_ports
import serial
import time
import re

ser=serial.Serial(port='COM10',baudrate=9600,timeout=10)
time.sleep(2.5) # delay for arduino bootloader and the 1 second delay of the adapter.

ser.write(b'?!')
sdi_12_line=ser.readline()
sdi_12_line=sdi_12_line[:-2] # remove \r and \n since [0-9]$ has trouble with \r
m=re.search(b'[0-9a-zA-Z]$',sdi_12_line) # having trouble with the \r
sdi_12_address=m.group(0) # find address
print('\nSensor address:', sdi_12_address.decode('utf-8'))

time.sleep(1)
ser.write(sdi_12_address+b'I!')
sdi_12_line=ser.readline()
sdi_12_line=sdi_12_line[:-2] # remove \r and \n
print('Sensor info:',sdi_12_line.decode('utf-8'))

time.sleep(1)
ser.write(sdi_12_address+b'M!')
sdi_12_line=ser.readline()
sdi_12_line=ser.readline()

time.sleep(1)
ser.write(sdi_12_address+b'D0!')
sdi_12_line=ser.readline()
sdi_12_line=sdi_12_line[:-2] # remove \r and \n
print('Sensor reading:',sdi_12_line.decode('utf-8'))
print('\nFor complete data logging solution, download the free Python data logger under "data logger programs"\n https://liudr.wordpress.com/gadget/sdi-12-usb-adapter /')
ser.close()

If you are planning to build your own data logger with free time-series database such as influxdb, this will be a good start to read data.

Share: