Bilal Shihab / Projects

Laser Speckle Imaging

A real-time laser speckle imaging system I built in the Functional Optical Imaging Lab at UT Austin. It keeps the camera and laser tuned automatically so the speckle contrast stays usable:

Functional Optical Imaging Lab, UT AustinSep 2023 – May 2025
Spec
Camera
Basler, 16-bit
Contrast window
7×7 pixels, sliding
Exposure control
Microsecond steps
Saturation target
Center-weighted, 98%
Laser control
Arduino feedback loop
UI
Python, PySide6
The laser speckle setup on an optical table, with an Arduino and a laptop running the control software
Fig. 1The setup on the optical table: the camera and laser mounts, the Arduino that drives the laser current, and the control software on the laptop.
A power meter reading 105.7 mW under a red laser in a dark lab
Fig. 2Before automation: raising the laser current by hand while a power meter reads 105.7 mW. A frame from a December 2024 video.

Why I built it

I joined the lab in my first month as a freshman. I already had a lot of coding experience, so I ended up working on much of the software, and through the research I learned DAC control and serial communication well before any of my classes covered them. The contrast was adjusted by hand, which meant a lab technician had to be there the whole time the system ran. The lab asked me to automate it with an Arduino, and the software now makes those adjustments on its own.

The hard part

The automatic control loop kept oscillating. It would overshoot, correct, then overshoot again, bouncing the laser current between 19% and 21%. I added logic that detects the alternating corrections, holds the current at 20% and pauses adjustment for five seconds, plus a 0.3% dead band so small fluctuations are ignored.