Introduction: Big Arduino LCD Clock With Two Alarms and Temperature Monitor Controlled by IR TV Remote

How to build an Arduino based LCD Clock with Two alarms and temperature monitor controlled by IR TV remote.

Step 1: Description

This is an LCD clock made with DS3231 real time clock module, which unlike DS1307 has the possibility of Alarm and temperature monitor. In this case, the LCD screen displays the date, time, two alarms and also the current temperature. And the most interesting part is that the complete settings of the clock as well as muting the alarm is done through the TV remote controller.

Step 2: Parts

Hardware parts required for building:

-Arduino board

-DS3231 RTC board

-20X4 LCD display

-I2C Arduino LCD Display Module

-RC5 protocol IR remote control

-IR receiver



-220 Ohm resistor

Step 3: Building

The basic code is taken from simple-circuit web page And I made a few changes : For simplicity, I added an I2C module to the LCD display and modified the code accordingly. I also added a small buzzer that generates sound with a given frequency while the alarm is active.

The DS3231 board is supplied with 5V as the 20x4 LCD and the IR receiver, this 5V comes from the Arduino board, there are 3 data lined connected between this board and the Arduino, SCL line is connected to analog pin 5, SDA is connected to analog pin 4 and INT line is connected to digital pin 2 which is the external interrupt pin of the Arduino (INT0). The DS3231 interrupts the microcontroller when there is an alarm (alarm1 or alarm2). The IR receiver has 3 pins: GND, VCC and OUT where the OUT pin is connected to Arduino pin 3 which is external interrupt pin (INT1). The LED which is connected to Arduino pin 10 is used as an alarm indicator (alarm1 or alarm2), so if there is an alarm the DS3231 pulls down the INT pin which interrupts the microcontroller (ATmega328P) and the microcontroller turns the LED ON, here a button on the remote control turns both the LED and the occurred alarm OFF. We need to decode our remote control in order to know the code of each button because we’ve to add it in the Arduino software (code).

Step 4: Remote Controller

The remote control used in this project is a TV IR remote control with RC5 protocol, it’s the one shown below (used buttons are numbered):

Button Function Code (hex format)

1 Increment 0x20

2 Set time and calendar 0x10

3 Decrement 0x21

4 Set alarms 0x11

5 Reset alarms 0x0C

Note that this code must use the remote control with the RC5 protocol, and most often such remote devices are used by older Philips devices. Below is a simple code "IR protocol finder" that allows you to easily determine the protocol of any remote control, as well as the value of each button. The picture shows the remote control I used with the marked values and functions of the buttons.

Step 5: Schematic and Code

Below is presented small code for determining protocol type and values of the buttons on IR controller and complete clock code