by Gary Peek
Standalone Watchdog Timers
An External Guard Circuit for Your µC Projects
What's a watchdog timer? Many of you who have
worked with single board computers are
familiar with watchdog timer circuits. These
circuits monitor the operation of the microcontroller and
its software and restart it if a problem is detected.
Watchdog timers are an excellent way to insure that a
microcontroller-based system continues to operate
unattended if occasional failures occur.
There are a number of reasons why your
microcontroller might need this kind of monitoring:
operation in a harsh environment that creates electrical
"spikes," hardware conditions that the software
could not be tested for, and — yes — even "bugs" in
The way that a watchdog timer does its job is to
monitor a particular signal sent by the microcontroller. If
this signal does not occur on a regular basis, it assumes
the microcontroller is "locked up" or the software is
"lost" and cannot send this signal. It then restarts the
What We Needed
I was talking to one of our customers recently about
our RC51 Programmable Relay Controller, which is based
on an Atmel AT89C4051 microcontroller chip. He asked
about the reliability of microcontroller-based systems in
harsh environments. Although our full-featured, single
board computer has a built-in watchdog timer chip, our
single microcontroller chip-based products — like the
RC51 — do not.
Even though we have found that the RC51 and other
products based on single microcontroller chips are very
resistant to the problems associated with harsh
environments, I realized that it would be nice to increase
its reliability further — if the need arose — with a simple
standalone watchdog timer circuit.
What I Designed
Watchdog timer circuits can either be included in the
circuitry on a single board computer or microcontroller or
they can be standalone devices connected to a variety of
signals. If the circuit is included on a single board
computer, it usually restarts the software by issuing a
hardware reset to the microcontroller, just as though
someone had pressed a reset button.
What if your microcontroller does not already have
a watchdog circuit? Any add-on circuit would need to
interface to the reset circuitry on the board. This may
Figure 1. Schematic of the watchdog circuit. Note that C3 is in Farads, not µF.
NUTS & VOLTS