12Digit Clock With WS2812B NeoPixel LED and DS1307 RTC
by vrsolanki in Circuits > Arduino
1679 Views, 7 Favorites, 0 Comments
12Digit Clock With WS2812B NeoPixel LED and DS1307 RTC
Since long i have purchased many electronics parts along with Arduino Uno. Today i tryed to use my Arduino Uno with WS2812B neo pixel led and DS1307 RTC.
Project in my mind was very simple, just create 12 pixel watch which is different with others of similar kind, so instead of making round clock, i wish it will be like ruler one style... just straight line.
I have just connected Arduino Uno with 5V power supply, Neo Pixels WS2812B strip with 5V and DS1307 with Arduino Uno.
Connection/Circuit is very simple and it's fully described into sketch of arduino.
Other resources i have used and found is also commented into sketch.
This is just first instant version of my project idea implementation and need many more improvement like add buttons for setting time along with serial monitor time setting in yymmddhhmmss format.
Right now, implemented features are :
1. White dim light on 12,3,6,9 O'Clock
2. Green color for hour movement from led 1 as per RTC Time..., Blue for 5 minute and Red for 5 Seconds...
3. When clock starts, all Led blinks in white for indication of start of clock..
So right now in my mind to add features is :
1. Add physical tactile switch for setting date time.
2. Add PIR for present sensor so that it will be off when there is no presence in the room
3. Add LDR so that night light can be adjusted/reduced at night accordingly
4. Add alarm function visually and beep
5. Add ESP32/ESP8266 so that clock can take time from network/internet/bluetooth/Mobile
6. All possible additions with minimal parts like 3D print numbers with different styles ...
There is not much work which need step by step guide so hope you will be able to make such clock and can attach it to monitor side or TV front side or door or fridge with Arduino Nano as compact form.
Download Arduino Uno Sketch for more details and circuit/connections to uno and leds.
Feel free to change anything you need to, if you will use 60 Led Per Meter version, it will be small and can be placed on keyboard of laptop or desktop as night light whose keyboard doesn't have back light feature...
For step by step guide you may continue ... for latest updates of code and new feature implementation or for your contribution you may visit my github repository
If you like my efforts, Vote for me for Make it Glow Contest ...
Downloads
Supplies
1. Arduino Uno
2. 12 Neo Pixel WS2812B Led (30 LED per Meter roll)
3. DS1307 RTC module
4. 5V Power supply (Any mobile charger with 2A rating will do fine)
Gather All Required Parts and Materials
1. Arduino Uno or any variant of Arduino
2. DS1307 Real Time Clock Module
3. WS2812B or WS2811 Neo Pixel LED (30 Led Per Meter or 60 Led Per Meter)
4. Good 5V, 2A power supply (Mobile charger may be fine)
5. Jumper wires and bread board for instant checkup of working, USB Cable for program upload to Uno
6. If all works fine as intended, you may solder all parts with Arduino or Arduino nano or pro version for smaller size.
7. Any small size encloser for decoration and hiding of circuit and parts which fits Arduino and power supply
8. Laptop or Desktop computer to upload or mobile with ArduinoDroid app to upload program
9. Place to show off your good work !!!
Connect Them All With Power Supply of 5V
All parts now handy, connect your Arduino Uno/Pro/Mini to computer and upload Attached Clock12LedRTC_v1.ino file along with all connections to Arduino and DS1307 along with power supply as follows :
1. Connect 5V power supply to WS2812B as +5V, GND and Data IN pin of Arduino Pin 7. Make sure that you notice ---> of data pin so data travel to that side of arrow and you have to connect pin 7 to Data in side.
2. Connect 5V power supply to Arduino +5V In, GND
3. Connect 5V power supply to DS1307RTC +5V, GND
Now Power requirement of project is over and you are ready to upload your code ... but wait you need to connect other connections as well to work DS1307 RTC.
Please make sure that you have connected power supply, Arduino and DS1307RTC to common ground or same power source other wise, make GND/Ground common with jumper wire of all power sources ... better you use single power supply for this requirement.
Downloads
Connect Arduino, DS1307RTC
In this step you need to connecty Arduino remaining pins to DS1307 to work it as clock or brain of our project.
1. In previous step, we have already connected DATA IN pin of WS2812B Neo Pixel to Arduino Pin 7
2. Now All Power pins is already attached in previous step..
3. Remaining pins of DS1307RTC is SCL and SDA pins, SCL->A5 of Arduino and SDA->A4 of Arduino which is near to ICSC headers or near to USB port side of Arduino Uno
All data connection is over ....
Connect Arduino With Your Computer
Now, All data connection and power connection is over,
Install all library like AdaFruit Neo Pixel and RTCLib library through library manager of arduino IDE. (Tools->Manage Library)
Just upload attached clock12LedRTC_v1.ino file through Arduino IDE or through create.arduino.cc with correct selection of COM port on your windows computer.
If you have already connected Uno to USB port of computer before start of Arduino IDE, it will select board and port automatically most probably in Windows 10 machine or if you have previously connected, it will auto detect it.
If all works fine, just compile and upload Clock12LedRTC_v1.ino sketch to Arduino ...
Downloads
Done Uploading, Check Your Creation !
After done uploading message on Arduino IDE, your sketch in successfully uploaded to Arduino.
In very first run of sketch, neo pixel strip/Led will flash with white color, all 12 led will flash with white color
After flash, your clock is ready to be shown at your desired location.
Clock 12 Hour, 3 Hour, 6 Hour and 9 Hour is shown in White color
Clock Hour indication is done with Green color
Clock Minute indication is done with Blue color
Clock Seconds indication is done with Red color
When Hour and Minute is same it changes color to magenta (Not actually) but you can change all the colors in sketch as per your choice.
If 30 Led per meter version, your clock will be approx 1 feet in length and if you take 60 Led per meter version of WS2812B neo pixel, it will be half. I prefer it in straight line version of clock but you are free to arrange it to any of shape you want may arrange with regular clock type round/square, you may stick it to wall as decoration item and there is so many limit less possibility to be used with.
If you want to change date/time just enable it by setting IsDisplaySerial to true in following line of sketch
boolean IsDisplaySerial = false; // Set to true for Get/Set Date time in yymmddhhmmss format as input to serial communication ...
Then open serial monitor by Tools->Serial Monitor (CTRL+Shift+M) in Arduino IDE.
and supply 210219202122 ( Year 21, Month 02, Date 19, Hour 20, Minute 21, Second 22) in short YYMMDDHHMMSS format and press enter to set date/time into RTC.
Future Inclusions
Now normal clock is over, there is so many possibility to be added and considered to be included like mentioned in 1st page of instructable.
1. Add physical tactile switch for setting date time. -- Physical button is added in new version, available on github repository - 24 Feb 2021
2. Add PIR for present sensor so that it will be off when there is no presence in the room or atleast very dim to conserve battery/power.
3. Add LDR so that night light can be adjusted/reduced at night accordingly : If night light is dim or vice a versa as per choice and requirements
4. Add alarm function visually and beep and near and dear ones birth day flashes or happy birthday visual theme or pattern of lights ...
5. Add ESP32/ESP8266 so that clock can take time from network/internet/bluetooth/Mobile
6. All possible additions with minimal parts like 3D print numbers with different styles ...
That's all for now, will be adding above features if i get time and energy ...