Project tutorial
Arduino Giant LED Clock by PCB GOGO

Arduino Giant LED Clock by PCB GOGO © GPL3+

A very huge LED clock made with an LED strip, an RTC module and other parts you will find in the project. Very, ver nice to see, believe me!

  • 842 views
  • 8 comments
  • 10 respects

Components and supplies

Necessary tools and machines

Cardboard
09507 01
Soldering iron (generic)
LED Strip 5m

About this project

I was inspired by this project (the original one), so I made another one by myself.

For mine I used a custom PCB by PCBGOGO, but here in this example we will use a simple breadboard.

I made its PCB on software and after designing the PCB I was in search of a good and affordable PCB manufacturer.

I came to know about PCBGOGO and after that I decided to order the PCB to PCBGOGO by completing my order very simply at www.pcbgogo.com. I received my order after 7 days via FedEx and then I made my project.

Note: Order your custom PCB at PCBGOGO -> https://www.pcbgogo.com?code=t

(You will get a discount by registering via this link).

PCBGOGO is a reliable and best service and it provides great quality PCB at very low price.

They provide high quality PCB services along with the assembly service and you can order minimum 5 pieces.

PCBGOGO is fully compliant with ISO 9001:2008 quality management system and is UL certified.

Obviously, all the circuit boards are fully tested before shipping.

PCB instant quote is available and there is no hidden cost associated.

You can also order your PCB quickly on urgent basis.

Shipping methods offered are DHL, UPS, FED-EX & HK POST.

You can easily track your order, your PCB manufacturing process as well as the shipping status of your order. In the end, I'd like to thanks such a great PCB service provider.

If you want this project on a high quality PCB then you can just place your at PCBGOGO by just clicking this link https://www.pcbgogo.com?code=t

The procedure is just simple and you can simply place your order at a best rate. I selected this pcb manufacturer because they are cheap and provides a best quality pcb with in a very less time at your doorstep.

Now, let's see the schematic and the code of the project!

Code

Code for the Arduino NanoC/C++
This makes your led strip change by following the RTC module (so it will give you the exact time on LED Strip
#include <DS3232RTC.h>
#include <Time.h> 
#include <Wire.h> 
#include "FastLED.h"
#define NUM_LEDS 29 // Number of LED controles (remember I have 3 leds / controler
#define COLOR_ORDER BGR  // Define color order for your strip
#define DATA_PIN 6  // Data pin for led comunication

CRGB leds[NUM_LEDS]; // Define LEDs strip
byte digits[10][7] = {{0,1,1,1,1,1,1},  // Digit 0
                     {0,1,0,0,0,0,1},   // Digit 1
                     {1,1,1,0,1,1,0},   // Digit 2
                     {1,1,1,0,0,1,1},   // Digit 3
                     {1,1,0,1,0,0,1},   // Digit 4
                     {1,0,1,1,0,1,1},   // Digit 5
                     {1,0,1,1,1,1,1},   // Digit 6
                     {0,1,1,0,0,0,1},   // Digit 7
                     {1,1,1,1,1,1,1},   // Digit 8
                     {1,1,1,1,0,1,1}};  // Digit 9 | 2D Array for numbers on 7 segment
bool Dot = true;  //Dot state
bool DST = false; //DST state
int ledColor = 0x0000FF; // Color used (in hex)
void setup(){ 
//  Serial.begin(9600); 
//  Wire.begin(); 
  LEDS.addLeds<WS2811, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS); // Set LED strip type
  LEDS.setBrightness(255); // Set initial brightness
  pinMode(2, INPUT_PULLUP); // Define DST adjust button pin
  pinMode(4, INPUT_PULLUP); // Define Minutes adjust button pin
  pinMode(5, INPUT_PULLUP); // Define Hours adjust button pin
} 
// Get time in a single number, if hours will be a single digit then time will be displayed 155 instead of 0155
int GetTime(){
  tmElements_t Now;
  RTC.read(Now);
  //time_t Now = RTC.Now();// Getting the current Time and storing it into a DateTime object 
  int hour=Now.Hour;
  int minutes=Now.Minute;
  int second =Now.Second;
  if (second % 2==0) {Dot = false;}
    else {Dot = true;};
  return (hour*100+minutes);
  };

// Check Light sensor and set brightness accordingly
void BrightnessCheck(){
  const byte sensorPin = 3; // light sensor pin
  const byte brightnessLow = 5; // Low brightness value
  const byte brightnessHigh = 255; // High brightness value
  int sensorValue = digitalRead(sensorPin); // Read sensor
  if (sensorValue == 0) {LEDS.setBrightness(brightnessHigh);}
  else {LEDS.setBrightness(brightnessLow);}  
  };
  
