Built with a Raspberry Pi Pico, a TF-Luna LiDAR Sensor, and a Hand-Held Potentiometer
LiDAR measures distances and can create precise 3D maps, using pulsed laser light. These Cornell University seniors developed “Sonic Sight”—a device mounted on a baseball cap—to provide intuitive spatial awareness through sound. LiDAR and directional audio cues enable visually impaired users to detect objects in their path.
Popular consumer electronic devices create an illusion of sound coming from all around, advertising a more immersive experience, compared to traditional two-channel audio. While some systems achieve this through the deliberate placement of several speakers, modern headphones and wireless earbuds use digital signal processing (DSP) to simulate directional sound.
Inspired by these gadgets, we sought to emulate these characteristics in our project, relying on a physical understanding of sound-wave propagation and the human auditory system.
We believe the value of technology lies in augmenting human abilities, and that individuals with disabilities have the most to gain from such innovations. Navigation and collision avoidance present significant challenges for visually-impaired individuals, who must rely on traditional aids such as canes or guide dogs.
We sought to create a wearable assistive device that provides intuitive spatial awareness through sound, translating visual information about the environment into directional audio cues.
To achieve this, we integrated two key technologies. First, inspired by the broad advances in Light Detection and Ranging (LiDAR) technology in autonomous electric vehicles, we use a LiDAR sensor for precise distance measurement.
LiDAR works by emitting rapid laser pulses, measuring the time it takes for them to reflect back, and converting the delay into distance. Similar to how modern vehicles use LiDAR for path planning and obstacle detection, our device uses it to detect objects in the user’s path.
Second, we employ spatial audio techniques to convey this distance information intuitively. By controlling interaural time differences (ITD), which are tiny delays between the two ears, we can trick the brain into localizing depth and direction, using only standard stereo earbuds.
We had originally planned to incorporate both ITD and interaural level differences (ILD), which are loudness variations, for more realistic directional cues. But due to time constraints (this was a four-week class project at Cornell University) and early setbacks with a magnetometer (described under “Form Factor and Iterative Design”), we implemented spatialization using only ITD. (ILD is discussed later, in the section on “Spatial Audio Implementation”).
USER EXPERIENCE
The system, which we named “Sonic Sight,” is designed to be comfortable and unobtrusive. A small LiDAR sensor is mounted on the brim of a baseball cap to measure distances straight ahead and near the user’s eye level. Real-time audio synthesis, generated by a Raspberry Pi Pico RP2040 microcontroller, delivers cues through earbuds to indicate which way to turn toward the nearest object, and adjusts pitch to reflect how far away it is as the user walks. The system is powered by an external battery pack, with earbuds plugged into a headphone jack for feedback.
To operate the device, the user simply places the cap on their head and connects a pair of standard stereo earbuds to the 3.5mm jack. When powered on, a brief tone confirms that the system has initialized.
The user holds a small potentiometer and aligns it with their head, keeping the potentiometer’ pointer aimed in the same direction they’re looking, and begins to scan the space around them. As they slowly sweep from side to side, turning both their head and the potentiometer together, the LiDAR sensor measures distances straight ahead, while the potentiometer records the corresponding angle.
Maintaining this alignment between head direction and potentiometer orientation is critical for accurate spatial mapping. After a few seconds, the device identifies the closest obstacle in the user’s field of view, and begins emitting directional beeps through the headphones.
If the sound seems to come from the left or right, the user turns accordingly until it disappears, indicating they are facing directly toward the object. A button press then switches the device into proximity mode, where the beeps grow faster and higher in pitch as the user moves closer, providing a natural sense of depth and distance.
This approach gives users spatial awareness of their immediate environment, allowing them to locate and navigate toward objects of interest. When finished, the user presses the button once more to reset the system, ready for the next scan.
FORM FACTOR AND ITERATIVE DESIGN
Convenience for the end user influenced most of our design choices. Our earliest prototypes relied on a magnetometer to measure head orientation, but we found that accurately detecting the Earth’s magnetic field indoors was unreliable, due to interference from surrounding electronics and building materials.
Since we wanted the device to operate seamlessly in indoor environments, we replaced the magnetometer with a simpler and more dependable potentiometer-based approach. This meant the user would now need to manually align the potentiometer with their head direction during scanning, rather than relying on automatic orientation tracking.
Although the potentiometer came with a tiny molded arrow, it was hard to see and use for practical alignment. As a result, we glued a coffee stirrer to the knob for ease of use. This made it much easier to align the head angle during scanning. Although this added some manual intervention, it offered accurate angle input readings during testing and made our device more reliable. The components are shown in Figure 1.

