Tuesday, April 24, 2007

Final Project - Power Laces

Against my better judgement, I decided to attempt my Power Laces shoe for my final project. I knew it would be very difficult but with the encouragement and enthusiasm from the class, I did my best to create a sneaker that automatically tightens around the wearers foot when they step in the shoe.

The system works like this: First, the wearer puts their foot in the shoe. A sensor in the heel sends a signal to an Arduino mini microcontroller and then the MC sends a signal to the motors, telling them to turn on. There are two wires going across the tongue of the shoe. Both wires are anchored on one end and attached to a motor shaft on the other. The motors begin to wind the wires and tighten the shoe around the foot. When the shoe reaches a certain predetermined tightness, a sensor underneath the tongue and is triggered and sends a signal to the MC. The controller then sends a High signal to both motor legs and prevents the motor from slipping. Now the shoes are tight on the wearers foot. To loosen the shoes, the wearer places the toe of one shoe behind the heel of the other. A magnet in the toe of each shoe closes a magnetic switch in the heel of of the opposite shoe. The microcontroller code is written in such a way that the number of winds it takes to tighten the shoe is recorded and then used to unwind the laces the same number of turns.

Here is the code:

//power laces

int heelswitchPin = 2; // heel switch input
int heelswitchState = 0; // the state of the heel switch
int toemotor1Pin = 3; // H-bridge1 leg 1
int toemotor2Pin = 4; // H-bridge1 leg 2
//int tonguemotor1Pin = 5; //H-bridge2 leg 1
//int tonguemotor2Pin = 6; //H-bridge2 leg 2
int speedPin = 9; // H-bridge enable pin
int sensorPin = 0; // Analog input pin that the sensor is attached to
int sensorValue = 0; // value read from the sensor
int magnetswitchPin = 8; //magnet switch input
int magnetswitchState = 0; //state of the magnet switch
long tightenInterval;
long loosenInterval;
long startTime;


void setup() {
// set the switches as an input:
pinMode(heelswitchPin, INPUT);
pinMode(magnetswitchPin, INPUT);
// initialize serial communications at 9600 bps:
Serial.begin(9600);

// set all the other pins you're using as outputs:
pinMode(toemotor1Pin, OUTPUT);
pinMode(toemotor2Pin, OUTPUT);
// pinMode(tonguemotor1Pin, OUTPUT);
//pinMode(tonguemotor2Pin, OUTPUT);
pinMode(speedPin, OUTPUT);


// set speedPin high so that motor can turn on:
digitalWrite(speedPin, HIGH);


}

void loop() {
// read the heel switch input:
heelswitchState = digitalRead(heelswitchPin);
magnetswitchState = digitalRead(magnetswitchPin);

// if the switch is high, motor will turn on one direction:
if (digitalRead(heelswitchPin) == HIGH) {
digitalWrite(toemotor1Pin, LOW); // set leg 1 of the H-bridge1 low
digitalWrite(toemotor2Pin, HIGH); // set leg 2 of the H-bridge1 high
startTime = millis();
// digitalWrite(tonguemotor1Pin, LOW); //set leg 1 of the H-Bridge2 low
//digitalWrite(tonguemotor2Pin, HIGH); //set leg 2 of the H-Bridge2 high
}

if (analogRead(sensorValue) == 80) {
digitalWrite(toemotor1Pin, HIGH); //set both motor legs to High
digitalWrite(toemotor2Pin, HIGH);
tightenInterval = millis() - startTime;
Serial.println(sensorValue); // print the sensor value back to the debugger pane
}


if (digitalRead(magnetswitchPin) == HIGH ) {

if (tightenInterval >0 ) {
digitalWrite(toemotor1Pin, HIGH); // set leg 1 of the H-bridge1 high
digitalWrite(toemotor2Pin, LOW); // set leg 2 of the H-bridge1 low
delay(tightenInterval);
}
digitalWrite(toemotor1Pin, HIGH); // set leg 1 of the H-bridge1 high
digitalWrite(toemotor2Pin, HIGH); // set leg 2 of the H-bridge1 low

tightenInterval=0;
}


}

This is the schematic for the Arduino circuit with the L293 H-Bridge chip:



Here is the breadboard circuit:





