Skip to content

© 2026 Rami Kronbi · Beirut, Lebanon

Back
Robotics

PID light tracker

A two-axis robot that turns to follow a light, steadied by a PID control loop on each axis.

My partLed the software, with Wassim Ghaddar on hardware

In short

An Arduino project from fall 2024 that uses light sensing and two servo axes to follow a light source with PID control.

What it is
An Arduino two-axis light-tracking robot that runs a PID controller against a small light-sensor array.
Why it matters
A tracker that can be made to move with proportional control is not the same as one that settles: gain, noise, saturation, and mechanical behavior all conspire.
My part
I led the software and system architecture; Wassim Ghaddar handled hardware integration and testing.
The finished tracker following a moving lamp on two axes.

Step by step

  1. 1

    Sense

    Light-dependent resistors produce an error signal in two axes. Filtering and centering matter as much as the raw reading.

    Circuit schematic: four LDR voltage dividers with 10 kΩ resistors feeding the Arduino Uno’s analog inputs, and two servos on PWM pins 6 and 9.
    The circuit, simulated in Proteus: four LDR dividers into an Arduino Uno, two servos on PWM.
  2. 2

    Control

    A PID controller converts error into servo commands. Proportional gain provides response; integral removes bias; derivative damps motion when the sensor is quiet enough for it to help.

    The prototype: one axis first, then two axes with PID.
  3. 3

    Actuate

    Yaw and pitch servos move the sensor assembly. Backlash, limited travel, and chassis flex are inside the loop, not outside it.

    The two-axis build: four light sensors under a shade, two servos.
  4. 4

    Calibrate

    The system requires a defined center, safe mechanical limits, sensible sensor filtering, and a consistent update rate before tuning is meaningful.

    CAD render of the light tracker: a 3D-printed base, a pan servo, a tilt bracket, and a mount carrying four light sensors behind a cross-shaped shade.
    The tracker in CAD: two MG995 servos for pan and tilt, and four LDRs split by a shade so each axis sees a difference in light.
For engineersHow it is built, its limits, and its keywords.

How it works

Four light-dependent resistors form directional error signals, the Arduino runs a PID controller against them, and yaw and pitch servos move the sensor assembly. Calibration includes safe mechanical limits, sensor filtering, and a consistent update rate.

Limits

  • PID tuning is system-specific; per-axis gains may differ because inertia and friction differ per axis.
  • Sensor noise can turn derivative action into jitter unless it is filtered.

Keywords

  • PID tuning
  • light tracker
  • Arduino
  • two-axis servo
  • sensor filtering

Read the write-up →