Prototype assembly of the device. The LiDAR module is mounted on a baseball cap, and a breadboard hosts the potentiometer with an attached coffee stirrer pointer. Standard earbuds connect via the 3.5mm jack to deliver directional audio feedback.
For distance sensing, we selected a LiDAR module, because of its high accuracy at ranges of several meters. Although our demonstrations often used shorter targets for convenience, our hardware can reliably handle distances up to 8m as per the datasheet [1]. Form factor was also taken into consideration, since the sensor needed to face in the same direction as the user—ideally at eye level.
Additionally, we wanted something wearable and comfortable enough for extended use, so we chose to mount the electronics on a baseball cap. The LiDAR sensor sits forward on the brim of the cap, and wires run from the cap to a breadboard holding the potentiometer.
The usable field of range was limited from 0° to 180°, because we believed it would be unnatural for users to scan for objects behind them. To receive the audio feedback, our device featured a standard 3.5mm stereo jack, allowing users to wear their existing headphones, while avoiding the need for specialized hardware [1].
System Overview
Hardware
The project runs on a Raspberry Pi Pico, powered by a dual core RP2040 chip. For our purposes, a single core handled both the continuous audio generation and higher-level logic. An analog 10kΩ Trimpot potentiometer sourced from Sparkfun was used. The Pico’s internal analog-to-digital converter (ADC) changes the potentiometer’s input to digital readings to obtain the head angle orientation [2]. A hardware timer triggers interrupts at 50kHz, so that new audio samples are generated at a fixed rate. The generated audio samples are sent over serial peripheral interface (SPI) to a dual-channel Microchip MCP4802/4812/4822 digital-to-analog converter (DAC) [3]. The resulting analog stereo signals are then played through a headphone jack, so the user can hear directional audio cues in real time.
Accurate distance sensing is at the heart of the system, and we achieved it using the TF-Luna LiDAR module [4] made by Benawake (Beijing) Co. Ltd. This sensor was chosen because it can reliably detect objects up to 8m away and weighs ≤5g, making it ideal for a head mounted assistive prototype.
Software
An overview of the software system is shown in Figure 2. A breadboard view (Fritzing-style) diagram of the hardware layout and wiring is shown in Figure 3.

Software flow of the RP2040 system, showing initialization, sensor sampling, and real-time audio synthesis through a protothread and 50kHz interrupt for spatialized stereo feedback.

Breadboard view (Fritzing-style diagram) of the device. A Raspberry Pi Pico interfaces with the LiDAR sensor over UART, samples head angle input via its internal ADC, and outputs stereo audio through an external DAC over SPI to the headphone jack. A push-button cycles through system states, and power is supplied by a four-cell battery pack
A push-button cycles through all the possible system states—initialization, scanning, directional audio, and proximity feedback. Audio cues indicate state transitions. A brief initialization tone confirms the system is ready, and changes in the beep patterns signal when the device switches between scanning, directional guidance, and proximity modes.
In the scan state, users rotate their head from side to side at any comfortable rate to find the closest object, while the system continuously samples LiDAR and angle data in real time. A key part of this design involves ensuring that the direction of the popsicle stick on the potentiometer sensor is aligned with the direction the user’s head is facing.
The LiDAR readings are sampled every few milliseconds and mapped to the corresponding potentiometer angle, which the system automatically splits into 5-degree buckets. As the scan progresses, the system continually checks whether the distance of the closest object in the user’s current direction is the absolute closest encountered, storing both its angle and distance.
After exiting scan mode, the finite state machine transitions to directional audio feedback. In this state, beeps generated via direct digital synthesis use ITD to create spatial audio cues. The ITD is calculated based on the angular difference between the user’s current head position and the stored minimum distance angle. When the user faces within ±10° of the target object, no sound is played, creating a “null” for precise alignment.
A button press transitions to proximity mode, where beep interval timing is dynamically adjusted based on the current LiDAR distance reading, with shorter intervals indicating closer proximity. The finite state machine coordinates all these transitions, ensuring smooth progression through scanning, directional guidance, proximity feedback, and reset phases. A diagram displaying these various states is shown in Figure 4.

