Skip to the content
2 layers100 × 149.5 mmRs485-moist sensor pannel, the printed circuit board in 3D

Rs485-moist sensor pannel

Miceuz/rs485-moist-sensor74

Digital (RS485 - based) soil moisture and temperature sensor

Size
100 × 149.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
170
Nets
20
Pads
450
Tracks, vias
2,020, 865
Pours
29
Routed
Yes
KiCad
KiCad 5 (file 20170123)
Created
16 Feb 2015
Updated
4 Dec 2023

Overview

Rs485-moist sensor pannel is an open-source printed circuit board by Miceuz, from the Miceuz/rs485-moist-sensor repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 100 × 149.5 mm with 170 parts on 20 nets, routed with 2,020 tracks and 865 vias.

It is built around the ATTINY441-SSU, SN65HVD72D and BAT54, with the NCP18XH103F03RB among its other parts. Its parts include 45 capacitors, 45 resistors, 15 ICs, 15 diodes and 10 connectors. It belongs with the interfaces and adapters and sensors and measurement boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

4

README

README.md

rs485 soil moisture sensor

Digital (RS485 - based) soil moisture and temperature sensor

A version of I2C soil moisture sensor with several updates - antistatic protection, local voltage regulation and RS485 networking.

This is a contact-less capacitive soil moisture sensor, a continuation of my I2C soil moisture sensor. This particular version of the sensor is suited for more professional installations where long cable runs is a requirement. It adds a local voltage regulator to mitigate the voltage drop and RS485 transceiver to accommodate long wires, also reverse polarity and an additional ESD protection level is added.

This is the easiest and the most robust way to read soil moisture and temperature values into Raspberry Pi. I have written a tutorial how to do it.

The main features:

  • Capacitive soil moisture sensing
  • Temperature sensing
  • Good stability with temperature
  • Good stability with power variation
  • Suitable for long cable runs
  • Uses industrial Modbus protocol

Python library

A python library is available via pip. Type pip install chirp_modbus to install it. Check the source code for documentation. Usage example:

python
from chirp_modbus import SoilMoistureSensor
s = SoilMoistureSensor(1, '/dev/ttyUSB5')
print(s.getTemperature())
print(s.getMoisture())

Technical data

  • Supply voltage - 5V
  • Bus can be run on both 3V and 5V
  • Default serial settings: 19200, 8-bit frame, no parity, 2 stop bits
  • Default Modbus address: 1
  • Current consumption: Active: 9mA, Deep sleep: 11uA

Principle of operation

Sensor makes periodic measurements (by default, once every 500ms), delays between measurements can be updated by writing to one of the Modbus registers. The results of the measurements are kept in specific Modbus registers and can be read by master any time unless the sensor is in deep sleep.

Deep sleep is entered by writing a number of seconds to sleep into a special sleep register. The sensor will put the transceiver and all the periphery into the lowest possible power consumption mode and sleep for the specified amoutn of time. After the sleep the sensor will wake up, start taking measurements and be available on the bus till the next sleep command.

Serial communication parameters as baud rate, parity and address can be updated by writing to related registers. The sensor will reset and boot with the new parameters if any of those registers are written.

Input (read only) registers

Register numberSize (bytes)Description
02Soil moisture. Unsigned
12Temperature. Signed. In tenths of degrees Celsius. I.e. 220 means 22.0C

Holding (read/write) registers

Register numberSize (bytes)Valid valuesDefault valueDescription
02[1 - 247]1Modbus address
12[0 - 7]4Baud rate
22[0 - 2]0Parity Note: most cheap ebay USB to RS485 dongles don't support parity properly!
32[1 - 65535]500Measurement interval in milliseconds
42[1 - 65535]0Time to sleep in seconds. Write to this register to put the sensor to sleep.
Supported baudrates
NumberBaudrate
01200
12400
24800
39600
419200
538400
657600
7115200
Supported parity settings
NumberParity
0None
1Even
2Odd

Note: most of the cheap ebay USB to RS485 dongles and/or their drivers do not support parity setting properly! You will have to use a proper parity supporting adapter to unbrick the sensor if you set this to something that your dongle does not support! Luckily Adruino with ATmega 16u2 can be used as USB to Serial adapter to solve this.

How to interpret the readings

Moisture values are relative. Meaning, more moisture will give you higher reading, less moisture - lower reading. It's up to you to calibrate it to amount of water in the soil as readings will be different for different types of soils.

Moisture is somewhat linear. I test all sensors before shipping and they give about 292 in free air.

Temperature is measured by the thermistor on the body of the sensor. Calculated absolute measurement accuracy is better than 2%. The returned value is in tenths of degrees Celsius. I.e. value 252 would mean 25.2°C.

Controller support

The sensor will work fine with any controller supporting serial communication provided you have an RS485 transceiver. There are a lot of Modbus libraries readily available for a variety of micro-processor families. Thea easiest way to try the sensor is to use one of the abundant and cheap USB to RS485 dongles and connect it to a Raspberry pi or even directly to your computer.

I have written some basic test code in python that is available on github page.

Waterproofing

