I did this assignment with a light sensor, but was not too successful. I finally had to revert back to my trusty potentiometer.