Hi Denis,

I think you are missing the point of the PID routine. There is no set period that the pulse is on / off for.

Lets say you make the set point 32 deg C, and the current temperature is 25 deg C. You switch on the thermostat and the PIC reads the current data from the sensor, then using the PID routines works out that it's way below the set point and turns the output on 100%. The heater thus starts to get hot and the increasing temperature is monitored by the sensor until it is within a few degrees of the set point at which time the maths in the PID routine calculates the percentage period to turn off the heater. The frequency at which the PID routine runs it's cycle is around half a second. Eventually as the temperature reaches the set point the PID should be just turning on the heater for the shortest of pulses, and if it is over the set point then the output remains off until the heater cools down and the temperature falls below the set point, at which the pulses increase to maintain the temperature.

This method doesn't use any paused pauses etc as you describe, and is by far the safest method as the actual temperature is controlling the feedback loop and it's almost impossible for the drive to lock hard on and over heat the vivarium. If the DS sensor develops a fault or becomes disconnected the code makes the pin low so there is more risk of the vivaruim cooling than overheating, which most reptiles can tolerate better. Having said that it would be a simple matter to have a buzzer or some other audible warning if the temperature exceeded 5C above or 15 degree C below the set point for example.

The SSR requires no additional circuitry, connect one input pin to GND the other to the port pin, then I connect the neutral wire from the mains to one of the output pins, and then the neutral from the heater to the other output pin - the data sheet can be found here http://www.opto22.com/documents/0859...data_sheet.pdf

Hope that helps