Getting your Trinity Audio player ready...

[IMAGE: Hero photograph of a small, low-voltage two-axis tabletop tracker outdoors beside an identically sized fixed-reference panel, both on the same plane of ground] — ALT TEXT: “Dual-axis solar tracking system beside a fixed solar-panel reference”

Introduction

A solar panel produces its best direct-beam output when sunlight strikes it close to perpendicular. A fixed panel faces one direction while the sun moves across the sky and changes elevation. A dual-axis tracker turns around an azimuth axis and tilts around an elevation axis to reduce that incidence-angle loss. Yet rotating a panel consumes energy, adds mechanical failure points and may offer little gain in diffuse, cloudy conditions. A credible build therefore needs more than two servos that chase a torch: it needs a stable controller and a fair net-energy test.

This project is a small, low-voltage experimental platform. Four light-dependent resistors (LDRs) behind a cross-shaped shade provide directional error signals. An Arduino Uno drives two servos supporting a lightweight demonstration panel. A second, matched panel stays fixed for comparison. The design includes sensor normalisation, a movement deadband, mechanical limits and a test method that subtracts actuator consumption. It is a learning instrument rather than a roof-mounted solar installation.

Popular four-LDR Arduino tutorials establish the basic mechanism, but examples often quote a universal “up to 40%” gain without a site-specific test or stop the explanation at comparing raw analogue readings. Others omit servo supply separation or reference-panel measurements. The improvement here is to distinguish a tracking demonstration from a measured energy benefit. Arduino Project Hub example; another four-LDR example; Open Electronics motor-driven tracker. These are examples of approaches, not evidence that their claimed gain transfers to your site.

Theory and Working Principle

Incidence angle and energy

For direct sunlight, irradiance on a flat collector approximately follows the cosine of the angle between the light ray and the panel normal. A fixed panel therefore loses direct-beam capture as its orientation diverges from the sun. Diffuse skylight behaves differently: it comes from many directions, so pointing precisely at the brightest patch is not necessarily optimal. Cloud shadows, trees and reflections can fool a purely optical tracker. Temperature also matters because photovoltaic output changes with cell temperature. Compare electrical energy from two matched panels under the same load and local weather, rather than multiplying a momentary voltage reading by an assumed current.

Published figures must be placed in context. A National Renewable Energy Laboratory paper describes a 15–25% single-axis gain relative to fixed tilt in the systems discussed there, but that is not a measurement of this dual-axis prototype. It provides a reason to test, not a result to copy. See the NREL study.

Define the meaningful result as net tracking benefit = tracked panel energy − tracker electronics/actuator energy − fixed panel energy. Include equal measurement intervals and record clouds and shading. A gross gain smaller than the energy consumed by servos and controller is a net loss.

Four sensors and a shade

Put LDRs at top-left, top-right, bottom-left and bottom-right, separated by a small opaque cross. Each forms a voltage divider with a fixed resistor. In this design, LDR goes to 5 V, resistor to ground and the junction to an analogue input: a brighter LDR tends to produce a higher measured voltage. If you reverse the divider, the control sign reverses. Average the two left readings and compare with the right pair to obtain azimuth error; average top and bottom pairs for elevation error.

LDRs are inexpensive but their response is non-linear and parts vary. Normalise each pair by its total, reject readings when overall illumination is too low, and apply a deadband so small mismatches do not make the mechanism twitch. A photodiode array with transimpedance amplifiers can offer a more predictable and faster optical response, at the cost of a more demanding analogue circuit. Neither sensor type directly measures the panel’s electrical maximum power point.

Threshold versus PID

A simple threshold controller moves a small angle only when normalised error exceeds a set limit. It is well suited to a slowly moving sun and a servo with backlash. A PID controller combines proportional error, accumulated error and error change, but noisy LDRs, clipped servo travel and intermittent clouds can cause integral wind-up and needless motion. Start with filtering, threshold control and movement intervals. Add PID only after measuring a control error that those simpler measures cannot meet.

