SwitchDoc Labs Dual WatchDog Timer

[include-page id=”buy-include-file”]

 

IMG_4119 2Production Dual WatchDog Board

Why do you need a external Hardware WatchDog on an Arduino or Raspberry Pi? The reason is the internal watchdog is disabled in the boot loader for the Arduino and the Raspberry Pi watchdog is unreliable and difficult to use.

The SwitchDoc Labs Dual WatchDog Timer is designed to make small computer such as the Arduino and Raspberry Pi more reliable by detecting and recovering from computer or software malfunctions. It has two WatchDog Timers that can be used independently or together to reset non-responsive computers. It directly can drive the Arduino Reset line, the Raspberry Pi B/B+ reset line or a to a relay to reset a Raspberry Pi.

 

Version 110216-01-001 Note: Open Drain buffers were now added to the Grove Watchdog inputs. You no longer have to leave the inputs float for the watchdogs to operate. You can leave them float or set them high. It works both ways. This makes the WatchDog compatible with the Pi2Grover Raspberry Pi Grove board. If you want the previous behavior, you can connect up to JP1. The Dog1 and Dog2 inputs from JP1 are not buffered.

Version 032116-01-001 Note: that your Grove Connector on your computer must be capable of being able to “float” (i.e. be an input) for the watchdog to work. If it does not float, then you must connect the Triggers directly to a GPIO on your computer.

Here is a recent series of articles by SwitchDoc Labs about WatchDog Timers.

WatchDog Timer
First Page Dual WatchDog Timer Product Brief

 

 

 

 

 

 

You can download the Dual WatchDog Product Brief here.

 

 

Comments are now closed.   Please go to the Product Support Forum at the top of the page.

Below is how you hook it up to an Arduino.

WatchDog Timer
Dual WatchDog and Arduino

And here is how you hook it up to a Raspberry Pi B+.

DualWatchDogRaspberryPiB_bb

