← All projects03 / 04 · Independent project

AutoFlag

Vision-assisted flag actuation

An embedded electromechanical system for a recreational boating flag. Camera observations and vessel motion inform a rider-down decision, while persistent manual override keeps the operator in control. I designed the enclosure, actuator mounting, component integration, and control behavior.

Manual actuation demonstrated · Automatic boat operation in development

  • Arduino UNO Q
  • Sensor fusion
  • Electromechanical control
Sensors

Observe

Camera
GNSS speed
Compass heading

Linux MPU

Interpret

Human detection
Motion analysis
Sensor evidence

State controller

Decide

Fusion + debounce
Rider-down latch
Recovery conditions

STM32 MCU

Sequence

Motor / servo PWM
Encoder feedback
Limits + timeouts

Mechanism

Deploy

Rack-and-pinion concept
Flag extension
Pole positioning

Operator overrideWeb dashboard + physical controls
Manual mode persists until released
Arduino UNO Q: Linux application processing and onboard STM32U585 actuation, connected internally through Arduino Bridge. This is the implemented software architecture; automatic boat operation remains unvalidated.

01 / Computing architecture

Two processors, one board

The UNO Q Linux MPU runs camera capture, computer vision, sensor fusion, and the operating state machine. Its onboard STM32U585 handles physical I/O and actuator sequencing. Arduino Bridge carries commands, calibration, and telemetry between them.

Linux application

Perception and decisions

Python / OpenCV · Local web dashboard · Configuration · Transition logging

Processes camera frames and sensor observations, selects an operating state, and issues actuator commands.

Onboard MCU

Physical control

PWM outputs · Quadrature encoders · UART / I²C sensors · Local inputs

Enforces the motion sequence, individual motor endpoints, soft limits, and motor-motion timeouts.

Internal Arduino Bridge RPC2 Hz heartbeat5 Hz telemetry
Software modules and communication contract

The application separates camera management, detector backends, ROI processing, sensor fusion, state management, transport, configuration storage, and event logging. Bridge methods expose heartbeat, command, settings, and telemetry calls. The primary architecture uses the UNO Q’s onboard MCU.

Source-derived software modules and data flow.
Source-derived software modules and data flow.
Open vector diagram ↗

02 / Detection & control

Rider-down detection and recovery

Camera observations, GPS speed loss, and compass-heading changes contribute to a weighted rider-down score. Only available sources are normalized into the decision, and the configured threshold must persist through a debounce interval.

Human-presence detection

The pipeline supports ROI-limited person detection using a local ONNX model when available, with an OpenCV HOG fallback. Boat-scene detection accuracy has not yet been measured.

Motion context

GPS tracks a towing-speed baseline and subsequent speed drop. Compass heading change and heading rate provide additional evidence, rather than proof of a fall.

Unavailable inputs

A camera failure removes CV from fusion rather than being interpreted as a rider disappearing. Detection describes presence, not identity recognition.

01

Deploy and latch

Once a rider-down condition is inferred, deployment stays latched. A reduction in the score cannot silently store the flag.

02

Recover deliberately

Automatic storage requires GPS speed recovery from the post-fall minimum and current positive rider detection, followed by recovery debounce.

03

Preserve manual control

App and physical Deploy/Store commands enter persistent manual override. Automatic scores cannot undo an active manual command.

Operating-state diagram
Automatic deployment and recovery with manual and fault paths.
Automatic deployment and recovery with manual and fault paths.
Open vector diagram ↗

03 / Electromechanical system

Sequenced deployment and retraction

The flexible rack-and-pinion concept extends and retracts the flag through motorized motion, with a separate servo stage for pole positioning. The enclosure and dedicated actuator mount connect that mechanism to the electronics and operator controls.

Deploy
  1. Extend both motor channels

    Each channel stops independently at its calibrated encoder endpoint.

  2. Command the pole servo

    After extension, move to the deployed angle and allow the configured settling interval.

Store
  1. Return the pole servo

    Command the stored angle and allow settling before retraction.

  2. Retract the motor channels

    Stop each channel at its retracted encoder endpoint.

Motion supervision and fault behavior
Communication loss
The MCU has a 2.5-second heartbeat timeout for remote motion when physical override is not active. The application enters ERROR on lost controller communication.
Motion limits
Encoder soft limits and motor-motion timeouts are implemented in firmware. The application also supervises deployment/storage time.
Stop behavior
Local Stop is handled on the MCU. Motor PWM stop is distinct from actuator power isolation; the servo angle is commanded, not independently confirmed by closed-loop position feedback.

04 / Electrical architecture

Signal interfaces and actuator power

The firmware assigns separate interfaces for navigation sensors, local controls, encoder feedback, and PWM outputs. Actuator power is separate from the controller’s signal I/O.

Sensor paths

Camera into the Linux video pipeline; GPS over UART; compass over I²C.

Motion paths

PWM commands to external drivers, with quadrature feedback and active-low physical controls.

Power boundary

3.3 V signal I/O and separate fused actuator supply are specified in the firmware documentation. Installed driver models and supply sizing still need as-built confirmation.

Firmware signal diagram and pin assignments
Firmware-defined interfaces. This functional diagram is not an as-built harness schematic.
Firmware-defined interfaces. This functional diagram is not an as-built harness schematic.
Open vector diagram ↗
Current UNO Q firmware assignments
FunctionPins / interface
GPS TX / RXD0 / D1 · 9600 baud UART
Override / DeployD2 / D4 · Active-low inputs
Store / StopD7 / D8 · Active-low inputs
Pole servoD3 · PWM command
Motor drivers 1 / 2D5 / D6 · Servo-style PWM
Encoder 1 A / BD9 / D10
Encoder 2 A / BD11 / D12
Compass SDA / SCLA4 / A5 · I²C
CameraLinux video device

05 / Validation

Manual actuation demonstrated

The mechanism has moved under manual control on hardware. Automatic operation on a boat is still in development.

Demonstrated
Physical actuation from manual control.
Implemented in source
Perception interfaces, fusion, state management, command sequencing, and fault-control paths for the UNO Q target.
Remaining verification
Actual deployed hardware configuration, rider-detection reliability, repeated boat deployment, and environmental performance.

Software implementation was AI-assisted. The project emphasizes my mechanical design, component integration, and control-definition work.

Continue exploringValkyrie All projects