Temperature controller for heating and refrigeration processes