Maker Pro
Maker Pro

Daylight sensors recommendation?

  • Thread starter Martin Griffith
  • Start date
M

Martin Griffith

Jan 1, 1970
0
I'm going to use a ATtiny 13 to PWM a led display. I've never played
with a AVR tiny13, it should be simple.

I notice that it has an ADC on it, and would like to use this to sense
the ambient light, and increase the LED on time accordingly.

It's not for scientific type stuff, so it doesn't need to be
exceptionally linear

Any recommendation for a sensor, cheap, but not Joerg cheap, and
simple to mount, not the bumpy things


martin
 
M

Martin Riddle

Jan 1, 1970
0
Martin Griffith said:
I'm going to use a ATtiny 13 to PWM a led display. I've never played
with a AVR tiny13, it should be simple.

I notice that it has an ADC on it, and would like to use this to sense
the ambient light, and increase the LED on time accordingly.

It's not for scientific type stuff, so it doesn't need to be
exceptionally linear

Any recommendation for a sensor, cheap, but not Joerg cheap, and
simple to mount, not the bumpy things


martin

What the ADC impedance? You could try a led, they do produce a small voltage under ambient light.
Cheers
 
M

Martin Griffith

Jan 1, 1970
0
What the ADC impedance? You could try a led, they do produce a small voltage under ambient light.
Cheers
Haven't got a clue , still reading the datasheet, aaaah...100M it
says, 10ish bits, they get a lot fitted into 8 pins these
days.....Glad I gave up on the LM393 triangle method


martin
 
J

Jan Panteltje

Jan 1, 1970
0
I'm going to use a ATtiny 13 to PWM a led display. I've never played
with a AVR tiny13, it should be simple.

I notice that it has an ADC on it, and would like to use this to sense
the ambient light, and increase the LED on time accordingly.

It's not for scientific type stuff, so it doesn't need to be
exceptionally linear

Any recommendation for a sensor, cheap, but not Joerg cheap, and
simple to mount, not the bumpy things


martin

I am using a simple photo transistor for that, uses a series resistor.
Software can do anything to the curve.
 
F

Frank Buss

Jan 1, 1970
0
Martin said:
I'm going to use a ATtiny 13 to PWM a led display. I've never played
with a AVR tiny13, it should be simple.

I notice that it has an ADC on it, and would like to use this to sense
the ambient light, and increase the LED on time accordingly.

It's not for scientific type stuff, so it doesn't need to be
exceptionally linear

Any recommendation for a sensor, cheap, but not Joerg cheap, and
simple to mount, not the bumpy things

I've bought this sensor some time ago, just for testing, because it was
advertised on the Farnell site:

http://www.avagotech.com/assets/downloadDocument.do?id=4360&Source=SearchResultPage

You can get it from Farnell for 0,61 Euro for single units:

http://de.farnell.com/1339013/optoelektronik/product.us0?sku=AVAGO-TECHNOLOGIES-APDS-9003-021

Some experimental results: If used with a 10k Rload and 3.3V at Vcc, you
can measure less than 0.1V if dark, 1.4V for normal lighting in my room and
2.5V if illuminated with a flashlight from near distance.

I think for Joerg cheap you have to use the cheapest standard LED you can
get and a some magic transistor circuit to amplify and linearize it. Or
even saw the cap from a transistor and use this in the magic circuit,
without an additional costly LED :)
 
M

Martin Griffith

Jan 1, 1970
0
I've bought this sensor some time ago, just for testing, because it was
advertised on the Farnell site:

http://www.avagotech.com/assets/downloadDocument.do?id=4360&Source=SearchResultPage

You can get it from Farnell for 0,61 Euro for single units:

http://de.farnell.com/1339013/optoelektronik/product.us0?sku=AVAGO-TECHNOLOGIES-APDS-9003-021

Some experimental results: If used with a 10k Rload and 3.3V at Vcc, you
can measure less than 0.1V if dark, 1.4V for normal lighting in my room and
2.5V if illuminated with a flashlight from near distance.

I think for Joerg cheap you have to use the cheapest standard LED you can
get and a some magic transistor circuit to amplify and linearize it. Or
even saw the cap from a transistor and use this in the magic circuit,
without an additional costly LED :)

Thanks, just looking at the Vishay tept4400 @0.63€ from farnell. Idiot
datasheet, not a single app circuit.

Got AVRstudio 4 and GCC installed, for the first time , and my PWM
loop works, and compiles, and simulates, all on the same day. Time to
build the programmer thing

I'll never be good enough to be as cheap as Joerg


martin
 
A

Arlet Ottens

Jan 1, 1970
0
Frank said:
I think for Joerg cheap you have to use the cheapest standard LED you can
get and a some magic transistor circuit to amplify and linearize it. Or
even saw the cap from a transistor and use this in the magic circuit,
without an additional costly LED :)

Cheapest solution is to measure the LED/display itself during the
off-state of the PWM cycle. Depending on the configuration, this might
even be done without any additional components.

Linearizing can be done in software.

Here's a nice application that builds on a similar idea:

http://cs.nyu.edu/~jhan/ledtouch/index.html
 
W

Wimpie

Jan 1, 1970
0
I'm going to use a ATtiny 13 to PWM a led display. I've never played
with a AVR tiny13, it should be simple.

I notice that it has an ADC on it, and would like to use this to sense
the ambient light, and increase the LED on time accordingly.

