Tag Archives: Clock

Real Time Clock and Temperature Monitor using DS3231 Module

The DS3231 is a very low power RTC chip, it has the ability to keep time with incredible accuracy such that even after power has been disconnected from your product, it can run for years on a connected coin cell battery. This module has the ability to communicate via I2C or SPI but for this tutorial we will be using the I2C mode for communications between our arduino and the DS3231. The module also comes with a quite accurate temperature sensor which we will be using to get temperature readings. The collected temperature and clock data is then displayed on the 16×2 LCD via the Arduino.

Real Time Clock and Temperature Monitor using DS3231 Module – [Link]

ESP32 NTP OLED clock

@ blog.danman.eu build a OLED display NTP clock and document his process on his blog:

As a first project with my new ESP32 module with OLED display I chose to build OLED clock. I thought I’ll just find some existing code, upload it and it’s done. There are a few such projects for ESP8266 in NodeMCU. So I started with NodeMCU upload.

ESP32 NTP OLED clock – [Link]

Solr: Digital Wrist Watch Calculates time from Sun Position

Time can be calculated using the azimuth of the sun (aka solar time). Based on this idea, Tinkerman has built an unusual project called Solr. The concept is to translate the position of the sun into time presented on a vintage display. This new digital watch is freak enough to work only with a battery and the sun. The battery is needed to power the electronic parts and the sun is needed to calibrate the shadow of a screw with a reference line to calculate the time digitally using a digital compass.

Solr watch in action

The PCB has a white line and all you have to do is to align the shadow of the screw to it. The science behind this project rely on the fact that a change of 1 degree in longitude equals to 4 minutes. So, as the day is passing the orientation you need to follow to make the shadow align with the white line increases and therefore the time can be calculated. HMC5883L ( 3-axis digital magnetometer) is used to determine the orientation. This chunk of code in Solr’s repo makes the method used to calculate the time very clear.

The firmware (written in Arduino C) behind this project has three main tasks:

  1. Calibrating the HMC5883L, and the calibration procedure is explained in the HMC5883L datasheet.
  2. Calculate the time according to the bearing of the circuit.
  3. Display on HP QDSP-6064 display.

HP QDSP-6064 display

The PCB is assembled using the assembling service (PCBA) from Seeedstudio and designed using Eagle CAD. You can download the source files from here.



Wooden Digital Clock is controlled over WiFi

androkavo @ instructables.com build a nice looking wooden clock that is able to show time, temperature, humidity and also it has alarm. The clock is controlled through your web browser using wifi connectivity and it also has a vibration sensor to stop the alarm.

Wooden Digital Clock is controlled over WiFi – [Link]


The quadrature LS7084 Module is a CMOS quadrature clock converter. Quadrature clocks derived from optical or magnetic encoders, when applied to the A and B inputs of the LS7084 are converted to strings of a Clock and an Up/down direction control. These outputs can be interfaced directly with standard Up/Down counters for direction and position sensing of the encoder.


  • Supply 5V DC
  • +4.5V to +10V operation (VDD – VSS)
  • On Board Power LED
  • J1 Encoder pulse multiplication ( Jumper JL Close =1X, Jumper JH Close = X4)
  • Header Connector for Encoder Interface
  • X1 and X4 mode selection
  • Programmable output clock pulse width
  • On-chip filtering of inputs for optical or magnetic encoder applications.
  • TTL and CMOS compatible I/Os
  • Up to 16MHz output clock frequency


RGBdigit clock

by Lucky @ elektormagazine.com build a LED display clock able to display temperature, humidity and air pressure. He writes:

What do you do when you want to design ‘something’ with a vintage or modern display? A clock of course, and this is our first design with RGBDigits: multi-colour 7-segment displays. With a BME280 breakout board attached it will also display temperature, humidity and air pressure. The clock is controlled by an ESP12 module, which makes it possible to synchronise the clock with an internet time server, change the clock settings from any mobile device or computer in the network, or transmit sensor data via Wi-Fi.

RGBdigit clock – [Link]

Making An Arduino I2C Digital Clock

Using Adafruit’s 0.56″ 7-segment LED backpack and display and the DS1307 RTC (Real Time Clock) board, this tutorial will guide you to make a simple 4-digit clock that uses only 2 Arduino pins.

The 7-Segment Backpack is a combination of the LED display, header pins, and a PCB which need to be soldered together. The PCB contains a driver chip with a built in clock that multiplexes the display and constant-current drivers for ultra-bright consistent color.

This module uses I2C interface, which means it needs just two data pins to control the 4 digits instead of 14 pin, freeing up Arduino pins for other usages.

DS1307 is a battery-backed real time clock (RTC) that allows a microcontroller project to keep track of time even if it is reprogrammed, or if the power is lost. DS1307 breakout board also comes as a kit of parts to be soldered.

Building the digital clock

It is a simple process, connect the part as shown in the image, the red wire connected with 5V, black wire with GND, orange to A4 (SDA – data), yellow to A5 (SCL – clock).

Both RTC and 7-segment modules have an Arduino library, as normal with libraries, unzip the folders into your Arduino ‘libraries’ directory and then restart the Arduino IDE for it to pick them up.

Paste the following sketch into a new Arduino window and upload it to your board. It will set the RTC to the time at which the sketch was compiled and uploaded. So, if your computer picks up its time from the Internet, that will be pretty accurate.

#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
#include "RTClib.h"


Adafruit_7segment disp = Adafruit_7segment();

void setup()
 if (! RTC.isrunning())
   RTC.adjust(DateTime(__DATE__, __TIME__));

void loop()

int getDecimalTime()
 DateTime now = RTC.now();
 int decimalTime = now.hour() * 100 + now.minute();
 return decimalTime;

The full documentation of the project is reachable here.

Tiny LED Time Watch


David Johnson-Davies designed a minimalist ATtiny85-based watch using 12 LEDs, arranged like a clock face, to show the time in analogue-style. He writes:

To show the time you press the button on the watch face, and the time is then displayed for four seconds. It lights one LED to show the hour, and flashes another LED to show the minutes to the nearest five minutes, like the hour and minute hands on a clock. If only one LED lights up you know that both hands are pointing to the same hour mark.

Tiny LED Time Watch – [Link]


Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display


Nicu Florica blogged about his adjusting clock with alarm, hygrometer and thermometer on 1.8″ ST7735 display:

I use feature from article Another adjusting clock with alarm & thermometer using DS3231 on 1.8″ ST7735 display and change reading internal temperature of DS3231 with DHT22 sensor (AM2302), but you can use a cheaper and not very precise DHT11 sensor.
By using educ8stv_rtctft160_alarm_dht.ino or much better educ8stv_rtctft160_alarm_eeprom_dht.ino sketch, on display you can see: name of day, date, hour clock, hour alarm, temperature and humidity

Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display – [Link]

Yet another Arduino clock


Sverre Holm blogged about his Arduino clock project:

But I needed another Arduino project as I had made a K3NG morse keyer. I love this keyer because it is unique in supporting a display where you can see what you send. But I wasn’t using the morse keyer all the time, so I wanted the hardware to serve two purposes. That’s the excuse for also making a clock.

Yet another Arduino clock – [Link]