My last concert visit was a memorable experience. The german medieval music group "Faun" is one of my all-time favourites. I enjoyed dancing and singing along to their mystical tunes. For more information see their website Faun

Another group I particularly like is dArtagnan. I even bought their limited fanbox.


 

When I was young I started programming with punch cards, then moved to assembler which is still my favourite way of programming. From time to time I get interested in high level languages which are so popular these days. Python is among them and so I decided to make first step towards reading out the SMT100 soii moisture sensor from my PC or Raspberry Pi. The hardware required is a SMT100 in RS-485 ASCII version and a USB to RS-485 converter cable. A RS485 shield for the Raspberry Pi would be fine as well, but I simply started with the converter cable which provides power (5V), GND, RS-485A and RS-485B.

As a first step I developed this simpy Python code. Choose the correct COM port for your system.

import serial
import time

def GetTemperature():
    ser.readline()                                               # remove any unwanted characters
    command = bytes("GetTemperature!\r\n", 'utf-8')              # set command here!
    ser.write(command)                                           # write to serial port
    line = ser.readline()                                        # read from serial port
    line = line.decode('utf-8')                                  # convert bytes object to string
    line = line[:-2]                                             # remove CR+LF from right side of string
    if line == '':
        print("no response from sensor")  
    else:
        print("Temperature: "+ line+" °C")
    
def GetWatercontent():
    ser.readline()
    command = bytes("GetWatercontent!\r\n", 'utf-8')                                
    ser.write(command)
    line = ser.readline()
    line = line.decode('utf-8')
    line = line[:-2]
    if line == '':
        print("no response from sensor")                                        

    else:
        print("Watercontent: "+ line+" %")
    
port = 'COM3'                                                         # set comport here!
ser = serial.Serial( port,
         baudrate=9600,                                               # set baudrate here!
         bytesize=serial.EIGHTBITS,
         parity=serial.PARITY_NONE,
         timeout=1)

while(1):
    if(ser.isOpen() == False):
        print ("error open serial port: " + port)                    
        exit()                                 

    if ser.isOpen():
        print("Please enter your command: ", end = '')
        INPUT = input()
        
        if INPUT == "GetTemperature!":
            GetTemperature()
            
        if INPUT == "GetWatercontent!":
            GetWatercontent()
            
    else:
        print ("error communticating")                               

 

Usage

Please enter your command: GetTemperature!

Temperature: 24.7 °C

Please enter your command: GetWatercontent!

Watercontent: 96.46 %

Please enter your command:

My nephew visited me some months ago and asked me for a wireless soil moisture sensor. At that time I was already aware of those groundbreaking new wireless technologies like LoRa, Sigfox and NB-IoT, but had no comprehensive experience so far. So I decided to

  • get an overview of the competing technologies LoRa, Sigfox and NB-IoT,
  • develop some low cost wireless nodes
  • and get some practical experience.

This is the first part of my journey which covers LoRa. Before diving into the technical details let me talk about low power long range communication in general.The range of a wireless system mainly depends on these factors

  • transmitter power
  • receiver sensitivity (bandwidth)
  • antenna gain
  • radio environment (from line of sight to dense urban areas)

Many people are not aware that the radio environment has an extreme infkuence in range. There is easily a factor of 10 or morge in range comparing rural and urband sites. Datasheets often claim a range which can only be achieved under most favourite conditions and therefore disappointment is guaranteed.  I usually follow these rules:

  • use the highest transmitter power which is accpetable in regard to frequency spectrum regulations and power supply capability
  • use antennas with as much gain as possible
  • place the antennas as high as possible
  • use a low bandwidth/datarate to increase sensitivity (in my application I usually transmit only a few bytes of data)

Before LoRa it was already possible to achieve long range at low power, but LoRa made this possible at very low cost by integrating the required signal processing into a single chip. I usually go with the module RFM95 by HopeRF which is about 5-6 Euros and add an ATmega328 controller. Here you can see me first attempt.

