Arduino based incubator - hangs - SOLVED - power supply issues

Well the last version of my code seems a bit more stable, runs for about 12 - 16 hours before it crashes.

MarkT:
Crashes can be caused by power supply glitches, or electrical noise, not just software problems. Try monitoring the power source when the outputs switch and check that the relay coil has a flyback diode fitted.

Hi Mark, the relay has all the bells and whistles (transistor, LED, diode), it's from a kit I bought on ebay. Furthermore, I'm not switching the 220 V -> 24 V AC transformer on and off that powers the ultrasonic fogger. The transformer is always on, I switch the output (24 V AC ~ 1 amp). It also switches only once every two minutes.

My Arduino is powered by a beefy 7805 voltage regulator, which gets 12 Volts at 5 A maximum from a switching power supply I bought, originally to power the motor to turn the trays. It used to be on it's own 9 V PSU, it crashed back then as well.

wildbill:
That's disturbing - could that be causing an issue with not resetting the watchdog timer soon enough as well? Also, what on earth is consuming that time?

I wonder as well. But untill the eggs hatch the dog is my best friend: before I configured wdt, the Arduino froze, not regulating humidity for hours. Now it's just an annoyance.

On the topic of missing screens of LCD data, I'd be inclined to just flip to the next one every eight seconds, rather than using multiple measures such as LCDHUM2. I don't believe it's causing a problem, but it would make the code a little simpler.

I'll write some switch case code to control the LCD, thanks for the tip.

Can you use softwareserial for the LCD and reserve the serial port for debug? Although it sounds like you're not going to be around to capture that data anyway. Somehow you need to be able to indicate where you were when it crashed. Is the watchdog masking your ability to tell?

I'll put my code full off serial.prints, then run the incubator with my pc attached untill it freezes. Hopefully, that way we can figure out what it was doing when it crashed... This will have to wait untill hatch time I'm afraid.