Forum Index > General > Ask an Evil Mad Scientist!
 Simple light sensor for ATmega
 |  Printable Version
By: gunhed (offline) on Thursday, February 25 2010 @ 07:42 AM PST (Read 5594 times)  
gunhed

Greetings! I've got an idea for an interactive art project, and what I need is a simple, low-tech way to measure visible light intensity and feed that information to an ATmega328. My thought was to use a photodiode or a phototransistor and connect it to one of the processor's ADC pins (actually, I would like to hook many of these to all the ADC pins). It doesn't need to be highly accurate or high quality, just dependable and cheap! My rough idea is to have an array of these to create a raw "light intensity map" of the surrounding area, sort of like a primitive proto-eye. I may go so far as to build tiny enclosures for each sensor that directs and focuses light.

The questions I have are:
1. Which do I need, a photo-diode or -transistor? Something else?
2. What's the best circuit to use to interface this to an ADC pin? Do I need an op-amp?
3. Are there any caveats to using the ADC port (i.e. the 1.1V internal ref voltage, etc.)?

Any help or suggestions would be great!
Thanks! Smile
-Emo


Forum Henchperson
Henchperson


Status: offline

Registered: 12/30/09
Posts: 21

Profile Email    
   
By: Windell (offline) on Thursday, February 25 2010 @ 10:52 AM PST  
Windell

>Which do I need, a photo-diode or -transistor? Something else?

Either will work, as will a photoresistor (AKA photocell or LDR).

>What's the best circuit to use to interface this to an ADC pin? Do I need an op-amp?

Usually a phototransistor or photoresistor can be used with just one external resistor to convert the current or resistance into a voltage. If you're using a photodiode, you may want to add an external transistor or op-amp for gain.

On this page, there's an example "IR sensor" circuit that's what you need for a phototransistor. One LED, your +V, and your analog input
http://www.itee.uq.edu.au/~emami/metr2800/

You can use pretty much the same circuit for a CdS photocell:
http://www.neufeld.newton.ks.us/electronics/?p=135

>3. Are there any caveats to using the ADC port (i.e. the 1.1V internal ref voltage, etc.)?

Sounds like you need easy and cheap; I'd use just the power supply (probably 5 V or so) hooked up to the ADC reference pin. If you use a different reference (like 1.1 V), you'll need to keep care to reference your analog signals to that range. Keeping things inside the power supply range is easier.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: gunhed (offline) on Thursday, February 25 2010 @ 11:08 AM PST  
gunhed

Thanks, Windell - that's just what I needed! Big Grin


Forum Henchperson
Henchperson


Status: offline

Registered: 12/30/09
Posts: 21

Profile Email    
   



 All times are PDT. The time is now 07:33 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?