Arduino LED Clock
Hello World,
Today we are going to make a clock from LEDs using Arduino UNO & 12 LEDs. This clock can show the hour, minute, second but not all at one time! I will upgrade this soon. I have also made some more sketches for some light effects. Like disco light & many things.
Hope you will enjoy this instructable!
So let's start-
Supplies
You will need -
- An Arduino Uno
- Some jumper wires(mainly male to male)
- 12 LEDs of random color (or any color you want)
- A Circular piece of thermacol
Making the Body
I will make the body like a casual normal round clock(as you can see in the images).
To make this is very simple. Take a round piece of thermacol or any material you have.
Make 12 holes equally with the help of a compass name it as in clock eg.12,1,2,3,........
you can also color print the face of the clock you want and glue it over the body(don't forget it has holes)
Schematics
This step is a little hard but if you named all numbers then it will be easy.
Here I have joined all the -ve wires(they must be 12) of all LEDs to one and connect it to the GND of Arduino.
Here is the tough part doing with +ve wires which are 12 in numbers.
The positive wire of LED which is in place of 12 O clock, connect it with Digital pin 12 of Arduino.
Same connect +ve of led with digital pin 11 of Arduino (LED which is in place of 11).
..........................................................you have to do all remaining LEDs the same.
You can also add a Resistor but because my LEDs are of 5v I didn't use them.
Coding
I have made the code very simple just by copy & paste the 'Blink' example 12 times.
& name all LEDs according to my clock. My naming of code was a little bit different therefore it may random. So to work it fluently you have to name it according to your clock.
IMPORTANT: By changing the delay value you can add many light effects.
To use it as a clock you have to change the delay to 3600000 milliseconds & start the circuit at 12 O' clock
Here is the Code=
int led13 = 13; int led12 = 12; int led11 = 11; int led10 = 10; int led9 = 9; int led8 = 8; int led7 = 7; int led6 = 6; int led5 = 5; int led4 = 4; int led3 = 3; int led2 = 2; void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(led4, OUTPUT); pinMode(led5, OUTPUT); pinMode(led6, OUTPUT); pinMode(led7, OUTPUT); pinMode(led8, OUTPUT); pinMode(led9, OUTPUT); pinMode(led10, OUTPUT); pinMode(led11, OUTPUT); pinMode(led12, OUTPUT); pinMode(led13, OUTPUT);} void loop() { digitalWrite(led3, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led3, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led11, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led11, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led6, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led6, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led13, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led13, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led5, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led5, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led4, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led4, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led8, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led8, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led7, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led7, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led10, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led10, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led2, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led2, LOW); // turn the LED off by making the voltage LOW delay(10); digitalWrite(led9, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led9, LOW); // turn the LED off by making the voltage LOW delay(15); digitalWrite(led12, HIGH); // turn the LED on (HIGH is the voltage level) delay(15); // wait for a second digitalWrite(led12, LOW); // turn the LED off by making the voltage LOW delay(15); // wait for a second }<br>
The Conclusion
I have uploaded my youtube video to see more tutorials see my youtube video.
It will work very great. But only If you named it correctly.
Hope you liked my instructable. Please vote If you like it.
And Consider subscribing to my Youtube channel.
I will try to upgrade it soon using 24 LEDs.
Hope you enjoy it!