Digital Hourglass

3.5K8917

Intro: Digital Hourglass

To be honest: If you're not working, you don't really need an exact time: it's about afternoon, I'm hungry, I'm tired, it's time to go to bed. And in the morning, the alarm clock on my mobile phone wakes me up again.

In the meantime, an hourglass would be enough to show the passage of time. Unfortunately, the large hour glasses are hardly available any more.. Only small ones for the kitchen that show maybe 3 or 5 minutes.

That's why I built an hourglass that takes exactly one hour to run through. The hour time is still displayed as a number in the top glass.

The construction and programming are simple, and there are no limits to the imagination when it comes to the outer design.

Have fun rebuilding it.


Basic knowledge of Arduino required.

STEP 1: The Wiring

The wiring seems to be the most complicated part of this project. Step by step, however, it is not difficult.

Displays and RTC each need a 3.3V power supply and GND.

The RTC needs two more connections:


Follow the table for the displays. TFT1 is the upper display, TFT2 the lower one.

STEP 2: The Program & RTC

For the ESP32 you need the following settings in the Arduino IDE:


Upload the sketch to the ESP32. If the wiring is correct, everything should work now.

The RTC module gets the time by encrypted signals via radio. It can take a few minutes to show the correct time. The minute and hour figures are isolated from the received data and used for our program. The minutes are converted into coordinates for the sand triangles so that a sand pass takes exactly one hour. The hours are only displayed as a number.

Upload 'HourGlass.ino' or 'HourGlass-demo.ino" to your ESP32. Make sure the file 'colors.h' is in the same folder.

STEP 3: How the Graphic Works

The graphic is made up of simple geometric elements. The upper sand is initially shown with a filled rectangle (tft1.fillRect(…) ). Of course, this cannot be recognized due to the round display. The cone created by the sand flow is simulated by a black triangle that changes its shape and position over time (tft1.fillTriangle(…)). The lower sand pile is made up of triangles.

The trickling sand consists of a long rectangle, which is cancelled by a black rectangle after one hour. The sand collecting at the bottom is also represented by triangles. 

The number of the hour is simply displayed on the upper glass.

STEP 4: The Housing

I favored a housing from the 3D printer, made with Tinkercad. I divided it into 3 parts so that the clock can be easily placed in the holes.This is the closest I can get to the shape of an hourglass.

You don't have to turn the hourglass round. The sand magically moves back into the upper glass after an hour.

A small wooden box or a case made of cardboard would also fulfil its purpose. The two displays just need to be placed as close together as possible.

12 Comments

I ordered the parts in and built a prototype, got it wired, and programmed but ran into a slight issue...the upper display is upside down...I've verified all wiring and code but the display continues to be display upside down. The demo also displays upside down on the upper display. Based on a video you supplied, the pin connectors are placed at the top for the upper display and at the bottom for the lower display...the lower display displays OK......am I missing something?

I am happy to read that it is working now!

Hi there, thank you for your enthusiasm. It doesn't really matter where the connections are located. You can rotate the display in the program sketch by command:

tft1.setRotation(2); tft2.setRotation(0);

sets the directions. (0) is "normal"; 1, 2 and 3 rotate clockwise by 90 degrees. Please try it out.

After doing some more debugging and making code tweaks, I determined that the "SetRotation" function was not working when executed from "Setup"...I can only assume that something is different between my libraries and ones used originally for this project...for future reference, I added an additional "tft1.setRotation(2);" line at the start of the "minutes" function...this corrected my issue and the display is now rotated correctly...thanks again for a great project

Great looking project...do you have any links to the modules and displays that you used...thanks

Just added a link in the supplies section. Happy making!