Summary of Binary metric clock using Arduino
The article describes building a binary metric clock using an Arduino, displaying time as deci-days, centi-days, and milli-days instead of traditional hours and minutes. The clock uses LEDs to represent the time in binary form, with each unit subdivided by factors of ten, aligning with a metric time concept. The project is suitable for beginners and involves wiring 12 LEDs and resistors to an Arduino, with basic code to track and display the time. This unique approach offers a creative twist on timekeeping with readily available components.
Parts used in the Binary Metric Clock Project:
- 12 LEDs
- 12 330 ohm resistors (10k ohm resistors can be used as an alternative)
- Arduino (e.g., Uno R3)
- Breadboard
- 14 wires
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!
Step 2: Building it
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.
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
For more detail: Binary metric clock using Arduino