Burglar Alarm System Custom Circuitry
Here's the schematic of the custom circuitry (click to embiggen):
Apologies for the schematic, I used fritzing, and found out after I'd started that it doesn't have symbols for nand gates, etc. As a result the schematic is rather hard to understand because the gates are just shown as rectangles.
Anyway, the circuitry here is as follows. IC1 is a textbook missing pulse detector from the 555 timer applications book. As long as the computer keeps pulling _WDT_RESET low faster than C1 can charge up via R1, then IC1 output (pin 3) will not go low. That output goes through gate 1 of IC3 that is configured as an inverter, and then into gate two of IC3, which is being used as a NAND gate.
The output of that NAND gate will trigger one-shot multivibrator IC2, which will make a nice, wide reset pulse, fed to the Arduino RESET pin via transistor Q2 and switch S1. The one-shot is there so that no matter how short a glitch is fed into the 555, the reset pulse is sufficiently long to ensure the complete reset of the Arduino and all circuitry sharing that reset (like the Ethernet shield.)
The other input of the NAND gate is the output of the flip-flop formed by the two "right side" gates on IC4. The flip-flop is cleared by the Arduino Reset, and in the cleared state, reset pulses from IC1 are inhibited. The flip-flop is set to allow the watchdog to work by a low on "_ENABLE_WDT" from the Arduino. In this way, the Arduino can disable the watchdog time while it starts up, and then enable it once it starts running loop().
The Arduino can also reset itself, by putting a high on the pin labeled "RESET_COMMAND". This is inverted by gate 3 of IC3, and the low edge on that output will trigger the reset generator one shot again. This allows the Arduino to reset itself if it decides that some hardware subsystem isn't responding and it needs a good swift kick in the ass.
The "left side" gates of IC4 are there to massage the output of the Ming Radio Receiver, but since this receiver is no longer available, there isn't much point in discussing what's happening here. I will say that WIRELESS_1 and WIRELESS_2 signals go low when the user presses button 1 or 2 on the wireless transmitter, respectively.
The "run"/"program" switch allows the watchdog to be disconnected while code is pushed into the Arduino by avrdude. Otherwise the watchdog triggers during the upload and the upload fails.
Why did I use two different logic families? Because the Ming outputs are CMOS-rated and I didn't want to experiment and see how much of a load they could drive reliably. It was easier to just use a CMOS gate in the design.