Projects / Single-axis solar tracker

Single-axis solar tracker

Intermediate1.5 hGuided buildReviewed

Build it step by step

0 of 5 done
  1. NANOSOLAR690 lux

    Build the sensor head

    Fix the two LDRs on the panel's edge with a small card wall between them, so the wall shades one LDR when the sun is off to one side.

  2. NANO691 lux

    Wire the LDRs

    Each LDR from 5V to its pin (A0 east, A1 west), with 10 kΩ from the pin to GND.

  3. NANO71°SOLAR

    Mount the panel

    Fix the panel on the servo horn with a light bracket, axis running north-south.

  4. NANO71°SOLAR

    Wire the servo and panel

    Servo on D9 from the AA pack with the 470 µF. Panel through the 10 k / 10 k divider to A2.

  5. NANO

    Test with a torch

    Indoors, shine a torch from one side and watch it turn. Then test outside in the morning.

In short

How do you build a single-axis solar tracker?

Two LDRs on either side of a divider compare light, and a servo tilts a small solar panel east or west to face the sun. You need Arduino Nano, LDR Photoresistor × 2, Resistor 10 kΩ × 4, MG996R metal gear servo, Solar panel 6 V 1 W, Battery holder 4 × AA with switch, AA alkaline battery × 4, Electrolytic capacitor 470 µF and Jumper wires male to male (40 pcs, 20 cm). It takes 5 steps and about 90 minutes.

Level
Intermediate
Time
About 90 min
Parts
9

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
East LDRNano 5V to A0, with 10 kΩ from A0 to GNDEast light reading
West LDRNano 5V to A1, with 10 kΩ from A1 to GNDWest light reading
Panel +10 kΩ to A2, 10 kΩ from A2 to GNDPanel voltage halved (max 3.5 V at A2)
Panel −Nano GNDShared ground
Servo signalNano D9Tilt
Servo red / brown4 × AA + / −, 470 µF acrossServo power, minus to Nano GND

Code

Arduino IDE, board "Arduino Nano". Servo library is built in.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

#include <Servo.h>

Servo tilt;
int angle = 90;
const int DEAD = 25;                     // ignore small differences

void setup() { tilt.attach(9); tilt.write(angle); Serial.begin(9600); }

void loop() {
  int east = analogRead(A0), west = analogRead(A1);
  int diff = east - west;
  if (diff > DEAD && angle > 15) angle--;          // more light in the east: turn east
  else if (diff < -DEAD && angle < 165) angle++;
  tilt.write(angle);
  float panel = analogRead(A2) * 5.0 / 1023 * 2;   // undo the divider
  Serial.print("E="); Serial.print(east); Serial.print(" W="); Serial.print(west);
  Serial.print(" angle="); Serial.print(angle); Serial.print(" panel="); Serial.print(panel, 2); Serial.println(" V");
  delay(50);
}

What the serial monitor should show

Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.

E=512 W=513 angle=90 panel=5.00 V
E=512 W=512 angle=90 panel=5.00 V
E=512 W=511 angle=90 panel=5.00 V
E=511 W=511 angle=90 panel=5.00 V
E=512 W=511 angle=90 panel=5.00 V
E=512 W=512 angle=90 panel=5.01 V

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Torch from the east sidePanel turns towards the torch until E and W are within 25
Even lightNo movement
Panel voltage facing the sun vs fixed flatHigher when tracking, especially in the morning and late afternoon

If it does not work

Turns away from the light

Swap the A0 and A1 wires, or swap angle-- and angle++.

Hunts back and forth

Raise DEAD to 40, or make the shade wall taller.

Servo too weak in wind

Use a lighter panel and a balanced mount, or a geared motor.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the single-axis solar tracker?

Arduino Nano, LDR Photoresistor × 2, Resistor 10 kΩ × 4, MG996R metal gear servo, Solar panel 6 V 1 W, Battery holder 4 × AA with switch, AA alkaline battery × 4, Electrolytic capacitor 470 µF and Jumper wires male to male (40 pcs, 20 cm). Resistor 10 kΩ × 4: Two for the LDRs, two for the panel divider. MG996R metal gear servo: Strong enough for a small panel.

How long does the single-axis solar tracker take to build?

About 90 minutes for a intermediate maker, in 5 steps.

How do I know the single-axis solar tracker works?

Torch from the east side: Panel turns towards the torch until E and W are within 25. Even light: No movement. Panel voltage facing the sun vs fixed flat: Higher when tracking, especially in the morning and late afternoon.

Turns away from the light: what should I check?

Swap the A0 and A1 wires, or swap angle-- and angle++.

Hunts back and forth: what should I check?

Raise DEAD to 40, or make the shade wall taller.

Servo too weak in wind: what should I check?

Use a lighter panel and a balanced mount, or a geared motor.