I plan to construct an Arduino circuit which will read two temperature sensors, and turn on a relay if the differential gets too large.
This is eventually to be pressed into service on the dew heaters for the telescope.
But for now, I rigged up a nice little circuit which turns on a relay based on input from two light sensors.
Here is the Arduino sketch. The two sensors are on A0 and A1. The relay trigger pin is 13.
I am using a 12v relay, so I am powering the Arduino from a regulated 13.8v supply. I am using the same supply voltage to drive the relay. To amplify the Arduino’s digital output to a level useful to the relay, I am using a N-type MOSFET. I have a diode wired “backwards” across the relay coil to prevent voltage spikes when the relay shuts off.