Introduction: LM555 Watchdog for Arduino!
This is a simple schematic that allows the use of the chip LM555 as a Watchdog for the Arduino board.
Step 1: Needed Components
- 1 x LM555
- 1 x MOSFET IRF540
- 3 x 100k Resistors
- 2 x 10k Resistors
- 1 x 100uF Capacitor
- 2 x 1uF Capacitor
- 1 x 0.01uF Capacitor
Step 2: Explanation
- R1 and C1 define the timeout accordingly to the LM555 datasheet;
- R2 avoids undershoot that otherwise would disrupt the LM555;
- C3 guarantees that only transitions (beats) are considered as Hearthbeats;
- R3 and R4 centers the heartbeat voltage at 2.5 volts, low enough not to trigger the MOSFET and high enough to enable the LM555 trigger;
- The MOSFET IRF540 discharges the capacitor C1 whenever receives a positive beat, avoiding this way the LM555 triggering that would reset the Arduino;
- C4 and R5 guarantee that the reset pin doesn't remain low when LM555 is triggered and its pin 3 goes LOW.
Step 3: How to Use
- In the Arduino loop function, insert an if statement that will switch the Pin D4 HIGH and LOW alternately;
- If for some reason the Pin D4 remains HIGH or LOW for more than the timeout, the Arduino RESET will be activated;
- After the previous RESET activation, this Watchdog will remain inactive until a new low beat is received.
Step 4: Schematic
Here is the Schematic in PDF.
5 Comments
11 months ago
Do you think it might be a problem if both internal comparators go high at the same time? I worry what would happen to the internal sr flipflop output in such case. I worry if a kick pulse comes at the very same time the capacitor is fully charged the circuit may behave in unexpected ways. I know the probability is nearly zero, but as it is a device to recover the microcontroller from unexpected situations I worry if this could turn into a source of intermittent problems as well. Am I too worried?
11 months ago
Neat!! Exactly what I was searching for! Thanks, Monteiro!
6 years ago
Hi, the problem with Bipolar Transistors is their typical Threshold Voltage of 0.6 volts, while the IRF540 has a typical Threshold Voltage of 3 volts... The LM555 had issues when its pin 2 was at 0 or 5 volts, in the first case it didn't triggered as expected while in the second case the LM555 depends on a new negative beat to restart the C1 charging each time it's discharged, in other words, it breaks the cycle!
Reply 6 years ago
BTW, that's why I used the resistors R3 and R4, to center the heartbeat voltage at 2.5 volts, avoiding this way the problematic chip behaviour at 0 and 5 volts!
6 years ago
Cool. There aren't a lot of projects that combine Arduinos with older IC circuits.