<br><div class="gmail_quote">On Fri, May 1, 2009 at 2:28 PM, C. Scott Ananian <span dir="ltr"><<a href="mailto:cscott@laptop.org">cscott@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Oh, yeah, you should be able to wire the top side of the LED directly to the LED and measure the photovoltaic current directly; that's not patented:<br>
<span style="font-family: courier new,monospace;">                  battery voltage<br>              Q1  |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ---from EC------|< _____ to A/D<br>

                  |<br>             LED  </span><u style="font-family: courier new,monospace;">V</u><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                  |</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">                 GND</span><br><br> The only question is whether the LED can put out enough photovoltaic current to be reliably measured by the A/D.  Depends on what the input to the A/D looks like, how much capacitance it sees, etc.  An ultralow power versoin of the 339 could fix any problems there, but then your parts count increases.  You don't *have* to reverse-bias the LED; that just enhances sensitivity, but distinguishing between "outside on a sunny day" and "inside" doesn't exactly require precision; there's at least an order of magnitude change in illumination, maybe 2 (<a href="http://en.wikipedia.org/wiki/Lux" target="_blank">http://en.wikipedia.org/wiki/Lux</a>).<br>

</blockquote></div><br>A reverse biased LED doesn't output much current at all - even photo sensor diodes that are tuned for the job. Have a look at this page for some ambient light sensors that you would find in a cell phone - <a href="http://www.avagotech.com/pages/en/optical_sensors/ambient_light_photo_sensors/light_sensor_photo_sensor/">http://www.avagotech.com/pages/en/optical_sensors/ambient_light_photo_sensors/light_sensor_photo_sensor/</a>. The basic variety has a photodiode and a small current amplifier. The output current is logarithmically related to the lux level. If hook a series resistor to the output, the voltage across vs lux is also logarithmic. Besides the current amplifier, these devices have other advantages. First, they have a spectral sensitivity that's tuned to the human eye, so infrared light (say a campfire) will not skew the reading. Second, they have a large optical window so the readings won't change when you tilt your phone/laptop slightly. These little sensors are less than $0.25 in large quantities (perhaps by quite a bit), and they are being used more and more in cell phones to reduce backlight power in low light environments. It's well worth the price if you get 10% more battery life on average. Quantifying the impact on battery life is tricky because there are a lot of assumptions.<br>
<br>Anyways, a normal LED might work under certain circumstances. I don't have the experience to say one way or another.<br><br>Thanks,<br>Nate<br>