Photoconductive Cell

Photoconductive Cell
250mW, 250V peak
12Kohm max light, 1Mohm min dark
Jameco Part # 120299

The photoconductive cell (photocell), effectively reads the amount of light hitting its surface, changing the resistance in its circuit. As the light gets brighter, the resistance lowers; darker light increases resistance. One thing to keep in mind is that photocells generally have a low reaction time (in the 100 ms), which is too slow for many applications (to access a range, you'll probably have to read its value several times over several seconds).

From Wikipedia:
A photoresistor is made of a high-resistance semiconductor. If light falling on the device is of high enough frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electron (and its hole partner) conduct electricity, thereby lowering resistance.

Photocells have a wide range of commercial and industrial uses, including street light control, room light control, contrast control in TVs, toys, camera light meters, clock radios, and security alarms. GE:CU (Germanium Copper) photocells are used in infrared detectors.

I used this photocell to generate sound in an installation via Arduino and Max/MSP. The Arduino Playground proved to be a good resource in opening the doors of communication between the photocell and Max. After downloading the SimpleMessageSystem library, I uploaded this code to my Arduino board:


#include
/* Analog/Digital inputs to MAX/MSP trigger
* ------------
* send serial values to MAX/MSP to trigger something
*/
char firstChar;
char secondChar;
void setup()
{
Serial.begin(115200);
}
void loop()
{
if (messageBuild()) { // Checks to see if the message is complete
firstChar = messageGetChar(); { // Gets the first word as a character
if (firstChar = 'r') { // Checking for the character 'r'
secondChar = messageGetChar(); // Gets the next word as a character
if (firstChar = 'd') // The next character has to be 'd' to continue
messageSendChar('d'); // Echo what is being read
for (int i=0;i

Once I had the code, I needed something to read. Initially, I tested my photocell on a breadboard, wiring one leg to 5V, and splitting the other to go to ground via a 120ohm resistor as well as out to a pin in the Arduino board.

pc circuit diagrampc circuit diagram

photocell testphotocell test

I also used the Max patch that Arduino made available then modified it. I simply linked the pin data coming from the photocell to a tone generator (that's the "cycle~" thing in the picture below). The level of resistance in the photocell sets the frequency of the tone. I found the tones to be a bit low, so I added a multiplication value that has a range from 1 to 100. Multiplying by 100 was incrediably high-pitched and my cat didn't like it at all, so I brought it down some. A video of my initial test is available here..

MaxPatchMaxPatch

After testing, I wanted to create an object that would function without the breadboard. I soldered the resistor directly to one of the legs, then added wire to the other end of the resistor (GND). Another piece of wire was attached to the same leg, without going through the resistor (Pin). A third wire was attached to other leg (5V). These wires are directly plugged into the Arduino board.

soldered photocellsoldered photocell