Re: [Fwd: Re: Ambient light sensing via LED response]

2009-05-10 Thread C. Scott Ananian
On Wed, May 6, 2009 at 6:14 PM, Reinder de Haan r...@mveas.com wrote:
     Absolutely not.  The A/D is eight bits, with an input range spanning
     0 - 3.3V, so the best you
     can hope for is about 13 mV per LSB.  I would guess actual accuracy
     to be closer to 26 mV.

I think the actual A/D reference voltage is probably *maximum* 3.3V.
What's the *minimum* A/D reference voltage?  And can the A/D measure
all the way down to ground?  (Sometimes there's a Vmin for the A/D
input, often around a diode drop above ground.)

 i did some more experiments and at ~20 cm from the halogen lamp i doest
 matter is i turn the backlight full on of off .. i dont have color
 anymore
 at that distance the bare led gave about 250mv (maybe a bit more into a
 very high R fet gate...)

250mv should be a count of about 20 from the A/D.  That's plenty for
this purpose.  Heck, a count of 1 would be sufficient, as long as it
was repeatable. ;-)

So, it seems like all that's required is one wire from the top of the
LED to the A/D input, and wiring Vref directly to +3.3.  Adding a
zener and a resistor for a lower Vref would probably improve precision
and accuracy.

Everything else is software  tweaking some constants.
  --scott

-- 
 ( http://cscott.net/ )
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Fwd: Re: Ambient light sensing via LED response]

2009-05-10 Thread Reinder de Haan


C. Scott Ananian wrote:
 On Wed, May 6, 2009 at 6:14 PM, Reinder de Haan r...@mveas.com wrote:
 Absolutely not.  The A/D is eight bits, with an input range spanning
 0 - 3.3V, so the best you
 can hope for is about 13 mV per LSB.  I would guess actual accuracy
 to be closer to 26 mV.
 
 I think the actual A/D reference voltage is probably *maximum* 3.3V.
 What's the *minimum* A/D reference voltage?  And can the A/D measure
 all the way down to ground?  (Sometimes there's a Vmin for the A/D
 input, often around a diode drop above ground.)
 
 i did some more experiments and at ~20 cm from the halogen lamp i doest
 matter is i turn the backlight full on of off .. i dont have color
 anymore
 at that distance the bare led gave about 250mv (maybe a bit more into a
 very high R fet gate...)


that 250mv is without the light guide and lcd cover installed!
with the light guide in place its more like ~70mv ...
0.07/3.3*256= 5.4 LSB and then the Rin of the ADC must be 10Mohm...

 
 250mv should be a count of about 20 from the A/D.  That's plenty for
 this purpose.  Heck, a count of 1 would be sufficient, as long as it
 was repeatable. ;-)
 
 So, it seems like all that's required is one wire from the top of the
 LED to the A/D input, and wiring Vref directly to +3.3.  Adding a
 zener and a resistor for a lower Vref would probably improve precision
 and accuracy.
 
 Everything else is software  tweaking some constants.
   --scott
 

if i find the time somewhere this week i might test it ... otherwise it
will be during of after paris..

Reinder
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Fwd: Re: Ambient light sensing via LED response]

2009-05-10 Thread C. Scott Ananian
On Sun, May 10, 2009 at 5:01 PM, Reinder de Haan r...@mveas.com wrote:
 C. Scott Ananian wrote:
 On Wed, May 6, 2009 at 6:14 PM, Reinder de Haan r...@mveas.com wrote:
     Absolutely not.  The A/D is eight bits, with an input range spanning
     0 - 3.3V, so the best you
     can hope for is about 13 mV per LSB.  I would guess actual accuracy
     to be closer to 26 mV.

 I think the actual A/D reference voltage is probably *maximum* 3.3V.
 What's the *minimum* A/D reference voltage?  And can the A/D measure
 all the way down to ground?  (Sometimes there's a Vmin for the A/D
 input, often around a diode drop above ground.)

 i did some more experiments and at ~20 cm from the halogen lamp i doest
 matter is i turn the backlight full on of off .. i dont have color
 anymore
 at that distance the bare led gave about 250mv (maybe a bit more into a
 very high R fet gate...)


 that 250mv is without the light guide and lcd cover installed!
 with the light guide in place its more like ~70mv ...
 0.07/3.3*256= 5.4 LSB and then the Rin of the ADC must be 10Mohm...

