Autonomous Robot Part 2 – TicTok

Group Member: Horace Hou, Zac Mau

Horace Hou, Zac Mau as Scribe, Designer, Integrator, Tutor,

Introduction

TicTok is a set of clocks which have their hands linked together by a conductive elastic. One of the clocks behave like a regular clock whereas the other clock actively tries to stop the other from rotating regularly.

Video

 

Circuit Diagram

Clock schematic

Technical Notes

For our project we used a flexible conductive elastic, whose resistance changes when it is pulled. Using an Arduino we measured the current of the elastic to determine when the clock hands where farthest away from each other. Using this information we adjusted the speed of the each individual stepper motor. The stepper motors are powered by a 6V power supply and the elastic is powered by the 3.3V input on the Arduino. The stepper motors are connected to stepper drivers which is in turn connected to the Arduino.

The stepper motor has a pedestal which allows the motor to be at the centre of the clock face. The stepper motor is screwed into the pedestal. The elastic is tied onto the ends of the clock hands. Wiring is passed underneath the clock hands where an exposed wire rotates over some conductive foil which acts as a slip ring.

 

Photos

Initial Design Drawing

diagram

 

First PrototypeIMG_6446

Second Prototype

IMG_6464 IMG_6472

Stepper Motor HolderIMG_6455

IMG_6489

 

Arduino Code

#include <Stepper.h>
#define MAX_SPEED 1000
const int stepsPerRevolution = 200;
int speed1 = 200;
int speed2 = 200;
int sensorNow;
int sensorLast;
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper stepper1(stepsPerRevolution, 6, 7);
Stepper stepper2(stepsPerRevolution, 8, 9);
void setup() {
  Serial.begin(9600);// nothing to do inside the setup
}
void loop() {
    sensorLast = sensorNow/2;
  sensorNow = analogRead(A0);
  if (sensorNow < sensorLast) {
   stepper1.setSpeed(sensorNow);
   stepper2.setSpeed(sensorLast);
  }
  if (speed1 >= 0 )
      {stepper1.setSpeed( speed1 += 400);}
      else {stepper1.setSpeed( speed1 -= 400);}
  if (speed2 >= 0 )
      {stepper2.setSpeed( speed2 += 400);}
      else {stepper2.setSpeed( speed2 -= 400);}
   Serial.print(“Sensor Now: “);
   Serial.print(sensorNow);
   Serial.print(” | Stepper 1: “);
   Serial.print(speed1);
   Serial.print(” | Stepper 2: “);
   Serial.println(speed2);
    // step 1/100 of a revolution:
    stepper1.step(20);
    stepper2.step(-10);
}