// Convert time to array needet for display 
void TimeToArray(){
  int Now = GetTime();  // Get time
  int cursor = 29;
  
//  Serial.print("Time is: ");Serial.println(Now);
  if (DST){   // if DST is true then add one hour
   Now+=100;
//   Serial.print("DST is ON, time set to : ");Serial.println(Now);
  }; 
  if (Dot){leds[14]=ledColor;}
    else {leds[14]=0x000000;
    };
  for(int i=1;i<=4;i++){
    int digit = Now % 10; // get last digit in time
    if (i==1){
//      Serial.print("Digit 4 is : ");Serial.print(digit);Serial.print(" ");
      cursor =22;
      for(int k=0; k<=6;k++){ 
//        Serial.print(digits[digit][k]);
        if (digits[digit][k]== 1){leds[cursor]=ledColor;}
         else if (digits[digit][k]==0){leds[cursor]=0x000000;};
         cursor ++;
        };
//      Serial.println();
      }
    else if (i==2){
//      Serial.print("Digit 3 is : ");Serial.print(digit);Serial.print(" ");
      cursor -=14;
      for(int k=0; k<=6;k++){ 
//        Serial.print(digits[digit][k]);
        if (digits[digit][k]== 1){leds[cursor]=ledColor;}
         else if (digits[digit][k]==0){leds[cursor]=0x000000;};
         cursor ++;
        };
//      Serial.println();
      }
    else if (i==3){
//      Serial.print("Digit 2 is : ");Serial.print(digit);Serial.print(" ");
      cursor =7;
      for(int k=0; k<=6;k++){ 
//        Serial.print(digits[digit][k]);
        if (digits[digit][k]== 1){leds[cursor]=ledColor;}
         else if (digits[digit][k]==0){leds[cursor]=0x000000;};
         cursor ++;
        };
//      Serial.println();
      }
    else if (i==4){
//      Serial.print("Digit1 is : ");Serial.print(digit);Serial.print(" ");
      cursor =0;
      for(int k=0; k<=6;k++){ 
//        Serial.print(digits[digit][k]);
        if (digits[digit][k]== 1){leds[cursor]=ledColor;}
         else if (digits[digit][k]==0){leds[cursor]=0x000000;};
         cursor ++;
        };
//      Serial.println();
      }
    Now /= 10;
  }; 
};
void DSTcheck(){
   int buttonDST = digitalRead(2);
//   Serial.print("DST is: ");Serial.println(DST);
   if (buttonDST == LOW){
    if (DST){
      DST=false;
//      Serial.print("Switching DST to: ");Serial.println(DST);
      }
      else if (!DST){
        DST=true;
//        Serial.print("Switching DST to: ");Serial.println(DST);
      };
   delay(500);   
   };
  }

void TimeAdjust(){
  int buttonH = digitalRead(5);
  int buttonM = digitalRead(4);
  if (buttonH == LOW || buttonM == LOW){
    delay(500);
    tmElements_t Now;
    RTC.read(Now);
    int hour=Now.Hour;
    int minutes=Now.Minute;
    int second =Now.Second;
      if (buttonH == LOW){
        if (Now.Hour== 23){Now.Hour=0;}
          else {Now.Hour += 1;};
        }else {
          if (Now.Minute== 59){Now.Minute=0;}
          else {Now.Minute += 1;};
          };
    RTC.write(Now); 
    }
  }
void loop()  // Main loop
{ 
  BrightnessCheck(); // Check brightness
  DSTcheck(); // Check DST
  TimeAdjust(); // Check to se if time is geting modified
  TimeToArray(); // Get leds array with required configuration
  FastLED.show(); // Display leds array
}

Schematics

Schematic
Led ypcsiuvd0k

Comments

Similar projects you might like

Arduino Nano "One Digit" Big LED Clock

Video tutorial by Mirko Pavleski

  • 1,588 views
  • 0 comments
  • 5 respects

Analog Style LED POV Clock

Project tutorial by Mirko Pavleski

  • 7,364 views
  • 2 comments
  • 27 respects

Arduino Infinity Mirror LED Clock

Project tutorial by Mirko Pavleski

  • 2,565 views
  • 2 comments
  • 3 respects

Arduino Nano Clock with 4x64 LED Matrix

Project tutorial by M.V.P.

  • 7,642 views
  • 16 comments
  • 29 respects

Arduino Word Clock on 8x8 RGB LED Matrix

Project tutorial by Mirko Pavleski

  • 4,556 views
  • 4 comments
  • 23 respects

Arduino Wake Up Light Alarm Clock

Project tutorial by wolfidan

  • 1,197 views
  • 0 comments
  • 4 respects
Add projectSign up / Login