It's not for scientific type stuff, so it doesn't need to be
exceptionally linear

Any recommendation for a sensor, cheap, but not Joerg cheap, and
simple to mount, not the bumpy things

martin

Hello Martin,

When you want an electrical output that is proportional to the eye
perception, you should not use a regular phototransistor. Most
phototransistors have highest sensitivity in the IR range. So they
give much output under real daylight or light bulbs (incandescent),
but the output drops significantly under, for example, fluorescent
lighting.

When it should be really good, you can use a real (ambient) light
sensor, like OSRAM SFH 5711 (good one, about 2USD) or cheaper SFH
2430, SFH 3410 (farnell). You should also take into account the
directivity of the sensor. When you have a sensor with narrow viewing
angle and the light comes from another direction (than main beam
direction), output will be also small.

Best regards,

Wim
PA3DJS
www.tetech.nl
please remove abc from the address
 
J

John Devereux

Jan 1, 1970
0
Martin Griffith said:
I'm going to use a ATtiny 13 to PWM a led display. I've never played
with a AVR tiny13, it should be simple.

I notice that it has an ADC on it, and would like to use this to sense
the ambient light, and increase the LED on time accordingly.

It's not for scientific type stuff, so it doesn't need to be
exceptionally linear

Any recommendation for a sensor, cheap, but not Joerg cheap, and
simple to mount, not the bumpy things

The LED idea can work, but the currents involved are quite low.

I just measured a 5mm red led at 6nA in (bright) room lighting.

So you will need to run it into an opamp - in which case you may as
well go for a proper photodiode or purpose made "ambient light sensor"
as suggested.
 
J

Joerg

Jan 1, 1970
0
Arlet said:
Cheapest solution is to measure the LED/display itself during the
off-state of the PWM cycle. Depending on the configuration, this might
even be done without any additional components.

Bingo! The best solutions are the ones that cost next to nothing in
hardware. Then us hardware guys can lean back, open a beer and toss it
over to the software guys. "Hey, it's just software!"

:)))

Linearizing can be done in software.

Here's a nice application that builds on a similar idea:

http://cs.nyu.edu/~jhan/ledtouch/index.html


Just make sure it's sensitive enough and reliable.
 
Hello Martin,

When you want an electrical output that is proportional to the eye
perception, you should not use a regular phototransistor.

Well, my experience with auto brightness display is that
there are basically 3 situations:
1) absolute dark.
2) normal room light or daylight via windows.
3) bright sun directly on display, in whatever way.

My experience is that 1 and 2 require about the same brightness,
the advantage of some brightness in '1' is that that helps light up
the room
(your eyes get used to the low light from all those displays and you
can
see perfectly well).
ONLY in case 3 needs the display a big boost in brightness.
The photocell detects direct sunlight 100% accurate.
If you want to get cheaper get a LDR.
Those are slow, but that really does not matter much.
So in most cases even a simple level comparator would do.
 
J

Joerg

Jan 1, 1970
0
Robert said:
Use the same LED for the light sensor (during off time).


The one spec to consider here is the speed of the ADC on his uC. On a
muxed LED matrix the off times can be awfully brief. He'd have to swing
a port pin or two over to the ADC, do the conversion, swing it back. Not
a problem if the ADC has a good S/H built in. This interrupt routine may
have to be written in inline-assembler.
 
M

Martin Griffith

Jan 1, 1970
0
The one spec to consider here is the speed of the ADC on his uC. On a
muxed LED matrix the off times can be awfully brief. He'd have to swing
a port pin or two over to the ADC, do the conversion, swing it back. Not
a problem if the ADC has a good S/H built in. This interrupt routine may
have to be written in inline-assembler.

I am thinking of using the AVRtiny13 just to do the PWM, and the led
display is a CA 7 segment device. The led driver, is a STP16PS05. Just
finished the prototype layout this minute

I just realised that indoors I would need to compensate for the 100 or
120 light pulses/sec.



martin
 
A

Arlet Ottens

Jan 1, 1970
0
Joerg said:
The one spec to consider here is the speed of the ADC on his uC. On a
muxed LED matrix the off times can be awfully brief. He'd have to swing
a port pin or two over to the ADC, do the conversion, swing it back. Not
a problem if the ADC has a good S/H built in. This interrupt routine may
have to be written in inline-assembler.

The ATtiny13 has a 1.5 us sample/hold window.
 
A

Arlet Ottens

Jan 1, 1970
0
I just realised that indoors I would need to compensate for the 100 or
120 light pulses/sec.

The simplest solution is to measure the light every PWM cycle (using the
PWM timer interrupt), and feed the data through a low-pass filter.
 
J

Joerg

Jan 1, 1970
0
Arlet said:
The simplest solution is to measure the light every PWM cycle (using the
PWM timer interrupt), and feed the data through a low-pass filter.


But then make sure your mux frequency is different from 100Hz/120Hz and
its harmonics.
 
M

Martin Riddle

Jan 1, 1970
0
Joerg said:
The one spec to consider here is the speed of the ADC on his uC. On a muxed LED matrix the off times can be awfully brief.
He'd have to swing a port pin or two over to the ADC, do the conversion, swing it back. Not a problem if the ADC has a good
S/H built in. This interrupt routine may have to be written in inline-assembler.

If he's using a 7-segment, he could use one of the free decimal points...

Just a thought.

Cheers
 
Top