simulate this circuit – Schematic created using CircuitLab

I have a project in which I am controlling/trying to control a Carson CMS-1 servo using a PIC.

I have a board set up with a 7.5v 1A dc supply going through a 5V regulator to power the PIC and servo.

I have generated a software PWM at 50Hz as per specification.

I have connected the output pin - RC4 of the PIC16F72 to a transistor C547B which switches 5v to the signal line of the servo. There is nothing else connected to PIC except the 4MHz oscillator, 9k pull up on MCLR and ICSP pins.

The PIC is programmed using a ICSP interface and a Pickit 3.

The circuit works fine when ICSP is connected to Pickit 3 however when the Pickit is disconnected the PIC gets very hot and the circuit fails to run.

I have looked online and seen PIC's connected directly to servo signal line and also through a transistor.

I assume the signal line requires more current that the PIC can supply so the PIC gets hot and programme fails.

Does anybody have any ideas as to where I am going wrong? I have changed the circuit a few times to reflect different schematics I have seen and always found the same problem. Does the Pickit affect the power on the PIC? I thought the Vdd and Vss lines on the Pickit were simply to detect if the device was powered.

Circuit Image

edit: I mentioned the Vdd and Vss lines on the ICSP connection because the circuit works when all other connections are removed except these

edit: I dont have a schematic drawn but circuit is similar to http://www.pyroelectro.com/tutorials/servo_motor/parts/schematic_large.gif

edit: power from Pickit 3 is deselected.

edit: Schematic drawn and added. (thanks for pointing me to the tool)

edit: note added to schematic

edit: image added. Same problem occurred when using a different breadboad. One link removed

edit: Circuit diagram now amended to show functioning circuit. With separate power rail +5V for servo and decoupling between Vdd and Vss.

  • 2
    \$\begingroup\$ Show us your circuit. \$\endgroup\$
    – brhans
    Jul 5, 2016 at 14:50
  • \$\begingroup\$ Please create a schematic. It is not good enough to say "I dont have a schematic drawn but circuit is similar to..." There are tools to create a schematic in the post formatting tool bar. \$\endgroup\$
    – pgvoorhees
    Jul 5, 2016 at 15:13
  • \$\begingroup\$ Can you also post a photo of your circuit? \$\endgroup\$
    – pgvoorhees
    Jul 5, 2016 at 15:56
  • \$\begingroup\$ The schematic says "All other pins set to input and floating". This is probably not the problem, but it is bad. Floating inputs disipate a lot of power. Either enable the pull-up resistors (if the PIC has them) or set them all to outputs. \$\endgroup\$
    – Mark
    Jul 5, 2016 at 20:02
  • \$\begingroup\$ How much current does the motor draw? Have you measured Vdd both with the Pickit attached and disconnected? \$\endgroup\$
    – Mark
    Jul 5, 2016 at 20:05

1 Answer 1


In all likelihood, you are suffering from bad layout causing problems with power. The ugly truth is that physical circuits are not perfect and the imperfections are sometimes not ignorable. Sometimes those imperfections really break a circuit.

The reasons that the circuit works with the ICSP connected is that it is helping regulate the power to the uC.

Things causing the problem:

  1. your motor is seeing the same power rail as your uC, and there is nothing in the uC to mitigate the crap the motor is doing to the power. Motors do nasty, bad, evil things to power lines and must be accounted for.

  2. The breadboard. They are OK, but notorious for being less than ideal. In this case, the breadboard doesn't provide a good enough power bus. Couple this with the fact you have a motor... and well, bad things happen.

Here is what I would do:

  1. Add a/some decoupling capacitors to the power pins of the uC. They must be as close as possible to the uC pins. Just a 0.1uF from pin 20 to pin 9 on the uC should get you going.
  2. If you have a second 7805, use it. Use 1 7805 for the uC and a separate 7805 for the motor. Do not tie the 5V+ lines together, but they can share ground.

Try 1 first, if it doesn't work, try 2 also. That will almost certainly work.

One last thing: I would also add a resistor to the FET driver: See https://i.sstatic.net/v3dhW.png

  • \$\begingroup\$ Okay so I have followed your advice as best I can, I don't have any capacitors around 0.1uF, the only ones I had left that were similar were 10-15uF. I did have the separate 7805, so have made another 5V rail for the motor. I have had the same result, uC gets hot and no PWM. I will have a look at getting some 0.1uF caps if you think this what the issue is. I thought the second power rail would do it. \$\endgroup\$
    – Ritchie
    Jul 5, 2016 at 18:16
  • \$\begingroup\$ Yeah, you have to decouple the power supplies for the uC. Please see the following notes; intersil.com/data/an/an1325.pdf designers-guide.org/Design/bypassing.pdf \$\endgroup\$
    – pgvoorhees
    Jul 5, 2016 at 18:30
  • \$\begingroup\$ Thanks for the help and links. Much appreciated. The circuit now works, I added a cap 10uF between Vdd and Vss on the uC power rail. \$\endgroup\$
    – Ritchie
    Jul 6, 2016 at 11:24
  • \$\begingroup\$ @Ritchie I'm glad to hear it. Good luck \$\endgroup\$
    – pgvoorhees
    Jul 6, 2016 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.