rolerman-clock

Alarm Sundial

The Alarm Sundial is a fully functional sundial alarm clock that uses the shadow of the sun to trigger a moveable alarm. The project is a mash-up of the modern alarm clock with the ancient art of timekeeping. While the alarm clock is a byproduct of the highly scheduled lifestyle, the Sundial is a reminder of how far schedules have come.

The device consists of a light sensor, which is hooked up to an Arduino inside the box. When the shadow of the sundial crosses the light sensor, it sets off the alarm. This way, the position of the sensor radially around the sundial controls the time of the alarm.

When the shadow crosses the sensor, the alarm is set off.

The sun hasn’t come out yet this week, but when it does, I’ll be shooting a video of my clock working outside as intended. For now, here is a video demonstrating the effect:

Technology

The Alarm Sundial’s guts consist of an Arduino, an SD card reader, an audio amplifier, two speakers, and a photoresistor. The photoresistor sends brightness values to the Arduino, which decides whether there is a shadow cast or not. If a shadow is cast, the Arduino unmutes the speakers, and plays an alarm sound file off of the SD card.



Code:

#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"
 
// TMRpcm library from TMRh20 on GitHub: https://github.com/TMRh20/TMRpcm
TMRpcm tmrpcm;
 
int ampPowerPin = 7;
int lightPin = 0; 
int lastVal = 0;
int currVal = 0;
int lightVal = 0;
int thresh = 40;
 
void setup()
{
    Serial.begin(9600);
    lastVal = analogRead(lightPin) / 4;
    lightVal = analogRead(lightPin) / 4;
    pinMode(ampPowerPin, OUTPUT);
    tmrpcm.speakerPin = 9;
    if (!SD.begin(SD_ChipSelectPin)) {
      Serial.println("SD fail");
      return;
    }
    tmrpcm.setVolume(2);
}
 
void playAlarm() {
   digitalWrite(ampPowerPin, HIGH);
   tmrpcm.play("alarm.wav");
}
 
void loop()
{
  // deal with weird audio interference
  if (!tmrpcm.isPlaying()) {
      digitalWrite(ampPowerPin, LOW);
   }
 
   currVal = analogRead(lightPin) / 4; 
   if (abs(currVal - lightVal) > thresh && !tmrpcm.isPlaying()) {
    Serial.println("playing alarm");
    playAlarm();
   }
 
   delay(10); //short delay for faster response to light.
}

 

Fabrication

A massive thank you to Avi Romanoff for helping me with CAD and with the laser cutter, his help was invaluable to getting this done.

I made a paper prototype before preparing the files for laser cutting.

To figure out the angles of the sundial lines, I used this tool by Greg Tarrant. I input the latitude of Pittsburgh, and it output the angles at which I should draw the lines around the sundial.

The final version next to the prototype

Paper sketches

The project came together the way I envisioned, and I’m happy with what I made.

This project was supported in part by funding from the Carnegie Mellon University Frank-Ratchye Fund for Art @ the Frontier.