Skip to content

Motion awareness

Motion sensing is optional and requires a configured supported GY-521/MPU-6050 on the local I²C path. It is not required for the display or eye animation. When installed and enabled, inspect the Sensors page for interpreted motion status. Missing or unavailable hardware does not produce a motion reading. An external device can also provide a configured MQTT motion observation; that source is exposed as external physical context, not as the local IMU's motion interpreter input. See External Devices — MQTT & ESPHome.

Motion as semantics

flowchart TD
  sensor[MPU-6050] --> interpreter[MotionInterpreter]
  interpreter --> motion[MotionState / MotionEvent] --> behavior[BehaviorEngine]
  behavior --> output[Eyes]
  style behavior fill:#0F4C5C,stroke:#49E7FF,color:#fff
  style interpreter fill:#0F4C5C,stroke:#49E7FF,color:#fff
  style output fill:#334155,stroke:#94A3B8,color:#fff

Fresh samples can become confirmed states: STILL, MOVING, TILT_LEFT, TILT_RIGHT, TILT_FORWARD, TILT_BACK, SHAKE and IMPACT. These describe interpreted movement; they are not direct commands to the display or GPIO.

Visual reactions

  • Directional tilt


    Tilt produces directional pupil intent and eye asymmetry.

  • Optional LED feedback


    The optional WS2812B ring is driven by the ESP32 through phos-hw v1 semantic LED commands. Its controller path is separate from eye-motion intent; it requires an active serial connection and advertised LED capability.

  • Shake & impact


    Shake and impact create short alert intent.

Temporary visual overrides

These reactions do not rewrite the configured base source. The currently resolved persistent visual state returns after the effect expires.

Hardware validation

To try the feature, install and mount the supported sensor, configure the Sensors page and restart PHOS when requested. Then move or tilt the sensor and inspect its status. Expected readings depend on mounting orientation and confirmation timing. Configured eye and optional controller LED reactions are transient; the selected persistent visual source returns afterward.

The supplied configuration leaves the local IMU disabled. A connected sensor that is not configured, unavailable or stale should not be treated as evidence that PHOS detected movement.

Check the physical installation

Check the board wiring and mounting axes, then verify the configured tilt directions and visual reactions on the Pi.

Details belong in the canonical hardware guide and architecture reference.