Project in progress
Pyranometer

Pyranometer © GPL3+

Like a real pyranometer, realize a measurement of sun power.

  • 2,686 views
  • 4 comments
  • 16 respects

Components and supplies

Necessary tools and machines

About this project

As describe in the website 'Bricolsec,' we use the diode's thermal feature to establish a really accurate sensor. We kept and reproduced the same approach with two small copper squares black placed on a hot diode balanced with a reference diode hidden and protected from sun light.

The most important thing is always to define correctly the casing to be compatible with the outdoor conditions. So we define a design close to a professional sensor and be focused on the following points:

  • find a polycarbonate dome to avoid opacity deviation
  • improve reference inertia => create a concrete space to hold the reference diode
  • still provide so enough place to handle silica gel packet and reduce condensation*

*Condensation is a real issue, not for the electrical system really simple but to the optical filtration apply to the light. A professional sensor use a double skin to avoid this...

A first correlation's been done with the first design and was really good. The deviation in lower insulation level can be assigned to a bad inertia over the reference diode. It's precisely why we decided in the final design to implement a plug with a concrete cylinder to handle this component. (that mean, we don't have new correlation)

This final configuration (second design) is running for one year now and the sun power analysis is really interesting. In the following you could appreciate the sun diagram.

The sketch is really simple, it's just an analog conversion (with a ponderation from past consistent test) and an average measurement recorded each 10mn but refresh each second.

The main difficulty concern the electrical shield with voltage and current regulator, follower, converter / subtractor... I used a full Mega proto shield to realize this as describe in the following:

Code

SunPowerOnly.inoArduino
Code extracted from the main program of my weather station. Building successful but could hold some useless lines
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#define DS1307_I2C_ADDRESS 0x68
#define dataPin  5
#define clockPin 4

volatile int top, top60, top10, Count_Rain, topD;
volatile float SunPower, SunPowerInt, varCompteur;

float SunPowerAvg, temperature, humidity, dewpoint, pressure,SunPowerMin, SunPowerMax, voltage, angle;
const int chipSelect = 10, LedOnTimeRTC = 20, LedOnTimeWIND = 10;
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
String File_record = "Test341A", Dir;

//------------------------------------------------------------------------------------------------------------------------
void setup ()
{
  Serial.begin(9600);
 
  Serial.print("Version: "); Serial.println(File_record);
  Serial.println("Initializing SD card...");
  if (!SD.begin(chipSelect)) {Serial.println("Card failed, or not present");return;}
  Serial.println("card initialized.");
  
  File dataFile = SD.open(File_record, FILE_WRITE); 
  if (dataFile) { dataFile.println("Date ; Heure ; Max Speed ; Average speed ; Rafale ; Direction ; SunPowerAvg; SunPowerMin; SunPowerMax; Rain Level; Temperature ; Humidity ; Dewpoint; Pressure; Lux Avg; Lux Min; Lux Max; Index_day; Index_Hour; glitch; AvgWSFS; MxWSFS; altFOV10; tObjetFOV10; AmbientFOV10; MaxtObjetFOV10; altFOV90; tObjetFOV90; AmbienFOV90; MaxtObjetFOV90; Version; File"); dataFile.close();}  
    

  attachInterrupt (digitalPinToInterrupt(18), Flash_RTC , RISING );    // SQW RTC

  
  Wire.begin();                     // Join i2c bus for TSL2561 , MPL3115A2 & DS1307
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.write(0x07);
  Wire.write(0x10);
  Wire.endTransmission();

  TCCR3A = 0b00000001;
  TCCR3B = 0b00000001; //no prescaling => period 1micro-s    
  TIFR3  = 0b00000001;   


  // Delai de synchronisation sur la minute pleine------------------------------------------------------------------------
  
  do {getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year); top = -1;} while(second  != 0);

  top10 = 0 ;
  top60 = 0 ;

} 

