Project

General

Profile

Frequency Input » History » Version 1

Adam Klama, 06/21/2026 02:23 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
> Schema: `config/PhonicWheelConfiguration.proto`.
33
34
| Setting | Meaning | Unit | Range / values | Notes |
35
|---|---|---|---|---|
36
| **Mode** | What the input reports | — | `Frequency`, `Duty`, `Time` | `Frequency` (with tooth count) gives speed/RPM; `Duty` = on/off ratio; `Time` = pulse/period time. |
37
| **Tooth count** | Pulses per revolution | teeth | uint32 | Scales frequency into speed/RPM. |
38
| **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. |
39
| **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. |
40
| **Median filter length** | Median filter window | samples | int | Rejects spikes; larger = smoother but slower to respond. |
41
| **Pull mode** | Direction of the input pull | — | `Up`, `Down` | Sets the idle level for the detection comparator. |
42
| **Enable pull-ups** | Enable the pin pull-up(s) | — | on / off | **Hardware dependent** — only on pins that provide a pull-up. |
43
| **Pull-up voltage** | Adjustable pull-up reference | mV | uint32 | The pull-up rail used by the detection thresholds (adjustable-pull-up hardware). |
44
| **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). |
45
| **Fault voltage Hi / Lo** | Fault thresholds | mV | uint32 | Readings beyond these flag an open/short or failed sensor. |
46
| **Input config** | Whether to (re)configure the pin hardware | — | `Configure`, `Skip configuration` | `Skip configuration` leaves the pin hardware as-is (advanced). |
47
48
## Common settings
49
Frequency Input also uses the shared settings — alias and pin. See
50
[Common IO Settings](../Common-IO-Settings.md).
51
52
## Example — crank speed from a 60-2 wheel
53
1. Type **Frequency Input**, alias `Crank Speed`, on the sensor's pin.
54
2. **Mode** `Frequency`, **Tooth count** `60`, **Missing tooth count** `2`.
55
3. **Signal mode** `Positive pulse` (single-channel Hall).
56
4. Set **Reference Hi/Lo** thresholds with enough hysteresis to reject noise.
57
5. **Median filter length** a few samples to suppress spikes at speed.
58
59
## Troubleshooting
60
- **No reading / drops out at speed:** check the **threshold voltages** and add
61
  **median filtering**; verify the sensor type matches the **signal mode**.
62
- **Speed/RPM reads wrong by a factor:** the **tooth count** (or missing-tooth
63
  count) doesn't match the wheel.
64
- **Counts in the wrong direction:** use a **Quadrature** signal mode with a
65
  two-channel sensor.
66
- **Reads a fault:** the level is beyond **Fault voltage Hi/Lo** — check wiring.
67
68
## Related
69
- [Digital Input](Digital-Input.md) — single on/off contact.
70
- [Counter Input](Counter-Input.md) — count edges/events from other inputs.
71
- [Scaling & Maps](../Scaling-and-Maps.md)