ARDUINO 10 SEGMENT RAINBOW CLOCK

by EDISON SCIENCE CORNER in Circuits > LEDs

4975 Views, 127 Favorites, 0 Comments

ARDUINO 10 SEGMENT RAINBOW CLOCK

IMG_20210614_205515.jpg
IMG_20210614_210225.jpg
IMG_20210615_092127.jpg
How to Make Neopixel Clock at Home | DIY

I know making a clock sounds a little irrelevant, especially nowadays because we all have smartphones and no one is going to use or look into the clock for time, but it is good when you are doing some work or during the workout. So, I decided to make one Arduino digital clock for my room. While searching for the clock model, I got thousands of designs but most of them were using seven-segment displays and I wanted to build a unique and colourful clock without using Seven segment display. So, here I am going to use Neo-Pixel LEDs with Arduino pro mini and RTC module. About the clock I made, it's a very simple clock that shows time and room temperature and the main feature of this clock is that the colour of the digits changes every minute.

COMPONENTS NEEDED FOR MAKING THE RAINBOW CLOCK

IMG_20210613_101344.jpg
  • Arduino Pro Mini
  • DS3231 RTC Module
  • WS2812 Neo pixel LEDs- 42nos
  • 2× Push Button
  • Switches
  • AMS1117 Voltage Regulator
  • Perf Board
  • Connecting Wires
  • 330-ohm Resistor
  • MDF sheet
  • 3D printed structure

Arduino 10 Segment Rainbow Clock Working

The working of this clock is very simple and similar to other digital clocks. This clock gets the current time and date using the DS3231 RTC module and then this time is displayed on Neo-Pixel LEDs using Arduino Pro Mini. The DS3231 is a low-cost, accurate Real Time Clock that can maintains hours, minutes, and seconds, as well as, day, month, and year information. The module uses the I2C communication protocol which makes the connection to the Arduino board very easy. However, when it comes to communication between Arduino and RTC module the code isn’t that small and easy. But there are already several libraries for the DS3231 RTC which can be found on the internet. with the help of such libraries, we can read the current time, and with the help of Arduino, we can display that time in any type of display. DS3231 RTC module also comes with a temperature sensor so, we can also get the temperature readings.

Ten Segment Rainbow Clock Circuit Diagram

The complete schematic for building Arduino LED Clock is shown in the image given below:

As you can see, this circuit diagram has two parts, first one is the main circuit that consists of an Arduino Pro Mini, DS3231 RTC module, push buttons, and AMS1117 voltage regulator and the second is the LED digit circuit where all the Neo-Pixel LEDs are arranged to display the time. DS3231 works on the I2C communication protocol so the SCL and SDA pins of the RTC module are connected to I2C pins (A4 and A5) of Arduino. The push buttons are connected to digital pin 2 and 4 of Arduino. This complete setup is powered by two 18650 cells connected in series. The output voltage from these cells will be around 7.4 so an AMS1117 5V voltage regulator is used to supply regulated 5V to Arduino pro mini and other components.

3-D Printing the Parts to Display Time

Screenshot from 2021-07-06 20-33-16.png
PhotoGrid_1625591129144.jpg
IMG_20210520_203720.jpg
PhotoGrid_1625591256959.jpg
IMG_20210520_203734.jpg
IMG_20210520_203758.jpg

As discussed earlier, instead of using a 7-segment display we are going to use Neo-Pixel LEDs for displaying time. Here, we are going to 3-D print some parts so that we can arrange the Neo-Pixel LEDs in digits form and display time. After hours of thinking and calculations, I designed a ten-segment digit. The design is very simple, each segment has a slot for Neo pixel LED. Later in these slots, we will place Neo pixel LEDs. I also designed two segments for the second indication. I have designed all the parts in Tinker CAD software. Once it was done, my design looked something like this:

After I was satisfied with the design, I exported it as an STL file, sliced it based on printer settings, and finally printed it. The STL file is also available for download and you can print your casing using it.

Assembling the Neo-Pixel LEDs on 3-D Printed Parts

IMG_20210520_204715 - Copy.jpg
IMG_20210520_205250.jpg
IMG_20210607_080314.jpg
IMG_20210607_080548.jpg
IMG_20210520_205255.jpg
PhotoGrid_1625591836601.jpg

