This real time clock (RTC) with battery backup allows your microcontroller project to keep track of time even if it's reprogrammed or if the power is lost. It's perfect for data logging, clock-building, time stamping, timers, alarms, and more. The DS1307 is the most popular RTC but it requires 5V power to work (although we've used it with 5V power and 3.3V logic successfully).
The DS1307 is simple and inexpensive but not a high precision device. It may lose or gain up to 2 seconds a day. For a high-precision, temperature compensated alternative, take a look at the DS3231 precision RTC.