Wiki

Technical reference for system integrators and engineers.

Hall Sensor

A magnetic switch that powers a sealed device on and off without a button, so the enclosure needs no opening and no moving part through its wall.

Fitted to Locator Pro and Locator Lite XT. Both carry the same part; the power gesture described here is the Locator Lite XT behaviour, where a battery-powered device genuinely needs to be switched off in the field.

Unlike the other entries in this section, the Hall sensor produces no telemetry. It emits no Sensor TLV record and appears in no MQTT payload — it is a power-control input, not a measurement.

Hardware

PartAllegro APS11753, SOT-23-3
Typeunipolar Hall-effect switch, open-drain output
OutputLOW while a magnet is present, high-impedance otherwise
Pull-upthe MCU's internal pull-up only — no external resistor to rail
Series resistor100 Ω between sensor output and MCU pin

Because the output is open-drain and only ever pulls down, the line reads high whenever no magnet is present and the MCU pull-up is enabled. A device with the pull-up disabled reads a floating pin, not a defined state.

Unipolar means one magnetic polarity operates it. A magnet presented the wrong way round does nothing at all — which is a feature for a control that must not be triggered by stray fields.

The gesture

Both directions use the same action — hold a magnet against the marked spot for two seconds. Brief contact does nothing:

Powering on Powering off device in SYSTEM_OFF magnet — pin goes LOW, chip wakes hold confirmed for 2 s → boot continues released early → straight back to SYSTEM_OFF device running magnet held 2 s → shutdown requested 3 blinks + 1 s pulse → SYSTEM_OFF 15 s cooldown prevents an immediate re-trigger
The hold requirement is what separates a deliberate action from a device brushing past a magnet in transit.

Powering on

A device in SYSTEM_OFF is not running code — nothing polls the pin. Waking is done by the hardware DETECT signal, with SENSE-on-LOW armed on the Hall pin, so the magnet pulling the line low wakes the chip through a reset.

That hardware wake can only respond to a level; it cannot measure how long the level lasted. So the two-second test has to happen after the wake, in software:

StepWhat happens
1Before entering SYSTEM_OFF, firmware writes a signature into a retention register that survives the wake reset
2The magnet pulls the pin low; DETECT fires; the chip resets and boots
3Very early in boot — before any subsystem starts — the signature is read and immediately cleared
4Signature absent → return at once, so wired, USB and OTA reboots are unaffected
5Signature present → poll the pin every 20 ms and require 2 s of unbroken magnet presence
6Magnet released early → re-enter SYSTEM_OFF; the function never returns

Clearing the signature at step 3 rather than later is deliberate: a brown-out, a USB re-plug or an OTA reboot occurring afterwards must not find a stale flag and re-arm the hold gate on a device the user never touched.

The confirmation runs before any subsystem is initialised. A device that fails the gesture has spent a few hundred milliseconds awake and started no radio, so a magnet brushed in passing costs almost nothing in battery terms.

Powering off

While running, a thread polls the pin every 50 ms. Two seconds of continuous presence fires the shutdown handler.

Debounce

Breaking the hold takes five consecutive absent readings — 250 ms — not one. The sensor has built-in hysteresis, but its output can still flicker when a magnet sits at the edge of the trip zone, and a single noisy reading would otherwise reset the timer and make the gesture feel unreliable exactly where a person is most likely to hold the magnet.

Cooldown

A 15-second cooldown applies after each trigger and from boot. Without it a magnet left resting on the device would power it off, and a magnet still in place at the end of the power-on gesture would immediately power it back off again.

Indication

Shutdown is announced on the LED before it happens: three blinks at 3 Hz, then a single one-second pulse, then SYSTEM_OFF. On a sealed device with no screen this is the only confirmation that the gesture registered, so it is driven directly rather than through the normal LED scheduling — a queue that is about to be powered down cannot be relied on to deliver it.

Re-arming for the next wake

Before entering SYSTEM_OFF, the firmware waits for the pin to read high — that is, for the magnet to be taken away — before arming SENSE-on-LOW.

Arming SENSE-on-LOW while the pin is still low would assert DETECT immediately and the device would wake, shut down and wake again in a tight loop. Waiting for the magnet to leave is what makes the state stable.

The wait has a timeout, so a device stored against a magnet still reaches SYSTEM_OFF rather than spinning indefinitely.

Related

  • Locator Lite XT — battery-powered, where the gesture is the field on/off control.
  • Locator Pro — same part fitted; mains or PoE powered.
  • OTA Upgrade — an OTA reboot bypasses the hold gate, by design.