AMBI Light Sensor max value

Interfacing hardware, sensors, output drivers, chips.
cinch123
Posts: 10
Joined: Sun Oct 31, 2010 1:33 pm

AMBI Light Sensor max value

Post by cinch123 »

I bought a couple of the AMBI light sensors and have one hooked up to log some outdoor brightness values. Looking at the data though, by 8:30am it got up to 996 and has stayed there since then. Has anyone seen theirs go past 996? I guess I'm a little surprised that it would hit its max value so early in the day. I am going to put a neutral density filter over the sensor to see if I can get a better range of data, but I expect to see it just drop to zero quicker.

cinch123
Posts: 10
Joined: Sun Oct 31, 2010 1:33 pm

Re: AMBI Light Sensor max value

Post by cinch123 »

Well I may have found the answer to my own question. The maximum value this sensor can detect is 55000 lux. According to Wikipedia, direct sunlight can have a range of 32,000 to 120,000 lux. In my particular application, the sensor is in a Hoop House, similar to a very small greenhouse, in my garden. Though the sunlight is diffused by a white fabric, it shouldn't reduce the luminance; only scatter it. Therefore, I could see how I might be maxing out the sensor. Today I put the sensor (attached to a JeeNode) inside an anti-static bag, which should block some of the light. I'll take a look at the data tonight and post an update.

If anyone is interested, you can take a look at the Pachube feed for this sensor at http://www.pachube.com/feeds/12401 . If you look at the light sensor 24 hour history, you can see that it flat-tops abruptly at 960. That happened around 8:30am yesterday, which I'm sure is nowhere close to full sunlight for the day. Maybe with the "sunglasses" of an anti-static bag, I'll be able to show a wider range.

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: AMBI Light Sensor max value

Post by oz »

cinch123,

The sensor outputs its value as a current source, and we have a 100K resistor as the load resistor which converts current to voltage. To increase the range, just parallel the output with another 100K resistor or even lower. All my testing has been with 5V so I'll be glad to hear how it works out with a JeeNode, at 3.3V - or do you have it hooked up to the power pin?


Paul

cinch123
Posts: 10
Joined: Sun Oct 31, 2010 1:33 pm

Re: AMBI Light Sensor max value

Post by cinch123 »

I have it plugged directly into the A, + and G pins on a JeeNode port, and I'm doing a straight Ports library anaRead() to get the value. So you're saying put another 100K between which pins? V0 and +5?

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: AMBI Light Sensor max value

Post by oz »

cinch123,
So you're saying put another 100K between which pins? V0 and +5?
No, hookup the resistor between ground and Vout. Try 100K to start, maybe decrease this value until you get it to not saturate in direct sunshine. The sensor's datasheet says it maxes out at 55000 which I believe is pretty bright for North American sunshine. You may be closer to the tropics of course.

The sensor's output maxes out at around 47 uA - if you do the math on that with 3.3V 3.3 / .000047 - you get something in the range of 70K - which means that our 100K resistor probably wouldn't capture the brightest values. Unfortunately the driver in the chip may not be able to get to VCC (3.3V) either, so if, say, the highest voltage the chip can muster is around 2.7 (this would be a diode drop (.6V) below 3.3 - not unlikely if the output is a voltage follower [NPN transistor]) - then the the math would look like 2.7 / .000047 = ~57K. So two 100k's in parallel (50K) should do the trick - or darn close to it. But try lower if you are still saturating. You are also correct in supposing that you'll lose resolution on the dark end.

Send some sunshine to us in Providence and good luck,

Paul

cinch123
Posts: 10
Joined: Sun Oct 31, 2010 1:33 pm

Re: AMBI Light Sensor max value

Post by cinch123 »

Excellent feedback. Thank you. I'll experiment with it with a potentiometer over the next few days and let you know. I'm in Ohio so I should have similar sunshine to you. I'll let you know the results of my testing.

cinch123
Posts: 10
Joined: Sun Oct 31, 2010 1:33 pm

Re: AMBI Light Sensor max value

Post by cinch123 »

Okay I can definitely say the extra 100k resistor did the trick. Today was a sunny day like the last three. Instead of hitting max value by 8:30 am, the light level didn't hit its max value until around noon, and there were variations up and down throughout the day as clouds went by, etc. The "max" value is now around 650, but a graph of values seems to show that it would go higher if the sun was brighter. Thanks!

