
Home · Wiring · Installation · Troubleshooting
LED–LDR Feedback Control Lab
A hands-on feedback control experiment using an LED (actuator), the environment (plant), and an LDR voltage divider (sensor), controlled via MATLAB and Simulink with an Arduino.
Start here: If this is your first time, do the steps under Quick start.
Quick start (5–10 minutes)
- Wire the kit → see Wiring
- Install MATLAB support package → see Installation
- Run Blink:
matlab/Blink_led.m - Run Sensor check:
matlab/LDR_sanity_check.m - Run PI control (script or GUI):
matlab/PI_led_control.mmatlab/Led_ldr_pi_gui.m
What’s in this toolbox
MATLAB (scripts + GUI)
- Blink / Fade: verify actuation + PWM intuition
- LDR sanity check: verify measurement + ambient disturbance
- PI control (+ filter): closed-loop behavior + tuning + noise filtering
- GUI: real-time interaction for students
Simulink (hardware-in-the-loop)
- Full block-diagram loop using a MATLAB System block plant
- Uses
ArduinoLedLdrPlant.minside a MATLAB System block