0% found this document useful (0 votes)
108 views

Binary Desk Clock: by Taifur

This instructable shows how to build a binary desk clock using an Arduino, RTC module, LED driver IC, and wooden case. Key steps include: 1. Engraving the wooden case using a laser engraver. 2. Wiring an Arduino, RTC module, and LED driver chip to control 20 LEDs and display the time in binary. 3. Uploading code to the Arduino to read the time from the RTC and display it on the LEDs while allowing setting the hours and minutes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views

Binary Desk Clock: by Taifur

This instructable shows how to build a binary desk clock using an Arduino, RTC module, LED driver IC, and wooden case. Key steps include: 1. Engraving the wooden case using a laser engraver. 2. Wiring an Arduino, RTC module, and LED driver chip to control 20 LEDs and display the time in binary. 3. Uploading code to the Arduino to read the time from the RTC and display it on the LEDs while allowing setting the hours and minutes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

instructables

Binary Desk Clock

by taifur

Binary Clocks are awesome and exclusively for the person who knows the binary. If you are a tech guy this weird
clock is for you. So, make one by yourself and keep your time secret!

Before going down please watch the demo video.

https://www.youtube.com/embed/B_1klIlCcmA

Binary Desk Clock: Page 1


Step 1: Bill of Materials

Hardware Components 8. Prototype PCB Board (buy from aliexpress.com)

1. Arduino Pro Micro (buy from aliexpress.com) Hardware Tools

2. DS3231 RTC Module (buy from aliexpress.com) 1. CNC 3018 PRO Laser Engraver Wood CNC
Router Machine (buy from aliexpress.com)
3. MAX7219CNG LED Driver IC (buy from
aliexpress.com) 2. Soldering Station (buy one from aliexpress.com)

4. 20 PCS Blue LED, 5mm (buy from aliexpress.com) 3. Wire Cutter (buy from aliexpress.com)

5. 20 PCS Playing Marble (buy from aliexpress.com) 4. Titanium Coated Carbide End Milling Cutter for
CNC (buy from aliexpress.com)
6. Resistor 10K

7. Wires

Binary Desk Clock: Page 2


Step 2: Engraving

Binary Desk Clock: Page 3


I took a 165X145X18.8 mm Soft Maple wood piece Easel Pro is a membership-based cloud software that
for placing the LEDs of the clock. At the top of the led builds upon Inventables’ free Easel software. Easel
will place a marble and the size of a standard playing and Easel Pro minimize the barriers associated with
marble is 15.5mm in diameter. So, I made 15.7 mm complicated CAD and CAM product manufacturing
holes with a depth of 7mm. At the center of the hole, I software, making it easy for users to produce physical
made a 5mm drill for placing the LED. All the text is products.
made with 2mm depth.
Using Easel you can export the design file in G-code
The complete design was prepared by Easel from format or directly set up your CNC from the Easel
Inventables. Easel is a web-based software platform environment. You can also import a previously
that allows you to design and carve from a single, created G-code into the Easel IDE. I included the
simple program and most of the features are free to design file herewith. You can easily modify the design
use. You only required to login to the system by according to your choice.
creating an account or using Gmail.

Binary Desk Clock: Page 4


Step 3: Sanding and Applying Varnish

Varnish can provide a beautiful finish to wood Before applying the varnish you need to remove any
projects and paintings. Before applying varnish to imperfections and blemishes before applying the
wood, sand your piece and clean your workspace. varnish. To do that Use 100 grit sandpaper for
Apply the varnish in several thin layers, letting each unfinished pieces, and work with the grain of the
one dry thoroughly before proceeding to the next. To wood. Sand gently until the piece is smooth. After
varnish a painting, let it dry completely and then cleaning the wood piece apply the varnish in a well-
carefully brush the varnish on. One coat is enough for ventilated area.
many paintings, but you can add an additional layer
as long as you first let the previous one dry
thoroughly.

Binary Desk Clock: Page 5


Step 4: Making the Circuit