[IMAGE: Optical sensor head close-up showing four LDRs, an opaque cross vane, four resistor dividers and named TL/TR/BL/BR positions] — ALT TEXT: “Four-LDR dual-axis solar tracker sensor array and shadow vane”

[IMAGE: Graph comparing ideal direct-beam cosine response with measured tracked and fixed panel power across a day, with measured curves left blank until field data are collected] — ALT TEXT: “Solar tracking energy test chart comparing fixed and tracked panel output”

Comparative Overview

Method Strength Limitation Best fit
Fixed tilt No motor energy or moving parts Direct-sun angle varies Durable reference and low-maintenance installation
Single-axis tracking Fewer actuators than two-axis Does not correct both angles Larger arrays where motion can repay its cost
Four-LDR dual-axis tracking Responds to local directional light Can chase clouds/reflections; mechanical complexity Instrumented small demonstrator

Full Components List

Prices are planning ranges, [VERIFY: current UK distributor listing] before publication or purchase. Servo torque, panel mass and power are deliberately left dependent on the actual selected parts.

Component Exact specification or selection criterion Approx. UK price Supplier Purpose
Controller Genuine Arduino Uno Rev3, 5 V logic £20–£30 [VERIFY] Farnell/RS Four analogue reads, two servo controls
Optical sensors Four matched through-hole CdS LDRs; select one stocked part and verify response £1–£5 set [VERIFY] Mouser/RS Directional illumination
Divider resistors Four 10 kΩ, 1%, 0.25 W £1–£2 set [VERIFY] RS/Farnell LDR voltage dividers
Servos Two low-voltage positional servos, torque and current to match weighed mechanism [VERIFY: servo datasheet] £8–£35 pair [VERIFY] Farnell/RS Azimuth and elevation positioning
Panel One small demonstrator PV panel; obtain a second matched unit £10–£30 pair [VERIFY] Mouser/RS Tracked and fixed energy measurements
Servo supply Regulated supply matching servo voltage and measured combined peak current [VERIFY: selected motors] £8–£20 [VERIFY] RS/Farnell Powers motors independently of Uno USB
Mechanical parts Low-mass pan/tilt bracket, shaft supports, stops, fasteners £10–£25 [VERIFY] RS/mechanical supplier Holds and limits panel motion
Prototype hardware Breadboard, jumpers, 100 nF bypass capacitors, suitable bulk reservoir [VERIFY: motor current] £5–£15 [VERIFY] RS/Farnell Low-voltage prototype
Measurement Two matched measurement channels or a meter and repeatable load [VERIFY: panel rating] £10–£35 [VERIFY] RS/Farnell Fair energy comparison

The Uno Rev3 pinout identifies A0–A3 and digital pins used here. These prices are not a purchasing quote.

Circuit Design and Schematic

Connect TL, TR, BL and BR divider junctions to A0, A1, A2 and A3 respectively. Each divider is LDR-to-5 V, 10 kΩ-to-ground. Connect azimuth servo signal to D9 and elevation servo signal to D10. Power the Uno by USB and the servos from their own rated supply; join the grounds at a defined return point. Never assume the Uno’s 5 V USB rail can deliver two servos’ peak current. Keep the PV panel electrically separate from the controller for initial tests; connecting it to a charger or load requires an independently designed power stage.

The sensor head should rotate with the panel. If it does not, its measured error ceases to represent panel alignment after movement. Put a 100 nF capacitor close to each board supply input and size a reservoir capacitor using the actual servo transient and supply impedance. Keep mechanical stop positions within programmed limits. D9 and D10 carry low-current control signals only; they are not motor supply outputs.

[IMAGE: Complete low-voltage schematic with four LDR/10 kΩ dividers to Uno A0–A3, two servo signals to D9/D10 and a separate servo supply sharing ground] — ALT TEXT: “Dual-axis solar tracker schematic with four LDR inputs and separate servo power”