After 3D printing of the parts, first, we need to insert the Neo-pixel LEDs on their respective sockets. A Neo-pixel LED has 4 pins that are VCC, GND, data IN, and data Out. To control a Neo-pixel LED, we should feed the signal to the din pin. We can connect multiple LEDs by connecting the Data OUT pin to the Data IN pin of the next LED and so on. Here, take a WS2812 Neo-pixel and insert it into the socket. Do the same for the 10 segments, remember to place the LEDs in the same orientation. After placing the LEDs let's start soldering. First, solder all the grounds of 10 LEDs together. For this, I am using single-stranded copper wire. Check the pins of each LED before soldering. Also, don't apply more heat on the LED. After connecting all grounds, now let's connect all VCC pins together. Next, connect the first data out to the data in the pin of the next LED. Repeat this for all the ten LEDs. After finishing all the soldering, we will get a common ground, common 5v, data in connection for the first LED, and data out the wire from the last LED. We have to repeat this process for the remaining 3 digits. Also, insert two LEDs in the second segment and solder. After connecting all the digits and the second segment, let's connect digits together. Connect first digit (from left-hand side) data out to the din in of the second digit then data out of second to the din of third and so on finally connect the last digit out to the data in of the second segment. connect all the 5 v together and also the grounds. That's it, now we have a common ground, a common 5v, and a din.

Building the Circuit on Perf Board

IMG_20210607_081301 - Copy.jpg
IMG_20210607_081221 - Copy.jpg
IMG_20210607_081106.jpg
IMG_20210607_083056 - Copy.jpg
IMG_20210607_082135 - Copy.jpg
IMG_20210609_170533.jpg
IMG_20210613_101820.jpg
IMG_20210613_103038.jpg
IMG_20210614_100707.jpg
IMG_20210614_100659.jpg
IMG_20210614_100653.jpg
IMG_20210614_100622.jpg
PhotoGrid_1625592350797.jpg

After testing the circuit on the breadboard, I decided to solder it permanently on a perf board. I tried to build the circuit as small as possible to reduce the size. First, I took a small piece of perf board, and then I placed the female header pin for the RTC module and Arduino pro mini. Next, I placed the push buttons on an even small perf board and soldered its pins to the perf board. Then with the help of flexible wire, I attached the push buttons to the main PCB.

Building the Enclosure for Ten Segment Rainbow Clock

IMG_20210614_100853.jpg
IMG_20210614_100918.jpg
IMG_20210614_155356.jpg
IMG_20210614_155637.jpg
IMG_20210614_155725.jpg
IMG_20210614_160135.jpg
IMG_20210614_165835.jpg
IMG_20210614_160137.jpg
IMG_20210614_165823.jpg
IMG_20210614_165845.jpg
IMG_20210614_171621.jpg
IMG_20210614_171630.jpg
IMG_20210614_203716.jpg
IMG_20210614_203723.jpg
IMG_20210614_203734.jpg
IMG_20210614_204137.jpg

This is not the hardest part. Either you can 3D print the enclosure or make it yourself. So, first I measured the length and width of the digits. After getting the measurement, I took a 5mm MDF board and drawn sides of rectangles having a length of 18cm and a width of 6.5mm. I plan to build a rectangular structure and place the digits in it. After drawing the lines, I cut the rectangles using the cutter and joined them together, and made a rectangular structure without a front. If you are confused with the making, you can refer to the images. After building the frame, I inserted the digits into the frame and secured it with glue. On the backside of the frame, I fixed the main circuit and battery. Also, I placed the pushbuttons and the on/off switch on the outer backside. After connecting the digits with the main circuit, I closed the backside. Finally, we need to attach a plastic sheet to the front side of the clock for better light diffusion. You can use any type of diffused plastic sheet.

Programming Arduino Pro Mini for Rainbow Clock

As I mentioned earlier, the code for this project is not very simple. Honestly, I referred to lots of other clock projects to make this code. Whatever, the complete code is given at the end of the document. Here, I am explaining the complete code line by line.

Testing Our Ten Segment Rainbow Clock

IMG_20210614_205250.jpg
IMG_20210614_205857.jpg
How to Make Neopixel Clock at Home | DIY

Ok, so now we have assembled the Neo-Pixel LEDs and circuit. It’s time to test the clock. For that, connect the Arduino to the laptop and upload the code.

I hope you liked this clock project. The complete making video is given below. If you have any questions, please, leave them in the comment section below.