Our team developed an autonomous light-seeking robot car designed to detect and navigate toward sources of light. The system utilizes a 4-direction photosensor array and real-time processing via an in-built microcontroller to demonstrate sensor-based decision-making and control.
HardwareThe robot's perception and tracking capabilities are driven by photodiode modules. The photodiode modules we used converts the standard micro-ampere output current of the photodiodes into an amplified analog voltage ranging from 0V to 3.3V. These analog signals are then transmitted to the TI Launchpad and then scaled to a 0V - 3V range using the onboard ADCs to optimize the dynamic range for the control logic.
4 photodiodes were arranged in a directional N-S-E-W array mounted on top of a fixed platform. With the "North" sensor aligned with the robot's forward direction, the robot can simultaneously sample incident light intensity from four cardinal directions.
Sampling, Navigation, and TrackingThe control logic operates on a comparative principle designed to align the robot's forward direction with the strongest detected light source. By constantly sampling from the four photodiodes, the control system identifies which direction provides the highest light intensity. When one photodiode detects stronger light than the others, the robot’s control system adjusts the motors, so the car turns toward the brighter source. This continuous feedback loop of sensing, comparing, and maneuvering allows the robot to autonomously reorient itself and drive toward the light source until it reaches its destination, demonstrating basic sensor-based navigation and autonomous decision-making.
Our control logic was broken up into three main sections each with their own interrupt:
- The process is initiated with the
ADC_ISR, which samples the analog signals from the photodiodes and convert them into digital values for processing. - Control then passes to the
SPIB_ISR, which performs a 2-second initial signal calibration of the ADC readings by subtracting ambient light levels from the live readings. This minimizes the robot's sensitivity to background environmental noise. - Finally, the
SWI_ISRinterrupt houses the high-level decision-making and motor actuation. The outer light-intensity-based and inner motor control loops are housed in this interrupt function. Here, the calibrated sensor data are compared to determine the optimal steering direction, and the motor PWM signals are adjusted accordingly to steer the robot.
A nested control loop is used to determine the robot's navigation behavior to the light source by separating the control logic into two loops: the high-level, outer "light tracking" loop, and the low-level, inner "motor control" loop.
1) Outer Intensity-Based Loop- A light magnitude vector m is calculated to determine the signal strength and directionality of the light source:
m = sqrt(pow(N-S,2) + pow(W-E,2));
// Light source directionality - if low, indicates that light in all directions is similar (e.g., ambient lighting)- If a decently directional light source is detected such that m is greater than a threshold value, the robot calculates a normalized error between the East and West sensors to determine the steering direction. The normalization helps to ensure consistent sensitivity between dim/far light sources and strong/near light sources, preventing the robot from becoming "over-aggressive" near strong light sources while also remaining responsive to weak/far light sources.
- A proportional-derivative (PD) controller uses the normalized error to calculate a turn rate, while the derivative term aids to dampen oscillations and prevent overshooting.
- If the robot detects that the strongest light source is behind the robot (i.e., highest intensity reading from the South sensor), a 180° spin is initiated to pivot the robot.
- If the robot does not detect a strong/directional light source for 400 ms, it enters a "search state" where it performs a slow, continuous counterclockwise rotation to scan the environment until it detects a strong light source → enters "light-tracking state".
- As the robot approaches a light source, a first intensity threshold limit is triggered that stops the robot from moving forward anymore. Shortly after that, a higher (+0.01 V) second intensity threshold limit is triggered that sounds the buzzer to indicate a strong light source directly in front of the robot.
- A coupled proportional-integral (PI) controller here compares the desired turn rate against actual wheel speeds and adjusts the PWM signals sent to the motors to constantly update their rotational speeds. Anti-integral-windup is implemented to prevent the integral term from accumulating errors.
- Improved tracking resolution - 4 diagonal sensors (NE/NW/SE/SW)
Expand the current (N-S-E-W) sensor layout to an eight-direction octagonal array to fill the gaps between the north, east, south, and west directions. This denser sensor placement fills the gaps between the cardinal axes, improving angular resolution and allowing the control logic to interpolate light intensity across a continuous 360° field. This allows the robot to react more smoothly when the light source is off axis, reducing sudden changes in direction and oscillations, and preventing "dead zones" in which the robot does not pivot due to similar sensor readings. Overall, this improves steering stability and results in a more stable, natural navigation and a fluid trajectory toward the target.
- Dynamic 3-axis light tracking
By integrating a servo-driven tilt mechanism, the robot gains a second degree of freedom, allowing it to actively scan for the specific elevation of peak light intensity. This "pitch" axis enables the control system to move beyond simple horizontal estimation and determine whether the target light source is positioned above or below the robot's current plane.
With this vertical scanning capability, the robot can locate and track a three-dimensional light source, rather than assuming the light source is always located on a two-dimensional plane, making the system more robust in real-world environments where the height of the light source may vary.

















Comments