Introduction: Minimalistic Led Clock
In this instructables, I will show you how to make a simple/minimalistic led clock.
The clock shows 3 dots.
One from the seconds (blue), one for the minutes (yellow) and one for the hours (red).
Let's get started!
Step 1: Parts
For this clock, you'll need several parts. These are:
- An arduino nano
- A 60 led ring (seconds/ minutes)
- A 24 led ring (hours)
- A DS1307 RTC (for keeping time)
- Some wire, I recommend white single core wire
Step 2: Schematic
This project has pretty simple wiring.
First you connect both rings after each other.
Then you connect the input of the rings to pin D9 on the arduino.
After that, you can connect the RTC to the arduino on pins A4, A5 and D2.
Step 3: Clock Overlay
I made a pretty basic layout, which fits the led rings.
I printed it on heavy paper, so the leds aren't that bright.
After you printed it, just cut out the circles and its ready to use.
Step 4: Code
In the code, I used 2 libraries.
The first one is the adafruit Neopixel library
And the second one is the RTClib
To set the time, connect the arduino to the computer and open clock.exe in clock.rar.
It will show all com ports available and ask you which port you want to use. Just type "COM0" where 0 is the number you want. The script should automatically update the time of the RTC using the time off your computer.
Step 5: Resume
That's it, now you have a simple led clock.
I hope you liked it and you are able to recreate it yourself.
16 Comments
Question 3 years ago on Step 5
Hello, sir,
Simple, interesting project ...
I want to make it, and for the Arduino Program, I don't yet understand and am still learning.
Can be helped for the program, if the RTC uses DS 3231 which I happen to have at the moment.
Does the program have the same sketch or changes?
Thank you
Question 3 years ago on Step 1
I down loaded the required software and am running into a problem. The outer ring correctly lights and runs. I am having problems with the inner ring. Should the 60 ring output be connected to the 24 ring input? If I connect the input from the 60 ring to the input of the 24 ring, I have the seconds and minutes appearing but no hours. What would you suggest that I do? Thank you
Answer 3 years ago
yes and code
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include <Adafruit_NeoPixel.h>
#include "RTClib.h"
#define PIN 6
#define NUMPIXELS 60
#define NUMPIXELS2 24
RTC_DS1307 rtc;
volatile char update = 1;
unsigned char month = 0;
unsigned char day = 0;
unsigned char hour = 0;
unsigned char mins = 0;
unsigned char secs = 0;
unsigned int year = 0;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS + NUMPIXELS2, PIN, NEO_GRB + NEO_KHZ800);
void setup () {
Serial.begin(9600);
pixels.begin();
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
rtc.writeSqwPinMode(SquareWave1HZ);
if (!rtc.isrunning()) {
Serial.println("RTC is NOT running!");
rtc.adjust(DateTime(2016, 6, 16, 12, 00, 00 )); // First setup
}
Serial.print("Time:\n");
unsigned long start = millis();
while (!Serial.available() && (start + 2000) > millis()) {} // Wait 2 seconds to receive the setup date/time
if ((start + 2000) > millis())
{
year = Serial.read();
year <<= 8;
while (!Serial.available()) {}
year |= Serial.read();
while (!Serial.available()) {}
month = Serial.read() & 0xff;
while (!Serial.available()) {}
day = Serial.read() & 0xff;
while (!Serial.available()) {}
hour = Serial.read() & 0xff;
while (!Serial.available()) {}
mins = Serial.read() & 0xff;
while (!Serial.available()) {}
secs = Serial.read() & 0xff;
rtc.adjust(DateTime(year, month, day, hour, mins, secs ));
}
pinMode(2, INPUT);
attachInterrupt(0, Clock, RISING);
}
void loop () {
if (update)
{
DateTime now = rtc.now();
secs = now.second();
mins = now.minute();
hour = now.hour();
hour = (hour >= 12) ? hour - 12:hour ;
hour= hour << 1 ;
pixels.setPixelColor(secs, pixels.Color(0, 0, 255));
pixels.setPixelColor(mins, pixels.Color(255, 255, 0));
pixels.setPixelColor(hour + NUMPIXELS, pixels.Color(255, 0, 0));
pixels.show();
pixels.setPixelColor(secs, pixels.Color(0, 0, 0));
pixels.setPixelColor(mins, pixels.Color(0, 0, 0));
pixels.setPixelColor(hour + NUMPIXELS, pixels.Color(0, 0, 0));
update = 0;
Serial.println("u"); // Debuging
}
}
void Clock() {
update = 1;
}
4 years ago
I did, but after 12 or after the red LED goes off after 24, I guess there is a lack of code?
Reply 4 years ago
kod bu şekilde iyi çalışıyor
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include <Adafruit_NeoPixel.h>
#include "RTClib.h"
#define PIN 6
#define NUMPIXELS 60
#define NUMPIXELS2 24
RTC_DS1307 rtc;
volatile char update = 1;
unsigned char month = 0;
unsigned char day = 0;
unsigned char hour = 0;
unsigned char mins = 0;
unsigned char secs = 0;
unsigned int year = 0;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS + NUMPIXELS2, PIN, NEO_GRB + NEO_KHZ800);
void setup () {
Serial.begin(9600);
pixels.begin();
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
rtc.writeSqwPinMode(SquareWave1HZ);
if (!rtc.isrunning()) {
Serial.println("RTC is NOT running!");
rtc.adjust(DateTime(2016, 6, 16, 12, 00, 00 )); // First setup
}
Serial.print("Time:\n");
unsigned long start = millis();
while (!Serial.available() && (start + 2000) > millis()) {} // Wait 2 seconds to receive the setup date/time
if ((start + 2000) > millis())
{
year = Serial.read();
year <<= 8;
while (!Serial.available()) {}
year |= Serial.read();
while (!Serial.available()) {}
month = Serial.read() & 0xff;
while (!Serial.available()) {}
day = Serial.read() & 0xff;
while (!Serial.available()) {}
hour = Serial.read() & 0xff;
while (!Serial.available()) {}
mins = Serial.read() & 0xff;
while (!Serial.available()) {}
secs = Serial.read() & 0xff;
rtc.adjust(DateTime(year, month, day, hour, mins, secs ));
}
pinMode(2, INPUT);
attachInterrupt(0, Clock, RISING);
}
void loop () {
if (update)
{
DateTime now = rtc.now();
secs = now.second();
mins = now.minute();
hour = now.hour();
hour = (hour >= 12) ? hour - 12:hour ;
hour= hour << 1 ;
pixels.setPixelColor(secs, pixels.Color(0, 0, 255));
pixels.setPixelColor(mins, pixels.Color(255, 255, 0));
pixels.setPixelColor(hour + NUMPIXELS, pixels.Color(255, 0, 0));
pixels.show();
pixels.setPixelColor(secs, pixels.Color(0, 0, 0));
pixels.setPixelColor(mins, pixels.Color(0, 0, 0));
pixels.setPixelColor(hour + NUMPIXELS, pixels.Color(0, 0, 0));
update = 0;
Serial.println("u"); // Debuging
}
}
void Clock() {
update = 1;
}
Question 4 years ago
Does anyone have any pictures of the whole thing completed including the power supply, Front and back? I'd like to see the wiring of the back side of the Arduino also to see how power is supplied to the LED's.
6 years ago
i found the ring arcs here as well. Have not purchased yet as i understand shipping times are long but prices are good per feedback seen.
https://www.aliexpress.com/item/Ring-Wall-Clock-60...
6 years ago
Hi, really nice proyect, but I don't really understand the power supply for the clock and the Arduino. Could you explain please? can the arduino be powered by batteries?
Reply 6 years ago
As power supply for the project I used a usb wall wart.
You can power it from a battery, but I don't think it will run for a long time. Because the leds and the arduino use quite some power.
Laurens
6 years ago
Thanks for posting links on where to get the parts! That really helps.
6 years ago
Cool clock! :)
6 years ago
Great project ,but the power source u. Used and can I used a arduino uno instead
Reply 6 years ago
Yes, you can use an arduino uno.
As power source I used a 1A USB charger, as there are only 3 led's on at the same time, which brings it to about 3*60mA = 180mA for the led's.
If you want to have all the led's on at the same time, you should have a power supply capable of delivering 5A (84*60mA).
Laurens
6 years ago
Great! tfs.you inspired me to make one.
6 years ago
I just love anything to do with time and clocks. Thanks.
Reply 6 years ago
I'm glad you liked it.
Laurens