Feature

Concrete Clock

with Touchless Night Lamp

Ashish Adhikari

Issue 75, October 2023

An Arduino-based clock with gesture-activated LED night light, all mounted into a unique concrete artwork structure.

When it comes time to put an electronics project into an enclosure, makers usually have a few options. These options usually include buying a commercially available plastic or metal enclosure, making something out of timber, repurposing a box from a different gadget, or printing something on a 3D printer. Many of us wouldn't think to make something from concrete, right?!

In this feature, we speak to maker, Ashish Adhikari, about his Arduino-based clock with night light, which has been mounted into a custom made concrete art-piece.

We caught up with Ashish to learn how he made the clock, and what was involved to make the contrete structure.

Please introduce yourself to our readers, Ashish, and what first got you interested in electronics.

Hi There! My name is Ashish Adhikari (Ash). I am an engineer, artist and a photographer. I work as a project engineer for the autonomous haulage systems (AHS) at Komatsu Australia.

The world of Electronics has always fascinated me. As a kid, I used to open up radios, pianos, and other electronic gadgets and then try to reverse-engineer them. My passion turned into my career as I grew up.

We’re sure many of our readers have had a similar past, taking things apart to learn how things work. What was the inspiration behind your concrete clock?

I always try to do something new and interesting. Instead of reinventing the wheel, I always try to add a bit of spice to something interesting to make it even more spicier. For example, here’s my outdoor clothes peg holder with an integrated temperature and humidity monitor using NodeMCU (https://diy-projects4u.blogspot.com/2022/03/blog-post.html).

What electronics does your clock use and how does it work?

The circuit uses a TM1637 4-digit Digital Clock Module and a DS1302 RTC (Real Time Clock) Module to keep the time. Five blue LEDs with limiting resistor are used for the night light. These LEDs are triggered when you hover your hand over the IR module. Two white LEDs are also integrated that flash three times every hour.

We read that you made your own IR Module. Why didn’t you use a commercially available one?

I created the IR module as part of another project (https://diy-projects4u.blogspot.com/2020/10/diy-ir-module.html).

It is just a simple IR module, so a user can buy one off the shelf or can design one of its own.

Is the clock accurate?

I have been using this clock for almost 6 months now without any issues. The time has not been offset at all.

If timesync is an issue, then we can replace the Arduino with a NodeMCU or similar WiFi enabled microcontroller to sync its time with the Google NTP server at regular intervals.

Considering that your structure is made from concrete, what design and planning was needed?

Since the body of the clock is created using Concrete, I had to plan it very well before pouring concrete mixture into the frame.

I used Microsoft 3D builder to design the model and test all the use cases in 3d to come out with the final design.

Are there any limitations using Microsoft 3D?

It's a free tool that can be downloaded from the Microsoft Store and can be used without any prior knowledge of 3D or Animation. Its very easy to use and user friendly tool.

We saw in your video that you had a challenge to glue the timber onto the concrete. How did you overcome that?

Ha ha ha, I ended up doing it outside the camera. I would, however, recommend making some groves in the concrete frame and then using screws instead of using hot glue.

You mention that you used code instead of using the push buttons to set the time. Can you elaborate on this please?

At the back of the clock there are 3 buttons. My aim was to use them to set/reset the time of the clock. However, I ended up using the below code to set the time:

myRTC.setDS1302Time(00, 39, 21, 7, 20, 1, 2023);

What are you most proud of in this project, and would you do anything differently if you started again?

I combined my knowledge of electronics with a bit of woodworking and concrete work. It was a combination of multiple items in the generation of a masterpiece.

I'd probably use a 3D printer and print the whole lot without going through all the pain, ha ha ha.

You shouldn't sell yourself short. Its come up well. 3D printing isn't always that straightforward either.

Thanks for taking the time to speak with us and for providing your build instructions that follow.

The Build:

Parts Required:JaycarAltronics
1 × Arduino Nano or Compatible BoardXC4414Z6372
1 × TM1637 Digital Clock ModulePhipps: PHI1071888-
1 x IR ModuleXC4524-
2 x High Brightness White 5mm LEDsZD0190Z0876E
5 x High Brightness Blue 5mm LEDsZD0810Z0869
4 x 220Ω ResistorsRR0556R7229
2 x Tactile SwitchesSP0609S1220

Parts Required:

* Quantity shown, may be sold in packs. You’ll also need hook-up wire, perfboard, and a power supply suitable to power the electronics and LEDs.

The heart of this circuit is an Arduino Nano, and wires up to the components as per the wiring diagram shown here.

The TM1637 Digital Clock Module connects to D4 and D5 pin of the Arduino.

The DS1302 RTC Module connects to the A1, A2 and A3 pin of the Arduino.

The two white LEDs on both sides of the digital clock connect to the D11 pin of the Arduino via a 220Ω resistor. These two LEDs flash 3 times every hour when the minutes counter is reset to "00".

The IR module is connected to the D6 pin of the Arduino and controls the blue cluster of LEDs connected to D12 pin of the Arduino.

My initial plan was to have two to three push button switches connected to D2 and D3 pin of Arduino to set the time of the clock. However, in the final version, I did that by adding an extra line of code to my program. I explain this in full detail when I discuss the code.

The Concrete Construction - TOP PART

STEP 1:

Using cardboard, create the mould intended for the concrete. The semi-circular piece on the left side of the inner circle will create the gap for the blue LED cluster, and the holes in the rectangular section are for the ribbon cables.

Note: Cardboard was my preferred choice as it is very easy to cut and bend into the shape I wanted. You could use an alternate method providing it comes away from the dried concrete easily.

STEP 2:

Pour some "Brickies Sand" in and around the mould to hold it in place when you pour the liquid concrete.

Making the sand a bit wet will help make the sand firm and remove any unwanted air pockets in the sand.

STEP 3:

Pour the concrete into the mould. Don't forget to compress the concrete mixture as you pour it. This way, the concrete should reach all the necessary places and will also remove the unwanted air bubbles from the mixture

You can add some small nails or similar within the concrete mixture that will add to the concrete’s strength.

Note: Adding nails was absolutely necessary for my build. My first design completely collapsed because it was not very sturdy.

STEP 4:

Once the concrete has dried completely, you can remove all of the sand and extract the piece of art from the mould.

The Concrete Construction - BASE

STEP 1:

For the base, I prepared 2 x cardboard boxes with open top one slightly shorter in height than the other.

The 2 x straws you see on-screen will create the hole for the IR module. The hole on the side is for the AC power cable.

STEP 2:

The cardboard block I just added is to create a hole on the top of the base, where the circular-top will sit.

Then it was just a matter of pouring the sand inside and outside of the cardboard molds followed by pouring the concrete mixture into it.

The Electronics assembly - BASE

STEP 1:

I used compressed wooden board to create the baseplate

STEP 2:

One-by-one, I soldered and hot-glued all the electronics components to the board.

The Electronics assembly - TOP

STEP 1:

The 4-Digit LED clock module will sit inside this gap. I will cover it up using a black plastic film which I extracted from a wrapping paper.

For the back, I am using a compressed wood board. Based on my initial design I am going to make some holes in the board and install 3 x push button switches to it.

The blue LED cluster will be hot-glued in the gap at the back of the circular section.

STEP 2:

I hot glued the two white LEDs to the backplate before putting it against the concrete.

Note: It was an absolute challenge for me to hot-glue the backplate on the camera. After struggling for a bit, I did that properly behind the scene.

The assembly - JOINING THE Base to the TOP

STEP 1:

Now that we have top and the bottom ready, we can join them together.

I created this cardboard jig to hold the concrete, when I pour the concert in the hole. This cardboard block will also prevent me from poring excessive concrete inside the hole. The flap in the middle is to hold the wires preventing them from getting mixed up with the concrete.

After pouring the concrete I left it of drying for almost two days.

ABOUT The Code

The code is available on the resources section of the DIYODE site. You can compile and upload the code to the Arduino.

For this project, you need to include the "ArduinoRTClibrary" and the "TM1637Display" libraries in your code. Links to these libraries are in the m from github from the link provided in the description below.

First, start the code by creating an instance of the RTC module followed by defining the variables used by the RTC module.

Then, define all the LED pins followed by creating an instance of the TM1637 module and defining all the variables used by the module.

Next, define the pins used by the IR module.

In the setup section, the first two lines can be used to attach an interrupt to the code if you are planning to use the push button switches. However, in my code, I am not using the buttons, so I commented them out.

Next, I set the brightness of the display to the max value = 7 and added the "showNumberDecEx" function to include the colon in the code.

I defined all the pin modes used by the attached components in the code.

The code below can be used to set the time of the clock. Set the correct time, uncomment and then load the code.

Once loaded, comment the lines and then load the rest of the code.

  // Set current date, and time in the following format:
  // seconds, minutes, hours, day of the week, day of 
  // the month, month, year
  // myRTC.setDS1302Time(00, 39, 21, 7, 20, 1, 2023);

In the loop section, all we are doing is reading the hour and minutes from the RTC module and displaying it on the 7-Segment display.

  myRTC.updateTime();    
   // This allows for the update of variables for
   // time or accessing the individual elements
   minutes = myRTC.minutes; 
   // Get the current minutes from the RTC Module
   hours  = myRTC.hours;  
   // Get the current hours from the RTC Modules  
   timeData = hours * 100 + minutes;

This code block is used to toggle the colon on and off.

  // Code that blinks the colon of the TM1637 module
 if (ctr == 200) {
  if (blinkToggle) {
   display.showNumberDecEx(timeData, 0x40, true);
   blinkToggle = false;
  } else {
   display.showNumberDecEx(timeData, 0, true);
   blinkToggle = true;
  };
  ctr = 0;
};ctr++;
delay(5);

This section is used to read the value of the IR sensor and either turn on or turn off the blue LED clusters.

// Code that turns on or off Blue LED Cluster
int Sensordata = digitalRead(IRSensor); 
// Set the GPIO as Input
if (Sensordata != 0) {
  if (millis() - timestamp>500) { 
  // This avoids multiple obstacle detection
   timestamp = millis();
   if (IRtoggler == 0) {digitalWrite(LED_BLUE, HIGH);IRtoggler = 1;}
   else        {digitalWrite(LED_BLUE, LOW); IRtoggler = 0;}
  };
};

This bit of the code, is to flash the white LED when the minute counter resets to 0.

// Flash the white LEDs if minutes = 0
 if ((int)minutes == 0) {
  if (blinkCTR==0 || blinkCTR==40 || blinkCTR==100 || blinkCTR==140 || blinkCTR==200 || blinkCTR==240 || blinkCTR==300 || blinkCTR==340) 
   digitalWrite(LED_WHITE, HIGH);
  if (blinkCTR==20 || blinkCTR==60 || blinkCTR==120 || blinkCTR==160 || blinkCTR==220 || blinkCTR==260 || blinkCTR==320 || blinkCTR==360)  
   digitalWrite(LED_WHITE, LOW);
  blinkCTR++;
 };
 if ((int)minutes == 1) blinkCTR = 0; // Reset blinkCTR for the next cycle of flashing

If you are planning to use the 2 x push button switches to set the time or to set an alarm, go ahead and uncomment this bit of the code and add your code block to it.

// Pressing this button puts the clock in setup mode
//void Button_1_Pressed(){};
// Pressing this button increments the values on the display
//void Button_2_Pressed(){};