Elina
Posts: 4
Joined: Wed Nov 21, 2012 12:36 pm

Re: AMBI Light Sensor max value

Post by Elina »

Hi Paul, could you please with the issue about the AMBI sensor that I've posted here:

http://arduino.cc/forum/index.php/topic,133522.0.html

I think that it's an electrical issue but can't understand how to behave.

thanks
Elina
paul wrote:cinch123,

The sensor outputs its value as a current source, and we have a 100K resistor as the load resistor which converts current to voltage. To increase the range, just parallel the output with another 100K resistor or even lower. All my testing has been with 5V so I'll be glad to hear how it works out with a JeeNode, at 3.3V - or do you have it hooked up to the power pin?


Paul

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: AMBI Light Sensor max value

Post by oz »

Elina,

I rewrote the sketch using the aliases of the analog pins. It may be possible that the Arduino guys changed the way analogWrite() deals with pin numbers since I wrote the sketch.
You can also confirm that the sensor is working by just checking the voltage with a multimeter.

Code: Select all

/* Ambi Light Sensor ProveOut
Insert AMBI light sensor in your Arduino analog pins A4, A5, A6 
- the chip should be facing away from the Arduino
GND - A5   // these are analog pins used in digital mode to power the sensor
+5V - A4    // these are analog pins used in digital mode to power the sensor
Output - A3
*/
void setup() {
Serial.begin(9600);
pinMode(A4, OUTPUT);
pinMode(A5, OUTPUT);
digitalWrite(A4, HIGH);
digitalWrite(A5, LOW);
}
void loop() {
int Light = analogRead(A3);
Serial.println(Light);
delay(250);
}

Elina
Posts: 4
Joined: Wed Nov 21, 2012 12:36 pm

Re: AMBI Light Sensor max value

Post by Elina »

Hi Paul,

thanks for your quick reply. I've already tested the other pins with the previous code and they worked fine: 0 on A5 and 1023 on A4.
I'm currently testing the code you wrote: the values from A3 have been increasing for few minutes and at the moment they are remaining almost constant around 620-630 in a room illuminated only by the light of my laptop monitor. Now that I've turned the light on they are around 640. Could it be?

Now I have a doubt: is the response of the sensor as quick as the changes in the brightness of the environment?
Or are there very long response time (some minutes)? If so, it could be that the signal looked constant in time for this reason: it is actually constant in intervals lasting some minutes.
However, from the datasheet it seems to me that rise/fall time is very short (and that's an important requirement for my project).

I have another issue: the sensor is very sensitive to...movements!
If I only touch the arduino board the digital values dramatically float. I guess that it could depends on many factor so the answer should be: ok keep it stuck somehow. Fine. Selfanswer :)

I'll let you know further results.

Elina

Elina
Posts: 4
Joined: Wed Nov 21, 2012 12:36 pm

Re: AMBI Light Sensor max value

Post by Elina »

Hi, update:
paul wrote:Elina,
I rewrote the sketch using the aliases of the analog pins. It may be possible that the Arduino guys changed the way analogWrite() deals with pin numbers since I wrote the sketch.
Checked again and again: the configuration worked properly.
paul wrote: You can also confirm that the sensor is working by just checking the voltage with a multimeter.
Done. Vcc is around 4.7V while Vout float few millivolts around 0V (even negative voltage).
paul wrote:

Code: Select all

/* Ambi Light Sensor ProveOut
Insert AMBI light sensor in your Arduino analog pins A4, A5, A6 
- the chip should be facing away from the Arduino
GND - A5   // these are analog pins used in digital mode to power the sensor
+5V - A4    // these are analog pins used in digital mode to power the sensor
Output - A3
*/
void setup() {
Serial.begin(9600);
pinMode(A4, OUTPUT);
pinMode(A5, OUTPUT);
digitalWrite(A4, HIGH);
digitalWrite(A5, LOW);
}
The old configuration was correct. However I didn't realized that this part of code was to configure the power. Another new information for a newbie.

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: AMBI Light Sensor max value

Post by oz »

Elina,

Did you get it going? From your reports it seems like you may have zapped the sensor with reverse polarity.
It should be very obvious and stable when you get it working.

good luck,

Paul

RomanceOsborn
Posts: 3
Joined: Thu Jul 23, 2015 1:31 am

Re: AMBI Light Sensor max value

Post by RomanceOsborn »

the configuration worked properly.
goldenslot

Post Reply