control relay by time interval