Hang Free Arduino Setup

Don't know about you but my experience to keep an Arduino running non-stop for long periods of time has been very frustrating. Things get worst when you add any kind of internet connection (Yun or WiFi shield) and a real nightmare when a GSM shield enters the picture.

After unsuccessfully trying various (HW and/or SW) solutions (found on the Internet) I designed my own which may not be very elegant but it seems to definitely solve my issue.

My approach was to remove power, from time to time, and then restart everything.

In order to do so I built a simple 555 astable timer circuit (schematic attached) that drives a p-channel MOSFET acting as a switch.
Most of the time, while the 555 Output is in the LOW state, the MOSFET is ON and provides energy to a 5 Volt regulator used to supply power to the Arduino.
For short periods of time, when the 555 Output is in the HIGH state, the MOSFET is OFF and the Arduino will be turned OFF (hard reset) until a new cycle begins.

Notes:

  • With the 2.2 M Resistor and 100uF Capacitor the Arduino will receive power for more that 2 minutes. You can achieve longer periods increasing the Resistor and or the Capacitor values.
  • The circuit uses a diode in parallel with the 2,2 M Resistor in order to shorten the OFF state, enough to reset the Arduino.
  • The regulator's output is connected to a Jumper to be able to use the same board with an Arduino UNO (connect to the 5V input) and with a Yun (connect to the Vin input).
  • A small heath-sink is required for the 7805 regulator.

Hope it helps

NoHangs.pdf (36.6 KB)

Just as a suggestion.

If you used the output of your 555 to feed a ripple counter, then you could have the arduino reset the counter on a regular basis.

In the event that the arduino stops resetting the counter, it will finally reach a point where say, bit 8 goes high and triggers the reset. So it would act a bit like a dead mans handle.

How come you can't just run a millis() timer in the Arduino and put it on an output driving a transistor base? The collector tied to the RESET pin?

rmetzner49:
How come you can't just run a millis() timer in the Arduino and put it on an output driving a transistor base? The collector tied to the RESET pin?

How is that transistor to know that it's time to go off? The thing that the external circuitry is trying to do is detect when the arduino STOPS responding.

Oops ... I didn't read carefully enough. Thought he was just resetting every once in a while.

rmetzner49:
Oops ... I didn't read carefully enough. Thought he was just resetting every once in a while.

Well his method DOES just reset it once in a while, but it's in case the arduino has been crashed or hung up.

As my experience shows that sometimes a simple reset is not good enough (see notes below) I have taken the radical approach of switching everything OFF and ON no matter what. Old trick that works fine...

Notes:

  • The GSM shield has a "MODEM Reset on Pin 7" and is not clear if it is (how?) or not related to the regular Arduino RESET Pin.
  • The Yun has 3 Resets buttons (one of them with double feature) but only one of them connected to an external Pin