Making an output follow a sensor
Download as PDFThe Follow sensor automation rule makes an output follow a sensor proportionally. You choose a sensor range, and the rule converts every value in that range into an output between 0% and 100%:
- At the start of the range, the output is 0%.
- At the end of the range, the output is 100%.
- In between, the output follows the sensor in a straight line.
- Outside the range, the output stays at 0% or 100%.
The most common use is to pass a measurement on to a PLC or SCADA system as a 4-20mA signal through the WD Output Module — for example an H2S measurement, as in the example below. You can also use it to set the speed of a pump or the position of a valve from a measurement.
Unlike On/Off controller and PID controller, Follow sensor has no setpoint: it doesn’t try to bring the measurement to a target value, it simply passes the sensor value on to the output on a scale you define.
Before you start
Section titled “Before you start”- A sensor element with the measurement you want to follow, and an output element that the rule should drive — for example a 4-20mA output on the WD Output Module.
- Firmware 3.16.0 or newer on the device that the output belongs to. Devices with older firmware don’t run Follow sensor rules.
- Edit permissions on the project.
The sensor and the output don’t have to be on the same device — see Follow a sensor on another device.
Create the automation rule
Section titled “Create the automation rule”- Go to v3.consibio.cloud and open your project.
- In the main menu, open Rules and select Automation rules.
- Select Add new automation rule and give the rule a descriptive name.
- In Output type, choose Follow sensor.
- In Input element, select the sensor element the output should follow.
- In Sensor range start (0% output), enter the sensor value at which the output should be 0%.
- In Sensor range end (100% output), enter the sensor value at which the output should be 100%.
- In Output element, select the element the output should be sent to.
- Save the rule.
Both range values are entered in the unit of the selected sensor, so select the input element first.
Example: H2S sensor to a 4-20mA output
Section titled “Example: H2S sensor to a 4-20mA output”An H2S sensor measures from 0 to 2000 ppm, and the measurement should be passed on to a SCADA system through a 4-20mA output, so that 4 mA means 0 ppm and 20 mA means 2000 ppm.
-
Install the WD Output Module, wire the 4-20mA loop to the SCADA input and set up the 4-20mA outputs channel with an element on the output you wired. See Setting up the WD Output Module, in particular Wire the 4-20mA outputs and Set up the 4-20mA output channels.
-
Create an automation rule with these settings:
Setting Value Output type Follow sensor Input element The H2S element Sensor range start (0% output) 0 ppm Sensor range end (100% output) 2000 ppm Output element The element on the 4-20mA output you wired, for example the one on 4-20mA output no. 1 -
In the SCADA system, scale the input so that 4 mA = 0 ppm and 20 mA = 2000 ppm.
The rule then drives the output like this:
| H2S | Output | 4-20mA signal |
|---|---|---|
| 0 ppm | 0% | 4 mA |
| 500 ppm | 25% | 8 mA |
| 1000 ppm | 50% | 12 mA |
| 1500 ppm | 75% | 16 mA |
| 2000 ppm | 100% | 20 mA |
| Above 2000 ppm | 100% | 20 mA |
When the output has no value, the WD Output Module drives 3.7 mA instead, so the SCADA system can tell a missing value apart from a genuine 0 ppm reading. This happens:
- Until the rule has set the output for the first time.
- If the rule hasn’t updated the output for more than 1 hour — for example because the device has no value for the H2S sensor after a restart.
Follow a sensor on another device
Section titled “Follow a sensor on another device”The sensor and the output can be on different devices in the same project. This lets a device in the field send in its measurements, and a device somewhere else turn them into an analog output — without running any cables between the two.
A typical setup:
- A Logger WD-68 with an H2S sensor is installed in a manhole out in the sewer network and sends its measurements to Consibio Cloud.
- A second Logger WD-68 with a WD Output Module is installed next to the SCADA system, for example at the treatment plant.
- A Follow sensor rule uses the H2S element from the field Logger as Input element, and a 4-20mA output on the second Logger as Output element — set up exactly like the H2S example above.
The rule runs on the device with the output — here the Logger next to the SCADA system — and receives the sensor values through Consibio Cloud.
Keep in mind that the output can only be as up to date as the values it receives:
- A new sensor value reaches the output in two steps: the field device transmits it to Consibio Cloud, and the output device picks up the latest value the next time it connects to Consibio Cloud. The output doesn’t change every time the field device measures. Set the transmission intervals of both devices to match how quickly the output needs to react.
- Between updates, the rule keeps driving the output from the last value it received — also if a device loses its connection for a while.
- If the output device restarts, it has no sensor value until it has connected and received a new one. If that takes more than 1 hour, a 4-20mA output falls back to 3.7 mA in the meantime.
When the sensor and the output are on the same device, the rule runs entirely on that device. The output then follows every new measurement, also between transmissions and while the device is offline.
Good to know
Section titled “Good to know”- Relay outputs switch on at 50% and off below 50% (see Set up the relay output channel). A Follow sensor rule on a relay therefore switches at the middle of the range. Use an On/Off controller rule instead if you need a deadzone around the switching point.
- If the start and end of the range are the same value, the output stays at 0%.
- Between new sensor values, the rule keeps driving the output from the last value it has. If the device has no value at all for the sensor, the rule stops updating the output, and after 1 hour the output is reset — a 4-20mA output then drives 3.7 mA.
Advanced
Section titled “Advanced”Invert the output
Section titled “Invert the output”The end of the range can be lower than the start. The output then rises as the sensor value falls.
For example, to open an inlet valve more the emptier a tank gets, set Sensor range start (0% output) to 180 cm and Sensor range end (100% output) to 20 cm. The valve is closed (0%) when the tank is full at 180 cm or above, and fully open (100%) when the level drops to 20 cm or below.
Troubleshooting
Section titled “Troubleshooting”- The output doesn’t change — check that the device the output belongs to runs firmware 3.16.0 or newer, and that the sensor element is reporting values. If the sensor is on another device, check that both devices are online, and remember that the output only changes when the sensor’s device has transmitted a new value and the output device has connected since.
- The SCADA system reads 3.7 mA — the output has no value. Check that the rule is saved with the right output element, and that the device the output belongs to has received a value from the sensor within the last hour.
- The output moves in the wrong direction — swap the values of Sensor range start (0% output) and Sensor range end (100% output).
- The output is always 0% or 100% — the sensor is outside the range you entered. Check that the range values are in the sensor’s unit and match the values the sensor actually reports.
- The SCADA system shows a different value than Consibio Cloud — check that the scaling in the SCADA system matches the range in the rule (for example 4 mA = 0 ppm and 20 mA = 2000 ppm).
Reach out to support@consibio.com if you need assistance.