PCB Layout Considerations

Place the four sensor dividers near a keyed sensor connector, identify TL/TR/BL/BR on silk and route their high-impedance analogue nodes away from servo power and signal traces. Keep a continuous ground reference for the analogue section and route motor return current away from the sensor junctions. A star-like connection at the supply entry helps prevent servo pulses from shifting the analogue reference. Bypass the controller and sensors locally; put bulk capacitance at the servo connector after measuring the supply dip.

Use traces and connectors rated for the selected servo current, not merely for nominal no-load current. Verify creepage where appropriate, cable strain relief and movement clearances. Put test points on each sensor junction, the regulated rail and ground. Label the servo supply polarity and never let a plug fit in reverse. Run electrical and mechanical design-rule checks before fabrication.

[IMAGE: Two-layer PCB concept highlighting quiet analogue sensor region, D9/D10 headers, separate servo power input and single defined ground return] — ALT TEXT: “Dual-axis solar tracker PCB layout separating sensor traces and servo current”

Step-by-Step Build Instructions

  1. Measure the structure. Weigh the panel, bracket and moving sensor head. Measure distance from each pivot to its centre of mass. Choose servos only after calculating required torque with margin and considering wind if used outdoors. This light tabletop frame is not a substitute for outdoor structural engineering.
  2. Build the sensor head. Arrange four LDRs symmetrically around an opaque cross vane. Number the positions before soldering. Inspect the shade height in direct light: each quadrant should be similarly lit when pointed at the source.
  3. Wire and validate dividers. Assemble one divider at a time. Use a multimeter to verify that covering an LDR reduces its analogue-junction voltage with the specified connection. Record individual bright and shaded ADC values for later adjustment.
  4. Build the frame. Fit azimuth and elevation pivots, check that neither cable winds around a shaft and add mechanical travel stops. Balance the moving assembly before attaching servos. A mechanically unbalanced panel can stall even when a demonstration seems to work briefly.
  5. Connect servo power. With power off, wire the external regulated servo supply and common ground. Double-check polarity. Attach servos to D9 and D10 signals. First test with the panel detached so an inverted control direction cannot drive a loaded frame into a stop.
  6. Upload firmware. Select Uno Rev3 in the IDE and upload the sketch. Cover the left pair; after the next control interval the servo should move toward the brighter side. If it moves away, invert the relevant AZ_SIGN or EL_SIGN constant, not the sensor wiring at random.
  7. Mount and align. Set both axes near mid-travel before fitting the panel. Adjust programmed limits within measured mechanical travel. Run a brief light-source test without pointing the sensor at a mirror or exposing parts to unwanted heat.
  8. Make a fair reference. Mount a second matched panel nearby in fixed tilt with the same shading conditions and matched electrical measurement arrangement. Record time, weather and both panel energies over repeated sessions.

[IMAGE: Breadboard prototype beside the pan/tilt frame, showing individual labelled A0–A3 sensor leads and an external servo supply] — ALT TEXT: “Breadboard prototype of a four-LDR Arduino solar tracking controller”

Firmware and Code Walkthrough

This full sketch deliberately uses a threshold rather than PID. AZ_SIGN and EL_SIGN encode mechanical orientation; reverse one after the unloaded direction test if necessary. The servo angle bounds are example software stops and must be adjusted to the measured mechanism before attaching a panel.

#include <Servo.h>

Servo az, el;
const byte sensorPin[4] = {A0, A1, A2, A3}; // TL, TR, BL, BR
const byte AZ_PIN = 9, EL_PIN = 10;
const int AZ_SIGN = 1, EL_SIGN = 1; // verify on unloaded frame
const int AZ_MIN = 35, AZ_MAX = 145; // VERIFY: physical travel
const int EL_MIN = 45, EL_MAX = 135; // VERIFY: physical travel
const float DEADBAND = 0.07;        // tune from measured sensor noise
const int MIN_LIGHT = 100;          // ADC units; tune on site
int azAngle = 90, elAngle = 90;
float filtered[4] = {0, 0, 0, 0};
unsigned long nextSample = 0;