Finite state machine controlling system behavior. A push-button cycles the user through initialization, scanning, directional audio, and proximity feedback states.
Software debouncing was implemented within the main loop to avoid accidental triggers. Both LiDAR data and potentiometer angle measurements were sampled at the same rate (every 20ms), though the angle readings were more reliable and drove the spatial audio positioning in directional mode.
Because the system is designed to capture the range of motion only within a user’s natural field of view, those raw ADC values were clamped and linearly mapped to 0° to 180°. By handling sensing and audio playback, the system requires minimal intervention from the user, since they are guided with audio cues while cycling through the various modes.
DISTANCE MEASUREMENT WITH LiDAR
The TF-Luna LiDAR module communicates with the Raspberry Pi Pico over UART, transmitting fixed-length data frames from the sensor’s TX pin to the Pico’s RX pin for continuous distance updates. On the Pico, pin 8 (TX) and pin 9 (RX) are allocated for this UART channel.
As shown in Figure 5, the sensor outputs a fixed-length, 9-byte frame that always starts with a 0x59 header. This is followed by 2 bytes encoding distance, 2 bytes for signal strength, and additional fields including a checksum for integrity checking.

Structure of the 9 byte TF-Luna LiDAR UART data frame, showing header bytes, encoded distance, signal strength, temperature data, and checksum for validation.
In firmware, a function polls the UART buffer, validates the header, and reconstructs the 16-bit distance value, using bitwise shifting operations. To ensure responsiveness, a 10ms timeout is enforced on each read. If a packet is incomplete or the UART read fails, the function discards the buffer and returns an error, preventing the control loop from stalling.
TF-Luna requires 3.3V input, and thus can be directly powered by the Pico without the need for a level shifter. The TX line is connected directly to the Pico’s RX pin, which is internally pulled up to logic level.
The unobstructed placement of the LiDAR at the brim of the cap ensures a clear line of sight for distance measurements. These design choices resulted in a steady stream of distance data updating frequently, allowing distance values to be mapped to real-time audio outputs.
SPATIAL AUDIO IMPLEMENTATION
While obtaining distance readings from the LiDAR module are critical, these readings don’t mean much to the user until they’re translated into natural sound cues. To achieve this, audio is generated via Direct Digital Synthesis (DDS) on the Pico, a technique for creating precise waveforms without computationally expensive trigonometric calculations. The core idea is simple: instead of computing sine values on the fly, we pre-compute a sine wave lookup table once at startup, and index into it at the audio sample rate.
A timer interrupt fires every 20ms (50kHz), generating each new audio sample. A phase accumulator, essentially a counter that tracks the instantaneous angle of the waveform, increments by a fixed amount with each interrupt. Like degrees or radians, the phase accumulator represents where we are in the sine wave’s cycle, but it uses the full 32-bit range (0 to 2³²-1) to represent one complete rotation from 0° to 360°. When the accumulator overflows and wraps back to zero, it naturally starts a new cycle.
The top 8 bits of this 32-bit accumulator serve as an index into our 256-entry sine table, effectively dividing the full wave into 256 discrete steps. For a 400Hz tone at 50kHz sampling, the phase increment is calculated as (400 × 2³²) / 50,000. This mathematical relationship ensures the accumulator cycles through the entire lookup table at exactly 400Hz, producing the desired tone frequency.
The retrieved sine sample then undergoes two scaling operations—first, by an envelope that creates smooth attack and decay (preventing harsh clicks); and second, by a channel-specific volume for left/right balance.
All arithmetic uses fixed-point representation, storing values as scaled integers rather than floating point numbers, to guarantee deterministic timing within the interrupt. After scaling, each sample is offset to match the DAC’s 0-4,095 range (where 2,048 represents silence) and transmitted over SPI.
Importantly, samples are computed and scaled separately for the left and right channels before being sent to the two-channel DAC that drives the headphone jack. This split path is essential for audio spatialization. This entire process is completed within the 20ms deadline, producing smooth, directional audio.
Two key principles define spatial hearing: ITD and ILD, both derived from the physical properties of sound propagation and the human auditory system. Our system was originally designed to incorporate both cues, but due to time constraints, we only implemented ITD. Early issues with the magnetometer and the calibration needed to stabilize ITD delayed our ability to add ILD before the project deadline.
— ADVERTISMENT—
—Advertise Here—
In practice, ILD works by adjusting the relative loudness between the left and right channels, a frequency-dependent effect that becomes more noticeable at higher frequencies. In contrast, ITD was successfully implemented by introducing a small phase offset between the stereo waveforms, to simulate the microsecond delay that occurs when sound reaches one ear before the other [5].
If time had allowed, both these cues together would have enabled us to achieve a more realistic spatial audio field, shown in Figure 6, with ITD conveying low-frequency directionality and ILD complementing it at higher frequencies.

