Binary metric clock using Arduino

This is a very odd kind of clock, which can easily be made with simple supplies.
To begin the explanation, I would like to say that I have always wanted time to be metric. 5 o’clock would be mid-day, 7:5 would be three quarters (6:00 pm), and so on. This prototype tells deci-days, centi-days, and milli-days, in that order. For those that are unfamiliar, ten deci-days are in a day, ten centi-days are in a deci-day, and ten milli-days are in a centi-day. For comparison, a milli-day is 86.4 seconds.
With my limited supplies, I had to make it read in binary, but that’s alright with me!

A note:
I am a beginner at Arduino. And a beginner at instructables. So at times it may not be perfect, and I hope you have some understanding!

Binary metric clock using Arduino

Step 2: Building it

The set up is pretty easy. If you take a look at the picture (created using Fritzing), the blue lines are wires, red things are leds, and the resistors are 330 ohm resistors. It is remotely self-explanatory.

 

Step 3: Code & explanation

The complete code is available as binarymetricclock.ino. I will now proceed to explain the code:

int deci = 0, centi = 0, milli = 0, micro = 0;

These are the variables that keep track of the time. 0, 0, 0, 0 means midnight. These should be set to the time when you upload the code, or power it on for the first time.

void setup ()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
}

This code is fairly self explanatory. I could have used a loop or something, but I chose not to.

[box color=”#985D00″ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12″ float=”right” head=”Major Components in Project” headbg=”#FFEB70″ headcolor=”#985D00″]

Supplies

Here is a list of what you’ll need (not very much):
12 leds.                              It helps if 8 are one color, and 4 are another, but that isn’t all that important.
12 330 ohm resistors.     10k works too, but it makes the leds a bit dim.
An Arduino                        I have an Uno r3, but anything with 12 or more output pins will work.
A breadboard                   You could probably survive without one, but I would highly recommend one.
14 Wires

[/box]

For more detail: Binary metric clock using Arduino


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top