void setup() {
  Serial.begin(115200);
  az.attach(AZ_PIN); el.attach(EL_PIN);
  az.write(azAngle); el.write(elAngle);
  for (byte i = 0; i < 4; i++) filtered[i] = analogRead(sensorPin[i]);
}

void loop() {
  if (millis() < nextSample) return;
  nextSample = millis() + 500;

  for (byte i = 0; i < 4; i++)
    filtered[i] = 0.75f * filtered[i] + 0.25f * analogRead(sensorPin[i]);

  float top = filtered[0] + filtered[1];
  float bottom = filtered[2] + filtered[3];
  float left = filtered[0] + filtered[2];
  float right = filtered[1] + filtered[3];
  float total = top + bottom;
  if (total < MIN_LIGHT * 4.0f) return; // do not hunt at night

  float azError = (right - left) / total;
  float elError = (top - bottom) / total;
  if (abs(azError) > DEADBAND) {
    azAngle = constrain(azAngle + AZ_SIGN * (azError > 0 ? 1 : -1),
                        AZ_MIN, AZ_MAX);
    az.write(azAngle);
  }
  if (abs(elError) > DEADBAND) {
    elAngle = constrain(elAngle + EL_SIGN * (elError > 0 ? 1 : -1),
                        EL_MIN, EL_MAX);
    el.write(elAngle);
  }
  Serial.print(azError, 3); Serial.print(',');
  Serial.print(elError, 3); Serial.print(',');
  Serial.print(azAngle); Serial.print(','); Serial.println(elAngle);
}

The first loop filters each ADC reading with an exponential average: 75% previous reading and 25% new reading. The sum of readings estimates overall light; the normalised differences represent directional imbalance. Dark conditions suspend movement. A one-degree correction no more than once per 500 ms limits chasing. Servo write commands request positions, not measured angles: ordinary hobby servos do not return absolute panel position to the Uno. If their shafts slip, this controller cannot detect it. Serial output supports debugging and setting the deadband from observed error noise.

Testing and Calibration

Begin indoors with unloaded axes and a diffuse lamp. Record four readings with the sensor square to the lamp and determine offsets caused by LDR mismatch. Swap LDRs or add software per-channel calibration if the centre error is large. Test each axis separately and invert its sign when the motion is away from light. Check both mechanical extremes, current draw while moving and supply voltage at the servo connector during a brief move.

Outside, log tracked-panel voltage and current simultaneously with those of the fixed reference. A voltage-only comparison is invalid because two panels can have similar open-circuit voltage at very different power. Use consistent loads or calibrated power measurements, integrate watts over time into watt-hours and also integrate tracker-controller and actuator power. Repeat on clear and overcast days, swap panel positions to expose mismatch and report weather, latitude, season, orientation and intervals. State whether the result is gross PV energy or net system energy.

[IMAGE: Outdoor calibration photograph of both matched panels and a logger showing separate electrical-energy channels and actuator supply current] — ALT TEXT: “Dual-axis solar tracker calibration against a fixed panel with energy logging”

Safety Considerations

Use only a small, low-voltage demonstration panel and an appropriate regulated servo supply. Do not connect a PV panel directly to a rechargeable battery without a designed charging system. Limit pinch points at the pan/tilt joint, restrain long hair and loose cables, and disconnect power before adjusting gears or mounts. An outdoor frame needs weatherproofing, stable anchoring and wind assessment; a hobby-servo breadboard is not a rooftop or unattended wind-rated mount. Check the selected panel and servo datasheets before applying power.

Troubleshooting

