Skip to content

Plugin current loop tanks monitor

Martin Pihrt edited this page Oct 13, 2026 · 1 revision

Current Loop Tanks Monitor

Monitors up to four water tanks through an ADS1115 and 4-20 mA pressure sensors.

At a glance

Item Value
Version 1.1.1
Category Irrigation and water management
Author Martin Pihrt
License GPL-3.0
OSPy 3.0.211 or newer
Python 3.8 or newer
Permissions email, files, i2c, system
Hardware platforms: raspberry_pi, linux; interfaces: i2c
Dependencies Database Connector (optional)
Python/OS packages smbus / python3-smbus (required)
Interfaces provider ospy.provider.v1, Mobile API v1
Source Open the plug-in directory

What it is for

Monitors up to four water tanks through an ADS1115 and 4-20 mA pressure sensors.

How it works and how to configure it

Tested in Python 3+

This plug-in module measures the water level in 4 tanks. A differential pressure sensor with a 4-20mA/24V current loop (e.g. TL-136) is used for the measurement. Visit Martin Pihrt's blog for more information.

The measurement interval is configurable in seconds. Longer intervals reduce CPU usage and I2C bus load. The plug-in reads only tanks that are enabled or needed by regulation, stop-station or e-mail rules.

Version 1.1.1 adds an explicit Automation Rules provider action for safely stopping regulation runs belonging to one selected tank or all configured tanks. Version 1.1.0 implements the read-only ospy.provider.v1 contract. Every enabled 4–20 mA channel is a separate tank resource with cached level, fill, volume and sensor voltage; provider reads never start an ADS1115 conversion.

The plug-in includes an OSPy plugin.json manifest, registers its measurement worker with the shared plug-in runtime, uses the common stop signal, and implements health(). Diagnostics reports configured tanks, worker state, ADS1115 address, latest successful measurement, and I2C or ADC errors.

In-app help and settings notes

The following notes are generated from the help page shipped with this plug-in. Field names are also explained directly in the OSPy settings page.

This plug-in module measures the water level in 4 tanks. A differential pressure sensor with a 4-20mA/24V current loop (e.g. TL-136) is used for the measurement. If the water level is low, this plug-in stops the irrigation system (stops the running stations in the scheduler) and sends an error e-mail. default address 0x48

Address of the converter on the bus:

Adr pin connecting to:

GND = 0x48

VDD = 0x49

SDA = 0x4A

SCL = 0x4B

The measurement interval sets how often the plug-in reads the AD converter. Longer intervals lower CPU usage and I2C bus load. The plug-in reads only tanks that are enabled or needed by regulation, stop-station or e-mail rules.

If logging is enabled, a graph with measured data will be displayed at the bottom of the screen

Automation Rules can explicitly stop regulation runs belonging to one selected tank or all configured tanks.

Visit for more information

How to installing in tank

Calibration

Without a sensor connected (on inputs 1 to 4), the plugin must display a voltage of 0V.

When connecting + and - (on inputs 1 to 4), approximately 3.2V must be displayed.

We connect the sensor (without immersing it in water, i.e. outside the tank) and see what voltage the plugin shows (example: we will see something around 0.7 V).

We will enter this voltage in the plugin settings in the "minimum voltage" section.

Then we insert the sensor into a full tank "to the bottom" and see what voltage the plugin shows (example: we will see something around 3.2 V).

We will enter this voltage in the plugin settings in the "maximum voltage" section.

In the "maximum volume" section, we enter our calculated/actual volume of the tank when it is 100% full of water (example: 50 liters).

In the "maximum height" section, enter the actual measured distance between the sensor and the maximum level at 100% (example: 43 cm).

This completes the calibration. The plugin will then recalculate the tank level and volume.

Pressure sensor

It is powered by 24V directly from this board and does not need to connect any other source! Hard-wiring the input terminal on the board - for example, input 1 + and - will not damage the circuit (board). The maximum current is set to 20mA. For checking, we can leave the unused input connected to + and - (in the plugin we will see the maximum voltage of about 3.5V). Or we can connect an LED of any color between + and - (LED If=20mA).

Wiring diagram

PCB

Related links and diagrams

tank

wiring

pcb1

pcb2

pcb3

pcb4

pcb5

Support

Check OSPy → Diagnostics first and remove passwords, tokens, private addresses and other secrets before sharing logs. Report reproducible plug-in problems in the OSPy-plugins issue tracker.

Back to the plug-in catalog

Clone this wiki locally