AquaticTechTank.net

A forum dedicated to design and program aquatic tanks
It is currently Wed Jan 17, 2018 4:02 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: DIY PAR meter
PostPosted: Tue Feb 12, 2013 12:19 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
Oh, I don't think we mentioned this but O2Surplus build in aFTDI connection into the meter. You can get a usb/ftdi adaptor and read the values from your computer or you favorite microcontroller.


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Tue Mar 05, 2013 2:07 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
Here are app made with processing to read serial output. Note that the baud is for 9600, where the latest code is for 115200. Change where appropriate. Someone over at TPT were looking for the files so I'm putting it here for now. I'll attach the exported apps and library here as well.

Image
Image
Processing code
Code:

import processing.serial.*;
import controlP5.*;

ControlP5 controlP5;
PFont font;
ListBox l;

Serial myPort;  // Create object from Serial class
String value;      // Data received from the serial port
String tempv;
public static final char CR = 13;     // ASCII linefeed

void setup()
{
  size(700, 700);
  // I know that the first port in the serial list on my mac
  // is always my  FTDI adaptor, so I open Serial.list()[0].
  // On Windows machines, this generally opens COM1.
  // Open whatever port is the one you're using.
  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 9600);
 
  font = createFont("Arial", 200, true);
  textFont(font);
 
  ///setup list
   controlP5 = new ControlP5(this);
  l = controlP5.addListBox("myList",5,20,200,120);
  l.setItemHeight(15);
  l.setBarHeight(15);

  l.captionLabel().toUpperCase(true);
  l.captionLabel().set("Serial/USB ports");
  l.captionLabel().style().marginTop = 3;
  l.valueLabel().style().marginTop = 3; // the +/- sign
  //l.setBackgroundColor(color(100,0,0));
  for(int i=0;i<Serial.list().length;i++) {
    l.addItem(Serial.list()[i],i);
  }
  l.setColorBackground(color(255,128));
  l.setColorActive(color(0,0,255,128));
 
  value = "\n\r";
  tempv = "\n\r";
}

void draw()
{
  background(30,70,30);
  if ( myPort.available() > 0) {  // If data is available,
    char val = char(myPort.read());         // read it and store it in val
    if(val == CR) {
       value = tempv;
       tempv = "";
    } else {
       tempv += val;
    }
  }
 
   textAlign(CENTER);
   fill(200);
   textSize(200);
   text(value, 350, 100);
   
   textAlign(LEFT);
   fill(200);
   textSize(10);
   text("The default port is the first on the list. Choose another port if you know what you're doing.", 220, 9,150,500);
   
       
 
}


void controlEvent(ControlEvent theEvent) {
  // ListBox is if type ControlGroup.
  // 1 controlEvent will be executed, where the event
  // originates from a ControlGroup. therefore
  // you need to check the Event with
  // if (theEvent.isGroup())
  // to avoid an error message from controlP5.
 
  if (theEvent.isGroup()) {
    // an event from a group e.g. scrollList
   int portIndex = (int) theEvent.group().value();
    myPort = new Serial(this, Serial.list()[portIndex], 9600);

  }
}



Attachments:
controlP5.zip [833.49 KiB]
Downloaded 304 times
application_windows.zip [510.2 KiB]
Downloaded 372 times
application_macosx.zip [596.03 KiB]
Downloaded 562 times
Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Mon Jul 01, 2013 6:01 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
Just out of curiosity and some question from reefers,
I wanted to measure color bulbs to too.
I had a green bulb around so I included in the measurement too.

The bulbs.
Image
Untitled by professorminh, on Flickr
Image
Untitled by professorminh, on Flickr

The light
Image
Untitled by professorminh, on Flickr
Image
Untitled by professorminh, on Flickr

The measurements
control, 14w spiral CF white light
PAR sensor: 3" - 118.5, 6" - 44
CEP sensor: 3" - 121, 6" - 36

Blue bulb
PAR sensor: 3" - 40, 6" - 12.5
CEP sensor: 3" - 32, 6" - 7

Green bulb
PAR sensor: 3" - 29, 6" - 9.5
CEP sensor: 3" - 25, 6" - 5

Conclusion:
The cep reading isn't perfect for color lights but it's in the same ball park. It's good to see the photodiode is on par spectrally with the PAR sensor.


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Thu Aug 01, 2013 10:07 pm 
Offline

Joined: Thu Aug 01, 2013 10:05 pm
Posts: 4
Awesome job. Can i buy one? If so, how do i go about that?

Thank you.


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Sat Aug 03, 2013 8:55 am 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
sketchy wrote:
Awesome job. Can i buy one? If so, how do i go about that?

Thank you.


Thanks for the interest. I replied to your email.


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Tue Mar 25, 2014 5:20 pm 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
I added sunlight reading to the CEP made by O2surplus

Code:
// CLOSE ENOUGH PAR Written in Arduino 23 By MISTERGREEN
// for sunlight and indoor light
#include <math.h>
#include <LiquidCrystal.h> // modified by O2surplus to include correct LCD pinout for "CLOSE ENOUGH PAR Meter" V2.0
                           //  Code also includes provision for seial output of PAR values to a PC.
float average = 0;
float output_indoor = 0;
float output_outdoor = 0;
float factor = 0;
unsigned long time;
int counter = 0;
// create the LCD
LiquidCrystal lcd(8, 7, 5, 4, 16, 2);
// set up backlight
int bkl = 6; // backlight pin

