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

5,751

26

17

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...

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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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

    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    17 Discussions

    0
    None
    niq_roTechCreator001

    Reply 8 months ago

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

    0
    None
    niq_roTechCreator001

    Reply 7 months 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
    None
    niq_roTechCreator001

    Reply 7 months ago

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

    0
    None
    TechCreator001niq_ro

    Reply 8 months 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
    None
    LodeS

    Question 1 year 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
    2 answers
    0
    None
    KaravanLodeS

    Answer 1 year 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
    None
    LodeSLodeS

    Answer 1 year ago

    Never mind, I apperently have a common anode screen

    0
    None
    Karavan

    1 year ago

    Thank you, niq_ro!

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

    0
    None
    Zann4

    1 year ago

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

    IMG_20170921_105329.jpgIMG_20170921_105327.jpgIMG_20170921_105324.jpg
    3 replies
    0
    None
    niq_roZann4

    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++)

    timp-afisare-ceas.jpg
    0
    None
    Karavanniq_ro

    Reply 1 year ago

    Thank you, niq_ro!

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

    0
    None
    Zann4niq_ro

    Reply 1 year ago

    Yes sir . It works . Thanks

    0
    None
    MajidS19

    1 year ago

    hi.

    I need a project library

    thanks