Knowing the time you collected a measurement can make can you help better understanding your environment. For example, comparing temperature readings taken at the same time from a sensor above the soil surface to another beneath it can tell us how the environment changes over very short distances. Comparing two different quantities, such as solar intensity and temperature, can help us understand weather patterns. Readings at different times can help us understand rates of change, such as cooling or warming of soil or air exposed to sun vs. shade, or across seasons. Knowing the time a measurement was taken is also key for comparing to other data, such as online weather or tide stations.
Most microcontrollers keep track of time using a Real Time Clock, or RTC for short. While there is a clock on the microcontroller itself (onboard RTC), it turns off when the microcontroller isn’t powered and therefore stops keeping track of time. To get around this problem, you will use an external RTC that has its own battery so it can keep the correct time even when the microcontroller is off. This will allow you to make sure your logger is collecting accurate timestamps when you leave it out collecting data!