Project showcase
Word Clock!

Word Clock! © CC BY-NC-SA

Are you tired of looking at spinning hands or plain numbers? This clock gives you the time in English!

  • 250 views
  • 0 comments
  • 4 respects

Components and supplies

Necessary tools and machines

About this project

Why?

Why not!

But really, I had a clock and it's alarm sound was basically an air raid siren. Therefore I took an Ipad and made it my alarm. You could then change alarm noise to something pleasant. The desk they were sitting on was too small though. I wanted an alarm clock that was customizable. Not an alarm and a clock.

The quest begins...

I immediately chose DIy because that is the ultimate customizability! For what type, I searched clocks on thingiverse. There was a clock that struck me as interesting. It used words! With a plan now, I hopped into Tinkercrap- cough cough sorry- Tinkercad and began designing. Tests wastes some wood but, eventually I got a design I was happy with. Cut, Assemble with hot glue, and add LED strips. As an aesthetic bonus I "stained" it white by lightly applying white spray paint.

Onto the electronics.

To control the 22 led strips, my original design was a board that had 22 transistors on it and connected an arduino mega, a 12 volt power supply and the LEDS. It caught on fire and I quickly moved to a purchased solution. Not because I was scared though. I just could not take any more soldering. The 24 Channel PWM Led Driver from Adafruit was the answer. 1 hour of soldering later, the LEDs worked and because of the drivers interface, I could downside to an arduino uno.

The clock needs an accurate way of keeping time. Adafruit to the rescue. Their ds1307 breakout board was very simple to hook up, and worked great. Not much excitement here.

The library I went with is called TMRPCM. It plays sound files off of an SD Card. The Adafruit SD Card adaptor I had lying around worked great! I quickly wired up a simple amplifier hooked to a speaker and stop button, and then it was time to code!

Code

This was uneventful, and took way less time than any of the other sections. In just one hour, the clock was fully functional. Except for one bug... Which was patched so don't worry about it.

How to operate:

For the alarm:

The variables alarmmin and alarmhour: set them to a time you wish the alarm to go off. For no alarm, set the alarmhours to -1. This clock operates in military time. Then reupload code. Follow this tutorial to make the sound for your alarm acceptable for TMRpcm: https://www.instructables.com/id/Audio-Player-Using-Arduino-With-Micro-SD-Card/

For the RTC:

The real time clock must be set to the right time. Upload code. Open the serial monitor, and set the baud rate to 57600. Then type in the current hour. Press enter. Then the current minute. Press enter. Then do the same for the seconds. The clock will update to this new time as soon as you update the seconds. Give about 1 second between entering each time(hours mins seconds) for the code to cycle.

Now you hopefully have a clock, or at least you know how I have mine. :)

Code

The Code! Version 2C/C++
Paste, Upload, Enjoy.
To anyone who saw this message, the bug is fixed!
//Look though this code if you want. Anything with a comment is changeable.

#include <Adafruit_TLC5947.h>
#include <Wire.h>
#include <RTClib.h>
#include <SD.h>
#include <TMRpcm.h>
#include <SPI.h>

#define SD_ChipSelectPin 8
#define NUM_TLC5974 1
#define din 4
#define clock 5
#define latch 6
RTC_DS1307 rtc;
TMRpcm tmrpcm;
Adafruit_TLC5947 tlc = Adafruit_TLC5947(NUM_TLC5974, clock, din, latch);

//Alarm Times
byte alarmhours = 8;
byte alarmminutes = 0;

String inputString = "";
boolean stringComplete = false;
int t = 0;
int hou = 0;
int m = 0;
int s = 0;
String data = "";
bool buttonpress = false;
int light = 4096;
byte to = 0;
byte past = 0;
bool itis = false;
bool mins = false;
byte h = 0;
int button = 0;
bool alarmran = false;

void setup () {
  rtc.begin();
  inputString.reserve(200);

  tmrpcm.speakerPin = 9;
  if (!SD.begin(SD_ChipSelectPin))
  {
    Serial.println("SD fail");
    return;
  }
  //Speaker Volume 1-6 1=quiet 6=loudest + audio cliping. 5 is best
  tmrpcm.setVolume(5);


  Serial.begin(57600);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    rtc.adjust(DateTime(2019, 6, 11, 0, 0, 0));
  }

  tlc.begin();
}

