Motors and Servo with Separate Battery Problems

Thread Starter

solpic

Joined Jul 23, 2009
25
Hello everyone,

As the title suggests, I am having trouble using a separate battery with my motors and servos. The whole circuit worked when they were using the same battery, except the dc motor was not spinning as fast as I would have liked. So I added another battery, making the ground from both batteries electrically common. I switched the power supplies from both servos to the new battery as well as the collecter pin on the npn transistor driving the dc motor. Also I made sure to attach the motor and servos to the new ground. Nothing happened. The microcontroller (I'm using the PIC16F84A) was still working, with it's heartbeat led, and the servos seemed to adjust themselves back to the center, but besides that, nothing.
Any help would be great
thanks
 

Thread Starter

solpic

Joined Jul 23, 2009
25
Argh, ok I spent some time making a minimalist version of my circuit. It does not show any of the microcontroller areas just the battery setup and the motor driver. Yes and the microcontroller is the wrong model, I could not find the PIC16F84A in my schematic editor. So please assume that the microcontroller is working, which it is, and that the wire coming from the microcontroller to the transistor is actually being written to because it was tested when there were not separate batteries. In conclusion, please don't mention anything about the microcontroller part. I hope this helps. Also those are two nine volt batteries and the transistor has a gain of 50.
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,087
Here are a few initial observations:
1) The PIC limits base current to 25 mA. Is that going to be enough to turn on the transistor for full motor speed? How much current does the motor draw? What is the value of the base resistor?
2) You have a resistor from the emitter to the motor. Why? What's its value?
3) Your motor is still only getting 9 V, why would you expect it to run faster, assuming the current drawn by the PIC is insignificant compared to the motor.
4) A typical 9-V battery won't provide much current. Can you get a series of AA cells to give you 9.6 V ( 8 cells) for your motor?

John
 

Thread Starter

solpic

Joined Jul 23, 2009
25
The resistor is 470 ohms and I assumed that the PIC has enough output current and the resistor was the right value because the motor did turn when I only had one battery, it just was not getting the speed I desired and when I did make the current higher via PWM, the PIC reset itself over and over again.
 

jpanhalt

Joined Jan 18, 2008
11,087
Sorry, I edited while you were writing. My apologies. Please check the additional questions I raised.

John

Edit: You can also drop your base resistor to 360 ohms and still be safe with respect to the PIC.
 

Thread Starter

solpic

Joined Jul 23, 2009
25
The resistor from the emitter to the motor was a mistake, I originally had it but it limited too much current so I took it out. Although I was hoping it would run faster, mostly the reason I wanted a separate battery is that the PIC was resetting when I had the motor on full power. You are definitely right that AA batteries would give more power but right now I mostly just want to stop the PIC from resetting while giving the motor full power and then I will figure out what the best configuration for the battery is. So mainly my problem is that my PIC resets itself. I tried decoupling capacitors but that only made it reset less frequently and I would like to have the motors have separate power from the microcontroller anyways.
 

jpanhalt

Joined Jan 18, 2008
11,087
You specifically asked for no comments about the PIC. If part of the problem is its continual resetting, I don't see how we can avoid commenting. You apparently have it operating at 9V. That is well above its specifications.

John
 

Thread Starter

solpic

Joined Jul 23, 2009
25
I was unclear. The PIC is operating as expected. I expected the PIC to reset if I used the dc motor with the same battery as the PIC. The PIC is operating at 5V, I neglected to add the regulator in the schematic. Since I do not have such great schematic editing software, I need you to assume that a safe PIC circuit is there with a voltage regulator, oscillator, and decoupling capacitors, with one pin connected to the base of the transistor in the schematic. I am not trying to find out how to not have the PIC reset with the motor using the same battery, I want to know how to implement that circuit with the motor using a different battery. The PIC has been working as expected, as long as the motor is not at full power, it does not reset, and I expected it to reset if the motor was at full power. I just want to know how to use a separate battery for the motor in this circuit. I am sorry if I did not make this clear from the beginning.
 

jpanhalt

Joined Jan 18, 2008
11,087
<snip> So mainly my problem is that my PIC resets itself. <snip>
slopic said:
<snip> The PIC is operating as expected. I expected the PIC to reset if I used the dc motor with the same battery as the PIC. <snip>
In sum, we do not have an accurate schematic for us to review. You are absolutely sure the PIC is connected properly and is working correctly. The main problem is that the PIC resets itself.

That happened when a single supply was used for both the PIC and motor, which you expected. Why? Now with the split supplies, however they are configured, you believe it should not be resetting, but you remain convinced the problem is not with the PIC. :confused:

Be sure MCLR is tied high with a resistor and capacitor as described in the data sheet.

Edit: You also need to consider what is happening with the voltage at E as the motor is running. That voltage will approach the motor battery voltage (minus the transistor drop), but the base is limited to the PIC voltage (approx. 5V), so the BE junction will be reverse biased (see: http://www.allaboutcircuits.com/vol_3/chpt_2/8.html).

John
 
Last edited:
Top