This project uses an Arduino Nano, a RTC, a rotary encoder, a Nokia 5110 display and a relay. It allows manual and programmed setting of temperature, and furnace control.
You can see a video of the system, a breakdown of the code, and how I put it together here: Arduino Programmable Thermostat
The DS3231 RTC is an I2C device. So in addition to needing +5V and ground, it has a clock pin (SCK) that connects to A5 and a data pin (SDA) that connects to A4.
The clock is set in the setup() function the first time you run the program with the following code:
Make sure to comment them out and reset the Arduino after setting the clock.