Device Resets / erratic operation - 16F88
Hey new member here! I've been building and programming "toys" for a while now and have not had issue anything like this before. I'm working on a controller for a car's load-levelling rear suspension. It uses a PIC16F88, reading a position sensor (0-5V signal) and controlling a solenoid valve and relay, as well as an indicator lamp, and an on-board LED.
The circuit works well on the bench, driving test lights, however when connected to the acutal hardware it is to control, I get sporadic resets, lockups, and garbled operation.
The problem happens when the relay turns off. I have checked and double-checked the MCLR pin (turned off in configuration, and set to output and LOW in program), all unused pins are output and LOW. The outputs are simple NPN switching transistors, biased through a 330R resistor. The relay coil has a diode to block inductive kickback, as well as a .1uF capacitor across its incoming wires.
The solenoid valve output is constructed the same, and it does not cause any resets, in spite of the fact it is a much higher current load.
The power supply is a 7805 regulator, with a 1000uF cap on the input side, a 1000uF cap on the output side, and the chip has a .01uF cap directly across the +5V and Gnd pins.
If I replace the relay with a resistive load, the problem goes away. I've replaced the output transistor, back-EMF diode, PIC chip, and all filter capacitors, and the rests and lockups continue.
I've built several other 16F88 based controllers that drive relays using the same configuration of transistor, and nothing like this has happened.
Ahy ideas?!?
Thanks in advance!
David
[email protected]
FOLLOW UP - the REST of the story!
Well - after all the fuss and mess; the real cause was after all..... a bad resistor. I had intended to use 1K resistors for the the transistor bias resistors on the relay, valve, and lamp driver circuits. They did all come from the same package.
The resistor for the relay driver was a 1R (1 ohm) resistor instead of 1K (1000 ohms) and was badly overloading the output on the PIC, causing it to malfunction. I finally determined there was a serious issue when I felt the PIC chip, and the 5V regulator both getting VERY WARM when the relay output was active.
After changing the resistor, the circuit works fine, without any extra choke coils or capacitors, and nothing gets warm.
The resistor was correctly marked as a 1R resistor (by color bands) but was in a package with 1K resistors so (like a dummy) I did not look closely at it before soldering it in.
Live and learn. Thanks again for the ideas, I really appreciate it and am glad to have found a place to discuss these projects!
Later,
David