Daylight sensors recommendation?

Apr 05, 2008 21 Replies

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

under ambient light.

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

On a sunny day (Sat, 05 Apr 2008 15:37:39 +0200) it happened Martin Griffith wrote in :

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

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

formatting link

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

formatting link

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 :-)

Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de

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

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:

formatting link

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

formatting link
please remove abc from the address

Thanks for the link, that's cool. Reminds me on this construction:

formatting link

Would be interesting to build the LED table without photosensors with this idea (the table was made with photosensors, as described at this page:

formatting link
).

Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de

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.

John Devereux

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!"

:-)))

Just make sure it's sensitive enough and reliable.

Regards, Joerg http://www.analogconsultants.com/

Use the same LED for the light sensor (during off time).

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.

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.

Regards, Joerg http://www.analogconsultants.com/

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

The ATtiny13 has a 1.5 us sample/hold window.

The ISL29000 looks interesting, from intersil

martin

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.

Regards, Joerg http://www.analogconsultants.com/

If that's a true sample & hold this should suffice.

Regards, Joerg http://www.analogconsultants.com/

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required