Microcontroller shutting down in etched circuit, but works as expected in breadboard circuit

microcontrollerpower supply

I have a computer fan controller circuit which uses an microcontroller to convert an analog signal from a potentiometer to control the speed of an computer fan (PWM controlled) and indicate the rough speed percentage with 4 LEDs.

When I use my circuit on the breadboard it works perfectly, but when I use the etched circuit it flickers for a second or two then shuts down completely.

Background

Here is the circuit:

As you can see it's using a 12V supply and then a voltage regulator to supply the microcontroller with the needed 5V. Then I have the fan hooked up to the 12V supply and the control cable hooked up to the microcontroller.

circuit

When I'm using the circuit in the breadboard I connect the resistors and the potentiometer to the breadboard via the IC holder on the etched circuit to make sure there isn't something wrong with the components or soldering. Then I supply the microcontroller with 5V from a stabilized DC power supply.

Then I measure the 5V PWM signal that should go to the fan with a multimeter. Everything works like expected, the LEDs light up when I turn the potentiometer and the voltage measured goes up.

Here is what the circuit looks like in action from the breadboard. (I'm measuring the PWM output with the potentiometer on these images) 0 percent:

All turned down

Around 50 percent (Yes, the code that lights the LEDs needs to be fine tuned :P)

50%

100 percent!

100%

So the only difference is essentially the supply. When I put my microcontroller on the circuit and connect my DC power supply with 12V it flickers and stops working after a second or two.

Here is what the circuit looks like in action in the circuit itself with 12V applied across the supply. It stays like this even if I turn the potentiometer. I have checked that the regulator is regulating successfully and that the microcontroller VCC pin has 5V applied.

No, no. Not working.

What could be the problem?

This is the first circuit I have designed and etched, so no need to tell you that I'm a novice. The only thing I can come up with that would be a problem is that different supplies share the same ground. Is there something else that could be the problem?

Best Answer

Is your circuit diagram complete? If so I miss the mandatory decoupling capacitors!

You don't mention the type of microcontroller you use, from the diagram I assume an 28-pin PIC like a 16F876 or 18F242 or the like. Such chips have two ground pins, which MUST both be connected to ground. You seem to use the chip's ground pins as a wire to connect your two grounds, which is not a good idea.

Does the chip have an internal reset and did you configure it? And idem for the oscillator?