void displayupdate() {
  DateTime now = rtc.now();

  for (uint16_t i = 0; i < 8; i++) {
    tlc.setLED(i, 0, 0, 0);
  }

  past = 0;
  to = 0;

  itis = false;

  if (now.minute() > 25 && now.minute() <= 30) {
    tlc.setLED(0, light, light, 0);
    itis = true;
  }
  if (now.minute() > 5 && now.minute() <= 10) {
    tlc.setLED(0, light, 0, light);
    itis = true;
  }
  if (now.minute() > 45 && now.minute() <= 50) {
    tlc.setLED(0, light, 0, light);
    itis = true;
  }

  if (itis == false) {
    tlc.setLED(0, light, 0, 0);
  }

  if (now.minute() > 10 && now.minute() <= 15) {
    tlc.setLED(1, light, 0, 0);
  }
  if (now.minute() > 40 && now.minute() <= 45) {
    tlc.setLED(1, light, 0, 0);
  }
  if (now.minute() > 15 && now.minute() <= 20) {
    tlc.setLED(1, 0, light, 0);
  }
  if (now.minute() > 35 && now.minute() <= 40) {
    tlc.setLED(1, 0, light, 0);
  }
  if (now.minute() > 0 && now.minute() <= 5) {
    tlc.setLED(1, 0, 0, light);
  }
  if (now.minute() > 50 && now.minute() <= 55) {
    tlc.setLED(1, 0, 0, light);
  }
  if (now.minute() > 20 && now.minute() <= 25) {
    tlc.setLED(1, 0, light, light);
  }
  if (now.minute() > 30 && now.minute() <= 35) {
    tlc.setLED(1, 0, light, light);
  }

  if (now.minute() > 30 && now.minute() < 55) {
    to = 1;
  }
  if (now.minute() < 31 && now.minute() > 0) {
    past = 1;
  }

  mins = false;
  if (now.minute() > 5 && now.minute() <= 10) {
    tlc.setLED(2, light, light * to, light * past);
    mins = true;
  }
  if (now.minute() > 45 && now.minute() <= 50) {
    tlc.setLED(2, light, light * to, light * past);
    mins = true;
  }
  if (now.minute() > 15 && now.minute() <= 25) {
    tlc.setLED(2, light, light * to, light * past);
    mins = true;
  }
  if (now.minute() > 30 && now.minute() <= 40) {
    tlc.setLED(2, light, light * to, light * past);
    mins = true;
  }
  if (now.minute() > 50 && now.minute() <= 55) {
    tlc.setLED(2, light, light * to, light * past);
    mins = true;
  }
  if (now.minute() > 0 && now.minute() <= 5) {
    tlc.setLED(2, light, light * to, light * past);
    mins = true;
  }

  if (mins == false) {
    tlc.setLED(2, 0, light * to, light * past);
  }

  if (now.minute() > 30 && now.minute() < 55) {
    h = now.hour() + 1;
  }
  if (now.minute() <= 30) {
    h = now.hour();
  }

  if (h == 1) {
    tlc.setLED(3, light, 0, 0);
  }
  if (h == 2) {
    tlc.setLED(3, 0, 0, light);
  }
  if (h == 3) {
    tlc.setLED(3, 0, light, 0);
  }
  if (h == 4) {
    tlc.setLED(4, light, 0, 0);
  }
  if (h == 5) {
    tlc.setLED(4, 0, light, 0);
  }
  if (h == 6) {
    tlc.setLED(4, 0, 0, light);
  }
  if (h == 7) {
    tlc.setLED(5, light, 0, 0);
  }
  if (h == 8) {
    tlc.setLED(5, 0, light, 0);
  }
  if (h == 9) {
    tlc.setLED(5, 0, 0, light);
  }
  if (h == 10) {
    tlc.setLED(6, light, 0, 0);
  }
  if (h == 11) {
    tlc.setLED(6, 0, light, 0);
  }
  if (h == 12) {
    tlc.setLED(6, 0, 0, light);
  }

  if (h == 13) {
    tlc.setLED(3, light, 0, 0);
  }
  if (h == 14) {
    tlc.setLED(3, 0, 0, light);
  }
  if (h == 15) {
    tlc.setLED(3, 0, light, 0);
  }
  if (h == 16) {
    tlc.setLED(4, light, 0, 0);
  }
  if (h == 17) {
    tlc.setLED(4, 0, light, 0);
  }
  if (h == 18) {
    tlc.setLED(4, 0, 0, light);
  }
  if (h == 19) {
    tlc.setLED(5, light, 0, 0);
  }
  if (h == 20) {
    tlc.setLED(5, 0, light, 0);
  }
  if (h == 21) {
    tlc.setLED(5, 0, 0, light);
  }
  if (h == 22) {
    tlc.setLED(6, light, 0, 0);
  }
  if (h == 23) {
    tlc.setLED(6, 0, light, 0);
  }
  if (h == 0) {
    tlc.setLED(6, 0, 0, light);
  }

  if (now.minute() == 0 or now.minute() > 55) {
    tlc.setLED(7, light, 0, 0);
  }


  tlc.write();
}

