This project contains two components:
- A web application for master-toy communication between browser windows
- An Arduino sketch for SOS signal transmission
- Master Page: Control panel with 3 toggle buttons (Red, Blue, Green)
- Toy Page: Display with 3 circles that fill/unfill based on button presses
- Device ID Pairing: Only pages with matching device IDs communicate with each other
- Open Button: Toy page can trigger a message display on the master page
- Real-time Sync: Changes are instantly reflected across paired windows
- State Persistence: Device IDs and circle states are saved and restored on page reload
- Open
master.htmlin your browser - Open
toy.htmlin another browser window or tab - Enter the same Device ID in both pages (e.g., "device1")
- The pages are now paired and will communicate with each other
- Click the Red, Blue, or Green buttons to toggle the corresponding circles on the toy page
- Click again to toggle them off
- The status bar shows the current state of all three colors
- Watch the circles fill/unfill as buttons are pressed on the master page
- Click the Open button to display a violet "Open" message on the master page for 5 seconds
You can run multiple independent master-toy pairs simultaneously:
- Master #1 (ID: "pair1") ↔ Toy #1 (ID: "pair1")
- Master #2 (ID: "pair2") ↔ Toy #2 (ID: "pair2")
- Each pair operates independently without interference
Simply open the HTML files directly in your browser (file:// protocol)
# Using Python 3
python3 -m http.server 8000
# Then open in browser:
# http://localhost:8000/master.html
# http://localhost:8000/toy.html- Pure vanilla JavaScript - No frameworks or dependencies
- localStorage - For state persistence across page reloads
- Storage Events - For real-time cross-window communication
- Device-specific keys - All localStorage keys include device ID for isolation
- No build tools required - Just open the HTML files directly
- Master page updates state → saves to
localStoragewith device ID - Browser fires
storageevent to all other tabs/windows - Toy page receives event → checks if device ID matches → updates circles
- Same process works in reverse for the Open button
This project includes two Arduino sketches for hardware integration.
Two versions available:
1. Basic Version (sos_signal.ino)
- Works on any Arduino (Uno, Nano, Mega, etc.)
- Simple delay-based timing
- Perfect for learning and standalone projects
2. Interrupt-Based Version (sos_signal_int.ino)
- ESP32 only
- Hardware timer interrupts for precision
- Non-blocking - main loop free for other tasks
- Production-ready for multitasking applications
Both versions:
- Send SOS distress signal (. . . - - - . . .)
- Connected to pin 3
- Configurable timing for dots and dashes
- Continuous transmission
See ARDUINO_README.md for basic version documentation. See ESP32_INTERRUPT_README.md for interrupt version documentation.
master.html- Control page with toggle buttons and Open message displaytoy.html- Display page with circles and Open button trigger
sos_signal.ino- Basic Arduino sketch (any Arduino board)sos_signal_int.ino- Interrupt-based sketch (ESP32 only)ARDUINO_README.md- Basic version setup and usage documentationESP32_INTERRUPT_README.md- Interrupt version detailed documentation
README.md- This file
Works in all modern browsers that support:
- localStorage
- Storage events
- ES6 JavaScript features