Microcontroller and Motor Controller using same Power Source

Thread Starter

kring123

Joined Feb 6, 2010
15
Hello,
I was hoping someone could provide me some advice on using the same battery to power my microcontroller as well as motors.
In the past I have used a 9V alkaline battery to power my microcontroller and used a separate 9.6V NIMH battery pack to power my motors. However, space is limited in my current project and I'd like to use just the NIMH battery pack if I can.
My concern is that the microcontroller won't get the +5V it requires from an LM7805 voltage regulator. Will the following circuit act as a voltage divider and provide all voltage to the motors and none to the microcontroller? Or can I expect a consistent 5V no matter if the motors are running or not?

+9.6V ---------------> LM7805 V. Regulator ------> Microcontroller (Expecting +5V)
|
|
|
|
------------------------------------> Motor Controller (Expecting +9.6V)

Many thanks in advance!
 

SgtWookie

Joined Jul 17, 2007
22,230
It won't necessarily act as a voltage divider, but the motor may cause so much noise at the battery that the microcontroller resets. You can add a diode in series with the wire going to the regulator, and a cap to ground after the diode to keep the regulator supplied during a large transient. Use a Schottky diode like a 1N5819; they have a very low forward voltage, but more importantly they have a very low reverse recovery time (they turn off quickly).

"Ground loops" can be a big problem. They can easily cause your microcontroller to crash.
 

tracecom

Joined Apr 16, 2010
3,944
What type of motor controller is it? And what type of motor is it? I'm just curious because 9.6V is a little unusual.

I have a stepper motor controller that I built that uses a similar setup, i.e., a 12V power supply to the motor and also feeding a 7805 to power the μC. It works fine, but I have plenty of capacitors around the 7805 and another one across the darlington driver IC.
 

Thread Starter

kring123

Joined Feb 6, 2010
15
The motor controller is actually an L298 Dual H-Bridge with some schottky diodes on the output along with one 0.1uf cap per motor.

The motors I'm using are are small ~75RPM 12V gearmotors.

I'll try the schottky diodes before the regulator. I have one 10uf cap on each side of the regulator. Hopefully that will be enough.

Thanks for the replies.
 
Top