Software is either pure LoRa or LoRaWAN in conjunction the TheThingsNetwork. For LoRaWAN I chose MCCI Catena LMIC lib which works quite well and a low power lib to achieve a few Mikroamps during sleep times. This way I am running an experiemental node in my garden together with an SMT50.

My nephew recently visited me and asked for advice on lawn irrigation. He has a couple of soil moisture sensors placed all over his lawn in the root zone (about 10 cm deep) and is wondering how to adjust the threshold for irrigation. My first simple advice was just to observe the lawn and identifiy the water content when the leaves are getting brown. Brown leaves are an indication of water stress. My nephew was not really satisfied with this answer and said: "Grandma, you have such a long experience in gardening, you have a so-called green thumb, but I am a real novice. Could you please help me so that even I can adjust he irrigation threshold without observing the leaves". So did a survey and found this guide from the University of Florida on Smart Irrigation This is the sum up of their recommendations:

  • Place the sensor at locations which are representative for the area to be irrigated (see more details about sensor locations in the guide)
  • Burry the sensors in the root zone
  • Carefully install the sensors with no air gaps around the sensor
  • Calibrate the sensor
    • Apply water in the sensor area up to saturation
    • Do not apply water for 24 hours
    • Record the water content which is the threshold value (threshold can be adjusted to 20% lower than this value)

In any case I would always observe the lawn and see if it is in good shape with this irrigation threshold setting.

It may sound a bit off topic, but I decided to share my experience in delicious food and drinks. As a passionate gardener I grow not only flowers but also vegetables and fruits, and of course I enjoy having good food. I came across many countries in the world and remember quite a number of unique spots. I start this series with my favourite shake supplier in the US which is Iceberg Drive Inn. The first restaurant open in 1960 in Salt Lake City.

My first experience with Icebergs was on a hot summer night in St. George, Utah. I came across Icebergs and decided to try their thick blueberry shake. It was incredible, both taste and size were amazing. Since that time I even take a longer detour just to enjoy the famous thick shake. My favourites are blueberry and strawberry.

 

This is my first step in building an automated irrigation system with the Loxone Miniserver. Loxone is a manufacturer of smart home systems and became quite popular due to its medium price tag and good support of interfaces. I decided to give it a try and chose the Loxone Miniserver and the corresponding Modbus extension. With the Modbus extension it is possible to add up to 32 Modbus devices. If this is not enough you can add more Modbus extensions Here is how the Loxone Miniserver looks like.

.

With Modbus RTU it is quite simple to add a SMT100 to the Loxone. The SMT100 is available as Modbus version (please mention this when ordering). The manufacturer TRUEBNER provides an application note and a Modbus test program. I configured the SMT100 as Modbus device with address 1. Here is the configuration required by the Loxone. Please first add the Modbus extension to the Miniserver and then connect the SMT100 to the Modbus extension. Do not forget to power the SMT100.

Step 1: Modbus Extension

Set Baudrate to 9600 and Parity to even

Step 2: Modbus Device

Set Modbus address

Step 3: Add Sensor settings for temperature

I/O address 0

Command 3 (read holding registers)

Data type 16 bit unsigned integer

Step 4: Add Sensor settings for moisture

I/O address 1

Command 3 (read holding registers)

Data type 16 bit unsigned integer

Use conversion formulas (math block formula)

moisture: 16 bit value /100

temperature: 16 bit value / 100 - 100

Use virtual status blocks to display moisture and temperature on the website

This is the final result

If anyone needs a more detailed explanation how to setup Loxone with the Modbus Extension please send me an email at maria.gardenergranny@gmail.com.

Of course it is not a requirement to use Modbus for the SMT100 with Loxone. There are two more options. First option: Use the SMT100 with analog voltage output. Second option: Use the SMT100 ASCII with an RS485 Extension. For me Modbus was the most convenient choice. I know Modbus from the beginng. I still remember the good old times back in 1979 when Modbus came on the market and I developed a Modbus controller for my sewing machine.