Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Solar Panel Efficiency Monitoring System with Current, Voltage, Light, and Temperature Sensors

View and Edit Project In Cirkit DesignerImage of Arduino UNO Solar Panel Efficiency Monitoring System with Current, Voltage, Light, and Temperature Sensors

Solar Panel Efficiency Monitoring System

Summary

This circuit is designed to monitor the efficiency of a solar panel by measuring voltage, current, light intensity, and temperature. The data is collected using various sensors and processed by an Arduino UNO microcontroller. The results are displayed on the serial monitor.

Component List

Arduino UNO

ACS712 Current Sensor 5A 20A 30A

Photocell (LDR)

Resistor (10k Ohms)

Voltage Sensor

Solar Panel

DS18B20 1-Wire Temperature Sensor Probe Cable

Resistor (4.7k Ohms)

Wiring Details

Arduino UNO

ACS712 Current Sensor 5A 20A 30A

Photocell (LDR)

Resistor (10k Ohms)

Voltage Sensor

Solar Panel

DS18B20 1-Wire Temperature Sensor Probe Cable

Resistor (4.7k Ohms)

Code Documentation

#include <SPI.h>
#include <SD.h>
#include <OneWire.h>
#include <DallasTemperature.h>

// Pin Definitions
#define VOLTAGE_PIN A0  // Voltage Sensor output
#define CURRENT_PIN A1  // Current Sensor output
#define LDR_PIN A2      // Light Sensor (LDR)
#define DS18B20_PIN 2   // DS18B20 Data Pin

// Initialize DS18B20
OneWire oneWire(DS18B20_PIN);
DallasTemperature sensors(&oneWire);

// Sensor Calibration Values
float voltageDividerRatio = 5.0;        // Voltage sensor divides input by 5
float analogResolution = 5.0 / 1023.0; // Arduino ADC resolution (5V system)
float currentOffset = 2.5;             // ACS712 outputs ~2.5V for 0A
float currentSensitivity = 0.185;      // ACS712 sensitivity for 5A version (in V/A)

File dataFile;

void setup() {
  Serial.begin(9600);
  sensors.begin(); // Initialize DS18B20
  Serial.println("Solar Panel Efficiency Monitoring Started");
}

void loop() {
  // Measure Voltage
  int voltageRaw = analogRead(VOLTAGE_PIN);
  float voltage = (voltageRaw * analogResolution) * voltageDividerRatio;

  // Measure Current
  int currentRaw = analogRead(CURRENT_PIN);
  float currentVoltage = currentRaw * analogResolution;
  float current = (currentVoltage - currentOffset) / currentSensitivity;

  // Calculate Power
  float power = voltage * current;

  // Measure Light Intensity
  int lightIntensity = analogRead(LDR_PIN);

  // Measure Temperature (DS18B20)
  sensors.requestTemperatures();
  float temperature = sensors.getTempCByIndex(0);

  // Print data to Serial Monitor
  Serial.print("Voltage (V): ");
  Serial.print(voltage);
  Serial.print("\tCurrent (A): ");
  Serial.print(current);
  Serial.print("\tPower (W): ");
  Serial.print(power);
  Serial.print("\tLight Intensity: ");
  Serial.print(lightIntensity);
  Serial.print("\tTemperature (C): ");
  Serial.println(temperature);

  // Delay before next reading
  delay(5000); // 5 seconds
}

This code initializes the sensors and reads data from the voltage sensor, current sensor, light sensor, and temperature sensor. The data is then printed to the serial monitor every 5 seconds.