Smart Building Control - IR sensor networks

IR Sensor Networks: BLEShark Shiver Mesh for Smart Building Control

Most IR remote controls have a range of 5 to 10 meters and require line of sight. Point the remote at the TV from across the room and it works. Try to control the projector in the conference room down the hall from your desk, and you're out of luck.

BLEShark Nano has both IR transmit/receive capability and Shiver mesh networking. Put those together and you have a distributed IR network: nodes positioned in different rooms, each handling IR commands for the equipment in their local area, all controllable from a single point via the mesh. You send a command to "Conference Room B's node" and that node points its IR transmitter at the projector 3 meters away and fires the code.

This is the IR sensor network use case - zone-based control of IR-equipped devices across a space larger than any single remote's range.

Table of Contents

How BLEShark Nano IR Works

BLEShark Nano has a built-in IR LED for transmission and an IR receiver for capturing signals. The IR system supports:

sequenceDiagram
    participant Admin as Admin Device
    participant Master as Master Node
    participant Mesh as Shiver Mesh
    participant Remote as Remote Node
    participant Device as IR Target Device

    Admin->>Master: Send IR command (zone + signal)
    Master->>Master: Resolve target node for zone
    Master->>Mesh: Queue mesh command
    Note over Mesh: ESP-NOW reliable delivery
    Mesh->>Remote: IR_TRANSMIT command
    Remote->>Remote: ACK mesh receipt
    Remote->>Device: Transmit IR signal
    Device->>Device: Execute command
    Remote->>Mesh: Status response
    Mesh->>Master: Delivery confirmed
    Master->>Admin: Command acknowledged

Mesh IR command flow - from admin request through mesh relay to IR transmission

graph TD
    subgraph "Zone A - Lobby"
        NA[Node A - Master] -->|IR TX| LOBBY_TV[Lobby Display]
        NA -->|IR TX| LOBBY_AC[HVAC Unit]
    end
    subgraph "Zone B - Conference Room"
        NB[Node B] -->|IR TX| CONF_PROJ[Projector]
        NB -->|IR TX| CONF_LIGHTS[IR Dimmer]
        NB -->|IR RX| CONF_REMOTE[Capture remote signals]
    end
    subgraph "Zone C - Server Room"
        NC[Node C] -->|IR TX| SERVER_AC[Precision AC]
        NC -->|IR Monitor| TEMP[Temperature response]
    end
    subgraph "Shiver Mesh"
        NA ---|ESP-NOW| NB
        NB ---|ESP-NOW| NC
        NA ---|ESP-NOW| NC
    end
    PHONE[Admin Phone] -->|WiFi| NA
    NA -->|Mesh CMD| NB
    NA -->|Mesh CMD| NC

Zone-based IR control architecture using Shiver mesh for coordinated smart building management

  • TV-B-Gone: Cycles through a library of power-off codes for hundreds of TV models. US and EU code sets are included.
  • IR Transmit: Send a custom captured code or a code from the device's stored library.
  • IR Receive: Capture and store raw IR signals from any remote. The captured signal can be stored and replayed later.
  • IR Clone: Receive a signal and immediately add it to the stored library for replay.

The Nano supports common IR protocols including NEC, Sony SIRC, RC5, and raw timing capture for protocols it doesn't recognize natively. Signals are stored in SPIFFS and available for transmission at any time.

Without the mesh, these features are local: the Nano in your hand controls IR devices in front of it. With the mesh, these features become remote: you send a command to a specific node, and that node executes the IR operation in its physical location.

Mesh IR Commands

Shiver implements two IR-related commands that can be sent to remote nodes:

CMD_IR_TVBGONE: Instructs the target node to run its TV-B-Gone sequence. The node begins cycling through its IR power-off code library, transmitting each code in sequence with short gaps between them. Any TV, projector, or display within IR range of the node will receive the appropriate off command when its code is reached.

