Introduction: RGB LED Wall Clock With Temperature Sensor Using Evive- Arduino Based Embedded Platform

About: STEMpedia is a place bringing project-making tools at one place- kits, online courses, coding platforms, controller app and tons of free learning resources.

Wall clocks are perhaps the single most important accessory that has the ability to completely change a previously plain living room into a smart, ultra-modern one! And that is exactly what we’re here for today: making a smart DIY RGB LED wall clock that won’t only make your room attractive and grab the attention of everybody who visits, but also display the date, temperature, and humidity in real-time! And helping us make it smart is evive and PictoBlox - a graphical programming software with advanced hardware-interaction capabilities. You can download it from HERE.

Who’s with us for making this super cool wall clock? Let’s begin!

Step 1: List of Components Required

Hardware

  • evive
  • MDF Sheet
  • Neopixel RGB Strip of 60 LEDs
  • DHT11 (Temperature and Humidity Sensor)
  • SuperGlue
  • Jumper Wires
  • Nuts and Bolts
  • DC adapter 9V/2Amps

Software

You can laser cut the clock design on the MDF sheet by downloading the following files.

Step 2: Assembling the Structure of the Wall Clock

First, let's begin with the assembly of the structure of the clock.

Attach the outer ring to the base plate which has numbers engraved on it using superglue.

Once done keep the assembly aside.

Step 3: Testing the RGB Strip

We will be using a neopixel strip of 60 LEDs whose reason will be explained in the latter part of the project.

As we already know, it's good to test the components before using them. Thus, we are going to test the RGB using evive and PictoBlox. To get started with PictoBlox, visit here.

Connect the RGB strip to evive:

  • VCC to 5v of evive
  • GND to GND of evive
  • DIN to Digital Pin 4 of evive.

Firstly, connect evive to your computer using a USB cable. Open PictoBlox, select evive from the boards' option and then connect the PictoBlox, by selecting the appropriate COM port.

Before, working in the stage mode(for real-time interaction), the first thing we need to do it to upload the firmware to evive. Click on “ Upload Firmware ” button.

Let's begin with the test script, to work with an RGB strip, we need to add the “Lighting Extention” by clicking the “ Add Extention “ button.

To initialize the RGB Strip use the Initialise RGB strip () with () LED pixels on pin () block. And set the number of pixels to 60.

Use () RGB strip () with color () & delay () seconds or () RGB strip () with delay () seconds block to make it glow like the way you want.

Step 4: Attaching the RGB Strip

Once done, take the connections out. Peel of the adhesive paper from the RGB strip and stick it to the inner side of the outer ring.

Note: Make sure that you start sticking the RGB Strip to the clock from the 1st division which is the right next to 12.

Once done, pass the wires through the hole next to the number and again bring it to the front from the horizontal slot given in the center.

Step 5: Attaching Evive

We need to fix the solid hanger plate to the hollow hanger plates, these plates will hold evive to the clock and also will be used to hang the clock to the wall.

Take the solid hanger plate and place it on the hollow hanger plate, as the hollow plate will give some space to the nail inserted in the wall.

Now, fix these plates to evive through the base plate using M3 bolts of length 25mm length.

With this, our basic clock assembly is complete.

Step 6: Attaching the Humidity and Temperature Sensor

We can add as many functionalities as we want in our wall clock. As we have evive’s TFT Display we can display whatever we want. We will use the display to show the room’s temperature, humidity, time (24hrs format), and date. Thus, we will need the DHT11(Temperature and Humidity) sensor. Attach the sensor to evive as given in the next step.

With this, our entire assembly is completed.

Step 7: Connections

RGB Strip:

  • VCC: 5V of evive
  • GND: GND of evive
  • DIN: D4 of evive

DHT11:

  • VCC: 5V of evive
  • GND: GND of evive
  • OUT: D2 of evive

Step 8: Working of the RGB Clock

As the name suggests us we will be using RGB LEDs instead of seconds, minutes, and hours hands. As we will need the LEDs to represent second and minutes, we will use 60 LEDs for the same.

We will provide a “Blue” as the base color to the wall clock. We low down the intensity of the color so that it gives the backlight to the clock.

Also, we need to differentiate between all the three hands. Therefore, we need the LED to turn the LED to “white” for each second. And the position of the minute hand will be the place where the LED is “green”. The LED will turn “red” at the position of the hour hand.

The minutes and seconds hand will be easy to represent, but the hour hand can be a bit tricky. There are two ways to represent the hour on the analog clock:

  • We can only turn the LEDs “red” of the numbers. Which means if the time is 4:30, 4:15 or 4:59, the hour LED will be “red” at four not somewhere between 4 and 5 in all the cases. All we need to do is, turn every fifth LED “red” after completion of 60 minutes. This is a simple way to do.
  • The next is to turn the LED “red” in between the numbers to, which is similar to the analog clocks we use at our home. When the time is 4:50 the hour hand is nearer to 5 but not at 5.There are five divisions in between two numbers. Thus, we will distribute the 60 minutes into those five divisions which make each division to represent 12 minutes. Example, when the time is 4:10, the hour LED will turn red exactly at 4, whereas, at 4:13, the hour LED of the first division between 4 to 5 will turn “red”.

Also, there will be times, where the minutes and hours are the same like 1:05, 2:10, …, 10:50, 11:55 and 12:00. Thus, the LEDs at this moment will turn “pink”.

As our clock is the analog clock and will show time only in 12 hours format, in both the cases we will need to convert the 24hour format into the 12 hours format. How? When the time is between 00 to 12:59, it can easily be represented without making any conversions. But once the time is between 13 to 23:59, we will need to subtract 12 from the hour hand, which is then converted into a 12hours format, making it easy to represent on our analog clock.

Step 9: Setting Time and Date

There is an inbuilt RTC in evive. But before using it, we need to initialize it. Follow the following steps:

Time:

To change the time slide the Slide switch 1 upwards.

  • Potentiometer 1 to set the hour.
  • Potentiometer 2 to set the minutes.

Date:

To change the date slide the Slide switch 1 downwards.

  • Potentiometer 1 to set the date
  • Potentiometer 2 to set the month
  • Tactile switch 1 to increase the year count by 1
  • Tactile switch 2 to decrease the year count by 1

Step 10: Coding the Wall Clock

We are going to code our clock in a simple way that is using PictoBlox– a graphical programming software. Either write the following script in PictoBlox or directly download and upload the code to evive from the code section:

The first block is the initialization block, that initializes the RGB as well the TFT Display.

The below two blocks “Set Time” and “Set Date” are used to set the time and date in RTC which is found inbuilt in evive. We need to set the time and date using potentiometers and tactile switch of evive.

This block is used to display Humidity and Temperature along with the symbols.

The value of both temperature and humidity will be obtained from the DHT11 sensor. Also, we will display the time and data on the display.

This block is used to divide 60 minutes into 5 slots between two numbers.

The main block, which will start the action and call the required blocks.

Step 11: Arduino Code

You can also upload the following Arduino Code to evive:

Step 12: Conclusion

With this, your DIY RGB LED wall clock is now ready!


Colors of the Rainbow Contest

Participated in the
Colors of the Rainbow Contest