35 Comments

  1. Can I use this board to set up 2 Pi’s or Arduino’s as a redundant pair that is master standby to switch if one is in fault?

    • Yes, definitely. You will need to power down the faulted module. You can use our USB PowerController to do that.

      SDL

  2. We have a doubt that our Raspberry will be again avilable after 4 min. In most cases this is enough time but in some cases not. Would it be possible to have a device with a longer delay ?

    Thanks

    • Alessandro,

      Almost invariably, the Raspberry Pi will boot up with in 4 minutes. However, I understand your concern. Here are two things you can do:

      1) Unsolder the trim pot and replace it with a 2M Ohm trimpot or resistor. That will take it up to about ~8 minutes

      2) Go into your local.rc file or the boot up files itself on the Raspberry Pi and insert a function that will “pat the dog” much earlier in the boot process than when your userspace program is run. This will work. Search on “boot up files Raspberry Pi” or “Bootup process on Raspberry Pi”.

      Best,

      SDL

  3. This seems to work fine on the arduino uno but it seems to instantly keep resetting the arduino mega.

    The LED1 on the Watchdog keeps flashing. Any ideas?

    • Hi Tom,

      My guess is you aren’t “patting the dog” on your Arduino Mega or you have connected the wrong WatchDog output (the pulse rather than the open drain output). We use these boards all the time with the ArduinoMega.

      Try checking your wiring very carefully.

      SDL

  4. Hi can the two halves of the board be physically separated for use on different projects? They kind of look like perf lines but I only see one power/gnd header unless the bus on the left can fill in once divided?

    • Hi Dave,

      No, they really can’t be cut. We have been asked to do that and will for the next revision of the board. Thanks for the comment.

      SDL

  5. Hello,

    Very interesting product here. I use on my raspberry pi a power button from MSL Digital Solutions. This button board uses the following pins:

    2,4,6.8.9,10 and 12

    Would I be able to use your dual watchdog timer using pins other than the ones my button daughterboard are using?

    Thank you.

      • Thanks very much for the reply. So this board has a firmware on it to set which pin to use to hard reset the frozen Pi? If so how do we interact with it to set the timeout limit.

        Also, I’m trying to understand how this board connects with the Pi itself. Does it require soldering? Is it mounted (affixed) in some way to the top of the Pi? I’m trying to find pictures of your board connected to a Pi but they are all conceptual drawings and not actual real pictures of how it would look together.

        Thank you.

  6. Using the WatchDog Dual Timer; it constantly resets the Arduino Mega. LEDS are both on steady, red.

    Starting server: 12/30/2015 , 19:58:19
    Starting server: 12/30/2015 , 19:59:40
    Starting server: 12/30/2015 , 20:01:00
    Starting server: 12/30/2015 , 20:02:29
    Starting server: 12/30/2015 , 20:02:48
    Starting server: 12/30/2015 , 20:03:42
    Starting server: 12/30/2015 , 20:05:02
    Starting server: 12/30/2015 , 20:05:37
    Starting server: 12/30/2015 , 20:06:26
    Starting server: 12/30/2015 , 20:07:14
    Starting server: 12/30/2015 , 20:08:02
    Starting server: 12/30/2015 , 20:08:50
    Starting server: 12/30/2015 , 20:09:38
    Starting server: 12/30/2015 , 20:10:13
    Starting server: 12/30/2015 , 20:10:27
    Starting server: 12/30/2015 , 20:13:03

    Have tried min and max trim resistor settings; as you can see above.

    How do I “pat the Dog?” Do I need to call the function? I see no reference in the product brief to calling the function.

    #define RESET_WATCHDOG1 6

    void ResetWatchdog1()
    {

    pinMode(RESET_WATCHDOG1, OUTPUT);
    delay(200);
    pinMode(RESET_WATCHDOG1, INPUT);
    Serial.println(“Watchdog1 Reset”);

    }

    Thank you for producing the WatchDog Dual Timer!

    William

    Trying to use the WatchDog Dual Timer to only restart server when defined pin 6 goes to 0 volt

  7. Hi, could you share your fritzing model for this board? I would like to generate a couple layouts my project documentation.

    • Dave,

      We will be happy to do that. We will add that onto the product page next week.

      Best regards,

      SDL

  8. I am using the ebl-arduino/RTCEventTimer library to call ResetWatchdog1() every one minute; without interfering the main loop

    • William,

      Here is what I would suggest. Add a print statement in the reset watchdog code to make sure it is being called. If it is being called, check the output pin that is going to the watchdog to make sure it is working correctly. It could be a software or wiring issues.

      Best regards,

      SDL

      • Output voltage from Arduino Mega (Digital Pin 6 on JP2) reads 3.3 V when pulse is HIGH. Print statements confirm RESET_WATCHDOG1 is being called. every one minute.

        What is the best way to set the trim pot (TR1)?

        What is the purpose of TP1-8? Test points?

        • Hi William,

          Pin 6 needs to be in hi-Z mode when it is not being actively pulsed. Would you post the code you are using for patting the dog?

          Look in the spec at the diagram of the trim pot. You can use a jewelers screwdriver to turn the pot to the desired position.

          TP1-TP8 are test points for testing the function of the device in production.

          Best regards,

          SDL

        • William,

          Thank you for sending me the code. Nice use of the RTCTimedEvent.h code. I like it.

          It looks good, except one thing is bothering me. Pin 6 needs to be pulsed Low and then returned to Hi-z (by turning it to an input). You say that it is at 3V when pulse is HIGH? That doesn’t make sense to me.

          Is it possible you have set the value of the GPIO pin to 1 somewhere in the code? Explicitly set it to 0 and see if that fixes it.

          Best regards,

          SDL

          • William, It should be 0.0V when patting the dog. It is floating the the rest of the time so measuring the voltage won’t work well.

            What pin do you have it plugged into the WatchDog?

            SDL

  9. would love to see a small foot print, single watchdog, line header bread-boardable version of this. random .02

  10. Voltage readings were taken without any connection at the pin (normally going to Watchdog1 Input) and referenced to ground. I could see voltage go from a High to a low; whenever, the RESET_WATCHDOG1 function was called within the running SdBrowse_Ethernet_WebServer.ino Sketch.

    Changed the delay to 5000, to more easily see voltage change. Change delay back to 200 in the RESET_WATCHDOG1 function when finished reading voltages.

    If the “pulse” at the input of Watchdog1 is missing –does this causes a Low voltage to be pulsed at the Watchdog1 output; resetting the Arduino?

    How can the Output pulsing of the Watchdog1 Output be tested? Trying to find right duration of the LOW Watchdog1 output. I think I have adjusted for it correctly; would like to confirmed the setting works.

    William

    • William,

      If you remove the lines attached to the DOG1_TRIGGER and DOG2_TRIGGER, the Watchdog board will start trying to reboot the attached devices. You will see the LEDs flash periodically (time depends where you have set the trim pot). That is how you test the output.

      If that test works, then connect up your GPIO signal and see if it changes the flashing behavior.

      Best regards,

      SDL

  11. Problem was I did not allow enough time for the Trim POT, time to expire and change the state of the LED from “ON” to “OFF.” Allowing approximately three minutes; the LED changed state from “ON” to “OFF.”

    Thank you for producing the SwitchDoc Labs, “Watchdog Dual Timer.”

    William

  12. Hi,

    very interesting board.
    What are the overall dimension of the board and
    what is the spacing of the mounting holes?

    Daniel

    • Hi Daniel,

      Physical dimensions of board: 63.44mm x 64.33mm x 12mm(max). Mounting holes inset 3.5mm x3.5mm from each corner

      Best Regards,

      SDL

  13. Hi,

    I’m trying to get the Dual WatchDog Board working with my Raspberry Pi 2B. If I connect the power and ground both LEDs on the WatchDog will light up solid and then blink periodically. But when I connect the input and output leads to the rpi I never get a blink on WatchDog 1. WatchDog 2 continues to blink periodically. I’m not doing anything with GPIO 18 at this point with my software, I just want to see it resetting the rpi before I try to get the “dog pat” process working in my software.

    Any ideas what I’m doing wrong?

    Thank you.

    Jim

    • It sounds like GPIO18 is being pulled up or down. You need to make sure that it is “floating”, i.e. programmed as an input with no pull-ups or pull downs.

      In python: GPIO.setup(RESET_WATCHDOG1, GPIO.IN)

      Add that to your code.

      Best regards,

      SDL

  14. My program is written in Java and I’m using pi4j. I was struggling to get any results that made sense, so I finally backed off the Java and experimented with Python using your code snippet and other examples that are easy to find on the web. I got expected results with Python after the realization that I needed to use GPIO.setmode(GPIO.BCM) which got me thinking about the port numbering scheme being used by pi4j. So I wrote a Java test program using an LED and discovered that the pin labeled GPIO_18 on the Raspberry Pi 2 Model B is referenced as GPIO_01 in pi4j. Go figure. My WatchDog is working fine now, and I’m posting my Java code here for reference. Thank you.

    import com.pi4j.io.gpio.GpioController;
    import com.pi4j.io.gpio.GpioFactory;
    import com.pi4j.io.gpio.GpioPin;
    import com.pi4j.io.gpio.GpioPinDigitalOutput;
    import com.pi4j.io.gpio.PinMode;
    import com.pi4j.io.gpio.PinPullResistance;
    import com.pi4j.io.gpio.PinState;
    import com.pi4j.io.gpio.RaspiPin;

    private void patDog() {
    GpioController gpio = GpioFactory.getInstance();
    GpioPin pin = gpio.provisionPin(RaspiPin.GPIO_01, “GPIO_01”,PinMode.DIGITAL_OUTPUT );
    pin.setMode(PinMode.DIGITAL_OUTPUT);
    ((GpioPinDigitalOutput)pin).setState(PinState.LOW);
    Thread.sleep(200);
    pin.setMode(PinMode.DIGITAL_INPUT);
    pin.setPullResistance(PinPullResistance.OFF);
    return;
    }

    • Jim,

      We have fought with the GPIO numbering schemes since we started using the Raspberry Pi years ago. I wonder how many man-hours have been lost by their decision to support both?

      Good code.

      Best,

      SDL

