Automatic Solar Lighting

Published: July 27, 2026

This Year 2 team engineering project involved designing, building, and testing a self-contained outdoor lighting system powered by solar energy. The system generates energy during the day, stores it in a rechargeable battery, and automatically provides lighting when ambient light falls.

The complete design brings together photovoltaic generation, battery charging and protection, voltage regulation, Arduino-based sensing, load switching, and an outdoor enclosure. It was developed as a practical proof-of-concept for pathway, garden, and off-grid lighting applications.

My role: Systems & Electronics Lead. My work focused on circuit design, engineering calculations, electronic component integration, and connecting the theoretical system design to the physical hardware.


📸 Preview


⚙️ System Overview

The project was developed in two connected stages: a full 12V outdoor lighting system and a compact Arduino, LDR, and NeoPixel demonstrator used to refine the sensing and gradual-brightness control. The sections below explain how each stage contributed to the final prototype.

Full Outdoor Lighting Design

  1. A 20W photovoltaic panel converts sunlight into DC electrical energy.
  2. A 10A PWM solar charge controller regulates the panel output and charges the 12V battery safely.
  3. The battery supplies the 12V lighting load and also feeds an LM2596 buck converter.
  4. The buck converter steps the battery voltage down to a regulated 5V supply for the Arduino Nano and sensing electronics.
  5. An LDR module measures ambient light and sends an analogue signal to the Arduino.
  6. The Arduino applies the control logic and drives a logic-level N-channel MOSFET, keeping the high-current lighting load away from the microcontroller.
  7. During dusk and dawn, PWM control allows the light output to change gradually instead of switching abruptly.

Arduino Control Demonstrator


🧰 Full System Components

ComponentSpecificationPurpose
Photovoltaic panel20W, 12V nominalGenerates electrical energy from daylight
Solar charge controller10A PWMRegulates charging and protects the battery from overcharge
Prototype battery12V, 7Ah sealed lead-acidStores energy for night-time operation
Arduino Nano5V microcontrollerReads the sensor and executes the automatic lighting logic
LM2596 buck converter12V to regulated 5VProvides a safe supply for the Arduino and sensing circuit
LDR sensor moduleAnalogue outputMeasures ambient light for day/night detection
N-channel MOSFETLogic-level, low-side switchAllows the Arduino to control the higher-current lighting load
LED floodlight10W, 12-24V DCProvides the main outdoor illumination
Outdoor enclosureIP65 with cable glandsProtects the electronics from dust and water ingress

The engineering calculations initially identified a 20Ah SLA battery for greater autonomy. A smaller 7Ah battery was selected for the scaled prototype because of cost, size, and component availability.


🔌 Wiring and Interconnections

Outdoor System

FromToPurpose
Solar panelSolar charge controller inputTransfers generated solar energy
Charge controller12V batteryProvides regulated battery charging
12V batteryLM2596 inputSupplies the control-power regulator
LM2596 regulated outputArduino Nano 5V supplyPowers the microcontroller and sensing circuit
LDR analogue outputArduino analogue inputProvides the ambient-light reading
Arduino control outputMOSFET gateControls the lighting load using PWM
Battery, MOSFET stage, and LED12V lighting circuitDelivers switched power to the floodlight

Control Demonstrator Pin Mapping

ConnectionArduino Pin
12-pixel NeoPixel data inputD6
LDR analogue signalA0

Critical connections were soldered and insulated with heat-shrink tubing. Terminal blocks were used where appropriate, and 22 AWG wiring was selected for the low-voltage prototype. Power, control, and load wiring were routed separately inside the enclosure to simplify testing and maintenance.


🛠 Build Process

  1. Design and sizing: The team calculated the lighting demand, battery capacity, and solar-panel requirement before selecting practical prototype components.
  2. Control prototyping: The Arduino, LDR, and switching circuit were tested on a breadboard before being connected to the final power hardware.
  3. Power assembly: The panel, charge controller, battery, and LM2596 regulator were connected and checked independently.
  4. Voltage calibration: The LM2596 output was adjusted and verified with a multimeter before the Arduino was connected.
  5. Permanent integration: The control electronics were soldered, insulated, and connected to the lighting stage.
  6. Outdoor assembly: The electronics were installed in an IP65 enclosure with waterproof cable glands and an externally positioned LDR.

✅ Testing and Results

TestMeasured ResultOutcome
Solar chargingBattery increased from approximately 12.2V to 13.5-14.0V; sustained charging was approximately 13.8VCharge controller operated within the expected SLA charging range
Night-time runtimeApproximately 6-8 hours, averaging about 6.6 hours across seven nightsMet the scaled prototype target
Day/night switchingApproximately 4.5V in bright light, 0.45V in low light, and a 2.5V transition regionStable automatic switching after threshold tuning
Lighting outputStable brightness with no visible flicker during the runtime testPower delivery and switching remained stable
Outdoor enclosureNo internal moisture, condensation, cable damage, or visible degradation during winter testingIP65 enclosure and cable sealing passed the test

Initial false triggering from brief shadows was reduced by refining the light threshold, adding a short control delay, and improving the physical position of the sensor.


📦 Library

LibraryPurpose
Adafruit NeoPixelControls the 12 addressable LEDs

🧾 Arduino Control Code

This compact control sketch demonstrates how the LDR reading is converted into a smooth brightness level for the 12-pixel NeoPixel light. The full outdoor system uses the same sensing principle with a MOSFET switching stage for its 12V lighting load.

#include <Adafruit_NeoPixel.h>

#define LED_PIN 6
#define NUM_LEDS 12
#define LDR_PIN A0

Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

int currentBrightness = 0;

void setup() {
  strip.begin();
  strip.show();
  Serial.begin(9600);
}

void loop() {
  int ldrValue = analogRead(LDR_PIN);
  Serial.println(ldrValue);

  int targetBrightness = map(ldrValue, 500, 1000, 0, 255);
  targetBrightness = constrain(targetBrightness, 0, 255);

  if (currentBrightness < targetBrightness) {
    currentBrightness += 3;
  } else if (currentBrightness > targetBrightness) {
    currentBrightness -= 3;
  }

  strip.setBrightness(currentBrightness);

  for (int i = 0; i < NUM_LEDS; i++) {
    strip.setPixelColor(i, strip.Color(255, 255, 255));
  }

  strip.show();
  delay(30);
}

👤 My Contribution

As Systems & Electronics Lead, I was responsible for designing and integrating the circuit components, supporting the engineering calculations, and helping translate the planned architecture into a working physical system. This included:

The software and wider project work were completed collaboratively, with responsibilities shared across the team.


⚠️ Challenges and Safety


📝 Limitations and Future Improvements

← Back to Projects