LightWire (wk6)

ian's picture

Description

Originally, I wanted to make an object similar to Live Wire that allowed one to change the speed of a spinning string and therefore see different mode patterns in the string. In actuality, the motor is too fast to allow for any other stable modes aside from 3 fixed points and two oscillating points. However, the string is actually very unstable, twists and tangles often, etc. I had the potentiometer also control a flashing light to capture certain configurations (it has to be pretty dark) of the string while it is spinning. The faster the string spins, the quicker the LED blinks, and the shorter duration, to better "freeze" the string.

Components

  • TIP120 transistor
  • potentiometer
  • diode
  • 1 kΩ resistor
  • battery pack
  • twine
  • washer
  • cork slice to offset string from motor axis
  • small DC motor

Arduino Code


// Ian Leighton
// TUI homework 6
// 2011-10-11
 
/*
 * one pot fades one motor
 * modified version of AnalogInput
 * by DojoDave <http://www.0j0.org>
 * http://www.arduino.cc/en/Tutorial/AnalogInput
 * Modified again by dave
 */
 
#define potPin 0   // select the input pin for the potentiometer
#define motorPin 3 // select the pin for the Motor
#define ledPin 13
 
int val = 0;      // variable to store the value coming from the sensor
int ontime;
int offtime;
void setup() {
  Serial.begin(9600);
}
void loop() {
  val = analogRead(potPin);    // read the value from the sensor, between 0 - 1024
  Serial.println(val);
  analogWrite(motorPin, val/4); // analogWrite can be between 0-255
 
  ontime = 20 - map(val,0,1023,2,18);
  offtime = 500 - map(val,0,1023,100,470);
  analogWrite(ledPin, 255); 
  delay(ontime);
  analogWrite(ledPin, 0);
  delay(offtime);
}
 

 

wiring
motor and led
faint long exposure image of it working
0
Your rating: None