November 24, 2007
Reading for November 27th, are now posted. Enjoy!

October 2, 2007
To upload your thoughtless acts, create a new assignment page like any other lab. You'll see "Thoughtless Acts" listed as one of the assignment options.

May 24, 2008
This site has been archived and is no longer editable. Stay tuned for the next version, coming in the fall!

Lab6- Optical Vehicle

Project Members: 
Hsin-Hsien Chiu

Description: Optical Vehicle

Since I only have one DC motor, a set of gears is adopted to apply one DC motor into two directions. The original setup for this optical vehicle is only two wheels; however, it’s hard to be balanced when putting something on it. Thus, two small extra wheels are added in the front part of the model. The motion of the Optical Vehicle is controlled by a FSR. The major wheels emit green and blue light separately, controlled by the other FSR and photocell sensor.  



Components: Two force pressure resistors, one photocell sensor, Arduino board, breadboard, wires, Blue and Green LEDs, one silicon translucent ball, a set of gears.  

Arduino Code:

 * DC motors Input
 * Resistive Sensor Input
 * Takes the input from a resistive sensor, e.g., FSR or photocell
  * by Hsin-Hsien Chiu, 2007

int sensor1Pin = 0;  // select the input pin for the sensor

int sensor2Pin = 1;

int moterPin = 2;

int BluePin = 11;    // select the output pin for the LED

int GreenPin = 10;

int morterPin = 9;

int sensor1val = 0;        // variable to store the value coming from the sensor

int sensor2val = 0;

int moterval = 0;

void setup() {



void loop() {

  sensor1val = analogRead(sensor1Pin); // read the value from the sensor, 0-1023

  sensor2val = analogRead(sensor2Pin);

  moterval = analogRead(moterPin);

  analogWrite(BluePin, sensor1val/4);  // analogWrite (dimming the LED) can be between 0-255

  analogWrite(GreenPin, sensor2val/4);

  analogWrite(morterPin, moterval/4);

  Serial.println(sensor1val/4);       // writing the value to the PC via serial connection



  delay(50);                   // rest a little...






PA100003-2.jpg38.05 KB
PA110012-s.jpg53.04 KB
PA110013-s.jpg39.01 KB
PA110015-s.jpg41.03 KB
PA110016-s.jpg38.59 KB


Comments from TAs

Very nice work! Connecting your motor to gears and getting the vehicle to be steerable must have been a lot of work. As other students start working with mechanical systems in later labs or in their final projects, it would be great if you'd be willing to give advice on building similar sets of gears. I like the video!

Powered by Drupal - Design by Artinet