Interaural time difference (ITD) illustrated. A sound source offset from the center reaches one ear slightly earlier than the other (Δθ), creating a microsecond delay that the brain interprets as direction. This effect is digitally reproduced by phase shifting left and right audio streams.
The result is responsive stereo audio, where even small head movements translate into clear directional cues. We also shaped each beep with a simple attack-and-decay envelope, preventing the harsh clicks of abrupt starts and stops.
In “proximity mode,” the pitch and frequency of the beeps varied according to distance. Closer objects had a higher pitch and more frequent beeps, whereas the opposite occurred when the user was farther away.
Although the TF-Luna LiDAR module supports ranges up to 8m, we clamped the effective range to approximately 2m to 3m to prioritize short-range object detection. This prevented very close or very distant objects from producing audio cues that were either uncomfortably rapid or too loud. Within this bounded range, the interval between beeps and pitch varies linearly with distance, creating an intuitive escalation in feedback without being intrusive for the listener.
TESTING COMPONENTS AND AUDIO TIMING
We approached testing by first isolating individual components, then moving to the integration. Each component—LiDAR, potentiometer input, DAC audio output—was validated separately and tested again as the subsystems were combined. For software checks, we relied on UART printouts over the Pico’s serial port to confirm that LiDAR packets were parsed correctly, finite state machine (FSM) transitions occurred on button presses, and minimum distance values were stored as expected.
Audio timing required closer inspection. To verify that ITDs were being generated correctly, both DAC channels were connected to an oscilloscope. This made it possible to see whether the leading edge of the waveform shifted between left and right channels, rather than merely a phase offset.
In our tests, left or right timing differences appeared at the start of each beep, confirming that the ISR produced an offset as expected. A representative oscilloscope trace illustrating the expected signal shape is shown in Figure 7. It is not captured from actual hardware data.