void addition() {
  DateTime now = rtc.now();
  // Dims Light
  if (now.hour() < 6 or now.hour() > 21) {//Change the times for on/off light dimming
    light = 500; //Dimmest 0-4096
  }
  else {
    light = 4096;// Brightest
  }
}

void(* resetFunc) (void) = 0;

void loop () {
  //Set time from Serial Monitor. Enter each number hours,minutes,second press enter in between
  serialEvent();
  displayupdate();
  addition();

  if (stringComplete) {
    Serial.println(h);
    t = inputString.toInt();
    if (hou != 0 && m != 0 && s == 0) {
      s = t;
    }
    if (hou != 0 && m == 0) {
      m = t;
    }
    if (hou == 0) {
      hou = t;
    }
    if (hou != 0 && m != 0 && s != 0) {
      rtc.adjust(DateTime(2000, 0, 0, hou, m, s));
      hou = 0;
      m = 0;
      s = 0;
    }
    inputString = "";
    stringComplete = false;
  }

  //Alarm
  DateTime now = rtc.now();
  if (alarmhours == now.hour() && alarmminutes == now.minute() && alarmran == false) {
    tmrpcm.play("test.wav");
    do {
      button = analogRead(0);
      if (button > 800) {
        buttonpress = false;

      }
      else {
        buttonpress = true;
        tmrpcm.disable();
      }
    } while (tmrpcm.isPlaying() == 1 && buttonpress == false);
    alarmran = true;
    tmrpcm.disable();
  }

  if (now.hour() == 12 && now.minute() == 1 && now.second() == 15) {
    //alarmran = false;
    delay(1000);
    resetFunc();
  }
  if (now.hour() == 1 && now.minute() == 1 && now.second() == 15) {
    //alarmran = false;
    delay(1000);
    resetFunc();
  }

  delay(1000);
}



void serialEvent() {
  while (Serial.available()) {
    char inChar = (char)Serial.read();
    inputString += inChar;
    if (inChar == '\n') {
      stringComplete = true;
    }
  }
}

Custom parts and enclosures

This is meant to be cut on a k40 laser. Bigger bed sizes will also work. The main parts are for 5 mm plywood, and the filter is for anything thin and semi transparent. It is optional to have the filter
word_clock_laser_files_CnQQYxOVjo.zip

Schematics

The Schematic
Connect all the things like so.
Word clock schem i1hizxdccm

Comments

Author

Norathedoggo
NoraTheDoggo
  • 2 projects
  • 1 follower

Additional contributors

  • Their products are used in this project as well as the respective libraries. by Adafruit

Published on

June 12, 2019

Members who respect this project

DefaultDefaultTicsbeta

and 3 others

See similar projects
you might like

Similar projects you might like

Italian Word Clock

Project tutorial by Tittiamo

  • 5,831 views
  • 5 comments
  • 15 respects

Telephone Activation Clock

Project showcase by eluyten

  • 584 views
  • 1 comment
  • 4 respects

Android Things Word Clock

Project tutorial by Daniele Bonaldo

  • 21,316 views
  • 7 comments
  • 121 respects

Arduino OLED Word Clock

Project showcase by garysat

  • 5,205 views
  • 1 comment
  • 14 respects

Simple Word Clock (Arduino)

Project tutorial by rakshith bk

  • 4,888 views
  • 3 comments
  • 6 respects

Arduino to-the-minute word clock OLED Display

Project showcase by garysat

  • 1,834 views
  • 0 comments
  • 6 respects
Add projectSign up / Login