CMD_IR_CUSTOM_TX: Instructs the target node to transmit a specific stored IR code. The command specifies which code to send (by name or index in the node's stored library). The target node looks up the code in its SPIFFS storage and transmits it.

Both commands use Shiver's reliable delivery system - the command is acknowledged by the target node, and the sender knows whether the command was received and executed. If the target node is not a direct neighbor, AODV routing delivers the command through intermediate nodes.

Zone-Based Control

The value of the mesh for IR control is physical coverage. A single Nano has IR range of roughly 5-10 meters in a clear line-of-sight path. Walls, furniture, and distance limit it further. Equipment in different rooms is out of reach.

Zone-based deployment puts a node in each zone that needs IR control. "Zone" can be a room, a floor section, or any logical grouping of IR-controlled equipment. Each node in a zone captures the IR codes for the equipment in that zone and stores them in its local library.

Example: a 10-room conference center deployment.

  • One Nano per conference room, positioned near the display/projector
  • Each node has captured the room's projector power, input switching, and screen control codes
  • A command Nano (or the same device that coordinates the mesh) can send CMD_IR_CUSTOM_TX to any specific room's node to control that room's equipment

From the command node, you can control every conference room's AV equipment from one place. No physical access to each room required after initial setup.

IR Receive Over Mesh

CMD_IR_RX instructs a remote node to enter IR receive mode and listen for an incoming IR signal. When a signal is received by the remote node, the captured signal data can be sent back to the command node as a result payload.

This enables remote IR code capture: position a node in the equipment room and send CMD_IR_RX to it, then have someone press a button on the physical remote in that room. The captured code travels back to you over the mesh. No need to physically carry your capture device to each location.

For building-wide code libraries, this is the efficient approach: deploy nodes, capture codes remotely by having facility staff operate remotes in each location, receive captured codes at the command node. Build the full code library across all rooms from one position.

TV-B-Gone Deployment

TV-B-Gone in a distributed mesh context has a specific application for large spaces: sending CMD_IR_TVBGONE to multiple nodes simultaneously, or in sequence, covering an entire facility's displays from one command.

This is primarily relevant for security assessments of physical security controls. How many unauthorized people in a building can access AV controls? If a red team deploys Nano nodes in accessible areas (break rooms, lobbies, open conference rooms) and can remotely trigger IR sequences to demonstrate control of displays, that's a documented finding about physical access controls.

It's also applicable for facility management in authorized contexts: at the end of a large event, confirming all displays are off across a facility. Or testing whether the IR receiver configuration of new AV equipment responds to known codes.

Building the Setup

Setting up a distributed IR network with Shiver:

  1. Deploy nodes physically: Position a Nano in each zone where IR control is needed. The node needs a clear line of sight to the equipment it will control - IR doesn't go through walls.
  2. Pair nodes to the mesh: Navigate to the Node menu on any paired device, add each new node via BLE pairing. After pairing, nodes reboot into mesh mode and join the Shiver network automatically.
  3. Capture zone codes: Use CMD_IR_RX to capture IR codes from each zone's physical remotes. Alternatively, pre-load common protocol codes (NEC, Sony, etc.) from known libraries before deployment if the device types are known in advance.
  4. Label nodes by location: Set node names (up to 8 characters) that correspond to their physical location. "ConfRM-B", "LobbyTV", "BoardRm" - meaningful names make Execute menu targeting intuitive.
  5. Test IR transmission: Send CMD_IR_CUSTOM_TX to each node and verify the target device responds.

After setup, operating the IR network is straightforward from the Execute menu: IR category, select command (TV-B-Gone or Custom TX), select target node, execute. The command routes through the mesh and the target node fires its IR transmitter.

Use Cases

Physical red team assessment: Demonstrate unauthorized IR control as a physical security finding. Deploy nodes in accessible areas during an authorized assessment. From outside the building (within mesh range), trigger IR commands that affect equipment inside. This demonstrates that physical access to AV controls isn't limited to people with authorized room access.

Facility management: End-of-day confirmation that all displays are off across a facility. Or scheduled automation: trigger CMD_IR_TVBGONE at a specific time via the mesh automation system, affecting all deployed nodes in sequence.

Smart conference room control: A central controller (phone, laptop running the BLEShark web interface, or a paired Nano in your hand) controls AV equipment in any room without requiring physical access to each room.

Security education demonstrations: Show students or clients how IR interception works. Deploy a Nano as a monitor with CMD_IR_RX, have a demonstrator press a remote button in a different room, show the captured code arriving at the monitoring station. The mesh makes multi-room IR security demonstrations tractable in a classroom or training environment.

Testing IR security of building systems: Some building systems (HVAC panels, projector mounts, motorized blinds) use IR control. Assessing whether unauthorized people can control these systems from outside a secured area is a legitimate physical security test. Shiver nodes make this assessment possible without requiring the assessor to be in the room with the target equipment.

Technical Details

A few implementation details worth knowing for IR network deployments:

IR range and obstacles: BLEShark Nano's IR LED has a practical range of 5-10 meters in clear line of sight. Pointing directly at the receiver improves range. Infrared doesn't penetrate walls - the node needs to be in the same room as the target equipment and positioned to have a clear optical path to the receiver.

Carrier frequency: Most IR remotes use a 38kHz carrier frequency. BLEShark Nano generates this carrier for NEC and most common protocols. Sony remotes use 40kHz. The device handles both, with the protocol detected automatically during capture or specified during manual transmission.

Code storage: IR codes are stored in SPIFFS as files, accessible via the file portal. You can pre-load code sets from a computer (upload via file portal) rather than capturing each code individually. IR code databases like IRDB provide codes in formats that can be converted to BLEShark's storage format.

Grace-wait before IR commands: Like other radio-consuming tasks, IR operations use Shiver's grace-wait system. When CMD_IR_TVBGONE or CMD_IR_CUSTOM_TX is received by a remote node, the node waits a few seconds to allow the command to finish propagating through the mesh to any further-hop nodes before switching to IR transmit mode. This ensures other nodes receive the command before the executing node potentially disrupts mesh timing.

Simultaneous multi-node IR: Sending CMD_IR_TVBGONE to "All Devices" triggers TV-B-Gone on every online node simultaneously. This is useful for large-area coverage (multiple rooms at once) but produces heavy IR traffic. The mesh handles the command fanout reliably; the IR execution on each node is independent.

Get BLEShark Nano

Back to blog

Leave a comment