Goes unresponsive intermittently

I'm not sure where to place this query or even to describe it succinctly but:

I have an irrigation controller which has been good for a year or so. It is powered by a mains-connected AC transformer with my rectifier circuitry that then uses a buck DC-DC module and finally a three pin voltage regulator.
There is a 2 x 16 LCD display which is usually blank unless I switch it to a range of data. Recently I find the irrigation is not coming on at the expected times, and when I try to switch the display on nothing happens. The power supply light is still on but the Arduino board is out of sight so I can't see the on-board LED's. However, when I cut the (mains) power to the supply and switch on again the controller starts up normally at the beginning of the program. I would have thought that if there was an intermittent power failure the system would just re-set, but it seems to completely stop or lock up.

The outputs are electromechanical relays switching 24vAC. I can manually switch these on and there don't seem to be any shorts or surge interference with the rest of the system. There is a small electric fence energiser about 1m away but that's being going for about 6 months with no problems so far.

I think for my first try I'll re-load the program. The electronics are "buried" in a box and disconnecting and opening it all up to troubleshoot the circuitry will be quite a big job. I'm just looking for advice on the TYPE of influences that make an Arduino system go dead but recover with a power supply reset.

I'd like to suggest an approach which doesn't address the problem, but makes your system resilient to it: a watchdog.

There's a lot to be said about watchdogs, but in summary they are an essential part of any system which must remain working over very long periods in what might be a hostile environment. In other words, they provide a valuable layer of resilience.

They should not be used as an excuse to leave bugs extant, of course. But they are a realistic response to the imperfection of the environment (and our coding skills).

So, I'm not proposing it as a solution to your problem, but something for you to consider implementing anyway.

Take a look at these:

https://en-support.renesas.com/knowledgeBase/16978434

There are many other good sources of information on the web.

The two biggest hitters are:

  1. EMI from relay/motor switching
  2. Memory leaks (usually fragmentation from abuse of dynamic memory allocation).
1 Like

Hi,

Does your 3pin reg have bypass capacitors connected to its pins?
Have you checked your DC-DC converter?
Check its output DC volts and AC volts.
The capacitors on DC-DC converters, especially Electrolytic types, are working a lot harder than in a 50/60Hz application.
They eventually fail, usually high ESD and/or low capacity.

A circuit diagram would be helpful, please not a Fritzy image.

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

Hi,

[soapbox]
Now is also the opportunity to make you project "field serviceable" and make all the parts visible.

Forget about miniaturization and think what you need to work on it, in the dark, in the wet or blazing heat and with the minimum of tools.
[/soapbox]

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

...and an adequate heat sink?

Kind of like what @aarg said:

Relays are inductive loads. When you take power off of them, their magnetic field collapses and generates a spike of negative voltage that the Arduino doesn't really like. Upon reset it's fine but I wouldn't keep the system running that way. Use a MOSFET, transistor, or h-bridge to turn on the relay.

Thanks for the replies so far. The system is not mission-critical in that it is my hobby project for my own urban garden irrigation. I have reloaded the software and added a part which will give an obvious LCD display message if it re-starts (I know this won't tell me if it has merely locked up). I also switched off the electric fence energiser (it is to keep cats off the boundary wall).
I thought I had capacitors around the 7809 voltage regulator but buried the circuit diagrams and it's hard to see. I do have protection diodes across the relays, which are switched by small transistors. I thought that was easier/cheaper than using triacs to switch 24vAC for the irrigation solenoids.
I guess it should be straightforward to add a WDT to the software, then with the new restart display at least I'd see easily if it had locked up.

Post the code and a schematic. That could expose some potential issues.

So it's not that.

EDIT - I'm afraid I can't really give much more help at this point.

No answer to reply #7. It would be wise to consider reply #10.

Nobody mentioned optoisolators yet, but they may help, too.

That's not a bad idea.