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.

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.

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?

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?

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.

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.

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!

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?

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.

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