Electronics > Projects, Designs, and Technical Stuff
An Arduino hardware watchdog, the picky way.
(1/1)
centinex:
Hello folks.
Just a quick hack. It may give the idea to others.
I've replaced the defective and old management system of the 36kW home boiler (natural gas powered) with a thing built from scrap and stuff and a bunch of relays and an arduino. I needed the thing to be highly reliable nevertheless to prevent any HHCF event ("Halt and Home Catch Fire"...). So there is lot of redundant safety interlocks in the way its wired, and the software incorporate multiple points of fail-safe. But Arduinos are cool toys easy to use, but there are no serious watchdog readily available in them (well there is, in the Atmega but, it is needed to hack the stock bootloader and things to get it work, anyway a processor watching himself is a conceptual point of failure), and it could freeze in a state that leaves critical output enabled (ie the things keeps burning), tripping some last resort thermal switch, which would need manual intervention in the end.
So i've added a max6370 watchdog chip to tickle the reset pin in case of freezing. With its 15s-ish selectable timeout, it's perfect for the job (the arduino bootloader takes 2s to boot up, so a standard fixed 1.6s watchdog like the wd100 from ST is a tiny bit too fast, the board get stuck in a bootloop. Don't ask me how I know that). All this kind of chips are on tiny SOT23 package... Tiny enough to fit inside a dip socket.... So I thought, what about taking on the challenge to solder the tiniest piggyback board possible ever? =)
The SOT package is epoxy-glued upside down, before wiring with enamel-coated wire. It's small but nothing in the realm of the impossible, it probably took me less time to handwire this thing than to find a scrap board with an SOT23 pattern etched on, to cut and repurpose it, tied to a prototyping board with the socket and pins soldered separately, to bodge in the end a larger piggyback board. Random generic decoupling cap added for good measure. Also before plugging on the board, the thing has been completely potted in epoxy glue.
MarkMLl:
--- Quote from: centinex on July 08, 2020, 04:29:54 pm ---But Arduinos are cool toys easy to use, but there are no serious watchdog readily available in them (well there is, in the Atmega but, it is needed to hack the stock bootloader and things to get it work,
--- End quote ---
No you don't. The only issues are (a) whether the bootloader puts all registers in the right state when the watchdog triggers (and fairly recent bootloaders do) and (b) whether it zeroes the MCUSR register thus hiding the cause of the last reset (which fairly recent bootloaders do). So provided that you don't want to log why the Arduino restarted you don't need to fiddle with the bootloader, I've got a 90-min watchdog working fine here using a mix of a counter in the ISR and a nested watchdog event (forcing a reset) when it zeros.
MarkMLl
Navigation
[0] Message Index
Go to full version