Hardware watchdog

I'm curious if anyone uses a hardware Watchdog to reset their devices in case it becomes unresponsive.
(To clarify I am using Wemos D1 mini and ESP32 devices currently).

I have ordered a couple of Superhouse Watchdog timers from his website, shipping from Oz to UK I have some time on my hands! (I'm cheap and paid minimum postage :slight_smile: )

I would like to build one for myself just for fun, the circuits are readily available.

Anyone use them? Reasons why not?
Thx

Reasons why not?

Because you can make one with a NE555 chip, no need for anything special. The circuit is known as a missing pulse detector.
Although the circuit on that GitHub page uses a 555 it is a poor circuit because if the digital output gets stuck in one state it will prevent the watch dog resetting the processor. You need to AC couple the digital pin that kicks the dog so this can't happen.

When I did industrial controls using Allen-Bradley PLC's they all had hardware watchdogs built in - if the watchdog tripped all the outputs were disabled to stop the equipment - resetting was manual

Grumpy_Mike:
Because you can make one with a NE555 chip, no need for anything special. The circuit is known as a missing pulse detector.
Although the circuit on that GitHub page uses a 555 it is a poor circuit because if the digital output gets stuck in one state it will prevent the watch dog resetting the processor. You need to AC couple the digital pin that kicks the dog so this can't happen.

Hi there,

Apologies but I don't follow your point :slight_smile: Are you saying hardware watchdogs are a good idea?

Both of the links were to 555 based circuits, I don't understand why there is not a "standard watchdog circuit" out there. Every thread I have read it seems people are designing their own and trial and error aproach.

Hence I wondered - are people actually using hardware watchdogs? If not, why not? Maybe their coding is better and they get no hangs :slight_smile:

saildude:
When I did industrial controls using Allen-Bradley PLC's they all had hardware watchdogs built in - if the watchdog tripped all the outputs were disabled to stop the equipment - resetting was manual

Hi saildude, 20yrs ago I did industrial control panel wiring and worked on many PLC's, not the software side though. I can see why they would want the watchdog to lock out - imagine all those conveyor belts running amok! :slight_smile:

877:
I don't understand why there is not a "standard watchdog circuit" out there.

There are (or were) dedicated watchdog ICs; you possibly did not search for the correct terms :wink: Easy talking from my side as, from the past, I could remember the names of some semiconductor companies like Dallas Semiconductor so I could add that in the search :slight_smile:

e.g. Dallas DS1286

Hi sterretje,

Very interesting thanks, looks like they have gone out of fashion a little, as they don't seems widely available. Maybe CPU's are supposed to be more reliable without my janky code :slight_smile:

I often incorporate a TPL5010 into PCBs, so you can fit the watchdog if need.

You can use it a plain Watchdog, it will pull reset low of the DONE pin is not pulsed regularly , 100mS to 2 hours timeout.

You can also use it as an interrupt wakeup timer.

Quiescent current is circa 0.035uA

It is a little known fact that I invented the hardware watchdog back in 1975. It is little known because I never published this anywhere and the patent on it I think came about two years later. I called it an auto reset circuit. It was used on a single project a ham radio repeater for North Manchester ( England ) and later my friend used it on the South Manchester one.

I don't understand why there is not a "standard watchdog circuit" out there.

Because there’s more than one way to skin a cat, or as my father used to say, there is more than one way to kill a pig than strangling it with butter. Why should there be a standard. These days there is an internal watch dog on every processor and I wish I had the patent on that one.

My original circuit consisted simply of a charging capacitor with a transistor across it which discharged the capacitor to prevent the voltage reaching the reset voltage.

srnet:
I often incorporate a TPL5010 into PCBs, so you can fit the watchdog if need.

You can use it a plain Watchdog, it will pull reset low of the DONE pin is not pulsed regularly , 100mS to 2 hours timeout.

That seems just the job, do you ever use it just to watch an arduino? If you have any circuit diagrams or any advice it would be much appreciated, I will start looking now..

Grumpy_Mike:
It is a little known fact that I invented the hardware watchdog back in 1975. It is little known because I never published this anywhere and the patent on it I think came about two years later. I called it an auto reset circuit. It was used on a single project a ham radio repeater for North Manchester ( England ) and later my friend used it on the South Manchester one.

Hi again, that is most impressive, pity you didn't publish it - but why would you I guess?

I know Manchester is in England, I only live 2hrs away from you! Mind you almost everywhere in England is 2hrs away when you live in the Midlands :slight_smile:

A lot of processors eg the 328 in the UNO now have built in watch dog timers , which you can access, as well as brown out detection etc - hence the separate chips have fallen out of fashion a bit .

I believe the 8266 has internal. WDT too.

You could also build a simple diode pump onto a digital
Output and use that to detect your program crash and generate a reset.

877:
That seems just the job, do you ever use it just to watch an arduino? If you have any circuit diagrams or any advice it would be much appreciated, I will start looking now..

Its really simple, just look at the data sheet, used it on several Arduino boards, it works. Time is fairly stable and accurate too, unlike the WDT in an Atmel processor.

Its worth adding a pullup resistor on the DONE pin.

@hammy thanks yes I have been reading that the 8266’s and esp32’s have internal watchdog. I wonder if it is considered ‘hardware’. I have in the past had software watchdog resets on a wemos, i can’t remember the issue.

Never heard of a diode pump, I’ll have a look

@srnet I will have a good read of the datasheet, thanks for the tip

pity you didn't publish i

But in those days you couldn’t just publish it on line you had to have someone who would agree to publish it. The RSGB, Radio Society of Great Britain was offered the chance to publish the design of the repeater controller but they declined saying they published radio designers not computer designs. Ok on your location but there was no indication of where you were on your posts.

Incidentally every commercial product I have ever worked on contained a software watchdog circuit but the built in ones are not always successful especially with multitasking and multi threaded code. The joke amongst programmers is that everything can crash except the thread kicking the watchdog.

That is why I said your design was poor because a set stuck logic level would defeat the watchdog, at least with AC coupling you have to keep pulsing the thing.

srnet:
Its really simple, just look at the data sheet, used it on several Arduino boards, it works. Time is fairly stable and accurate too, unlike the WDT in an Atmel processor.

Its worth adding a pullup resistor on the DONE pin.

@srnet I have spend a good while reading the data sheet, actually quite enjoyable as I don't normally understand too much of them. It was a pretty clear one I thought!

A few questions if you have time:

  1. It's a SOT23 package which I learned is SMT. As I have never worked with SMT I could use a breakout board like THIS. Seems ok?
    SMT breakout.jpg

  2. Do you use the WAKE signal? I see two options a)the arduino processes the signal and returns the DONE signal via code, or b) just send the DONE signal from the arduino more frequently than the WAKE signal is sent from the TPL5010.

  3. DONE pullup resistor - the TPL5010 registers the low>high transition from the arduino. So you just code the arduino output to be pulled low for a short interval? (datasheet says min 100ns). As 100K is recommended for RST line I would assume the same value if good for DONE.

Example connection diagram:

SMT breakout.jpg

It's a SOT23 package which I learned is SMT. As I have never worked with SMT I could use a breakout board like THIS. Seems ok?

Yes.

Or you could be inventive with strip board and a scalpel.

Ha that's a good idea!

I actually found a few breakout boards on the web with the TPL5110 already featured:

I need to read more about how it functions as to whether it would be suitable..

Looks like a contender. The WAKE pin appears to be connected to a mosfet which supplies Vcc to the DRV terminal. This would be the pin that normally pulls the reset pin low on the Arduino. I think the mosfet could be removed and just connect the WAKE pin directly to the DRV terminal. Or use an external transistor to convert the high DRV into a low.

Make sense to anyone? :slight_smile:

Breakout\adapter boards for SMT parts are real cheap on places like Aliexpress.

The Wake pin on the TPL5010 gives you a warning that a reset is going to happen, so you can use it as an interrupt wake up timer, to rouse an Arduino from deep sleep for instance. Much more stable and low current than the processors own WDT.

The TPL5110 is not a Watchdog device.

My bad. I think I fell victim to autocorrect as I was working off my tablet.

Thanks for pointing that out