Time Ticks Away
Time Ticks Away is an installation of eight clocks that lets visitors experience the relativity of time. This installation takes place when no one is there to watch it; since the closer one comes, the slower the time passes (also see figure 1.) To take the mickey out of the Expo theme (which is: "Futures") we want visitors of our installation to take a step back and think about the past and everything they have already accomplished. We came up with this concept when thinking about the concept: Future. To us the future is ungraspable and inevitable, and directed by time. Time on the other hand is directed by the very clocks we ourselves have built. The message here is: we are our own masters of time and are free to plan our own time as we see fit, that is how we came to this concept.
figure 1: wall setup schematics
The Setup
The installation is composed of eight Quartz clocks divided in two groups of four. Both sets of clocks have their own ultrasonic sensor that detects the distance to any visitor. This distance is translated into the speed of the cocks: the closer one comes, the slower the clocks tick, until they stand completely still. The standing still of the clocks is meant to propagate away from any approaching visitor to provoke a sense of awe (the silence that ensues can be quite impressive.) We have chosen to stick with Quartz clocks since they are the easiest to come by and are relatively cheap when compared to mechanical clocks. Furthermore, they are powered electrically which means we can hook them up to an Arduino. One Arduino Uno can precisely fit eight clocks and two sensor on its 20 pins (14 digital + 6 analog): because every clock needs two pins, as do the sensors (2x8 + 2x2 = 20). We have specifically chosen to look for eight different clocks to ensure an aesthetically pleasing look of our installation, eight the same clocks would feel quite monotone.
video 1: Time Ticks Away: How we did it.
How did we do it?
Quartz clocks look all very much the same on the inside (see figure 2). There is a set of gears that control the second, minute and hour hands (see figure 3 for the layout). These gears are powered by a single magnetic gear (at the left) that is surrounded by a coil. The coil consist of a solenoid and a metal bar running through it. This solenoid received power from the 1.5V battery and switches the direction of the current due to a tiny crystal at the back of the clock. The crystal is called a Quartz crystal (hence the name: Quartz clocks) and gives off pulses every half a second due to mechanical resonance of the vibrating crystal of piezoelectric material and creates an electrical signal with a precise frequency [1].
figure 2: The inside of a Quartz Clock
Now, we want to control this magnetic field to our own liking and thus have to set this crystal to our own hand. We first looked into replacing the crystal for a crystal with a different (faster) frequency. However, that would not solve our problem since it would still not offer a variable and controllable speed. Furthermore, such crystals are not easy to come by (because what would you need one for?). We then considered mechanically hacking the gear on the outside of the clock that is used to set the clock. However, we have had some bad experience with mechanically hacking gears and decided is was not the way to go. Then we came across a video by Robert Massaioli [2] which in great detail shows how to replace the entire Quartz crystal and solder the solenoid to an H-bridge that can be connected to an Arduino. With this H-Bridge we can namely control the speed of currency change through the solenoid and thus the magnetic field. For a more elaborate explanation, please take a look at video 1.
figure 3: Quartz clock gear layout
How do we simulate a crystal with an H bridge?
The crystal and the solenoid interact to create a magnetic field that spins the magnetic gear. If you want to copy the workings of a crystal you will have to create something that is able to let the power current flow through the solenoid clock wise and counter clock wise. The working of the power current and the schematic for the H bridge can be found in figure 4. With an H-bridge you can essentially make an AC-current with the power source being a DC-current. The motor in figure 4 would be our solenoid of one of the clocks. When you put a current through S1 and S4 the current will go one way and whenever you put a current through S3 and S2 it will change direction through the solenoid. The gates are simulated by transistors, to test our setup we have created the breadboard setup as layed out in figure 5. When we got this working we soldered eight of these H-bridges so we can manipulated every clock on its own.
figure 4: schematic for the H-bridge
figure 5: layout for H-bridge on Breadboard
Now that you have your modified clock connected to the H-bridge and your Arduino, it is time to hook up the ultrasonic sensors to your Arduino to make the installation interactive. in figure 6 you will find a simple schematic of how to connect the sensors to the Arduino. We didn't use any breadboards but simply soldered the wires together.
figure 6: layout sensor connections
The Code
Now all that is left is to upload code to the Arduino to make it all work. In this code you can specify the amount of time between each power pulse the Arduino gives off to the H-bridge, which in turn creates a magnetic field at the solenoid and makes the clock tick. The shorter the amount of time between each pulse, the faster your clock will tick. This code is setup in a way that the closer the people are to the sensor, the slower the clocks will tick. So if people are far away, the sensor will give a high output, this means that interval time of the energy pulses should be low. This will result in fast ticking clocks when no people are near. Keep in mind that very cheap clocks have very cheap gears and cannot run as fast as the more expensive clocks.
This code will also work with a single clock or without sensors.
This is the code to make your arduin run multiple clocks with sensors.
const int echoPin1 = 12; //S1
const int trigPin2 = 11; //S2
const int echoPin2 = 10; //S2
int pinH1 = 0; //Klok H
int pinH2 = 1; //Klok H
int pinA1 = 2; //Klok A
int pinA2 = 3; //Klok A
int pinB1 = 4; //Klok B
int pinB2 = 5; //Klok B
int pinC1 = 6; //Klok C
int pinC2 = 7; //Klok C
int pinE1 = 8; //Klok E
int pinE2 = 9; //Klok E
int pinF1 = A0; //Klok F
int pinF2 = A1; //Klok F
int pinG1 = A2; //Klok G
int pinG2 = A3; //Klok G
int pinD1 = A4; //Klok D
int pinD2 = A5; //Klok D
long previousMillis1 = 0;
long previousMillis2 = 0;
long previousMillis3 = 0;
boolean aIsOn1 = false;
boolean aIsOn2 = false;
boolean aIsOn3 = false;
// establish variables for duration of the ping,
// and the distance result in inches and centimeters:
long duration1, duration2, cm1, cm2, clockTicks1, clockTicks2, averageClockTicks = 0;
void setup() {
pinMode(pinA1, OUTPUT);
pinMode(pinA2, OUTPUT);
pinMode(pinB1, OUTPUT);
pinMode(pinB2, OUTPUT);
pinMode(pinC1, OUTPUT);
pinMode(pinC2, OUTPUT);
pinMode(pinD1, OUTPUT);
pinMode(pinD2, OUTPUT);
pinMode(pinE1, OUTPUT);
pinMode(pinE2, OUTPUT);
pinMode(pinF1, OUTPUT);
pinMode(pinF2, OUTPUT);
pinMode(pinG1, OUTPUT);
pinMode(pinG2, OUTPUT);
pinMode(pinH1, OUTPUT);
pinMode(pinH2, OUTPUT);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
}
void loop()
{
// The sensor is triggered by a HIGH pulse of 10 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);
duration1 = pulseIn(echoPin1, HIGH);
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);
duration2 = pulseIn(echoPin2, HIGH);
// convert the time into a distance
cm1 = microsecondsToCentimeters(duration1);
cm2 = microsecondsToCentimeters(duration2);
if(cm1>250)cm1=250;
if(cm2>250)cm2=250;
unsigned long currentMillis1 = millis();
unsigned long currentMillis2 = millis();
unsigned long currentMillis3 = millis();
clockTicks1=abs(map(cm1,60,250,1000,40));//map cm to time the clock needs to tick, board 1 => 50cm becomes 1000ms and 3m becomes 50 ms
clockTicks2=abs(map(cm2,60,250,1000,40));//map cm to time the clock needs to tick, board 2 => 50cm becomes 1000ms and 3m becomes 50 ms
if(cm1>50){
if(currentMillis1 - previousMillis1 > clockTicks1) {
// save the last time
previousMillis1 = currentMillis1;
// if the LED is off turn it on and vice-versa:
if (aIsOn1){
digitalWrite(pinA1, LOW);
digitalWrite(pinA2, HIGH);
digitalWrite(pinB1, LOW);
digitalWrite(pinB2, HIGH);
digitalWrite(pinC1, LOW);
digitalWrite(pinC2, HIGH);
digitalWrite(pinH1, LOW);
digitalWrite(pinH2, HIGH);
aIsOn1 = false; //TODO: gaat dit goed? Moet deze niet pas geactiveerd worden als de andere zoveel seconden klaar zijn??
}else{
digitalWrite(pinA1, HIGH);
digitalWrite(pinA2, LOW);
digitalWrite(pinB1, HIGH);
digitalWrite(pinB2, LOW);
digitalWrite(pinC1, HIGH);
digitalWrite(pinC2, LOW);
digitalWrite(pinH1, HIGH);
digitalWrite(pinH2, LOW);
aIsOn1 = true;
}
}
}
if(cm2>50){
if(currentMillis2 - previousMillis2 > clockTicks2) {
// save the last time you blinked the LED
previousMillis2 = currentMillis2;
// if the LED is off turn it on and vice-versa:
if (aIsOn2){
digitalWrite(pinD1, LOW);
digitalWrite(pinD2, HIGH);
digitalWrite(pinE1, LOW);
digitalWrite(pinE2, HIGH);
digitalWrite(pinF1, LOW);
digitalWrite(pinF2, HIGH);
digitalWrite(pinG1, LOW);
digitalWrite(pinG2, HIGH);
aIsOn2 = false;
}else{
digitalWrite(pinD1, HIGH);
digitalWrite(pinD2, LOW);
digitalWrite(pinE1, HIGH);
digitalWrite(pinE2, LOW);
digitalWrite(pinF1, HIGH);
digitalWrite(pinF2, LOW);
digitalWrite(pinG1, HIGH);
digitalWrite(pinG2, LOW);
aIsOn2 = true;
}
}
}
}
long microsecondsToCentimeters(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}
[1] Laplante, Phillip A. (1999). Comprehensive Dictionary of Electrical Engineering. US: Springer. ISBN 3540648356.
[2] Robert Massaioli, How fast can a Quartz Clock spin? https://www.youtube.com/watch?v=XzXfadQXRn8