The main component of the clock is an Arduino Pro individual LEDs while using only 3 wires for
Mini microcontroller board and a DS3231 RTC communication with the Arduino, and what’s more we
module. The connection of the Arduino Pro Mini and can daisy chain multiple drivers and matrixes and still
the RTC module is very simple. You need to connect use the same 3 wires.
SDA pin of the RTC module to the SDA pin of the
Arduino and SCL pin of the RTC module to the SCL The 64 LEDs are driven by 16 output pins of the IC.
pin of the Arduino. SDA and SCL pins are actually The question now is how is that possible. Well the
A4, and A5 pin of Arduino respectively. You also maximum number of LEDs light up at the same time
need to make a common ground connection between is actually eight. The LEDs are arranged as 8×8 set
Arduino and RTC modules. I used jumper wires to of rows and columns. So the MAX7219 activates
make the connections. each column for a very short period of time and at the
same time it also drives each row. So by rapidly
For showing hour, minute and second a binary clock switching through the columns and rows the human
required 20 LEDs. Arduino board has a limitation of eye will only notice a continuous light.
the GPIO pins. So, I used MAX7219CNG LED driver
IC for driving tons of LEDs using only three pins of The VCC and GND of the MAX7219 go to the 5V and
the Arduino board. GND pins of the Arduino and the three other pins,
DIN, CLK, and CS go to any digital pin of the Arduino
The MAX7219 driver IC is capable of driving 64 board. If we want to connect more than one module

we just connect the output pins of the previous DOUT pin of the previous board goes to the DIN pin
breakout board to the input pins of the new module. of the new board.
Actually these pins are all the same except that the

Binary Desk Clock: Page 6


Step 5: Uploading the Program

The whole program is written in Arduino environment. Two external libraries were used for the sketch. One is for
the RTC module and another is for the MAX7219 IC. Download the libraries from the link and add to the Arduino
IED before compiling the program.

/*
GIT: https://github.com/jarzebski/Arduino-DS3231
*/

#include
#include
#include "LedControl.h"

/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
We have only a single MAX72XX.
*/

DS3231 clock;
RTCDateTime dt;
Binary Desk Clock: Page 7
RTCDateTime dt;
LedControl lc=LedControl(12,11,10,1);

int seconds, minutes, hours;


byte number[10]={B00000000,B01000000,B00100000,B01100000,B00010000,B01010000,B00110000,B01110000,B00001000,B01001000};

void setup()
{
//Serial.begin(9600);
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,15);
/* and clear the display */
lc.clearDisplay(0);
//lc.setLed(0,row,col,true);

// lc.setRow(0,0,B11111111);
// lc.setRow(0,1,B11111111);
// lc.setRow(0,2,B11111111);
// lc.setRow(0,3,B11111111);
// lc.setRow(0,4,B11111111);
// lc.setRow(0,5,B11111111);
// lc.setColumn(0,2,B11111111);
// lc.setColumn(0,3,B11111111);
// lc.setColumn(0,4,B11111111);
// lc.setColumn(0,5,B11111111);

// Initialize DS3231
clock.begin();
// Set sketch compiling time
//clock.setDateTime(__DATE__, __TIME__);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
}

int menu = 0, up, down;

int hours_one;
int hours_ten;
int minutes_one;
int minutes_ten;
int seconds_one;
int seconds_ten;