The graph on the left displays Channel 1 (left ear) waveform leading Channel 2 (right ear), indicating sound is arriving from the left. The graph on the right displays Channel 1 (left ear) waveform, lagging behind Channel 2 (right ear), indicating sound is arriving from the right.
After the audio spatialization logic was working correctly, we tested the system’s responsiveness. Debouncing logic was implemented within the software, while LiDAR readings were sampled every 20ms.
Because both audio channels were updated synchronously with a shared ISR, this avoided potential concurrency issues and audible glitches. The proximity mode also worked as expected, and beep intervals shortened as the user walked closer to an object, demonstrating that the amplitude and timing differences mapped well to human perception.
Hardware level safety and usability were also considered. The system operated at low voltage, with all components being driven at 3.3V and also secured with duct tape during mounting. The TF-Luna LiDAR emits eye-safe infrared light, so it poses no hazard for daily use.
FUTURE CONSIDERATIONS
Moving forward, we would not merely detect the single closest object, but also several of the closest objects, and overlay the feedback to achieve a more realistic spatial audio map of the environment. Additionally, we would eliminate the handheld potentiometer, and use an Inertial Measurement Unit paired with a magnetometer. Using algorithms such as Kalman filtering would provide more accurate yaw tracking, with sensor fusion to achieve a true, hands-free wearable device.
Future iterations could also explore head-related transfer functions (HRTFs), though these require individual calibration and more time involvement.
LiDar Success
Our final system successfully met our expectations in simulating spatial awareness through real-time audio feedback. The combination of LiDAR sensing, potentiometer-based head tracking, and stereo DDS audio allowed users to detect both the direction and proximity of nearby objects.
The project had good execution and ease of usability, especially after iterating on small design elements, such as the potentiometer pointer. It was especially good to be able to meet the design criteria on a very short time-line to completion.
The complete setup of the Sonic Sight device is shown in Figure 1. A demonstration video of the Sonic Sight “sensory augmentation hat, implemented with a Raspberry Pi Pico” is available on YouTube [6]. Code for the project is available on the Circuit Cellar Article Code and Files webpage. Additional details about the Sonic Sight project are available on the project’s webpage [7].
Understanding Spatial Audio: Mapping the World Through Sound
Spatial audio simulates the human auditory system to create an immersive three-dimensional experience. For the “Sonic Sight” project, this technology provides visually impaired users with intuitive navigation by replicating biological cues: Interaural Time Difference (ITD) and Interaural Level Difference (ILD).
ITD happens when sound reaches one ear microseconds before the other. The system simulates this horizontal directionality by introducing a precise phase offset between stereo waveforms. While ILD—loudness variations between ears—was planned, the developers focused on ITD for this prototype due to time constraints.
For proximity awareness, the device utilizes LiDAR sensor data to adjust audio beeps. As a user nears an obstacle, the beeps increase in pitch and frequency, providing a natural sense of depth. This synthesis is powered by Direct Digital Synthesis (DDS) on a Raspberry Pi Pico. By using a 50kHz sample rate, the system ensures audio remains smooth and responsive to real-time movements.
Think of these cues as audible landmarks: just as a traveler uses visible signs to navigate, these spatial sounds create a mental map that guides a user safely through their environment.
— ADVERTISMENT—
—Advertise Here—
RESOURCES
Benawake | en.benewake.com
Microchip Technology | microchip.com
Raspberry Pi | raspberrypi.com
REFERENCES
[1] SJ1-3555NG-PI Datasheet – Jacks | Audio Connectors | Same Sky: https://www.sameskydevices.com/product/resource/sj1-355xng.pdf
[2] RP2040 Datasheet: A microcontroller by Raspberry Pi: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
[3] MCP4802/4812/4822 Data Sheet: https://vanhunteradams.com/Pico/Cricket/DAC.pdf
[4] TF-Luna LiDAR Datasheet: https://en.benewake.com/uploadfiles/2024/04/20240426135921367.pdf
[5] Interaural Time Difference – An overview | ScienceDirect Topics: https://www.sciencedirect.com/topics/neuroscience/interaural-time-difference
[6] Demonstration video of the Sonic Sight sensory augmentation hat, implemented with a Raspberry Pi Pico: https://youtu.be/l2lWxGuDcH4?si=n5HeED7DPPEKlUQ2
[7 ] Sonic Sight project webpage on GitHub. (This webpage also contains a link to the demonstration video minus commercials): https://ece4760.github.io/Projects/Spring2025/ar933_aks247_dk844/index.html#
SOURCES
Sound localization – Wikipedia: https://en.wikipedia.org/wiki/Sound_localization
Spatial Audio Murder Mystery: https://ece4760.github.io/Projects/Fall2022/mk2592_yw575_asx3/index.html#conclusion
Spatial AudioMap: https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2021/az292_lh479_kw456/az292_lh479_kw456/index.html#Intro
PUBLISHED IN CIRCUIT CELLAR MAGAZINE • FEBRUARY 2026 #427 – Get a PDF of the issue
Sponsor this ArticleArnav Shah is a senior Electrical and Computer Engineering student at Cornell University with interests in low-level software, embedded systems, and RF. On campus, he works on building autonomous electric vehicles and enjoys experimenting with SDRs in his free time. He can be reached at aks274@cornell.edu.
Anishka Raina is a senior at Cornell University studying Electrical and Computer Engineering. She is passionate about embedded systems and robotics. Outside of the classroom, she enjoys playing tennis, dancing, and hiking. She can be reached at ar933@cornell.edu.
Yoon Kang is a senior at Cornell University studying Electrical and Computer Engineering. He can be reached at dk844@cornell.edu.
