You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TankAlarm-112025-Client-BluesOpta/README.md
+77-35Lines changed: 77 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,74 +84,87 @@ The client creates a default configuration on first boot. You can update configu
84
84
-**Low Alarm**: Threshold in inches for low level alert
85
85
-**Analog Pin**: Arduino Opta analog input (A0-A7, I1-I8)
86
86
-**Sensor Type**: "voltage" (0-10V), "current" (4-20mA), or "digital" (float switch)
87
-
-**Min Value**: Minimum sensor value (e.g., 0.0V or 4.0mA)
88
-
-**Max Value**: Maximum sensor value (e.g., 10.0V or 20.0mA)
89
-
-**Min Inches**: Tank level in inches at minimum sensor value
90
-
-**Max Inches**: Tank level in inches at maximum sensor value
91
87
92
88
### 4-20mA Current Loop Sensor Configuration
93
89
94
-
For 4-20mA current loop sensors, two mounting options are supported:
90
+
For 4-20mA current loop sensors, two mounting options are supported. The implementation uses the sensor's **native measurement range** (sensorRangeMin/Max/Unit) for accurate pressure-to-height conversions.
95
91
96
92
#### Pressure Sensor (Bottom-Mounted)
97
93
Used for sensors like the Dwyer 626-06-CB-P1-E5-S1 (0-5 PSI) mounted near the bottom of the tank.
98
94
99
95
-**Current Loop Type**: "pressure"
100
96
-**How it works**: Measures the pressure of the liquid column above the sensor
101
-
- 4mA = Empty tank (0 PSI / no liquid above sensor)
102
-
- 20mA = Full tank (max PSI / max liquid height)
103
-
-**Sensor Range**: The native measurement range (e.g., 0-5 PSI, 0-2 bar)
104
-
-`sensorRangeMin`: Minimum value (typically 0)
105
-
-`sensorRangeMax`: Maximum value (e.g., 5 for 0-5 PSI)
106
-
-`sensorRangeUnit`: Unit of measurement ("PSI", "bar", etc.)
-**Sensor Range**: The native measurement range from the sensor datasheet
100
+
-`sensorRangeMin`: Minimum pressure at 4mA (typically 0)
101
+
-`sensorRangeMax`: Maximum pressure at 20mA (e.g., 5 for 0-5 PSI)
102
+
-`sensorRangeUnit`: Pressure unit - "PSI", "bar", "kPa", "mbar", or "inH2O"
107
103
-**Sensor Mount Height**: Height of sensor above tank bottom (usually 0-2 inches)
108
-
-**Max Value**: Maximum liquid height the sensor can measure (corresponds to 20mA)
109
104
110
-
**Example Configuration** (0-5 PSI sensor, 1 PSI per 2.3 ft of water):
105
+
**Known Limitation - Blind Spot:** Pressure sensors cannot detect liquid levels below their mount height. When the tank is empty (0 PSI), the reported level will be the sensor mount height (e.g., 2"), not 0". Mount the sensor as close to the tank bottom as possible to minimize this blind spot.
106
+
107
+
**Pressure-to-Height Conversion:**
108
+
The system automatically converts pressure to inches using these factors:
109
+
- 1 PSI = 27.68 inches of water
110
+
- 1 bar = 401.5 inches of water
111
+
- 1 kPa = 4.015 inches of water
112
+
- 1 mbar = 0.4015 inches of water
113
+
- 1 inH2O = 1 inch of water
114
+
115
+
**Example Configuration** (0-5 PSI sensor on 120" tank):
111
116
- Sensor mounted 2 inches above tank bottom
112
-
- Max sensor range = 5 PSI = ~138 inches of water
113
-
- Tank height = 120 inches
117
+
- Max sensor range = 5 PSI = ~138 inches of water column
114
118
- Configuration:
115
119
-`currentLoopType`: "pressure"
116
120
-`sensorRangeMin`: 0
117
121
-`sensorRangeMax`: 5
118
122
-`sensorRangeUnit`: "PSI"
119
123
-`sensorMountHeight`: 2.0
120
-
-`maxValue`: 118.0 (tank height minus mount height: 120 - 2 = 118 inches)
121
124
122
-
> **Note:** For pressure sensors, set `maxValue` to the tank's usable height minus the sensor mount height. The implementation adds `sensorMountHeight` to the measured value, so `maxValue` should represent the height of liquid *above* the sensor, not the total tank height.
125
+
**How It Works:**
126
+
1. 4mA → 0 PSI → 0 inches of liquid above sensor
127
+
2. Total height = 0 + 2" mount height = 2" (minimum reported value due to blind spot)
128
+
3. When tank fills: 12mA → 2.5 PSI → 69.2" + 2" = 71.2" total
123
129
124
130
#### Ultrasonic Sensor (Top-Mounted)
125
131
Used for sensors like the Siemens Sitrans LU240 mounted on top of the tank looking down.
126
132
127
133
-**Current Loop Type**: "ultrasonic"
128
134
-**How it works**: Measures the distance from the sensor to the liquid surface
129
-
- 4mA = Full tank (liquid close to sensor)
130
-
- 20mA = Empty tank (liquid far from sensor)
131
-
-**Sensor Range**: The native measurement range (e.g., 0-10 meters, 0-30 feet)
132
-
-`sensorRangeMin`: Minimum distance (typically 0)
133
-
-`sensorRangeMax`: Maximum distance (e.g., 10 for 0-10m)
134
-
-`sensorRangeUnit`: Unit of measurement ("m", "ft", "in", etc.)
135
-
-**Sensor Mount Height**: Distance from sensor to tank bottom when tank is empty
136
-
-**Max Value**: Maximum liquid height (tank capacity)
137
-
138
-
**Example Configuration** (ultrasonic sensor with 0-10m range on 10-foot tank):
139
-
- Sensor mounted 124 inches above tank bottom (tank is 120 inches + 4 inch clearance)
140
-
- Maximum tank fill level = 120 inches
135
+
- 4mA = `sensorRangeMin` (minimum distance, typically a blind spot)
1. Record the actual mA output at known liquid levels (empty, half-full, full)
151
-
2. Verify sensor mount height is accurate
164
+
2. Verify sensor mount height is accurate using a tape measure
152
165
3. Enter the correct sensor native range (as specified in sensor datasheet)
153
-
4.Check for temperature effects on readings
154
-
5.Consider the specific gravity of the liquid (for pressure sensors)
166
+
4.For pressure sensors: account for specific gravity if not measuring water (multiply PSI by 1.0/SG)
167
+
5.Check for temperature effects on readings (cold liquids are denser)
155
168
156
169
### Float Switch Configuration (Digital Sensors)
157
170
Float switches can be configured as either normally-open (NO) or normally-closed (NC):
@@ -165,6 +178,35 @@ Float switches can be configured as either normally-open (NO) or normally-closed
165
178
166
179
**Wiring Note**: For both NO and NC float switches, connect the switch between the digital input pin and GND. The Arduino uses an internal pull-up resistor, and the software interprets the signal based on your configured switch mode. The wiring is the same for both modes - only the software interpretation changes.
167
180
181
+
### Analog Voltage Sensor Configuration
182
+
183
+
For analog voltage sensors (like the Dwyer 626 series with voltage output), the system supports the same native range configuration as 4-20mA sensors. This allows you to specify both the voltage range and pressure range for accurate pressure-to-height conversion.
184
+
185
+
**Supported Voltage Output Configurations:**
186
+
- 0-10V (default)
187
+
- 0-5V
188
+
- 1-5V
189
+
- 0.5-4.5V
190
+
- 2-10V
191
+
- Any configurable range
192
+
193
+
**Configuration Parameters:**
194
+
-`analogVoltageMin`: Minimum voltage output (e.g., 0.0 for 0-10V, 1.0 for 1-5V)
195
+
-`analogVoltageMax`: Maximum voltage output (e.g., 10.0 for 0-10V, 5.0 for 1-5V)
196
+
-`sensorRangeMin` / `sensorRangeMax`: Pressure range in native units
197
+
-`sensorRangeUnit`: Pressure unit - "PSI", "bar", "kPa", "mbar", or "inH2O"
198
+
-`sensorMountHeight`: Height of sensor above tank bottom (inches)
199
+
200
+
**Example Configuration** (Dwyer 626 with 1-5V output, 0-5 PSI range):
0 commit comments