Project in progress
Pyranometer

Pyranometer © GPL3+

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

  • 5,977 views
  • 4 comments
  • 18 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

Author

Default
KFMAKR
  • 2 projects
  • 13 followers

Additional contributors

Published on

January 4, 2019

Members who respect this project

MicrometDevrematikPhotoUploads2ftmp2fd43ef12e dbf0 4ec8 93a0 30b5095fbcde2fwp 20170305 11 53 37 rich 987tw7mociAdrianojpnFtollesonChamuko72Hyperchiicken logov4 2vlyxrhptd

and 10 others

See similar projects
you might like

Similar projects you might like

Ceilometer

Project in progress by KFMAKR

  • 3,481 views
  • 13 comments
  • 29 respects

Arduino Based Weather Station with Remote Sensor Unit

Project showcase by antiElectron

  • 12,748 views
  • 7 comments
  • 51 respects

LAN WeatherStation with Web Interface and PHP/MySQL Backend

Project showcase by Ross

  • 5,083 views
  • 6 comments
  • 24 respects

Personal Weather Station (Arduino+ ESP8266 + Thingspeak)

Project tutorial by Jayraj Desai

  • 71,443 views
  • 34 comments
  • 141 respects

Rube Goldberg Weather Station with Internet Data Storage

Project in progress by randtekk

  • 10,562 views
  • 7 comments
  • 48 respects

Playing With Nextion Display

Project tutorial by Alexander

  • 7,086 views
  • 0 comments
  • 16 respects
Add projectSign up / Login