Monthly Archives: February 2012

Arduino: PhotoResistor Motor & Stepper Motor

I bought a bunch of CdS photo resistors from ebay. The basic use of these is to change resistance depending on the ambient light it detects. More light = less resistance and less light = more resistance. You can set it up in a circuit with a DC motor to make it spin faster or slower. See attached image for the circuit. Basically when the transistor gets more ground on the base, it flows more current through, making the motor spin faster.

For Stepper Motor, I used the arduino code and information available here to setup the photo resistor with an Arduino Uno board. The resistance from the photo resistor is converted into an analog signal which in turn is converted to a integer value. This value can be used to turn something on/off. In this case, I used a stepper motor connected to a group of gears that I removed from an old HP laser printer. The stepper motor is connect to a motor shield and set to turn on when the “int” value of the photo resistor is 900 or higher. See attached Arduino code.

PhotoStepper (copy to .pde file)

The video cannot be shown at the moment. Please try again later.