Light Meter Arduino Project

Arduino Light Meter: Ye olde digitalWrites and analogRead at work.Arduino Light Meter: Ye olde digitalWrites and analogRead at work.Here's an example of something simple and (potentially) practical you can make with an Arduino: a light meter!

The trick for me, if you look at the photo, was to use a voltage divider for the photoresistor. That is, the analog input comes from the point on the circuit between the photoresistor and a 1K ohm resistor.

This gets me pretty much the full analog range into the chip, as opposed to just using the photoresistor, which a few people had trouble with the other day in class.

I also used a trick with the code that kept me from having to use arrays, thereby reducing the memory required to store the program on the chip. Probably. I think. Check it out for yourself (see the attached file).


Obviously, LEDs can be added on at will. In fact, the code is set up so that just changing the pinMax variable will let you do this pretty easily. Try it yerself, cowboys and cowgirls!

AttachmentSize
lightmeter.ogg2.88 MB
lightmeter.pde607 bytes

Copyright Mike Edwards 2006-2009. All content available under the Creative Commons Attribution ShareAlike license, unless otherwise noted.