I want to read an RFID tag using an Arduino, which controls some relais. This is easy.
For me the more complex part is to build it fault-tolerant. So I thought I could use the watchdog. The tricky part is, my relais module should keep a certain state (change of state is rare), no matter what happens to the Arduino.
My first thought was to put some condensators to the relais. Calculate the RC component so it can last the watchdog timeout plus booting up.
Now there is the problem, that the relais module is keeping its state while booting. I guess I can't use a pull up/down resistor, since the state of the relais can be low or high at random.
My second thought was using a latch relay. But this has the disadvantage, that it probably can hide problems. For example if the arduino died, and the latch relay holds a certain state, it masks the problem. In that case it's not possible to notice a faulty Arduino.
Those are the reasons I tend to think condensators are better?
Are those ideas feasible? Are there easier ways to accomplish this?
Are there more problems to think about?
(I was already reading about millis at gammon's page. Apparently it's not a problem after all.)
1 Answer 1
Consider constraining your design with clear requirements. As it is highly unlikely any design can protect its self for all situations.
my relais module should keep a certain state (change of state is rare), no matter what happens to the arduino
Consider latching relays where there is a set coil and a reset coil. Such as this one. Such a device does not need to be continuously powered. Only pulsed to set and a pulsed to reset.
So I thought I could use the watchdog.
Watchdog timers are fine if your program can get stuck waiting for an event that may never happen. Like waiting to read the data from and RFID chip. If you think this might happen, then add the watchdog timer to your design.
Now there is the problem, that the relais module is keeping its state while booting.
Most embedded processors with bi-directional GPIO pins force those pins to be inputs when booting up. This appears as high impedance to the outside world. Consider using pull ups or pull downs on these pins to prevent them from floating to a state which may change the relays during booting of the processor.
-
Yes you're totaly right. My requirements are not clear. Even I am not sure about them. Good point. I was thinking about a timed latch. If I go into default state, nothing happens and I can detect a problem. If there is a state other than default, I want to be sure it's the proper one.duedl0r– duedl0r01/19/2019 02:47:10Commented Jan 19, 2019 at 2:47
relais module should keep a certain state (change of state is rare), no matter what happens to the arduino
........ andif the arduino died, and the latch relay holds a certain state, it masks the problem