<figure><img src="image_1.png" /></figure>

HAL
open science

# Demo: Multi-sensor Lighthouse v2 Decoding Optimized for Low-Power CPU

Said Alvarado-Marin, Arnaud Taffanel, Marcus Eliasson, Filip Maksimovic, Thomas Watteyne

<figure><img src="image_2.png" /></figure>

## To cite this version:

Said Alvarado-Marin, Arnaud Taffanel, Marcus Eliasson, Filip Maksimovic, Thomas Watteyne. Demo: Multi-sensor Lighthouse v2 Decoding Optimized for Low-Power CPU. EWSN 2025 - 22nd International conference on Embedded Wireless Systems and Network, Sep 2025, Leuven, Belgium. hal-05289419

HAL Id: hal-05289419

https://inria.hal.science/hal-05289419v1

Submitted on 29 Sep 2025

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_3.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Demo: Multi-sensor Lighthouse v2 Decoding Optimized for Low-Power CPU

Said Alvarado-Marin<fnref n="1" />, Arnaud Taffanel², Marcus Eliasson², Filip Maksimovic<fnref n="1" />, Thomas Watteyne<fnref n="1" />

said-alexander.alvarado-marin@inria.fr

¹Inria, Paris, France. ²Bitcraze AB, Malmö, Sweden

## Abstract

This paper demonstrate a low-power implementation of the Lighthouse v2 localization system using the RP2040 and RP2350 microcontrollers. Our system captures and decodes infrared signals from four sensors simultaneously using the PIO subsystem, eliminating the need for FPGAs for multi-sensor systems. We demonstrate reliable operation and benchmark the system's latency, confirming its suitability for low-cost, embedded multi-robot localization.

## CCS Concepts

* Hardware → Sensor devices and platforms; 
* Computer systems organization → Embedded hardware.

## Keywords

Localization, Multi-Robot System, Wheeled Robots, Lighthouse Positioning.

## 1 Introduction

The Lighthouse v2 (LH2) localization system is a low-cost commercial solution originally developed for virtual reality applications. It uses basestations that emit sweeping infrared laser planes to serve as spatial beacons. Recent research has shown that LH2 can achieve millimeter-level accuracy in decentralized multi-robot localization when tracked robots are equipped with specialized photo-receivers [3].

However, a key limitation of LH2 in robotics is the computational cost of decoding the sensor signals. Existing implementations typically rely on FPGAs to meet the required sampling rate (32 MHz), restricting the system's applicability to low-cost or low-power platforms.

In previous work, we presented a single-sensor LH2 receiver that runs entirely on a low-power microcontroller (nRF52833), eliminating the need for an FPGA [1]. While promising, that system was limited to decoding data from a single sensor.

In this paper, we demonstrate an expanded implementation capable of decoding signals from four LH2 sensors exposed to two basestations using a single low-power microcontroller (RP2040/RP2350). This advancement is significant, as at least three LH2 sensors are typically required to compute the 3D pose of a target, an approach commonly seen in commercial LH2 localization systems [2]. By enabling multi-sensor decoding on a cost-effective platform, our solution greatly enhances the practicality of LH2-based localization for low-cost applications. As an online addition to this paper, we published all the source code described under a BSD open-source license<fnref n="1" />.

<figure><img src="image_4.png" /><figcaption>**Figure 1:** Hardware setup. One RP2040/RP2350 is connected to four Lighthouse receiver sensors while in the presence of two basestations.</figcaption></figure>

## 2 Hardware

Our hardware setup consists of a single microcontroller – either the RP2040 or the RP2350 – connected to four LH2 sensors. Each sensor is composed of a photodiode paired with a TS4231 front-end chip. The sensors are placed within the coverage area of two active LH2 base stations, as illustrated in Fig. 1.

The TS4231 chip samples the photodiode signal and outputs two digital lines. As shown in Fig. 3:

* The Envelope pin transitions from high to low to signal the presence of a sweeping laser plane from the base station.

* The Data pin outputs a Manchester-encoded pseudo random bitstream at 12 MHz, carrying the angle of departure information encoded in the laser sweep.

As established in previous work [1], the Data line must be sampled at 32 MHz to ensure robust and accurate decoding. This presents a challenge for most low-power microcontrollers, as they typically lack the ability to continuously sample at such a high frequency.

