Skip to content

Repository files navigation

Sensor Watch Light Sync

Set a Sensor Watch Pro from an ordinary Android phone screen. The phone flashes a visible black-and-white patch; the watch receives it through its onboard phototransistor and sets its complete UTC date and time, including subsecond phase. No Bluetooth, camera, IR accessory, or case modification is required.

This repository publishes Light Sync as an optional Second Movement face. It does not replace the rest of your watch UI: add the face to the firmware you already use, compile once, and use the Android app for future time syncs.

Hardware result

Ambient-light sync works on real hardware.

  • An assembled Sensor Watch Pro in a Casio A158 with the original LCD synced successfully from a Pixel 10a screen.
  • A controlled reduced-contrast campaign completed 30/30 independent sync sessions and accepted 61/61 completed frames, with no completed-frame CRC rejection.
  • The predeclared gate required the one-sided 95% Wilson lower confidence bound for frame acceptance to exceed 95%. The 61/61 result gives 95.75%, so it clears that gate.
  • The assembled-watch check landed visually within roughly 25 ms of time.gov.

The 95.75% figure is deliberately narrow: it describes completed-frame acceptance in that controlled Sensor Watch Pro / Pixel 10a experiment. It is not a claim that every phone, brightness, alignment, or environment has already been qualified. Please report results from other phones and watch assemblies.

What is here

Path Purpose
watch-face/ Production Movement face and alarm-safe buzzer support
lightsync/ Shared C protocol, decoder, time-source arithmetic, and host tests
android/ Production Android transmitter source
patches/second-movement.patch Patch against Second Movement 4a580eeb
PROTOCOL.md Compact wire-protocol and receiver description
QUALIFICATION.md Scope and calculation behind the 95% acceptance gate

There is intentionally no ADB lab Activity, USB console, DOE controller, raw trace archive, or custom stock-A158 firmware in this repository.

Add the face to Second Movement

The integration patch targets the current Second Movement main commit 4a580eeb55a6a39b1eff4ec393e196a571520032.

git clone https://github.com/illusion-pasture-program/sensor-watch-lightsync.git
cd sensor-watch-lightsync
git clone --recursive https://github.com/joeycastillo/second-movement.git
git -C second-movement checkout 4a580eeb55a6a39b1eff4ec393e196a571520032
git -C second-movement apply ../patches/second-movement.patch
cd second-movement
make BOARD=sensorwatch_pro DISPLAY=classic

Use DISPLAY=custom only for the Oddly Specific replacement LCD. For the LCD supplied with a Casio watch, use DISPLAY=classic.

The patch adds light_sync_face to movement_config.h. Adjust its position in that list as you would any other face. The feature is compiled only for boards with HAS_IR_SENSOR, which currently means Sensor Watch Pro.

Flash second-movement/build/firmware.uf2 using the watch's normal WATCHBOOT drive. A face is source code, not a dynamically installable watch plugin, so the one full-firmware flash is unavoidable.

Build the Android transmitter

Requirements: JDK 17+, Android SDK platform 35, NDK 27.2.12479018, and CMake 3.22.1.

cd android
./gradlew testDebugUnitTest assembleDebug

Install android/app/build/outputs/apk/debug/app-debug.apk, or open android/ in Android Studio. The app requests only network access, obtains a fresh SNTP time estimate, holds the screen awake, and drives the display using the shared C protocol implementation.

Use it

  1. Open the Android app and wait for a network-backed time source.
  2. Navigate to the SYNC / PRESS face on the watch.
  3. Press the watch's alarm button to arm the receiver.
  4. Start Watch Sync in the app and center the sensor area over the flashing patch. Keep the watch still.
  5. Three short ascending beeps mean success. Two long descending beeps mean the attempt failed; reposition and retry.

The receiver requires two adjacent CRC-valid frames before touching the RTC. A frame lasts exactly seven seconds; normal acquisition is therefore longer than seven seconds and the watch allows up to 60 seconds.

Run the protocol tests

python lightsync/build.py --clean gcc

The seven portable suites cover the protocol vector, decoder impairments, RTC-phase arithmetic, transmitter scheduling, SNTP validation, adjacent-frame confirmation, session lifecycle, and structured interference.

License

MIT. See LICENSE and NOTICE.md.

About

Visible-light time synchronization for Sensor Watch Pro, with an Android transmitter and Second Movement face

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages