Brent Since it only happens whaen the motor is connected I suggest you look again at your earthing and power supply arrangements. It sounds as if you're doing it nearly right with the 2 supplies. Is the motor supplied from the 12V also - a bit of filtering on the feed to the relay may assist. If you are not going to be reversing the motor a diode accross it may help also - particularly if it has field windings rather than perminant magnets. Overall, I'd suggest making sure the earths are tied at only one point, filtering the 12V to the relay using a 10ohm resistor and 100n cap and if possible filtering the motor supply with at least a small inductor / cap and possibly a diode as well. Richard P Brent Brown cc: Sent by: pic Subject: Re: [PIC]: PIC reseting due to relays microcontroller discussion list 29/08/01 08:52 Please respond to pic microcontroller discussion list > Hello, > > I've got a 16f870 that I'm using to turn a relay (Tyco V23105 > 150 mW > Nominal Coil Power, 960 ohm, 12 volt Nominal Coil Voltage) on/off. > This relay is controlling a very small DC motor (~0.5amps). About 10% > of the time when this relay turns on/off, it resets the PIC. I've > verified this is what's happening. Seems to work fine when the motor > isn't connected to the relay. Only resets when the motor is > connected. > I'm using PORTA.0 through a resistor to turn on a 2N4401 > transistor that > then powers the relay coil. I have a 1N4004 diode across the relay > coil. I have two 0.1uf caps on the +5v to the PIC. > The +5v for the PIC is from a powered protoboard. The +12v > for the > transistor and relay are from a +12v battery. The grounds of these > two power supplies are tied together. > Can anyone help me figure out what's going on and fix this? > > Thanks, > > Gary Hi Gary, It may be worth trying a 1N4148 diode in place of the 1N4004, as it is much faster switching diode. All the suggestions so far have been good, so figure out which one fixes the problem and then add all the others as extra safeguards. That my 2 cents worth. Brent Brown Electronic Design Solutions 16 English Street Hamilton, New Zealand Ph/fax: +64 7 849 0069 Mobile/text: 025 334 069 eMail: brent.brown@clear.net.nz -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body