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:


































