Arduino LCD Shield Countdown Timer with Menu

This countdown timer demonstrates practical use of our LCD menu library code. It features multiple timer profiles, and is targeted to work with Arduino R3 Uno/Leonardo/Mega2560 and LCD keypad shield similar to that in the picture below:

Arduino LCD Keypad Shield

Arduino LCD Keypad Shield

There are numerous manufacturers of LCD keypad shields that have the same or similar pin connections, and you must ensure that the timer source code uses the pin connections that are right for your shield. If the keypad buttons of your shield give different analog readings, you’ll need to make changes to file LcdKeypad.h. Bear in mind that the analog readings are not always consistent, which can lead to the occasional misreporting of a button press.

The count down timer has multiple profiles that are configurable using a menu. The Select button on the LCD shield starts/stops a timer, with a long press resetting the timer. A long press of Up enters the menu. Up/Down/Right buttons are for navigating the menu, and Select for choosing a menu item. When an item is selected, Up/Down are used for changing values. When the Reset menu item is displayed, a long press of Select loads default configuration values. Digital pin 2 is used for activating a beeper for the alarm.

The source code can be downloaded from the link below. You’ll need to find and install the TimerOne library for the code to compile.

Examining the source should give you good insight for using the menu system in your own projects. If you find this timer useful, please share it. Thank you for reading.

Share on LinkedInShare on Google+Tweet about this on TwitterShare on Facebook

