DIY PAR meter, Yeah you heard me - Page 12
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY


Reply
 
Thread Tools Display Modes
Old 02-16-2012, 02:21 AM   #166
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 566
Default

I think I must have done something right. After making a few mods to Mistergreen's code to match the lcd circuit that my controller uses, I uploaded the code and SHAZZAAAAM! It works-



Here's the modified code-
Code:
#include <LiquidCrystal.h> // modified by O2surplus

float average = 0;
float output = 0;
float factor = 1.52;
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("2noodles PAR");
  pinMode(bkl, OUTPUT);
  digitalWrite(bkl, HIGH);
  
}

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 = 1.55;
   } else {
     factor = 1.36;
   }
   //corrects for high PAR
   output = average * 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);
  
    //reset timer & counter to get ready for the next second.
    time = millis();
    counter = 0;
    average = 0;
  }
}
Next will be to order some boards, put a couple together, and send'em to Mistergreen for evaluation and testing.
O2surplus is online now   Reply With Quote
Sponsored Links
Advertisement
 
Old 02-16-2012, 02:45 PM   #167
HD Blazingwolf
Planted Tank Guru
 
HD Blazingwolf's Avatar
 
PTrader: (8/100%)
Join Date: May 2011
Location: Chattanooga, TN
Posts: 4,907
Default

when this gets done. i will buy one to support the hobby. i can't do math, or coding, or decide whci hway to wire and code a microprocessor. i understand these principles well, just don't have the knack for actually making a system. but i can take anythign apart and replicate anything done efficiently which includes prewritten code, and fully assembled systems
__________________
HD Blazingwolf is offline   Reply With Quote
Old 02-16-2012, 04:57 PM   #168
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,953
Default

I'll make sure it's calibrated to actual PAR numbers and then will post it on the S&S probably. It'll probably be $40 - $50 over-all... Not sure about encasing this in a project box or not for the sake of cost and assembly time. Maybe we'll leave that up to you guys.
mistergreen is online now   Reply With Quote
Old 02-16-2012, 06:16 PM   #169
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 566
Default

Mistergreen- Can you think of anything, component wise, that should be added to the PCB? I was wondering if it would be prudent, to add another 1kohm pot inline with the 27kohm resistor, to allow for fine tuning of the signal coming from the photo diode? It's a simple matter to make any additions now, prior to the board production run.

Last edited by O2surplus; 02-16-2012 at 06:18 PM.. Reason: corrected punctuation
O2surplus is online now   Reply With Quote
Old 02-16-2012, 07:20 PM   #170
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,953
Default

Quote:
Originally Posted by O2surplus View Post
Mistergreen- Can you think of anything, component wise, that should be added to the PCB? I was wondering if it would be prudent, to add another 1kohm pot inline with the 27kohm resistor, to allow for fine tuning of the signal coming from the photo diode? It's a simple matter to make any additions now, prior to the board production run.
That's actually a pretty good idea. I was going to adjust the code for fine tuning
mistergreen is online now   Reply With Quote
Old 02-17-2012, 02:54 AM   #171
aaronbrown
Planted Member
 
aaronbrown's Avatar
 
PTrader: (2/100%)
Join Date: Apr 2010
Location: st peter mn
Posts: 228
Default

i want one when you get them up and operational just let me know the price and where to send it
aaronbrown is offline   Reply With Quote
Old 02-17-2012, 04:43 AM   #172
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 566
Default

Ok - I added a 5kohm pot in line with the resistor. I dropped the value of the resistor to 24.9k ohms so that with the additional resistance provided by the pot, total circuit resistance can be varied from the 27k Ohm target + or - 2.5k. This should allow for an increased PAR sensor calibration range. Here's the latest PCB. I'll send the files out for production and have some boards by next weekend.
O2surplus is online now   Reply With Quote
Old 02-17-2012, 04:56 AM   #173
Chlorophile
Wannabe Guru
 
Chlorophile's Avatar
 
PTrader: (5/100%)
Join Date: Aug 2011
Location: State of Emergency
Posts: 1,245
Default

Quote:
Originally Posted by O2surplus View Post
Mistergreen- Can you think of anything, component wise, that should be added to the PCB? I was wondering if it would be prudent, to add another 1kohm pot inline with the 27kohm resistor, to allow for fine tuning of the signal coming from the photo diode? It's a simple matter to make any additions now, prior to the board production run.
I have no idea what that might do, but I am wondering if that is something that maybe the end user shouldn't be able to tweak?
What would the effect be of adjusting the potentiometer?
It seems it would be nice for us all to have identical equipment so our readings are comparable.
Again I don't know what the heck it does, but I am wondering.
__________________
Chlorophile is offline   Reply With Quote
Old 02-17-2012, 05:46 AM   #174
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,953
Default

When you build applications, you try to be flexible so not to paint yourself into a corner. Things are rarely fixed so a little calibration is needed but the end product should be standardized.

For instance, a 27k resistor isn't really 27k. It can vary from 26.6k to 27.2k or something like that. That affects the read out. So, having a pot, I can calibrate the read out to match actual par readings.

I have an apogee par sensor.
mistergreen is online now   Reply With Quote
Old 02-17-2012, 04:45 PM   #175
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 566
Default

Ok everyone- I sent the PCB design files to SeeedStudio this morning. If everything goes smoothly, I should have 10 of the Pcb's in my hands in about 9 days. I'll then solder some of them up and send them out to Mistergreen for testing.

Mistergreen- Please send me a PM with your mailing address, when you have time.
O2surplus is online now   Reply With Quote
Old 02-17-2012, 06:39 PM   #176
audioaficionado
Planted Tank Guru
 
audioaficionado's Avatar
 
PTrader: (9/100%)
Join Date: Apr 2011
Location: Medford, Orygun
Posts: 2,198
Default

Subscribed.

It will be nice for a DIY alternative to the $$$ least expensive units I've looked at.
__________________
Steve

45 gal tall high-tech : 2-23-12 update
Complete CO2 Leak Test : How to build a CO2 regulator


Never argue with a fool. Onlookers often can't tell the difference.
Growing older is mandatory, growing up is optional.
My advice is free and worth every penny.
audioaficionado is offline   Reply With Quote
Old 02-18-2012, 01:56 AM   #177
mahko
Planted Member
 
mahko's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2011
Location: Calgary
Posts: 174
Default

Same. Subscribed. This looks really cool.
__________________
mahko is offline   Reply With Quote
Old 02-18-2012, 01:59 PM   #178
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,953
Default

Let's give this a name. How about "Close enough PAR".
O2Surplus, If you're going to upload the binary, can you change the 2noodles to that? It's 16 characters exactly
mistergreen is online now   Reply With Quote
Old 02-18-2012, 04:44 PM   #179
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 566
Default

Quote:
Originally Posted by mistergreen View Post
Let's give this a name. How about "Close enough PAR".
O2Surplus, If you're going to upload the binary, can you change the 2noodles to that? It's 16 characters exactly
I can do that. I was going to name mine " H&H PAR" which is short hand for "Horse shoes & Hand Grenades". since you only have to be "close enough" with either to win .
O2surplus is online now   Reply With Quote
Old 02-18-2012, 06:53 PM   #180
tentacles
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2011
Location: Winnipeg, Canada
Posts: 107
Default

How does a person get a place on the waiting list for these?
tentacles is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012