Fixed solar panels lose up to 30% of potential energy because they can't follow the sun. Commercial dual-axis trackers exist but are expensive and use simple LDR-based control that struggles in cloudy conditions.
DemoOur solutionWe built a real-time embedded C++17 application on a Raspberry Pi 5 that uses camera-based vision to detect the sun and drives a 3-RRS Stewart-type parallel platform to orient a solar panel. The entire software pipeline is event-driven with zero polling loops — every sensor wakes its thread through blocking I/O.
How it worksThe software pipeline runs as:
Camera → SunTracker → Controller → Kinematics3RRS → ActuatorManager → ServoDriver
- The IMX219 CSI camera captures frames at 30 fps via libcamera callbacks
- SunTracker detects the brightest region and computes a centroid
- The Controller converts pixel error into tilt/pan setpoints
- Inverse kinematics maps platform orientation to three servo angles
- ActuatorManager applies safety clamping and slew-rate limiting
- ServoDriver writes to three servos via PCA9685 over I2C
Average end-to-end latency is 8.37 ms — well under the 33 ms frame period.
Key technical features- Event-driven architecture: timerfd, signalfd, eventfd, GPIO edge interrupts, condition variables — no polling anywhere
- Multi-threaded: camera, control, actuator, and GUI dispatcher threads all wake from events
- Callback-driven inter-class communication using std::function and abstract interfaces
- IMU feedback via MPU6050 data-ready GPIO interrupt for platform tilt compensation
- Manual override via potentiometers (ADS1115 ALERT/RDY GPIO) or Qt GUI
- Quantitative latency monitoring with per-frame CSV export
- 60+ automated CTest cases covering vision, control, kinematics, state machine, and thread safety
- Raspberry Pi 5 (4 GB)
- IMX219 CSI camera module
- PCA9685 PWM servo driver (I2C 0x40)
- 3× DS3230 high-torque servos
- ADS1115 16-bit ADC (I2C 0x48) with 2 potentiometers
- MPU6050/ICM-20600 IMU (I2C 0x68)
- 5-6V external battery for servo power
- 3D-printed 3-RRS Stewart platform


















_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)

Comments