The sensor comes coated with PRF202 - a moisture resistant varnish for electronics. It's ok for play around in a flower pot but not enough for outdoor use. You must add an additional protection to the whole sensor after soldering cable to it! Some suggestions on making the sensor more robust after attaching the cable:

  • Polyester or epoxy resin - this method is the most bullet proof as the resin is totally resistant to the water. On the par side, note that sensitivity of the sensor will decrease depending on how thick the layer you are going to apply. Also applying the resin in uniform manner presents some challenge.
  • PlastiDip - some of my customers have tried this method - easy to apply by spraying and not a lot of loss of sensitivity.
  • Rubber balloon - yes, just roll a long balloon over the sensor :)

Be sure to coat the whole thing - the sensor part, the electronics and the cable connection itself so no bare copper or solder is accessible to the water.

Parts

170
QtyValueFootprintReferences
251uCapacitors_SMD:C_0603C3, C3, C3, C3, C3, C6, C6, C6, C6, C6, C7, C7, C7, C7, C7, C8 +9
201MResistors_SMD:R_0603R5, R5, R5, R5, R5, R6, R6, R6, R6, R6, R7, R7, R7, R7, R7, R8 +4
1510kResistors_SMD:R_0603R1, R1, R1, R1, R1, R3, R3, R3, R3, R3, R9, R9, R9, R9, R9
101nCapacitors_SMD:C_0603C4, C4, C4, C4, C4, C5, C5, C5, C5, C5
1033pCapacitors_SMD:C_0603C1, C1, C1, C1, C1, C2, C2, C2, C2, C2
10BAT54SMD_Packages:SOD-523D1, D1, D1, D1, D1, D2, D2, D2, D2, D2
510k 0.1%Resistors_SMD:R_0603R2, R2, R2, R2, R2
516MHzCrystals:Crystal_HC49-SD_SMDX1, X1, X1, X1, X1
5330Resistors_SMD:R_0603R4, R4, R4, R4, R4
5ATTINY441-SSUHousings_SOIC:SOIC-14_3.9x8.7mm_Pitch1.27mmIC1, IC1, IC1, IC1, IC1
5CONN_01X04Pin_Headers:Pin_Header_Straight_1x04_Pitch2.54mmP2, P2, P2, P2, P2
5CONN_02X03Pin_Headers:Pin_Header_Straight_2x03P1, P1, P1, P1, P1
5LOGOchirp_logo:ziogasG***, G***, G***, G***, G***
5LOGOw_logo:Logo_silk_OSHW_6x6mmG***, G***, G***, G***, G***
5MCP1702Housings_SOT-23_SOT-143_TSOT-6:SOT-23U2, U2, U2, U2, U2
5NCP18XH103F03RBResistors_SMD:R_0603TH1, TH1, TH1, TH1, TH1
5NUP4004M5T1GHousings_SOT-23_SOT-143_TSOT-6:SOT-23-5D4, D4, D4, D4, D4
5Q_PMOS_GSDHousings_SOT-23_SOT-143_TSOT-6:SOT-23Q1, Q1, Q1, Q1, Q1
5SN65HVD72Housings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mmU1, U1, U1, U1, U1

The 155 most common of 170 parts.

More from Miceuz/rs485-moist-sensor

3
  • 2 layers48.5 × 19.5 mmAdapter por, the printed circuit board in 3D

    Adapter por

    Miceuz/rs485-moist-sensor

    Digital (RS485 - based) soil moisture and temperature sensor

    21 parts74Apache-2.0
  • 2 layers35.5 × 19.5 mmAdapter, the printed circuit board in 3D

    Adapter

    Miceuz/rs485-moist-sensor

    Digital (RS485 - based) soil moisture and temperature sensor

    7 parts74Apache-2.0
  • 2 layers37.5 × 35.5 mmInterconnect, the printed circuit board in 3D

    Interconnect

    Miceuz/rs485-moist-sensor

    Digital (RS485 - based) soil moisture and temperature sensor

    5 parts74Apache-2.0

Similar boards

  • 2 layers100 × 150 mmI2c moist sensor pannel, the printed circuit board in 3D

    I2c moist sensor pannel

    Miceuz/i2c-moisture-sensor

    I2C based soil moisture sensor

    140 parts258Apache-2.0
  • 2 layers25.2 × 60.5 mmRs485-breakout, the printed circuit board in 3D

    Rs485-breakout

    Miceuz/rs485-breakout

    A tiny development board to quickly prototype RS485/Modbus devices

    33 parts2Apache-2.0
  • 2 layers52 × 49 mmLine interface, the printed circuit board in 3D

    Line interface

    Technariumas/smalsiukas

    The conversion of a forklift truck to a line following robot.

    35 partsApache-2.0
  • 4 layers63 × 50 mmLora bridge, the printed circuit board in 3D

    Lora bridge

    RainDrop-lora/raindrop

    Soil moisture monitoring system on LoRaWAN network

    74 parts10Apache-2.0
  • 2 layers50.8 × 20.3 mmPmod rs485, the printed circuit board in 3D

    Pmod rs485

    Agilack/pmod

    This repository holds multiple PMOD modules projects

    11 parts10

Questions

How big is the Rs485-moist sensor pannel PCB?

It measures 100 × 149.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Rs485-moist sensor pannel use?

170 parts, built around the ATTINY441-SSU, SN65HVD72D, BAT54 and NCP18XH103F03RB. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Rs485-moist sensor pannel KiCad files?

From the Miceuz/rs485-moist-sensor repository on GitHub, at the commit this page was made from: the board is rs485-moist-sensor-pannel.kicad_pcb and its schematic rs485-moist-sensor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rs485-moist sensor pannel design in my own project?

Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).