Arduino RTC timer sketch

Something somewhat useful, and the main reason I started playing the the DS1307 real time clock, was to be able to accurately control events based on the current time. In the same way you can get a simple plug-in timer to turn on or off an appliance depending on the time, I wanted to be able to do the same with the Arduino.

I wrote a fairly wide-ranging RTC timer sketch that I posted to Github that will allow you to execute a given block of code or function based on a start and end time that you specify. Although the default sketch is simply turning on and off an LED connected to digital pin 2, there’s probably a lot of situations beyond just turning a light on or off that this could be used for.

Hopefully it’s useful, and it’s definitely something I’ll be incorporating in to other programs I’ll be writing 🙂


Senior Content Development for Microsoft writing about Azure Kubernetes Service (AKS). Model train nerd. Occasionally I play video games.

3 comments on “Arduino RTC timer sketch
  1. Maik says:
    Safari 8536.25 iOS 6.1
  2. Tim says:
    Safari 601.1.56 Mac OS X 10.10.5
  3. player3 says:
    Google Chrome 48.0.2564.116 Windows 7

Leave a Reply

Your email address will not be published. Required fields are marked *