User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Lab 06: DC Motor: Actuation Assignment 1

Submitted by xiaomeng on Wed, 10/15/2008 - 21:32

Assignment: DC Motor: Actuation Assignment 1

Collaborators:

Collaborators: Laura Paajanen

Description

We created a vehicle for Mr. Moose. We tried to make the car drive on a flat surface, but the wires to the board were short and getting the tires connected tightly enough with the motors was tricky, so the weight of the car slowed it greatly and strained the tire connections. The wheels spin much better when they're not touching the ground, so an alternate title might be "Mr. Moose Spins his Wheels." We created a circuit so that both motors could share one battery pack but each have their own transistors and diodes. The motors were connected to the same pot so they could move at the same rate.

Components Used

  • Arduino Board
  • 2 Transistors
  • 2 Diodes
  • 2 1k Resistors
  • Wire
  • Breadboard
  • USB cable
  • Laptop running Arduino
  • Potentiometer (to control speed)
  • Wood, electrical tape, and erector parts to create the car
  • Mr. Moose

 

 

 

 

Arduino Code

/*
* one pot fades one motor
* modified version of AnalogInput
* by DojoDave
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave
* Also modified by Christina and Laura
*/

int potPin = 0; // select the input pin for the potentiometer
int motorPin1 = 9; // select the pin for the Motor
int motorPin2 = 10; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin1, val/4); // analogWrite can be between 0-255
analogWrite(motorPin2, val/4); // analogWrite can be between 0-255
}

Our board

The car's structure

The wheel attachment to the motor

Mr. Moose on his car

The wheels accelerating as the pot is turned

Mr. Moose spinning his wheels