in this project i attached a photocell with a 10k downpull to the analog i/o of my arduino w/ 5volts. Also attached are 5 LEDs connected to digital i/o pins 3, 5, 9, 10, and 11 -- all grounded with 220k resistance. the raw analog output of the photocell is read by the arduino, converted into a pulse-width modulation, broken into 6 sub-ranges, and output to the 5 LEDs using 'if/else if' statements; ranging from 0 (no LED output or very high light input) to 255 (5 LED output or very low light output). The light bargraph itself actually measures the approximate range of the pulse-width modulation.
**EDIT**
as lucasmontec has correctly pointed out in the comments, it is not a photocell but an LDR. i believe a large majority of people refer to these devices as photocells, and for that reason have left 'photocell' in the video title.
that is an LDR not a photocell
lucasmontec 2 years ago
which is a photocell
nativecodr 2 years ago
@nativecodr LDR is a photo sensitive resistor. It changes its resistance depending on the amount of light and does not generate energy. Photocells are silicon (Crystalline Silicon) arrays that generate a potential difference between the first layer and last layer of conductive material.
lucasmontec 2 years ago
i see. i was under the impression that the term 'photocell' referred to a device that produced a variable voltage when exposed to electromagnetic activity. my mistake...
nativecodr 2 years ago
@nativecodr hmmm
but that is the description of any energy generation device... anyway nice project!
lucasmontec 2 years ago
i suppose that is correct. you seem to have quite a bit of knowledge on the subject, so i can only assume you know what youre talking about. perhaps i should get a refund on my education hahah. Thanks for the compliment. the circuit is really quite simple. I would like to take this same idea and implement it into an 8x8 random matrix of rgb leds and use four ldrs ;) to calculate ambient lighting... like a fancy color changing picture, complete with frame.
nativecodr 2 years ago