4-digit 7-segment Led Clock With Manual Adjust & Alarm, Thermometer & Higrometer Using Arduino




About: I'm designer engineer in crane area with a special hobby: electronics :))) I love classical electronics, Arduino and Raspberry Pi... I'm intermediate in classical electronics and Arduino & I'm beginer i...

For RTC clock I use DS1307 homemade module, but works without changes with DS3231 module.

For thermometer and higrometer it use DHT11 sensor, but with a small change in sketch can be use DHT22 (AM2302) sensor.

I use led display named LFD080AAG-103-01 (4-digit 7-segment common cathode).

"Brain" is Arduino Nano with ATmega168 microcontroller, but work wery well with Arduino Nano with ATmega328 or Arduino Uno board.

Step 1: Schematic

Schematic use:

1) Arduino Nano board with ATmega168 chip (work also with Arduino nano wih ATmega328 chip or Arduino Uno board)

2) led display named LFD080AAG-103-01 (4-digit 7-segment common cathode)

with small changes in sketch work with common anode display

3) RTC module (homemade or buy-it) with DS1307 or DS3231 chip

4) DHT11 sensor (work with small change with DHT22 or AM3231 sensor)

5) 2 push button

6) 5V active buzzer (1kHz or 2kHz), I use for test red led & 330R resistor

7) breadboard

8) some Dupont wire

9) usb cable

10) 5V usb power supply

Step 2: Sketch

I write an sketch named multiplexedclock4_3.ino who can use for common cathode or common anode led display, just activate or deactivate some lines.

It use just 2 button, one is named ADJUST for enter in adjust mode, and second buton is named "+" because increase value until maximum, after changed value is put to minimum... value increase slowly by press repeatedly "+" or value increase quicly by push and hold down "+" button.

Step 3: Video

Is more easy to undertanf who work and how can be adjusted value be seeing the video...

Step 4: Normal Operation and Adjust Mode

Usual, on display is time (clock) about 5 seconds, temperature about 1 second and relative humidity in air about 1 second.

If you push on ADJUST button, clock enter in hour adjust mode (xx.CL style).

If push shortly or hold down the “+”button value fro hour increase (after 23 is reset at 0).

To exit in minutes adjust mode, must push ADJUST button… on display you will see CL.yy format.

If push shortly or hold down the “+”button value fot minute increase (after 59 is reset at 0).

For exit from minute adjust mode and enter in next menu, must push ADJUST button. On display is AL.on or AL.oF, in this case is AL.on (alarm is activate) and after push “+” button you will see AL.oF.

If alarm is deactivate (OFF = AL.oF) and push ADJUST button, system enter in usual mode, as clock with temperature and humidity indicator.

If push again ADJUST button, system enter again in hour adjust mode

and you can change hour value with “+” button

Exit in minute adjust mode with ADJUST button

Push “+” button to activate alarm

Now, if I push ADJUST button system enter in hour alarm adjust mode

and value chen be change with “+” button (push or hold down). After that, I push ADJUST button to enter in minutes adjust mode

If push “+” button value for minutes increase and when push ADJUST button system enter in clock mode.

In right side decimal point is on when alarm is activate and off when alarm is deactivate. When is time alarm, active buzzer (red led in my case) is intermittence active.

In time alarm, if you push “+”button alarm is temporary deactivate (until next day)....

For extra info see:

1) http://nicuflorica.blogspot.ro/2017/08/ceas-cu-reglaj-manual-al-orei-alarma-si.html

2) http://www.arduinotehniq.com/index.php/2017/08/17/rtc-clock-with-manual-adjust-alarm-thermometer-higrometer-using-arduino/



    • PCB Contest

      PCB Contest
    • Toys Contest

      Toys Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018

    9 Discussions


    Question 9 months ago


    This project looks great, but I have a problem, it looks like the pins don't switch fast enough and the numbers bleed through

    Any idea?

    2 answers

    Answer 7 months ago


    // for Common Cathode

    #define DIGIT_ON HIGH

    #define DIGIT_OFF LOW

    #define SEGMENT_ON LOW

    #define SEGMENT_OFF HIGH


    // for Common Anode

    #define DIGIT_ON LOW

    #define DIGIT_OFF HIGH

    #define SEGMENT_ON HIGH

    #define SEGMENT_OFF LOW


    Pick the right one.


    Answer 9 months ago

    Never mind, I apperently have a common anode screen


    7 months ago

    Thank you, niq_ro!

    How to change the display time of "Temperature"and " Humidity"?


    1 year ago

    it works but how can i display the time more than 10sec? thanks

    3 replies

    Reply 1 year ago

    Must change value 5 from line 185 with 10 or more...

    line 185 is:

    for (byte ceasu = 0; ceasu < 5; ceasu++)


    Reply 7 months ago

    Thank you, niq_ro!

    How to change the display time of "Temperature"and " Humidity"?


    Reply 1 year ago

    Yes sir . It works . Thanks


    10 months ago


    I need a project library