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

8,403

28

20

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

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

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/

Be the First to Share

    Recommendations

    • The 1000th Contest

      The 1000th Contest
    • Battery Powered Contest

      Battery Powered Contest
    • Hand Tools Only Challenge

      Hand Tools Only Challenge

    20 Discussions

    0
    LodeS
    LodeS

    Question 2 years ago

    Hello,

    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?

    28537322_2075021472538508_905431875_n.jpg
    0
    niq_ro
    niq_ro

    Reply 7 months ago

    you must change type of display

    0
    Karavan
    Karavan

    Answer 2 years 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.

    0
    LodeS
    LodeS

    Answer 2 years ago

    Never mind, I apperently have a common anode screen

    0
    TechCreator001
    TechCreator001

    1 year ago

    Please how can it be reconfigured for 12hrs format?

    0
    niq_ro
    niq_ro

    Reply 1 year ago

    in zone with meniu = 0 after hours = rtc.hours(); put another line
    if (hours > 12) hours = hours - 12;

    0
    TechCreator001
    TechCreator001

    Reply 1 year ago

    Here are the other problems I'm encountering.
    1. Alarm rings for both a.m. and p.m. For instance, alarm set at 11:00 at night ~= 23:00. How do I fix this?

    2. When setting the clock and/or the alarm (whenever SW0 is held), the 'seconds' segment stops and thereby lagging behind the real time. Can't there be a way a counter carries on whenever the SW0 is held so as to update the clock when I am done setting either the alarm or the clock?

    0
    TechCreator001
    TechCreator001

    Reply 1 year ago

    Please I still await your reply. Thanks.

    0
    niq_ro
    niq_ro

    Reply 7 months ago

    sorry.. must remain at 24h format... in my country is not used 12h format and is too hard for me to see how you want.. on othoer hand, I change my job and I can't modify because I havent free time

    0
    TechCreator001
    TechCreator001

    Reply 1 year ago

    Wow! Thanks! You are the best!

    0
    niq_ro
    niq_ro

    Reply 1 year ago

    sorry... I change my job and I haven't free time for Arduino project...
    Try to use information from here and change sketch somebody.. I can't help you, believe me..

    0
    TechCreator001
    TechCreator001

    Reply 1 year ago

    Kindly link me to someone. Thanks.

    0
    niq_ro
    niq_ro

    Reply 1 year ago

    search someone who can made changes,,, link is this article

    0
    MajidS19
    MajidS19

    2 years ago

    hi.

    I need a project library

    thanks

    1
    Karavan
    Karavan

    2 years ago

    Thank you, niq_ro!

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

    0
    Zann4
    Zann4

    3 years ago

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

    IMG_20170921_105329.jpgIMG_20170921_105327.jpgIMG_20170921_105324.jpg
    0
    niq_ro
    niq_ro

    Reply 3 years ago

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

    line 185 is:

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

    timp-afisare-ceas.jpg
    0
    Karavan
    Karavan

    Reply 2 years ago

    Thank you, niq_ro!

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

    0
    Zann4
    Zann4

    Reply 3 years ago

    Yes sir . It works . Thanks