Hi Doug, Check that you have connected the common pin of the ULN2003B to your *relay* positive feed, this will enable the free wheeling diode circuits when relays are de energised. Also you can connect a MOV across the relay power supply, and partly isolate relay supply from logic by indroducing a small resistor (ie 10 ohms) from initial supply to the 7805 reg'. Generally the relay coil transients are of far greater effect than the contact transients. (unless track layout is totally wrong.) The other big improvement you can make is to put a larger capacitor (ie 47 uF) on the logic supply. Capacitors are available in "low ESR" varieties, this relates to internal resistance. Look in the Farnell catalog and you will see resistance values at stated frequencies, low ESR capacitors will absorb spikes more rapidly before the voltage rises or falls excessivly. Additionally you can make the pic switch the relay at say 10 Hz and then scope out the source of the problem. regards, Graham Daniel, Electronic Product Enhancements Douglas Reid wrote: > > I am going crazy trying to solve an interference problem and would much > appreciate any ideas! > > I am using a 16C73 to control motorised entrance gates. The PIC drives > relays to switch motors to open and close the gates. I am experiencing > intermittent problems in that the PIC get frequently reset, apparently as a > result of the motor mains switching surges. > cut > I added a further 4700uF/ > 35V capacitor and a 0.1uF ceramic across the input to the LM340 on the PIC > CPU board. This improved the situation but only in so far as the system now > resets perhaps once in every 5 to 10 motor switchings. > > Doug Reid > > Liverpool, England