walkingnewbieteddyyoonie
Created June 20, 2022 © GPL3+

Compare irradiance performance of solar panels

This project provides a simple method to compare irradiance performance of solar panels using a simple resistor circuit.

BeginnerFull instructions provided58
Compare irradiance performance of solar panels

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Resistor 10k ohm
Resistor 10k ohm
×4
Resistor 22 ohm 1/2 W
×4
Solar Panel 60x60 5.5V 80mA
×4
Micro SD TF Card Adater Reader Module 6Pin SPI Interface
×1
Breadboard (generic)
Breadboard (generic)
×1

Story

Read more

Schematics

Schematic of connection

Code

Solar Panel Irradiance Comparison

Arduino
/*
  Measure solar panel irradiance and save to an SD card.
  
  Get approximated solar irradiance by measuring voltage across s small resistor.
	https://forum.arduino.cc/t/using-small-solar-panel-to-measure-irradiance/550371/7
  
  Solar panel terminals to Arduino:
  analog in A0 -- panel 1
  analog in A1 -- panel 2
  analog in A3 -- panel 3
  analog in A4 -- panel 4

  SD card pins to Arduino:
  VCC - 5V
  GND - GND
  MISO - Digital 12
  MOSI - Digital 11
  SDK - Digital 13
  CS - Digital 10
  
*/

#include <SPI.h>
#include <SD.h>
#include <Wire.h>

int analogPin1 = A0;  //solar panel #1
int analogPin2 = A1;  //solar panel #2
int analogPin3 = A2;  //solar panel #3
int analogPin4 = A3;  //solar panel #4
                    
int val = 0;  // variable to store the value read

File myFile;

void setup() {
  Serial.begin(9600);           //  setup serial
  
  Serial.print("Initializing SD card...");
  if (!SD.begin(10)) {
    Serial.println("initialization failed!");
    while (1);
  }
}

void loop() {
  analogReference(DEFAULT);
  
  save_panel_data(); // Call save_panle_data() function

  delay(60000 * 2); // measurement interval
}

void save_panel_data() {
  myFile = SD.open("data.txt", FILE_WRITE);
  
  val = analogRead(analogPin1);  // read the input pin
  Serial.print(val); 
  myFile.print(val);
  myFile.print(",");
  Serial.print(","); 
  delay(100);
  
  val = analogRead(analogPin2);  // read the input pin
  Serial.print(val); 
  myFile.print(val);
  myFile.print(",");
  Serial.print(","); 
  delay(100);
  
  val = analogRead(analogPin3);  // read the input pin
  Serial.print(val); 
  myFile.print(val);
  myFile.print(",");
  Serial.print(",");   
  delay(100);
  
  val = analogRead(analogPin4);  // read the input pin
  Serial.println(val); 
  myFile.println(val);
  
  myFile.close();
}

Credits

walkingnewbie
2 projects • 2 followers
Contact
teddyyoonie
3 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.