void loop()
{
if(digitalRead(5)==0){
delay(300);
menu++;
if(menu>3) menu = 0;
}

if(menu==0){
dt = clock.getDateTime();

hours = dt.hour;
minutes = dt.minute;
seconds = dt.second;

if(hours>12) hours = hours - 12;


if(hours==0) hours = 1;

hours_one = hours%10;
hours_ten = hours/10;

minutes_one = minutes%10;
minutes_ten = minutes/10;

seconds_one = seconds%10;
seconds_ten = seconds/10;

Binary Desk Clock: Page 8


lc.setRow(0,0,number[seconds_one]);
lc.setRow(0,1,number[seconds_ten]);
lc.setRow(0,2,number[minutes_one]);
lc.setRow(0,3,number[minutes_ten]);
lc.setRow(0,4,number[hours_one]);
lc.setRow(0,5,number[hours_ten]);
}

if(menu==1){
if(digitalRead(6)==0){
delay(300);
hours++;
if(hours>=24)hours = 0;
}
if(digitalRead(7)==0){
delay(300);
hours--;
if(hours<0)hours = 0;
}
hours_one = hours%10;
hours_ten = hours/10;
lc.setRow(0,2,B00000000);
lc.setRow(0,3,B00000000);
lc.setRow(0,1,B00000000);
lc.setRow(0,0,B00000000);
lc.setRow(0,4,number[hours_one]);
lc.setRow(0,5,number[hours_ten]);
}

if(menu==2){
if(digitalRead(6)==0){
delay(300);
minutes++;
if(minutes>=60) minutes = 0;
}
if(digitalRead(7)==0){
delay(300);
minutes--;
if(minutes<0) minutes = 0;
}
minutes_one = minutes%10;
minutes_ten = minutes/10;
lc.setRow(0,4,B00000000);
lc.setRow(0,5,B00000000);
lc.setRow(0,1,B00000000);
lc.setRow(0,0,B00000000);
lc.setRow(0,2,number[minutes_one]);
lc.setRow(0,3,number[minutes_ten]);
}

if(menu==3){
clock.setDateTime(2020, 4, 13, hours, minutes, 01);
menu = 0;
}

//lc.setLed(0,row,col,false);
//lc.setLed(0,row,col,true);
//lc.setColumn(0,col,B10100000);
//lc.setRow(0,4,B11111111);
//lc.setRow(0,row,(byte)0);
//lc.setColumn(0,col,(byte)0);

// For leading zero look to DS3231_dateformat example


// Serial.print("Raw data: ");
// Serial.print(dt.year); Serial.print("-");
// Serial.print(dt.month); Serial.print("-");
// Serial.print(dt.day); Serial.print(" ");
// Serial.print(dt.hour); Serial.print(":");
// Serial.print(dt.minute); Serial.print(":");
// Serial.print(dt.second); Serial.println("");
//
// delay(1000);
}

Binary Desk Clock: Page 9


Download
https://www.instructables.com/ORIG/FA5/SN2L/K5R37V6O/FA5SN2LK5R37V6O.ino

Step 6: Placing the LEDs

In this stage, I will put all the LEDs to the holes of the cathode pin of a led to a digit pin of the IC and anode
wood. The connection of the LEDs is shown in the pin of the led to a segment pin of the IC. So, our
schematic. As we will use MAX7219 LED driver to column pins should be connected to the segment pins
drive the LEDs, all the LEDs must be connected in and row pins should be connected to the digits pin of
matrix form. So, I connected the anode pins of all the MAX7219.
LEDs in every column together and all the cathode
pins of every row together according to the You need to connect a resistor between ISET pin and
schematic. Now, our column pins are actually anode the VCC of the MAX7219 IC and this resistor control
pin and row pins are actually cathode pin. the segment pins current. I used a 10K resistor to
maintain 20mA in each segment pin.
For driving LEDs using MAX7219 you must connect

Binary Desk Clock: Page 10


Step 7: Connecting LEDs

In this stage, I connected all the LEDs in a row- In this structure, no resistor is required because
column format. I need to use an extra jumper wire to MAX7219 will take care of the current. Before placing
connect the leds but you can made the connection the LEDs i will suggest you check every led. Because
without the help of extra wires if the lead of the LEDs placing a bed led will kill lots of time.
are long enough.

Binary Desk Clock: Page 11


Step 8: Connecting Circuit Board With the LEDs

Our circuit board including RTC, Arduino, and MAX7219 is ready and we also prepared the LED matrix. Now we
need to connect al the things together according to the schematic. I used hot glue for fixing all the circuits in place
and avoiding any short circuit. I also added three button switches for adjusting the time. The buttons are placed at
the top right corner so that it can be easily accessible.

Binary Desk Clock: Page 12


Step 9: Placing the Marbles

All the circuit connection is completed. Now you need to place the marble at the top side of the wood clock. For
placing the marbles I used hot glue. I applied hot glue in every hole at the top of the LEDs and gently placed the
marble in every hole. It will increase the slowness of the led. I used BLUE LED for my clock. It gives me the best
result.

Binary Desk Clock: Page 13

You might also like