Our chosen microcontroller has a Programmable Input/Output (PIO) peripheral. The PIO allows users to define custom communication protocols in software, with hardware-level timing precision. This enables reliable data capture and transmission at speeds of tens of MHz, well beyond what is typically achievable with conventional software interrupts. This capability makes the RP2040 family especially well-suited to our use case.

### 2.1 Software Description

The Lighthouse v2 localization algorithm consists of four main stages: capturing the LH2 sensor signals, decoding the differential manchester-encoded data, identifying the LFSR polynomial used to generate the bitstream, and locating the received sequence within

<footnote n="1">¹ https://github.com/DotBots/lh2_on_rp2040</footnote>
<figure><img src="image_5.png" /><figcaption>Figure 2: Diagram of the signal capture pipeline.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Figure 3: Logic analyzer capture of the data output of the TS4231 sensor when illuminated by a laser sweep.</figcaption></figure>

the full pseudo-random code. The decoding, polynomial identification, and LFSR index search follow the approach detailed in a previous publication [1]. In this work, we improve the data capture stage to support simultaneous acquisition from four sensors by leveraging the PIO subsystem. The architecture of this signal capture pipeline is illustrated in Fig. 2.

The PIO system in the RP2040 microcontroller consists of two banks (PIO0 and PIO1), each containing four state machines. Each state machine can execute a short, user-defined assembly program with a configurable clock frequency. These programs can sample or drive GPIO pins, make decisions based on GPIO states, and trigger interrupts on the main CPU. In our setup, both output pins of the TS4231 are connected to the PIO system.

When the Envelope pin signals the presence of a laser sweep, the PIO state machine samples the Data pin 512 times at exactly 32 MHz. This sampling period was chosen to match our earlier implementation on the nRF52833, where it is known to be effective, despite being an arbitrary limitation of that platform.

Once the sampling is complete, the PIO program triggers an interrupt, notifying the main CPU to retrieve and decode the sampled data. Data transfer between the PIO banks and general-purpose RAM is handled via the Direct Memory Access (DMA) controller to ensure low-latency, high-throughput operation.

## 3 Experimental Setup and Results

To evaluate the performance of our algorithm on the RP2040 and RP2350 microcontrollers, we benchmark the execution time of each

stage in the processing pipeline. A GPIO pin is toggled at the beginning and end of each function, allowing us to measure its timing using a logic analyzer. The results of these benchmarks are summarized in Table 1.

<table><caption>Table 1: LH2 Sweep Computation Time</caption><thead><tr><th>Function</th><th>Comp. Time RP2040<br>(Mean ± Std. Dev.)</th><th>Comp. Time RP2350<br>(Mean ± Std. Dev.)</th></tr></thead><tbody><tr><td>Signal Capture</td><td>2.8 µs ± 1.4 µs</td><td>1 µs ± 0.9 µs</td></tr><tr><td>Demodulation</td><td>307.0 µs ± 5.3 µs</td><td>150 µs ± 4.6 µs</td></tr><tr><td>Determine Poly.</td><td>197.0 µs ± 134.0 µs</td><td>113 µs ± 82.0 µs</td></tr><tr><td>LFSR index</td><td>295.0 µs ± 375.0 µs</td><td>27 µs ± 84.0 µs</td></tr></tbody></table>

These results demonstrate that it is possible to decode Lighthouse v2 signals from four sensors in real time using a low-power microcontroller. This paves the way for implementing a cost-effective, energy-efficient standalone tag capable of high-accuracy self-localization in the presence of Lighthouse v2 base stations, further increasing the accessibility of precision localization technologies.

## Acknowledgements

This project has received funding from the EU's Horizon Europe Framework Programme under Grant Agreement No. 101093046.

## References

[1] Said Alvarado-Marin, Cristobal Huidobro-Marin, Martina Balbi, Trifun Savić, Thomas Watteyne, and Filip Maksimovic. 2024. Lighthouse Localization of Minia-ture Wireless Robots. IEEE Robotics and Automation Letters (2024).

[2] Bitcraze AB 2022. Lighthouse Positioning Deck. Bitcraze AB. https://www.bitcraze.io/documentation/hardware/lighthouse_deck/lighthouse_deck-datasheet.pdf Rev. C.

[3] A. Taffanel, B. Rousselot, J. Danielsson, J. K. McGuire, K. Richardsson, M. Eliasson, T. Antonsson, and W. Hönig. 2021. Lighthouse Positioning System: Dataset, Accuracy, and Precision for UAV Research. In ICRA Workshop: Robot Swarms in the Real World. Xian, China.