
Motion Guard
Camera motion alarm for ESP-Mosaico. The home screen offers Run monitor and Settings. Run mode watches the left-slot camera and sounds the selected alarm on the board speaker when movement is detected. Settings selects and previews the alarm sound, tunes motion sensitivity and alarm volume, and switches live preview on or off. All choices are stored in NVS and restored at boot.
Run
- The camera module in the left slot (OV3640 or SC101IOT) streams UYVY. If it
is not plugged in, the Run screen reports
NO CAMERAand keeps retrying every 2 seconds without leaving monitoring. - With Live preview on, the Run page is a full-screen live image converted by PPA at roughly 12 fps, with Back and a status pill overlaid on the image.
- With Live preview off, the Run page shows a sweeping radar instead. The camera stream and motion detection keep running; only the preview conversion stops. The radar rim lights red while the alarm sounds and returns to its idle color when the tone ends or is silenced.
- Frames are sampled into a 48 × 36 luma grid. A cell counts as changed when its brightness moves beyond the frame's global shift, which suppresses auto-exposure false positives. Two consecutive frames must agree, and near-global changes are ignored as lighting events.
- Confirmed motion plays the selected alarm for 6 seconds and shows a large round stop button in the middle of the screen. Tapping it stops the tone but keeps monitoring. Further events are counted after a 4.5-second cooldown.
- Back stops monitoring and releases the camera and preview canvas.
Settings
| Sound | Pattern |
|---|---|
| Siren | Triangle sweep, rising and falling, 1 s cycle. |
| Beep | 2.2 kHz gated tone, 190 ms on / 190 ms off. |
| Klaxon | Alternating 380/560 Hz square wave every 220 ms. |
Tapping a row selects the sound, previews it for 1.5 seconds and saves it to NVS. If the speaker codec cannot be opened, monitoring still works and the preview is a no-op logged on the console.
Live preview (on by default) chooses between the camera image and the radar animation. Motion sensitivity (1–5) shifts the changed-cell delta, area and mean thresholds together; level 3 is the default and level 5 reacts to subtler movement. Alarm volume (0–100%) sets the ES8311 speaker level.
Install
Install through Vibe Mode; the retained firmware keeps the OTA writer, so the Idea only writes the application and its UI resources.
- Start from a device running current Vibe Mode.
- Download this Idea by its code and confirm.
- Select the installed application to boot into it.
Requires an ESP-Mosaico board with the camera module in the left slot and the on-board speaker. The application does not act on the AI button; returning to Vibe Mode is left to Vibe Mode's own entry points.
Comments (0)