Failure Cause to test Fix
Tracks away from lamp Axis sign or LDR ordering reversed Test unloaded; correct AZ_SIGN or EL_SIGN
Oscillates at centre Sensor mismatch, noise, deadband too small Inspect serial error; match sensors and increase deadband
Resets on movement Servo current collapses controller supply Independent rated servo supply, common ground, inspect transient voltage
Stops at one extreme Mechanical bind or software angle limit Detach linkage, inspect stops, reset measured bounds
Hunts on cloudy day Directional readings follow bright cloud edges Longer filtering, minimum-light rule or sun-position hybrid
Good voltage, poor energy Open-circuit voltage mistaken for power Log voltage and current under equivalent loads
Servo becomes hot Torque inadequate or linkage unbalanced Rebalance, reduce load and select a rated actuator

Performance Results: What to Expect and Measure

No measured gain is claimed for this design. The control loop requests at most a one-degree step per 500 ms when error exceeds 0.07; those are software settings, not measured pointing precision. Servo backlash, LDR matching and shade geometry determine actual accuracy [VERIFY: measured pointing error on assembled tracker]. Day-long gross energy gain against fixed tilt [VERIFY: paired-panel field trial]; net benefit after subtracting motor and electronics energy [VERIFY: power-log integration]. Runtime, movement count and peak servo current [VERIFY: selected hardware and measured log].

Report the NREL single-axis comparison only as literature context, not a predicted dual-axis yield. A ten-minute torch test cannot establish a seasonal energy gain. Even if tracked PV output rises, project cost and maintenance may outweigh that gain at small scale.

Upgrades and Variations

Replace LDRs with matched photodiodes and analogue front ends when controlled spectral response matters. Add real azimuth/elevation encoders to close the loop around panel position rather than relying on servo commands. A hybrid tracker uses calculated sun position during cloud cover and optical feedback during clear intervals. For larger panels, replace hobby servos with actuators sized for actual static and wind loads, add limit switches and a safe stow state, and seek qualified structural and electrical design.

For energy research, measure panel temperature, irradiance and both PV channels, and store raw samples rather than only a headline percentage. An MPPT controller changes electrical operating point independently of physical tracking and needs its own controlled comparison. Consider whether a fixed extra panel provides more net energy per pound than mechanical tracking.

[IMAGE: Finished small tracker and fixed-reference panel with sensor cross, protected cabling and labelled measurement connections] — ALT TEXT: “Finished autonomous dual-axis solar tracking system and fixed reference panel”

FAQ

Does a dual-axis solar tracker always generate more usable electricity?

No. It may capture more panel energy in direct sun, but motors and electronics consume energy and clouds reduce the directional advantage. Measure net watt-hours against a matched fixed panel before claiming an improvement.

Why use four LDRs instead of a single light sensor?

One sensor measures brightness without indicating which direction to turn. Four sensors separated by a shade form two differential direction measurements, although mismatched sensors need calibration.

Are photodiodes better than LDRs for solar tracking?

Photodiodes respond faster and can be more consistent when paired with a suitable analogue circuit. A slow sun-tracking demonstrator rarely needs that speed, so LDRs are often easier for a first build.

Is PID control necessary?

Usually not for a slow, backlash-prone hobby mechanism. Start with filtered error, a deadband, limited step size and a measured movement interval; add PID only if testing exposes a need.

Can the servo be powered from the Arduino 5 V header?

Do not assume so. Select an external regulated supply from the motors’ measured or specified peak current and join its ground to the Uno signal ground.

How do I prove the claimed efficiency gain?

Use two matched panels, comparable loads, simultaneous voltage-and-current logging and repeated full-day tests. Report both gross panel-energy difference and net difference after tracker consumption.

Conclusion

A useful dual-axis solar tracking system measures more than light direction. Build a balanced mechanism, filter and normalise the sensor readings, verify movement direction and compare net energy with a matched fixed reference. The result will tell you whether the extra complexity is justified at your location. For the next stage, read our first PCB design guide or contact PCB Electronics about a robust controller PCB and prototype.