|
||||||||||||||||
|
||||||||||||||||
|
|
#166 |
|
Planted Tank Obsessed
|
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;
}
}
|
|
|
|
| Sponsored Links | |||
Advertisement | |||
|
|
#167 |
|
Planted Tank Guru
|
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
__________________
|
|
|
|
|
|
#168 |
|
Bow ties are cool
|
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.
__________________
DIY High Tech Tank forum
http://aquatictechtank.net A forum dedicated to design and program aquatic tanks |
|
|
|
|
|
#169 |
|
Planted Tank Obsessed
|
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 |
|
|
|
|
|
#170 | |
|
Bow ties are cool
|
Quote:
__________________
DIY High Tech Tank forum
http://aquatictechtank.net A forum dedicated to design and program aquatic tanks |
|
|
|
|
|
|
#171 |
|
Planted Member
|
i want one when you get them up and operational just let me know the price and where to send it
|
|
|
|
|
|
#172 |
|
Planted Tank Obsessed
|
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.
|
|
|
|
|
|
#173 | |
|
Wannabe Guru
|
Quote:
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.
__________________
|
|
|
|
|
|
|
#174 |
|
Bow ties are cool
|
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.
__________________
DIY High Tech Tank forum
http://aquatictechtank.net A forum dedicated to design and program aquatic tanks |
|
|
|
|
|
#175 |
|
Planted Tank Obsessed
|
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. |
|
|
|
|
|
#176 |
|
Planted Tank Overclocker
|
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. |
|
|
|
|
|
#177 |
|
Planted Member
|
Same. Subscribed. This looks really cool.
__________________
|
|
|
|
|
|
#178 |
|
Bow ties are cool
|
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
__________________
DIY High Tech Tank forum
http://aquatictechtank.net A forum dedicated to design and program aquatic tanks |
|
|
|
|
|
#179 | |
|
Planted Tank Obsessed
|
Quote:
|
|
|
|
|
|
|
#180 |
|
Algae Grower
|
How does a person get a place on the waiting list for these?
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|