This is a video of the breadboard circuit in action:




Up until this point, everything was working as I had hoped. I neglected to make a video of the final breadboard circuit which includes the code that shuts off the motor after it is finished untying. It did however work just as it was supposed to. The next stage of construction involved making the circuit on a circuit board instead of a breadboard. It does after all have to be small enough to fit on a shoe. Unfortunately this is where the project went sour. I painstakingly recreated the circuit on a small piece of perfboard less than half the size of the original breadboard. In order to do this, I placed the H-bridge chip underneath the Arduino stamp. This made soldering extremely difficult and took close to 5 hours to do. My efforts were in vain however as the finished circuit did not function like the breadboard circuit did. There are so many solder joints and layers of wire that my debugging attempts were futile.

The following are photos of the finished (non-functional) shoe design:





Saturday, April 21, 2007

MIDTERM - THE DISCRETE NUDGE

This is a link to the wiki page for our midterm project:

http://thediscreetnudge.pbwiki.com/?doneLogin=42aec549034a46c1c49d403173dcb173b1681573

Here are some photos of the design process:

This is the original Arduino NG and breadboard prototype:


Miniaturized version on half-breadboard:


mini breadboard with reed switch:


The final circuit complete with indicator lights, battery, and vibrating motor:


The final circuit in it's final, ready to wear form:

Sunday, April 8, 2007

Lab 7 - MIDI Output

This lab featured my old friend, MIDI. The breadboard circuit was pretty straightforward but did not work at first. After a bit of troubleshooting I realized that pins 4 and 5 on the MIDI output jack were switched. After that realization, the lab was working as it should have and I started thinking about making an instrument. Earlier in the semester I attempted to make a drum trigger but was unsuccesful. This time, I used the code from the lab but instead of using a switch, I connected a trigger I made from a piezo element and a practice drum head. When struck, the piezo outputs enough voltage to bring a digital input high. With the Arduino, the high input is sent out to my computer as MIDI data which is running Ableton Live 4. When I hit the drum trigger, a sample of a drum is triggered in LIve. The triggering was pretty accurate with occasional hanging notes. For some reason it was more responsive after the first time I used it. The second time, in class, the triggering was not as tight and I couldn't reproduce the same rolls as I could earlier. I think with some software tweaks, better trigger response can be achieved.


Tuesday, March 27, 2007

Lab 6 - Controlling a DC motor with H-bridge.

For this lab, we used a DC gearhead motor and an H-bridge to control the direction of the motor. This lab was the first in which we used an external IC but since Charlie and I already had some experience working with Xbee's, we setup the Arduino to work with the chip with relative ease. Here are two photos of the board and little movie of the motor spinning and changing direction when I pressed the switch.








For the creative part of the lab, Charlie and I were trying to brainstorm ideas of what to do with the motor. We thought of making a fancy clock, a conveyer belt, and a car. We decided to try and make a car out of junk we found in the lab. I'd say we were pretty resourceful but couldn't quite nail the drive train.



Saturday, March 3, 2007

Lab 5 - Serial and Talking to Processing

This lab proved to be the most trying in terms of getting it all to work properly. It was also the first lab I worked on with other class members which was a nice change. Fortunately for us, the issues were easily resolved with the help of the resident researchers. My first problem was that I couldn't get Terminal to communicate with my Arduino. It turned out that I had left out the word "screen" when prompting the Terminal to find a serial port.
The next snag was getting Processing to communicate with the Arduino. After a web search, Charley found that in Mac OSX, a Terminal command was needed to get access to the serial ports. After that we got the program to run as intended and started to change parameters in the code.



After some fun moving the ball around in the box, I thought that it would be neat if the ball could draw. Charley, having taken a class about Processing, fiddled with the code so that the ball would draw. Lucia then added to the code so that the ball had further range of motion and then I adjusted the size of the ball as well as the size of the drawing space to compensate for the potentiometer range.
When we initially wrote the code, we were using a pot and a photoresistor. I decided that the photocell didn't give enough precision when drawing so I swapped it out for another pot. Knowing that this week's topic was enclosures, I whipped up a little box to hold the breadboard and attached some knobs on the pots so that the controls would be easier.


before.

after.


Here is a video of the application in action.

