Proximity Scanning

Robomates uses the CC1101 sub-GHz radio not just for data - it doubles as a proximity sensor. By measuring the strength of a received signal, robots can tell when another robot is physically close. This is the foundation for games like Zombie Tag.

The Idea

Every radio signal gets weaker the further it travels. A signal received at -30 dBm means the transmitter is very close; the same signal at -80 dBm means it's far away. This measurement is called RSSI (Received Signal Strength Indicator), and every CC1101 packet comes with it for free - the radio hardware measures it automatically.

Robomates uses this property to build a simple but effective proximity detection system. Instead of adding extra hardware like IR sensors or ultrasonic modules, the robots reuse the same radio they already have for communication. When a robot wants to know "is anyone near me?", it sends a short burst of scan packets. Any robot that receives those packets with a strong enough signal knows the scanner is physically close.

This approach is intentionally low-tech. It does not give you a precise distance in centimetres - radio signals bounce off surfaces and vary with orientation. But it reliably answers a simpler question: "is this robot within arm's reach?" And that is exactly what game modes like Zombie Tag need.

How It Works

Step by Step

StepWhat Happens
1. Player triggers scan The player presses R1 or L1 on the controller. The robot enters a 1.5-second scan burst and its body LEDs turn magenta.
2. Scan packets are sent During the burst, the robot sends a small SCAN packet (11 bytes) every 200 ms over the CC1101 radio. That is about 7-8 packets per burst.
3. Nearby robots listen All other robots on the same frequency receive these packets. The CC1101 hardware automatically measures the RSSI of each received packet.
4. RSSI check If the RSSI is ≥ -65 dBm (the threshold), the receiving robot considers itself "scanned" - the scanner is close enough. If the signal is weaker, the packet is ignored.
5. Scan recorded The scanned robot stores the scanner's crypto ID in a buffer (up to 4 slots). Its eye LEDs flash magenta for 1.5 seconds as visual feedback.
6. Result reported via ping On the next PING broadcast (every 750 ms), the scanned robot includes the stored crypto IDs. This is how the information leaves the RF network.
7. HQ reads the result Robomates HQ receives pings over BLE and checks for scan results. The game logic acts on them - for example, in Zombie Tag, a scanned survivor becomes infected.
The scanner does not know it succeeded. Only the scanned robot knows (because it measured the RSSI). The result travels: scanned robot → PING broadcast → HQ game logic.

Key Parameters

RSSI threshold-65 dBm
Scan burst duration1.5 seconds
Packet interval200 ms
Cooldown3 seconds after burst ends
Scan report window3 seconds (dedup + ping embedding)
Scan slots per ping4 crypto IDs
SCAN packet size11 bytes
Frequency869.525 MHz (EU/UK)

LED Feedback

EventLEDs affectedColorDuration
Scan burst active (scanner) All 6 body LEDs Magenta 1.5 s (burst duration)
Scan detected (scanned robot) Eye LEDs Magenta 1.5 s (then restores previous color)

Why Sub-GHz Radio?

The robots already have Bluetooth (BLE) for connecting to HQ and controllers. Why not use Bluetooth for proximity detection too?

No pairing needed CC1101 packets are broadcast - any robot on the same frequency can hear them without being paired or connected
BLE connections are limited The ESP32 can only maintain a handful of BLE connections. Sub-GHz scales to all robots on the field without connection management
Dedicated channel Sub-GHz traffic doesn't compete with BLE for radio time on the ESP32, keeping both systems responsive
Already there The CC1101 is on every main PCB for inter-robot communication - proximity sensing reuses existing hardware at zero extra cost

Limitations

RSSI-based proximity is not a precision distance sensor. It works well for the "close or not close" question that games need, but comes with trade-offs worth understanding:

Not a ruler RSSI gives a rough sense of distance, not centimetre-level accuracy. Two robots at the same distance can produce different readings depending on orientation and surroundings
Reflections Radio signals bounce off metal surfaces, walls, and furniture. A reflection can make a distant robot appear closer than it is
Body shielding The robot's own body and battery can partially block the signal in certain directions, affecting the effective scan range
One-way detection The scanner does not learn the result directly. It only flows through the scanned robot's ping to HQ, adding a small delay before the game reacts

Data Flow

The full path from button press to game event:

[Player presses R1/L1] -> Scanner sends SCAN packets over CC1101 (1.5 s burst) -> Nearby robot receives packet, measures RSSI -> RSSI >= -65 dBm? -> Record scanner's crypto ID in scan buffer -> Next PING broadcast embeds scan crypto IDs (up to 4) -> HQ receives PING over BLE -> Game logic processes scan results (e.g. infection in Zombie Tag)