Level of digital outputs in case of fault / error

Hello together, I'm new in the community and like to start with my first question.

How I can realize a safe state of a digital output. In detail I like to control a relay via a digital output, which should be switched for a maximum of a defined time. Is there a way to set this up so that the output is also reset in the event of an error or should I connect an edge-controlled HW monoflop between the output and the relay?
My application is to control an acid (PH reducer) pump for a pool.

Best regards Jörg

Hello
Post your current sketch to see how we can help you.

at the moment i don't have a sketch for it, i'm still researching if it can be solved this way with an arduino.
Controlling a digital output for a defined time (for example for 120 seconds) is not the challenge.
I'm just not sure how stable it is when it is controlled purely via software, I want to make sure that the output is reset even if the Arduino crashes for example or hang for any case in a infinite loop

Hello
take a view here:
https://www.arduino.cc/reference/en/libraries/watchdog/

that seems to be exactly what I'm looking for! Thanks a lot!

just found some time to look at the watchdog, yes it does exactly what i am looking for. But unfortunately it does not integrate on samd architectures

WARNING: library watchdog claims to run on avr, megaavr, teensy architecture(s) and may be incompatible with your current board running on samd architecture(s).

Hi, @horchi
Welcome to the forum.

What is your proposed project application that has you concerned about output stability and software lockups?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

and I don't like to add the whole 20 liter canister at once :slight_smile:

Hi,

Well a solution there would be to not make the whole 20ltr available to the controller.
Make it so the controller messaged/alarmed when it needed more chemical and the canister was empty.

Another solution make a separate hardware timer on the chemical pump, this way you will be completely independent of any controller malfunction.

You are looking at this in an emergency stop type situation.
In industry control situations, EMSTOP systems are completely independent of the controller and control circuits.
Usually they are positioned in the power supply, so when an emergency occurs the power is completely disconnected.

By letting the controller check itself you are still not 100% fail safe.

Tom... :smiley: :+1: :coffee: :australia:

yes that was also my idea in the first post, I just wanted to clarify if there is a way to do that with the Arduino.

Many Thanks!

The SAMD21 has a watchdog (I think all MCUs has one). An Arduino library for it may not exist, but you don't need one.

thanks, with the sodaq_wdt it is working fine :slight_smile: