I just wanted to share my latest HomeCSP.com project with the Arduino community. I've created a little voltage controlled switch using an ATtiny85, and of course tried to incorporate all the best practices that I could pickup from this forum. This circuit is primarily intended to be used in solar power applications. For example you might want to monitor battery or panel voltage and then trigger a relay at a set voltage to send power to some power hungry device as long as the voltage doesn't drop.
Part of the fun was using a couple LEDs to flash out the voltage set-point value, and just a couple buttons to handle all the functionality. The voltage divider portion of the circuit has a 4.7v zener protection diode, and uses a small capacitor for ADC impedance balancing with the 100K input resistance. I've built some with a 24V range, and some with a 50V range. A PNP TIP127 switches the positive supply voltage for the output circuit and should have adequate current capability for most relays or directly driving small fans and motors less than 2A. A small diode provides at least some protection to the microprocessor from the output circuit in the case of transistor failure (Ha! looking close at the picture I see I cheated and used a short jumper wire instead of the protection diode on this board!), and a 3A blocking diode prevents damage from reverse polarity power connection. The 78L05 regulator handles a wide input range allowing the board to work on any supply voltage from 6 to 35VDC.
On this first version I tried to use the RESET pin for an adc input since the diagram I had looked like that was possible, and I'm still not sure of that would work, but I didn't want to set the fuses to try it. So this version doesn't have any hysteresis control or an inverted mode option. The next version will feature a 4bit R-2R resistor network to read all four switches with just one analog input, and leave the RESET pin open.