//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
// BOUCLE PRINCIPALE
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
void loop ()
{ 
 
  if (bitRead (TIFR3, 0) == 1) {bitSet (TIFR3, TOV3) ; varCompteur++ ;}
  
  SunPower = (analogRead(A1) * (5.0 / 1023.0)) * 698;
  
  if ( top == 600 ) 
  {
  getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);
  Serial.print(minute);Serial.print(":");Serial.println(second);
  SunPowerAvg = SunPowerInt / 600;
  RECORD(); 
  }
  
}


void Flash_RTC ()
{
  
  top = top + 1;
  top60 = top60 + 1;
  top10 = top10 +1;
  
  SunPowerInt = SunPowerInt + SunPower;
  if (SunPower > SunPowerMax) {SunPowerMax = SunPower;} else {SunPowerMax = SunPowerMax;}
  if (SunPower < SunPowerMin) {SunPowerMin = SunPower;} else {SunPowerMin = SunPowerMin;}
      
}


byte bcdToDec(byte val) 
{ return ( (val/16*10) + (val%16) );}

void getDateDs1307(byte *second,byte *minute,byte *hour,byte *dayOfWeek,byte *dayOfMonth,byte *month,byte *year) //---
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.write(0);
  Wire.endTransmission();
  Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

  *second     = (bcdToDec(Wire.read() & 0x7f));
  *minute     = (bcdToDec(Wire.read()));
  *hour       = (bcdToDec(Wire.read() & 0x3f));  // Need to change this if 12 hour am/pm
  *dayOfWeek  = bcdToDec(Wire.read());
  *dayOfMonth = bcdToDec(Wire.read());
  *month      = bcdToDec(Wire.read());
  *year       = bcdToDec(Wire.read());
}


void RECORD()

{
    File dataFile = SD.open(File_record, FILE_WRITE); 
  
  Serial.print(hour);Serial.print(":");Serial.print(minute);Serial.print(":");Serial.print(second);Serial.print(" <> ");
  Serial.print(SunPowerAvg);Serial.print(" <> ");
  Serial.print(SunPowerMin);Serial.print(" <> ");
  Serial.print(SunPowerMax);Serial.print(" <> ");
  Serial.println(File_record); 
    
    if (dataFile) 
    {              
      dataFile.print(dayOfMonth);dataFile.print("/");dataFile.print(month);dataFile.print("/");dataFile.print(year);dataFile.print(" ; ");             
      dataFile.print(hour);dataFile.print(":");dataFile.print(minute);dataFile.print(":");dataFile.print(second);dataFile.print(" ; ");
      dataFile.print(SunPowerAvg,0) ;dataFile.print(" ; ");
      dataFile.print(SunPowerMin,0) ;dataFile.print(" ; ");
      dataFile.print(SunPowerMax,0) ;dataFile.print(" ; ");
      dataFile.println(File_record );dataFile.close(); 
    }

 
}

Custom parts and enclosures

Technical Drawing
All parts are PLA 3D printing

Schematics

Electrical Diagram
56009156 396rcplbji

Comments

Similar projects you might like

Playing With Nextion Display

Project tutorial by Alexander

  • 3,642 views
  • 0 comments
  • 11 respects

Ceilometer

Project in progress by KFMAKR

  • 79 views
  • 1 comment
  • 1 respect

Air Surfer

Project tutorial by Anton

  • 30,619 views
  • 27 comments
  • 157 respects

Huge LED Christmas Lights

Project showcase by Savva Osipov

  • 11,363 views
  • 2 comments
  • 34 respects

Arduino Controlled Smart Hydroponic Modular System

Project in progress by Luis Antonio Martin Nuez

  • 9,215 views
  • 2 comments
  • 62 respects

Arduino Based Weather Station with Remote Sensor Unit

Project showcase by antiElectron

  • 10,008 views
  • 7 comments
  • 46 respects
Add projectSign up / Login