How to use a clock as a trigger?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to use a clock as a trigger?

by Virtuous70 on Tue Sep 14, 2021 6:54 pm

Hello… I have only the most basic knowledge of working with microcontrollers. I have used the audio FX soundboard, but how would I use a clock with that as a timer that would trigger the audio files to go off regularly in a certain timeframe? What would I need in addition to the sound board?
Thanks in advance.

Posts: 23
Joined: Sat Nov 04, 2017 7:46 pm

Re: How to use a clock as a trigger?

by adafruit_support_mike on Tue Sep 14, 2021 9:42 pm

Some Real Time Clocks (RTCs) have an output pin that will change voltage at a specified time, but you'll need a microcontroller to tell the RTC when to change the pin. You also won't have the options to trigger more than one or two FX pins directly from the RTC.

Your life will probably be easier if you put a microcontroller between the RTC and the FX Board. It doesn't need to be fancy, but does need enough pins to trigger all the sounds you want, if you want to toggle the pins directly. The FX Board also has a Serial control interface that can talk directly to a microcontroller like the Trinket M0 through its TX/RX pins:


The Trinket M0 can ask an RTC for the timer periodically, and can tell the FX Board to play any tracks you want at any times you want.

A note about RTCs though: the quality of their timing varies dramatically. Marketing types use 'RTC' to mean anything that formats its output in HH:MM:SS format, whether it keeps time or not.

Low-precision RTCs like the PCF8523 and DS1307 are good enough to provide a stable time base over periods of a few minutes, but will drift from a real clock (meaning the atomic clock system) by a few seconds per day:


Precision clocks like the DS3231 are good enough for actual timekeeping. They have a built-in crystal and temperature compensation to prevent the 30ppm drift that's typical in low-precision RTCs, and will track the atomic clock system to within a few seconds per year:


Beyond that there are quartz oscillators that live in temperature-controlled ovens that can be nearly as reliable as the lower-quality atomic standards like Rubidium clocks. Those are expensive and delicate enough that we don't carry them.

Beyond those are the realms of mad scientists who've devoted their lives to the kind of voodoo necessary to establish provably-stable systems that vary by (at present) less than a second over the expected lifespan of the universe. The hardware exists now, but it will take years of statistical testing to show that their output really is as good as expected.

Posts: 63729
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.