Skip to content

Commit d521ccb

Browse files
authored
Merge pull request #126 from SenaxInc/copilot/select-hall-effect-sensors
Add hall effect sensor type selection and detection methods for RPM monitoring
2 parents 2a21a49 + 0714123 commit d521ccb

File tree

2 files changed

+324
-47
lines changed

2 files changed

+324
-47
lines changed

TankAlarm-112025-Client-BluesOpta/README.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The client creates a default configuration on first boot. You can update configu
8383
- **High Alarm**: Threshold in inches for high level alert
8484
- **Low Alarm**: Threshold in inches for low level alert
8585
- **Analog Pin**: Arduino Opta analog input (A0-A7, I1-I8)
86-
- **Sensor Type**: "voltage" (0-10V), "current" (4-20mA), or "digital" (float switch)
86+
- **Sensor Type**: "voltage" (0-10V), "current" (4-20mA), "digital" (float switch), or "rpm" (hall effect)
8787

8888
### 4-20mA Current Loop Sensor Configuration
8989

@@ -207,6 +207,90 @@ For analog voltage sensors (like the Dwyer 626 series with voltage output), the
207207
- `sensorRangeUnit`: "PSI"
208208
- `sensorMountHeight`: 2.0
209209

210+
### Hall Effect RPM Sensor Configuration
211+
212+
Hall effect sensors can be used to measure RPM (rotations per minute) for applications such as pump monitoring, motor speed tracking, or flow measurement. The system supports multiple types of hall effect sensors and detection methods.
213+
214+
**Sensor Types:**
215+
216+
1. **Unipolar** (default)
217+
- Triggered by a single magnetic pole (usually South pole)
218+
- Resets when magnetic field is removed
219+
- Output: Active LOW when magnet present, HIGH when absent
220+
- Use case: Simple magnet detection, one pulse per rotation
221+
222+
2. **Bipolar (Latching)**
223+
- Requires South pole to turn ON and North pole to turn OFF
224+
- Maintains state until opposite pole is detected
225+
- Output: Latches between HIGH and LOW states
226+
- Use case: Motor applications, precise position sensing
227+
228+
3. **Omnipolar**
229+
- Responds to either North or South pole
230+
- Simplifies magnet placement and orientation
231+
- Output: Toggles on any magnetic field
232+
- Use case: Flexible installations, bidirectional sensing
233+
234+
4. **Analog (Linear)**
235+
- Outputs voltage proportional to magnetic field strength
236+
- Can be used in digital threshold mode
237+
- Output: Voltage varies with field strength
238+
- Use case: Distance or angle measurement, fuel gauges
239+
240+
**Detection Methods:**
241+
242+
1. **Pulse Counting** (default)
243+
- Counts all pulses over a fixed sampling period (3 seconds)
244+
- More accurate for steady speeds
245+
- Averages multiple revolutions for better precision
246+
- Formula: RPM = (pulses × 60000) / (sample_duration_ms × pulses_per_rev)
247+
248+
2. **Time-Based**
249+
- Measures the period between two consecutive pulses
250+
- More responsive to speed changes
251+
- Works with fewer pulses (minimum 2)
252+
- More flexible for different magnet types and orientations
253+
- Formula: RPM = 60000 / (period_ms × pulses_per_rev)
254+
255+
**Configuration Parameters:**
256+
- `sensorType`: "rpm"
257+
- `rpmPin`: Digital input pin for hall effect sensor (uses internal pull-up)
258+
- `pulsesPerRevolution`: Number of pulses generated per complete rotation (default: 1)
259+
- Single magnet: 1 pulse per revolution
260+
- Multiple magnets: Set to number of magnets
261+
- **Note:** For **bipolar** or **omnipolar** sensors, a single magnet generates 2 pulses per revolution (one for each pole). Set `pulsesPerRevolution` to `2 × number of magnets` in these cases.
262+
- `hallEffectType`: Sensor type - "unipolar", "bipolar", "omnipolar", or "analog"
263+
- `hallEffectDetection`: Detection method - "pulse" or "time"
264+
- `highAlarm`: Maximum expected RPM for alarm (e.g., 3000)
265+
- `lowAlarm`: Minimum expected RPM for alarm (e.g., 100)
266+
267+
**Example Configuration** (Motor monitoring with 4 magnets):
268+
```json
269+
{
270+
"sensor": "rpm",
271+
"rpmPin": 2,
272+
"pulsesPerRev": 8,
273+
"hallEffectType": "omnipolar",
274+
"hallEffectDetection": "time",
275+
"highAlarm": 3000,
276+
"lowAlarm": 500
277+
}
278+
```
279+
Note: With omnipolar sensor and 4 magnets, use pulsesPerRev = 8 (2 pulses per magnet × 4 magnets)
280+
281+
**Wiring:**
282+
- Connect hall effect sensor VCC to 5V or 3.3V (check sensor datasheet)
283+
- Connect sensor GND to Arduino GND
284+
- Connect sensor output to configured digital pin
285+
- No external pull-up needed (Arduino uses internal pull-up)
286+
287+
**Tips:**
288+
- Use "time" detection for faster response to speed changes
289+
- Use "pulse" detection for better accuracy at steady speeds
290+
- For multiple magnets, set `pulsesPerRev` to the number of magnets
291+
- For omnipolar sensors, each magnet passing creates 2 pulses (both N and S poles trigger)
292+
- Monitor both high and low thresholds to detect over-speed and stall conditions
293+
210294
## Operation
211295

212296
### Normal Operation

0 commit comments

Comments
 (0)