Hi all, Many thanks for the varied and wonderful answers. I am driving the relay transistor (2N222A) through a 1K resistor from the PIC and the relay has reverse BEMF protection. -----Original Message----- From: Dale Botkin [mailto:dale@BOTKIN.ORG] Sent: Friday, 10 March 2000 10:26 To: PICLIST@MITVMA.MIT.EDU Subject: Re: Gotcha not On Fri, 10 Mar 2000, John Orhan wrote: 8< snip... > valve ( this in fact turns on a relay that activates the 24vDC water valve), 8< snip... > PIC is 16C84 and the whole thing sits under an acrylic dome. Anyone hear of > heat or light affecting the PICs as it seems to be latching up not turning > off the water valve. I don't think it would ever get more than 40 or 50 on a > hot day ( degrees C ). Any ideas?? Do you have a reverse diode across the relay coil? If not, de-energizing the relay will cause back EMF as the magnetic field collapses, which will spike the PIC pin and cause problems. Pretty common problem, from what I have heard. Of course, one would think that would cause it not to turn the water *on* the next time, but it would probably be pretty unpredictable. Another thought -- how are you driving the relay? I assume you have a bipolar or a MOSFET to drive the coil? You might be pulling too much current thru the PIC pin if you're trying to drive it dirrectly or thru a bipolar transistor. That's why I prefer MOSFETs, too lazy to compute base current. 8-) The PIC should be good to 125C under bias according to the spec sheet... but remember to allow for the black PIC absorbing energy from sunlight, which will raise the temp. of the PIC well above the 50C ambient temperature. Shouldn't get over 100C, though, I'd think. Dale --- The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" (I found it!) but "That's funny ..." -- Isaac Asimov