Skip to main content
Version: ACS CC

Light tracker with solar pannel & LEDs

A one line project description

info

Author: Daria-Catalina Banu
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-Scarlett-stack

Description

A system that follows the most intense light source using photoresistors and rotates and translates vertically a mini-solar panel to maximize light capture.

Motivation

I chose this project because it allows me to explore embedded systems through a practical application that combines environmental awareness with precise motion control. Using stepper motors to orient a solar panel towards the most intense light source offers both a technical challenge and an opportunity to improve energy efficiency. This project also gives me hands-on experience with ADCs, real-time light tracking, and low-level motor control using Rust and the Embassy framework.

Architecture

  • Light Sensor Module (ADC Sampling + Filtering) Continuously reads values from 4 photoresistors (via ADC), applies a basic smoothing/filtering algorithm, and computes which direction has the strongest light intensity.

  • Motor Control Module Controls two stepper motors for horizontal and vertical movement. Uses a state machine to determine the required movement based on the output of the light sensor module.

  • Tracking Algorithm Coordinates input from the sensors and sends precise motor commands. Includes logic for tolerance thresholds, and movement limits.

  • Display Module Shows real-time status info (e.g., direction, light levels, current position) on the LCD2004 screen using hd44780-driver

  • Debug & Logging (defmt) All internal states, sensor readings, and motor steps are logged via RTT for debugging and tuning purposes.

Log

Week 21 – 27 April

Ordered hardware components updated the project's initial diagram, and also started exploring some rust crates compatible with my components.(uln2003, ads1x1x)

Week 28 April – 4 May

I tested some of the components on the breadboard to see if they work properly. (ky-018 photoresistor module, ads1115 adc convertor). I am also thinking of using a port expansion module for the led band, in case i run out of gpios on the pico.

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

  • Raspberry Pi Pico W – The main microcontroller that runs the firmware using Rust and the Embassy async framework.

  • 4× KY-018 Photoresistors + ADS1115 ADC – Used to sense light intensity from different directions. The ADS1115 allows me to read data from the 4 modules

  • 2× Stepper Motors (28BYJ-48) + ULN2003 Drivers – Control the rotation and tilt of the solar panel. Each motor is driven by a ULN2003 driver module.

  • LCD2004 Display – Displays real-time tracking information. Controlled using the hd44780-driver crate over I²C.

  • 12-segment LED bar (4 red + 8 green) – Optional. Visual feedback for system status or light intensity. May be driven via port expander (PCF8574).

  • Mini Solar Panel – Rotates to face the brightest light source. Mounted on the motor platform.

  • PCF8574 I²C Port Expander (optional) – If GPIO pins run out, this expands the number of digital outputs, useful for controlling LEDs or other components.

  • Breadboard, jumper wires, resistors – For prototyping and building the circuit.

Schematics

TBD Place your KiCAD schematics here.

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe main microcontroller39.66 RON
ADS1115 ADC Module16-bit analog-to-digital converter for photoresistors32.98 RON
KY-018 Photoresistor Module (x4)Detects light intensity from different directions9.12 RON
28BYJ-48 Stepper Motor (x2)Provides panel rotation and tilt33.94 RON
ULN2003 Driver Module (x2)Drives the stepper motorsinclus in stepper
LCD2004 Display with I²CDisplays real-time tracking status26 RON
PCF8574 I²C Port ExpanderOptional I/O expansion for controlling LEDs9.99 RON
12-segment LED BarVisual feedback on light intensity (4 red, 8 green)6 RON
Mini Solar Panelpanel that follows light18 RON
Breadboard, wires, resistorsPrototyping and circuit building~15 RON

Estimated Total: 190.69 RON

Software

Library / CrateDescriptionUsage
embassyAsync embedded framework for RustUsed for async task scheduling and peripherals
embassy-rpEmbassy HAL implementation for RP2040/RP2350Used for GPIO, ADC, PWM, I²C on the Pico W
embassy-timeTiming utilities for async delaysUsed for blinking LEDs, servo control, debouncing
embassy-syncAsync-safe synchronization primitivesCoordination between async tasks (e.g., tracking + UI)
defmtLightweight logging frameworkUsed for debugging over RTT
defmt-rttTransports defmt logs over Real-Time TransferDebug output
panic-probePanic handler with defmt loggingUsed to capture and print panics in embedded code
ads1x1xDriver crate for ADS1115/ADS1015 ADCsUsed to read analog values from photoresistors
hd44780-driverDriver for HD44780-based displays (like LCD2004 via I²C)Used to display data on LCD screen
embedded-hal-asyncAsync traits for embedded-hal peripheralsRequired by embassy for async I²C, ADC, etc.
fixedFixed-point arithmetic crateUsed for precise PWM timing (e.g. servo control)
pcf857xDriver for PCF8574 I²C port expanderUsed if GPIO pins run out (for LED control)
fugitTime duration representation used by Embassy and driversUsed internally for time-related configs
  1. link
  2. link ...