Circuits for photocell lego tank, Jim Mahoney, Oct 2012 === left motor driver (see e.g. http://embedded-lab.com/blog/?p=1159 ) ---| diode >|---- | | /--------[ DC motor ] ------[ 9V DC ] |NPN arduino ---[ 1K Ohm] --- |transistor PWM out \------------[ground] pin 9 === right motor driver ---| diode >|---- | | /--------[ DC motor ] ------[ 9V DC ] |NPN arduino ---[ 1K Ohm] --- |transistor PWM out \------------[ground] pin 11 === left photocell (voltage divider; see http://learn.adafruit.com/photocells ) ---[ photocell ]---[ 5V DC] | arduino ----------| analog in | pin A1 ---[ 10K Ohm]------[ ground ] === right photocell (voltage divider) ---[ photocell ]---[ 5V DC] | arduino ----------| analog in | pin A3 ---[ 10K Ohm]------[ ground ] === push button (see http://www.ladyada.net/learn/arduino/lesson5.html ) -----[ switch ]---[ 5V DC] | arduino ---------[ 100 Ohm] ---| digital in | pin 2 -----[ 10K Ohm ]---[ ground]