New to Arduino and had a question regarding Analog inputs. I have a photosynthetic light sensor being read on A0 and printing to the screen with a short dalay (1000). My problem is that with a constant light source I'm not getting a constant output. I just used the example AnalogRead reference for initial setup. The sensor is a three wire sensor with 1 (output signal, that I have connected to A0), 1(input voltage, connected to 5v on Arduino Board), and 1 (Ground, connected to Arduino gnd).
Full sunlight should be 2000 micro-mols. Could this be a problem with mapping the values? How would I go about mapping the Arduino value of 1023 to the display between 0-2000?
Any help would be great.
int analogPin = 3;
int val = 0;
val = analogRead(analogPin);
Here is the literature for the sensor I'm trying work with Apogee.
Even if the values are mapped incorrectly shouldn't I be seeing a constant value with a constant light source? What would be created a flutter in the values? Could it be the delay is too short?
Ah, now that I couldn't say. But is the sun really constant?- maybe what looks constant to the human eye is actually not...
True, the Sun doesn't provide a constant light source. However as this is a photosynthetic light sensor so the light source being measured isn't natural light but rather Fluorescent, which is a bit more constant. Ultimately I'm trying to use this input to as an input to a PID loop to control light intensity. If the value flutters as much as it is the PID loop will have a difficult time providing a clean output.
I'm wondering if the sensor might be picking up the flickering coming from the input power to the tubes. Would a longer delay smooth that out? Or should I try and average that value? My concern with trying to average is that I'm seeing a fluctuations greater than 20-30.
Similar discussion: Arduino Forum
Hey I just bought a SQ-215 from Apogee for the same purpose. Cost $205.00 USD. Did you ever get to the bottom of the problem you were having? Did you start to get steady accurate readings? Any words of wisdom? Id be really interested to hear how things went. A lot of people have used Arduino to control their garden lighting, but you are the only one I have found who was trying to his a PAR / PPD / PPFD Target.
How are you providing power to the Arduino board?
Fluorescent light is going to be LESS constant than the sun, because it is flickering on and off 100 or 120 times per second.