Tuesday, February 20, 2007

Lab 4 - Analog Out/Servos

For the analog out lab, I picked up a servo motor from the computer store and set the board up like the lab described. I got the servo working with the potentiometer and changed some of the numbers to adjust the range of motion. Whenever I think of servos, I utlimately associate them with animatronics and things of that nature. I rigged up a little scene in which a hand rises from the "grave" when the pot is turned. Need to work on set design some more. Photos show the scene.



Wednesday, February 14, 2007

Observation - Vending Machines

For my observation, I chose a bank of three vending machines in a building on campus. Each machine was slightly different which made for a different kind of interaction for each interface. The first machine was Poland Spring machine that had individual buttons for each drink. This was the simplest interface of the three. The other two machines were of the keypad variety. One was for snacks and the other for beverages.

My first thought was that the Poland Spring interface was the simplest and thus, quickest to use. Each interaction was essentially three parts. First, the person inserted their money. Next, they selected an item by either pushing the button that corresponded with their selection or punching the two digit code on the keypad for their selection. Lastly, they removed the item from the bottom of the machine. I would say each person spent 30 seconds with the machine on average. Some subjects that didn't know what they wanted took longer and some subjects ended up walking away from the machine empty handed after juggling their change around a bit.

On the whole, I was surprised by the efficiency of all of the interactions. Having had my fare share of awkward vending episodes, I thought that at least one person would have trouble getting money into the machine, figuring out what the item key code was, or getting the item out but nobody had this trouble. The time differences for using the two different interfaces was negligable contrary to what I originally thought. I still think that having a seperate button for each item is a more user friendly interface but it didn't seem to be a factor during my observations.

Tuesday, February 13, 2007

Lab 3 - Analog In

For this lab I set up the board so that it would read analog input values. Setting this up was simple enough. I could dim the LED with the potentiometer. The only thing that gave me a problem was getting the values printed on the screen. After some clicking around I found the serial monitor was was reading the values from the potentiometer.



After I read out values from the potentiometer, I swapped it out and stuck in a photocell. I created the voltage divider and was dimming the LED by placing my hand over the cell. I noticed that the LED did not have as great a range as the potentiometer. The LED did not dim all the way either. That has to do with the qualities of the photocell. It might have had a lower absolute dark resistance meaning it is not as sensitive to low light and the resistance never went high enough to completely turn of the LED. Here are photos of the LED with my hand off and then on the photocell.




Unfortunately, after these two successes, I got stump. I attempted to read in values from a photocell that I had inserted into a practice drum pad to make a drum trigger that would output MIDI. I followed a tutorial from a site called TodBot and got code from the ITP site. My best efforts were thwarted and I can only hope to revisit this when we have do the MIDI output lab for class.


Monday, February 5, 2007

Lab 2- 1st Arduino Program

Everything went very smoothly with this lab. From, downloading and installing the Arduino software to getting the board up and running, I didn't run into a single snag which made the lab very fun.


This is the Arduino set up with the breadboard. The power is running from the Arduino to the breadboard with a switch hooked up to digital pin 2 with a pulldown resistor going to ground.



Here are the LED's. The yellow LED is normally on and when switch is pressed, the red LED lights up.





Here is a video of a sequence of 6 LED's running one after the next.


I switched the pins so that the sequence switched from one end to the next to give the illusion that the LED's were moving inward.

I attempted to use the voltage outputs to control an oscillator I made from a 555 chip. I couldn't generate enough voltage so I think I'll have to try again with an op-amp to boost the voltage. I might try a 741.

Sunday, January 28, 2007

Lab 1 - Electronics



Here we have the breadboard setup with the voltage regulator and the meter showing 5 volts.









This is the LED lighting up with the momentary switch being pressed.









Behold the wonders of LED's in series! When I added a third LED they did not light to full brightness. I don't think that there was enough current to power them all.











The potentiometer is dimming the 3 LED's in parallel.










Here is an attempted creative project. I set up these three LED's to look like a traffic light and made switches with bare wires coming out of the board. When you squeeze the wires together you can turn on the traffic signals. They turn on one at a time or all at once if you wanted to cause an accident.

Saturday, January 27, 2007

Welcome!


my workbench.