30 thoughts on “Arduino LCD Shield Countdown Timer with Menu

  1. Rob

    In file included from MenuManager.cpp:2:0:
    MenuManager.cpp: In member function ‘void MenuManager::descendToChildMenu()’:
    MenuManager.cpp:132:19: error: invalid conversion from ‘uint16_t {aka unsigned int}’ to ‘const MenuItem*’ [-fpermissive]
    currentMenu = pgm_read_word(&(currentMenu[currentMenuItemIndexPos].childMenu));


    1. Kashif Baig Post author

      Hi Rob. Try inserting (const MenuItem*) after the = sign. It’s quite possible you have different compiler settings enabled to mine.

  2. zach

    i am very new to arduino but when i try to press upload it says this:

    Arduino: 1.6.12 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

    /Users/student/Downloads/LcdCountDownTimer/LcdCountDownTimer.ino:5:22: fatal error: TimerOne.h: No such file or directory
    compilation terminated.
    exit status 1
    Error compiling for board Arduino/Genuino Mega or Mega 2560.

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

    1. Kashif Baig Post author

      Hi Zach. You’ll need to find the timerone library (on the internet) and install it.

  3. David

    Hello Friend.
    I loved your project, it’s just what I was looking for to better understand the lcd shield and the timers.
    I have a problem, I do not work the “select” button in both arduino one, as mega.
    It does not give me compilation error, it just does not work that button.
    Do you know what it could be?
    Thank you and congratulations for your work.

    1. Cohesive Computing

      Hi David

      It is possible that your select button is giving a different analog reading. I suggest you create a new project and try doing analogRead(0) and writing the result to the serial output to see what the value is.

  4. Alexandre Bertoletti

    Dear friend Kashif Baig
    Lengths by beautiful design
    I do not have much ability with the C ++ language I have to study more
    I would like to have your help for my project
    I need that when I run the countdown the digital signal of the alarm is high during all counting time and that when the signal is finished it is low.
    Through this signal I will put in the base of a transistor driver to keep a relay closed during all counting and it will open at the end of the count.
    Thanks for your help and best regards to all.


    1. Kashif Baig Post author

      Hi. This file is included in the downloadable project files. Essentially, it is a file where you paste menu code, overwriting existing file content.

  5. William Peters


    Great code! I’m currently operating on an arduino uni and using a DFrobot LCD keypad shield. The code works…except the select button does not. How will I fix this? I am really inexperienced with coding so I kind of need all the help i can get! if you could reply ASAP that’d be awesome.

    1. Kashif Baig Post author

      Hi. In a separate Arduino project, perform an analogRead on pin A0 and output to the serial console. What values to you get?

        1. Kashif Baig Post author

          Sorry, what I meant was what value(s) do you get from analogRead on pin A0 when you press the select button on the LCD shield?

  6. John Hutchison

    William, the following sketch will get you the analogRead values for each button. You’ll just need to edit the display config to match what you have, and the analogPin you have the buttons tied to.

    LiquidCrystal_I2C lcd(0x27, 20, 4);
    int a=0;

    void setup()
    pinMode(A12, INPUT_PULLUP);

    void loop()
    a = analogRead(12);
    lcd.print(” analogRead() “);
    lcd.print(” value is :”);

    1. William Peters

      Would you be able to help me edit the original code to do these things:

      – Only have 1 timer option
      – Once timer has reached zero, initiate digital pin 12 and 13 (I had LED’s attached to 12, and vibration motors attached to 13.)

      If you could help me do this It would be greatly appreciated!

  7. William Peters

    Does anyone know how I would be able to activate LEDs (Digital Pin 12) and Vibration motors (digital pin 13) when he timer value reaches 0? Could someone please help, I am very bad with code and any help would be amazing.

  8. Dello

    Hi there sir, just wanna know how can we put the Finger Print sensor on the LCD shield.

    I mean the wiring of it.

    We’re using the Wido board and the LCD shield same came from the DFRobot and a Finger print sensor.

    We’re going to create a Senior citizen program using biometrics. And the thumbmark will be saved on our website is there any tutorial sir about the Wiring of the Finger print sensor on the LCD shield.

    heres the link we’re we bought our LCD shield and Wido board with specification of it’s hardware.

    Thanks in advance for your help s

  9. holger

    ich have also the problem that the select button not work. but i have try another skeetch and its ok. i setup the working analog readings but the same problem.
    select not working and if i pusch left it change the timers…
    i hope anybody can help me…
    my mail

  10. jean

    I get a long list of error messages related to the TimerOne library, I tried to downlod differents TimerOne libraries and get differents error messages depending on the library (one message example below)
    could you point me to a download link for TimerOne that works for you ?
    thank you for your help !

    error message example :

    libraries\TimerOne\TimerOne.cpp.o (symbol from plugin): In function `TimerOne::disablePwm(char)’:
    (.text+0x0): multiple definition of `TimerOne::disablePwm(char)’
    sketch\TimerOne.cpp.o (symbol from plugin):(.text+0x0): first defined here
    c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
    libraries\TimerOne\TimerOne.cpp.o (symbol from plugin): In function `TimerOne::disablePwm(char)’:
    (.text+0x0): multiple definition of `__vector_20′
    sketch\TimerOne.cpp.o (symbol from plugin):(.text+0x0): first defined here
    libraries\TimerOne\TimerOne.cpp.o (symbol from plugin): In function `TimerOne::disablePwm(char)’:
    (.text+0x0): multiple definition of `Timer1′
    sketch\TimerOne.cpp.o (symbol from plugin):(.text+0x0): first defined here
    libraries\TimerOne\TimerOne.cpp.o (symbol from plugin): In function `TimerOne::disablePwm(char)’:
    …… etc,

    1. Kashif Baig Post author

      Unfortunately, I don’t recall where I obtained the timer one library. It’s not crucial for the LCD menu to work, and can be removed, together with the code that depends on it.

  11. Calade

    Great post ! Is it possible to add a Real Time Clock and change timers to start/stop at different days/hours in the week ?
    Thank you

  12. Beginner

    I want to add a “servo motor” to this code and make it work if the timer is activated and the alarm goes off, but where should I put it?
    The servo motor default To LcdCountDownTimer Add # include Servo.h and
    I tried putting the basic code in the loop and setup, but it didn’t work and the timer stopped. What should I do?

  13. CYB

    Hi Kashif Baig
    I try to run the motor when the buzzer sounds, what should I do?
    And with init itmers () ; the servo motor can not drive.
    I am going to use a tapping motor or a dc motor.


Leave a Reply

Your email address will not be published. Required fields are marked *