void setup() {
  time = millis();
  // set up the LCD's number of rows and columns:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Indoor   Outdoor");
  pinMode(bkl, OUTPUT);
  digitalWrite(bkl, HIGH);
  // initialize the serial communication:
  Serial.begin(115200); // Max for Arduino Uno
}

void loop() {

  int sensorValue = analogRead(0);
  average += sensorValue;
  counter++;

  //every second or 1000 millis
  if(millis() > time+1000) {
    //corrections to fit par
    average = average/counter;

    if(average <= 560) {
      factor = 2.077;
    }
    else {
      factor = 1.934;
    }
    float tempout = average * factor;
    //indoor fluorensence
    output_indoor = tempout;
   
    //add 10% to output for sunlight
    output_outdoor = tempout + (tempout * .10);

    // set the cursor to column 0, line 1
    // (note: line 1 is the second row, since counting begins with 0):
    lcd.setCursor(0, 1);
    // print the number of seconds since reset:
    lcd.print(round(output_indoor));
    lcd.print("   ");
   
    lcd.setCursor(9, 1);
    lcd.print(round(output_outdoor));
    lcd.print("   ");
   
    // send PAR data to the Serial output.
   
    Serial.print(output_indoor);
    Serial.print(",");
    Serial.println(output_outdoor);
   
    //reset timer & counter to get ready for the next second.
   time = millis();
   counter = 0;
   average = 0;
   
  }
 
  delay(5);

}


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Wed Mar 26, 2014 11:18 am 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
I'll be adding 3 roscolux filters to narrow down the spectrum to the photodiode

roscolux #3410, #38, #4307
http://www.plantedtank.net/forums/showt ... 225&page=2

The firmware code will have to be adjusted.


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Thu Mar 27, 2014 5:51 am 
Offline

Joined: Thu Aug 01, 2013 10:05 pm
Posts: 4
@MisterGreen - I just sent an email. At least for now I do not have time to set up an open Source PAR meter GitHub and other stuff to evolve.

Besides, I'd rather buy the DIY PAR meter and center expertise on you. You are doing an incredible job.


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Wed Jun 18, 2014 8:11 am 
Offline
Site Admin

Joined: Fri Nov 30, 2012 1:54 pm
Posts: 275
So here are the updates to the sensor.
For those that don't have a PAR meter to calibrate this against, set you total resistance to 19.8K in the photodiode line.

I added these filters. You can get a swatch of Roscolux filters online for a few dollars or if you have a distributor nearby, I believe it's free.
Image

Glued them on the sensor with tiny bits on the edges with silicone.
Image

Final
Image

And the code
Code:
// CLOSE ENOUGH PAR v 2.0 Written in Arduino 23 By MISTERGREEN
// made for sensors with roscolux filters
// #3410, #38, #4307
// I try to keep this order for the filters for consistency. Not sure if it matters
// for sunlight and indoor light
#include <math.h>
#include <LiquidCrystal.h> // modified by O2surplus to include correct LCD pinout for "CLOSE ENOUGH PAR Meter" V2.0
                           //  Code also includes provision for seial output of PAR values to a PC.
float average = 0;
float output_indoor = 0;
float output_outdoor = 0;
// account for the extra radiation
float outdoor_factor = 5.55;
//
float indoor_factor = 6.12;
unsigned long time;
int counter = 0;
// create the LCD
LiquidCrystal lcd(8, 7, 5, 4, 16, 2);
// set up backlight
int bkl = 6; // backlight pin

void setup() {
  time = millis();
  // set up the LCD's number of rows and columns:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Indoor   Outdoor");
  pinMode(bkl, OUTPUT);
  digitalWrite(bkl, HIGH);
  // initialize the serial communication:
  Serial.begin(115200); // Max for Arduino Uno
}

void loop() {

  int sensorValue = analogRead(0);
  average += sensorValue;
  counter++;

  //every second or 1000 millis
  if(millis() > time+1000) {
    //corrections to fit par
    average = average/counter;
    output_indoor = round(average * indoor_factor);
    output_outdoor = round(average * outdoor_factor);
    // set the cursor to column 0, line 1
    // (note: line 1 is the second row, since counting begins with 0):
    lcd.setCursor(0, 1);
    // print the number of seconds since reset:
    lcd.print(output_indoor);
    lcd.print("   ");
   
    lcd.setCursor(9, 1);
    lcd.print(output_outdoor);
    lcd.print("   ");
   
    // send PAR data to the Serial output.
   
    Serial.print(output_indoor);
    Serial.print(",");
    Serial.println(output_outdoor);
   
    //reset timer & counter to get ready for the next second.
   time = millis();
   counter = 0;
   average = 0;
   
  }
 
  delay(5);

}


Top
 Profile  
 
 Post subject: Re: DIY PAR meter
PostPosted: Wed Jul 09, 2014 2:18 pm 
Offline

Joined: Wed Jul 09, 2014 2:08 pm
Posts: 1
Hi,
I am going to make the meter asap.
But i didnt find the VTB8441BH anywhere.
Can i use BPW34 sensor which is mentioned at first post here?
otherwise, can you help me where to get it ?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Copyright 2noodles LLC 2012