get one at www.adafruit.com/products/80. Connect the
nine volt battery as shown in Figure 16 and you are ready
to run your Arduino away from a computer.
This process of gathering information external to a
computer is called data logging, and it is used to
record sensor readings over known intervals at
known dates and times. In later chapters, we will
learn how to use sensors, but first we will learn
how to keep time so that we can log the sensor
data and know when we took our readings.
1 Computer with Internet connection
1 Barrel connector with snap connections
1 Nine volt battery
Estimated time for this lab: 15 minutes (+ 24 hours)
Check off when complete:
; Attach a nine volt battery to the snap
connections as shown in Figure 15.
; Plug the nine volt battery into the Arduino
barrel connector as shown in Figure 16.
; Calibrate the clock as you did in Lab 2.
; Remove the USB connector and wait 24 hours.
; DO NOT plug in the USB cable. If you attempt to
contact the Arduino via USB, it will reset and you will
lose the time and have to start over.
; Refer to your PC time clock for the correct time and
then compare this to the time being displayed on the
; What is your error in seconds per day?
As we said earlier, this isn’t a particularly accurate
clock. In order to get really good accuracy, you’ll need to
use an external RTC like what was discussed in the
Smiley’s Workshops mentioned earlier. However, as we
will see when we look at data logging, our clock is good
enough to time a days’ worth of measurements, and you
can resync it each day when you upload the data you
Next month, we will learn to use light and
temperature sensors with the Arduino in preparation for
the following month when we will use those sensors and
what we have learned about time to build a data logger.
Remember that all the components used in the
Arduino 101 series are available from the Nuts&Volts
webstore for convenience. If you have any questions
about this series, be sure to visit the forum at
www.arduinoclassroom.com and ask. NV
; FIGURE 16:
to nine volt battery.
74 October 2014