39 Trackbacks / Pingbacks

  1. WeatherArduino Complete and Ready for the Caribbean - SwitchDoc Labs
  2. Wind Power and WeatherArduino in the Caribbean - SwitchDoc Labs
  3. Wind Power for the Pi/Arduino - 8 Days in the Breeze - SwitchDoc Labs
  4. Solar Power and the Raspberry Pi - 6 Months in the Sun - SwitchDoc Labs
  5. Dead Man Switch - SwitchDoc Labs
  6. 16 Days in the Breeze - Wind Power Raspberry Pi / Arduino - SwitchDoc Labs
  7. Reliable Projects 2: Using the Internal WatchDog Timer for the Raspberry Pi - SwitchDoc Labs
  8. Reliable Projects: WatchDog Timers for Raspberry Pi and Arduinos - SwitchDoc Labs
  9. Reliable Projects 3: Using the Internal WatchDog Timer for the Arduino - SwitchDoc Labs
  10. Reliable Projects 4: Internal Versus External WatchDog Timers - SwitchDoc Labs
  11. Reliable Projects 5: External WatchDog Timers for Raspberry Pi/Arduino Systems - SwitchDoc Labs
  12. Problems: New Part Generation with Fritzing - SwitchDoc Labs
  13. SunAir Solar Power Kickstarter Launched! - SwitchDoc Labs
  14. Solar Power on the Raspberry Pi - SunAir - SwitchDoc Labs
  15. Solar Power on the Arduino - SunAir - SwitchDoc Labs
  16. Solar Power and The Raspberry Pi/Arduino New Results - SwitchDoc Labs
  17. SunAir Solar Power Kickstarter Successful - 165% Funded - SwitchDoc Labs
  18. BeaconAir - Reading IBeacons on your Raspberry Pi - SwitchDoc Labs
  19. Solar Power for the Pi/Arduino - Six Days In The Sun - SwitchDoc Labs
  20. Raspberry Pi Python I2C Driver for TCS34725 RGBC color sensor - SwitchDoc Labs
  21. Solar Power, Weather and the Raspberry Pi - SwitchDoc Labs
  22. Solar Power, Weather and the Raspberry Pi | Fluharty Industries R&D
  23. Project Curacao – SwitchDoc Labs Solar Raspberry Pi Project | Voltaic Systems Blog – Solar DIY and Device Charging
  24. WeatherPi Solar Power Weather Station - Monitoring the Sun - SwitchDoc Labs
  25. WeatherPi Solar Powered Weather Station - 3D Printing Parts - SwitchDoc Labs
  26. WeatherPi Solar Powered Weather Station Deployed Outside - SwitchDoc Labs
  27. WeatherPi Outside- 7 Days in the Sun - SwitchDoc Labs
  28. Building Reliable Systems - New Instructable - WatchDog Timers - SwitchDoc Labs
  29. Solar Power - Project Curacao Update - SwitchDoc Labs
  30. 7 days in the Caribbean Sun - Project Curacao Results! - SwitchDoc Labs
  31. WeatherPi Solar Power Weather Station - Boxing Up - SwitchDoc Labs
  32. Project Curacao Update - Loose Wire in the Caribbean - SwitchDoc Labs
  33. Secrets of the USB PowerControl - Application Notes - SwitchDoc Labs
  34. Tutorial: WatchDog Timer - Adding a Status Bit - SwitchDoc Labs
  35. New Product - USB PowerControl With Grove - SwitchDoc Labs
  36. Reliable Projects 2: Using the Internal WatchDog Timer for the Raspberry Pi - SwitchDoc Labs
  37. Reliable Projects 3: Using the Internal WatchDog Timer for the Arduino - SwitchDoc Labs
  38. Reliable Projects 5: External WatchDog Timers for Raspberry Pi/Arduino Systems - SwitchDoc Labs
  39. SunAir Solar Power Controller for Raspberry Pi and Arduino • Tech Projects

Comments are closed.