Project

General

Profile

Frequency Input » History » Version 2

Adam Klama, 06/21/2026 03:12 PM

1 1 Adam Klama
# Frequency Input# Frequency Input
2
3
## Overview
4
A **Frequency Input** reads a pulsing signal on a hardware pin and, depending on
5
its **mode**, reports the signal's:
6
- **Frequency** — pulses per second;
7
- **Speed / RPM** — frequency scaled by the **tooth count** of the wheel/sensor;
8
- **Duty** — the on/off ratio of the signal;
9
- **Time** — the pulse/period time.
10
11
Use it for crank/shaft speed sensors (including missing-tooth wheels), wheel-speed
12
sensors, flow meters, and any frequency- or duty-output sensor.
13
14
> This input also covers what older configs called the separate *Frequency* and
15
> *Duty* inputs — they are folded in here as modes.
16
17
## Prerequisites & hardware
18
- A sensor that produces a **pulse train** on the pin (Hall, VR via a conditioner,
19
  optical, etc.), wired to the pin with a common ground.
20
- For **speed/RPM**, know the **tooth count** (pulses per revolution).
21
- Pull-up support is **hardware dependent** — only some pins provide it. Where it
22
  is absent, condition the signal externally.
23
24
## Add it in the app
25
1. Add a new input and choose **Frequency Input** as the type.
26
2. Select the **pin** and give it a clear **alias** (e.g. `Crank Speed`).
27
3. Choose the **mode** (Frequency, Duty or Time) and, for speed, set the
28
   **tooth count**.
29
4. Set the **signal mode** and detection **threshold voltages** to match the sensor.
30
31
## Settings reference
32
33
| Setting | Meaning | Unit | Range / values | Notes |
34
|---|---|---|---|---|
35
| **Mode** | What the input reports | — | `Frequency`, `Duty`, `Time` | `Frequency` (with tooth count) gives speed/RPM; `Duty` = on/off ratio; `Time` = pulse/period time. |
36
| **Tooth count** | Pulses per revolution | teeth | uint32 | Scales frequency into speed/RPM. |
37
| **Missing tooth count** | Number of missing teeth on the wheel | teeth | uint32 | For missing-tooth crank wheels (e.g. 60-2 → `2`). `0` for an even wheel. |
38
| **Signal mode** | How the pulse edges are interpreted | — | `Legacy`, `Positive pulse`, `Negative pulse`, `Quadrature`, `Quadrature rising edge`, `Quadrature falling edge` | Quadrature modes use a two-channel sensor and give direction; pulse modes count single-channel edges. |
39
| **Median filter length** | Median filter window | samples | int | Rejects spikes; larger = smoother but slower to respond. |
40
| **Pull mode** | Direction of the input pull | — | `Up`, `Down` | Sets the idle level for the detection comparator. |
41
| **Enable pull-ups** | Enable the pin pull-up(s) | — | on / off | **Hardware dependent** — only on pins that provide a pull-up. |
42
| **Pull-up voltage** | Adjustable pull-up reference | mV | uint32 | The pull-up rail used by the detection thresholds (adjustable-pull-up hardware). |
43
| **Reference voltage / Hi / Lo** | Detection comparator thresholds | mV | uint32 | The switching thresholds that turn the analog signal into clean pulses (with hysteresis between Hi and Lo). |
44
| **Fault voltage Hi / Lo** | Fault thresholds | mV | uint32 | Readings beyond these flag an open/short or failed sensor. |
45
| **Input config** | Whether to (re)configure the pin hardware | — | `Configure`, `Skip configuration` | `Skip configuration` leaves the pin hardware as-is (advanced). |
46
47
## Common settings
48
Frequency Input also uses the shared settings — alias and pin. See
49 2 Adam Klama
[Common IO Settings](Common_IO_Settings).
50 1 Adam Klama
51
## Example — crank speed from a 60-2 wheel
52
1. Type **Frequency Input**, alias `Crank Speed`, on the sensor's pin.
53
2. **Mode** `Frequency`, **Tooth count** `60`, **Missing tooth count** `2`.
54
3. **Signal mode** `Positive pulse` (single-channel Hall).
55
4. Set **Reference Hi/Lo** thresholds with enough hysteresis to reject noise.
56
5. **Median filter length** a few samples to suppress spikes at speed.
57
58
## Troubleshooting
59
- **No reading / drops out at speed:** check the **threshold voltages** and add
60
  **median filtering**; verify the sensor type matches the **signal mode**.
61
- **Speed/RPM reads wrong by a factor:** the **tooth count** (or missing-tooth
62
  count) doesn't match the wheel.
63
- **Counts in the wrong direction:** use a **Quadrature** signal mode with a
64
  two-channel sensor.
65
- **Reads a fault:** the level is beyond **Fault voltage Hi/Lo** — check wiring.
66
67
## Related
68 2 Adam Klama
- [Digital Input](Digital_Input) — single on/off contact.
69
- [Counter Input](Counter_Input) — count edges/events from other inputs.
70
- [Scaling & Maps](Scaling_and_Maps)