5 LSB is still okay, and it could be more if the A/D Vref can be
dropped below 3.3V.
 --scott

-- 
 ( http://cscott.net/ )
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Fwd: Re: Ambient light sensing via LED response]

2009-05-10 Thread Mark Bauer


Hi guys,

How can I help with this,  I still teach electrical engineering at the
University of Nebraska, and before that I have about 25 years in
the field.  Mostly embedded microcontrollers and stuff.  I do have
several XOs to work with.

I would have jumped in earlier but the end of the semester is a bit
hectic.

Mark




On May 10, 2009  Sunday, at 4:13:47:0, C. Scott Ananian wrote:

 On Sun, May 10, 2009 at 5:01 PM, Reinder de Haan r...@mveas.com wrote:
 C. Scott Ananian wrote:
 On Wed, May 6, 2009 at 6:14 PM, Reinder de Haan r...@mveas.com  
 wrote:
 Absolutely not.  The A/D is eight bits, with an input range  
 spanning
 0 - 3.3V, so the best you
 can hope for is about 13 mV per LSB.  I would guess actual  
 accuracy
 to be closer to 26 mV.

 I think the actual A/D reference voltage is probably *maximum* 3.3V.
 What's the *minimum* A/D reference voltage?  And can the A/D measure
 all the way down to ground?  (Sometimes there's a Vmin for the A/D
 input, often around a diode drop above ground.)

 i did some more experiments and at ~20 cm from the halogen lamp i  
 doest
 matter is i turn the backlight full on of off .. i dont have color
 anymore
 at that distance the bare led gave about 250mv (maybe a bit more  
 into a
 very high R fet gate...)


 that 250mv is without the light guide and lcd cover installed!
 with the light guide in place its more like ~70mv ...
 0.07/3.3*256= 5.4 LSB and then the Rin of the ADC must be 10Mohm...

 5 LSB is still okay, and it could be more if the A/D Vref can be
 dropped below 3.3V.
 --scott

 -- 
 ( http://cscott.net/ )
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


[Fwd: Re: Ambient light sensing via LED response]

2009-05-06 Thread Reinder de Haan


 Original Message 
Subject: Re: Ambient light sensing via LED response
Date: Thu, 07 May 2009 00:02:49 +0200
From: Reinder de Haan r...@mveas.com
To: raf...@laptop.org
References: 200904290017.n3t0hl2v006...@new.toad.com
c5d4a4e5-b183-4b7d-bafb-3488e15f7...@laptop.org
c6d9bea0905011128j2d5cdf3cw975cfad790480...@mail.gmail.com
675d3c5c-95ed-4ee9-84bc-3b5164675...@laptop.org
c6d9bea0905042207i458ed9b1if74e0e16d24f5...@mail.gmail.com
4a00a073.8020...@mveas.com
a80d16920905051544s525b7039nf7e87a4a3c754...@mail.gmail.com
75dc0458-925b-4792-9aee-a24b9b1f3...@laptop.org
a80d16920905051952h3d82d15brb8f690cf1c402...@mail.gmail.com



Rafael Enrique Ortiz Guerrero wrote:
  
 
 
 On Tue, May 5, 2009 at 8:34 PM, John Watlington w...@laptop.org
 mailto:w...@laptop.org wrote:
 
 
 On May 5, 2009, at 6:44 PM, Rafael Enrique Ortiz Guerrero wrote:
 
 These measurements are really cool.
 
 But the question remains in whether the ADC could have a
 resolution of 1mv?, i mean in light of these measurements is
 necessary to have an ADC that can reliable sense these
 variations and then with that basis  have a transfer function
 and add it to the algorithm.
 
 
 Absolutely not.  The A/D is eight bits, with an input range spanning
 0 - 3.3V, so the best you
 can hope for is about 13 mV per LSB.  I would guess actual accuracy
 to be closer to 26 mV. 
 
 
 But why do you say you would need 1 mV accuracy ?   Bright sunlight
 is far stronger than
 the light sources he used.
 
 
 i don't know if the measurements at sunlight would show the same
 variations.. we would have to make new measurements, but for experience,
 the variations of voltage regarding light sensing are not of
 considerable amounts, so if the accuracy is 26mv, we would have to see
 if a perceptible change in ambient light could be of a higher magnitude
 than 26mv, if not the accuracy could be lost..
 
 

i did some more experiments and at ~20 cm from the halogen lamp i doest
matter is i turn the backlight full on of off .. i dont have color
anymore
at that distance the bare led gave about 250mv (maybe a bit more into a
very high R fet gate...)

i guess it would be around 70mv whit the light guide in front of it..
(i guess this be more (150mv?) with a very high R (~25 Mohm?) fet gate
as only load)

i would add a simple amp (mosfet? or maybe cheap opamp ?)
to amplify ~X10 so 300mv would be full scale..
my memory is dusty but that should be posible with 2 resistors an a fet
? gain would be posible to change by replacing one of the resistors with
a bigger / lower value...

maybe a trasistor is better bc the leds is acts as a current source ?

ideas welcome

if i can get the partnr of a fet/transistor that would be usable (and
cheap enough) i could maybe order a couple of them from say farnell and
hack something together here

is there a free or hackable input on the current EC ? (or is that
different from the ec that will be in 1.5 ?


 (haven't checked the specs though..)
 
 
 Having the data sheet for the EC controller doesn't help --- 8 bits
 and recommended operating
 voltage for the analog reference voltage is about all it provides.  
 I had to ask a chinese speaker
 to call the app. engineer to find out the input impedance...
 
 Ok, thanks :).
  
 
 
 
 
 On Tue, May 5, 2009 at 3:24 PM, Reinder de Haan r...@mveas.com
 mailto:r...@mveas.com wrote:
 Hallo,
 
 C. Scott Ananian wrote:
 snip
 
  A last resort would be hooking up a MOSFET as a simple
 amplifier --
  again, you're not worried about linearity or any such
 niceties, but
  you'd still need a good match for your MOSFET's threshold
 voltage...
  some real measurements to replace the WAGes would go a long way.
--scott
 
 
 measured on a B1 XO1 laptop (where the leds and the series
 resistor are
 wired in parallel it seam) :
 
 almost dark: 0mv
 ~3meter away from a 8w PL; bare led: ~2mv
 ~50 cm below ~25W halogen desk lamp; bare led: ~40mv
 bright white led directly on bare led ~200mv
 bright white led directly on light guide of the bat.led (lcd
 side) ~50mv
 ~50 cm below ~25w halogen desk lamp (~75* angle to the axis of
 the light
 guide) ~5mv
 
 i measure this between  GND of the laptop the led side of the series
 resistor.
 all leds seam to be about the same.. i did not compare the different
 light guides.
 the main battery and DC power where removed, the RTC baterry was
 still
 in place.
 
 
 the meter i measured this with was fixed in the 2000mv range
 and was abou 10Mohm when i connected it to another meter in
 resistance
 mode; the (volt) meter read 250mv at that time.
 
 

[Fwd: Re: Ambient light sensing via LED response]

2009-05-06 Thread Reinder E.N. de Haan


 Original Message 
Subject: Re: Ambient light sensing via LED response
Date: Thu, 07 May 2009 00:02:49 +0200
From: Reinder de Haan r...@mveas.com
To: raf...@laptop.org
References: 200904290017.n3t0hl2v006...@new.toad.com
c5d4a4e5-b183-4b7d-bafb-3488e15f7...@laptop.org
c6d9bea0905011128j2d5cdf3cw975cfad790480...@mail.gmail.com
675d3c5c-95ed-4ee9-84bc-3b5164675...@laptop.org
c6d9bea0905042207i458ed9b1if74e0e16d24f5...@mail.gmail.com
4a00a073.8020...@mveas.com
a80d16920905051544s525b7039nf7e87a4a3c754...@mail.gmail.com
75dc0458-925b-4792-9aee-a24b9b1f3...@laptop.org
a80d16920905051952h3d82d15brb8f690cf1c402...@mail.gmail.com



Rafael Enrique Ortiz Guerrero wrote:
  
 
 
 On Tue, May 5, 2009 at 8:34 PM, John Watlington w...@laptop.org
 mailto:w...@laptop.org wrote:
 
 
 On May 5, 2009, at 6:44 PM, Rafael Enrique Ortiz Guerrero wrote:
 
 These measurements are really cool.
 
 But the question remains in whether the ADC could have a
 resolution of 1mv?, i mean in light of these measurements is
 necessary to have an ADC that can reliable sense these
 variations and then with that basis  have a transfer function
 and add it to the algorithm.
 
 
 Absolutely not.  The A/D is eight bits, with an input range spanning
 0 - 3.3V, so the best you
 can hope for is about 13 mV per LSB.  I would guess actual accuracy
 to be closer to 26 mV. 
 
 
 But why do you say you would need 1 mV accuracy ?   Bright sunlight
 is far stronger than
 the light sources he used.
 
 
 i don't know if the measurements at sunlight would show the same
 variations.. we would have to make new measurements, but for experience,
 the variations of voltage regarding light sensing are not of
 considerable amounts, so if the accuracy is 26mv, we would have to see
 if a perceptible change in ambient light could be of a higher magnitude
 than 26mv, if not the accuracy could be lost..
 
 

i did some more experiments and at ~20 cm from the halogen lamp i doest
matter is i turn the backlight full on of off .. i dont have color
anymore
at that distance the bare led gave about 250mv (maybe a bit more into a
very high R fet gate...)

i guess it would be around 70mv whit the light guide in front of it..
(i guess this be more (150mv?) with a very high R (~25 Mohm?) fet gate
as only load)

i would add a simple amp (mosfet? or maybe cheap opamp ?)
to amplify ~X10 so 300mv would be full scale..
my memory is dusty but that should be posible with 2 resistors an a fet
? gain would be posible to change by replacing one of the resistors with
a bigger / lower value...

maybe a trasistor is better bc the leds is acts as a current source ?

ideas welcome

if i can get the partnr of a fet/transistor that would be usable (and
cheap enough) i could maybe order a couple of them from say farnell and
hack something together here

is there a free or hackable input on the current EC ? (or is that
different from the ec that will be in 1.5 ?


 (haven't checked the specs though..)
 
 
 Having the data sheet for the EC controller doesn't help --- 8 bits
 and recommended operating
 voltage for the analog reference voltage is about all it provides.  
 I had to ask a chinese speaker
 to call the app. engineer to find out the input impedance...
 
 Ok, thanks :).
  
 
 
 
 
 On Tue, May 5, 2009 at 3:24 PM, Reinder de Haan r...@mveas.com
 mailto:r...@mveas.com wrote:
 Hallo,
 
 C. Scott Ananian wrote:
 snip
 
  A last resort would be hooking up a MOSFET as a simple
 amplifier --
  again, you're not worried about linearity or any such
 niceties, but
  you'd still need a good match for your MOSFET's threshold
 voltage...
  some real measurements to replace the WAGes would go a long way.
--scott
 
 
 measured on a B1 XO1 laptop (where the leds and the series
 resistor are
 wired in parallel it seam) :
 
 almost dark: 0mv
 ~3meter away from a 8w PL; bare led: ~2mv
 ~50 cm below ~25W halogen desk lamp; bare led: ~40mv
 bright white led directly on bare led ~200mv
 bright white led directly on light guide of the bat.led (lcd
 side) ~50mv
 ~50 cm below ~25w halogen desk lamp (~75* angle to the axis of
 the light
 guide) ~5mv
 
 i measure this between  GND of the laptop the led side of the series
 resistor.
 all leds seam to be about the same.. i did not compare the different
 light guides.
 the main battery and DC power where removed, the RTC baterry was
 still
 in place.
 
 
 the meter i measured this with was fixed in the 2000mv range
 and was abou 10Mohm when i connected it to another meter in
 resistance
 mode; the (volt) meter read 250mv at that time.