9v Power Distribution

Hi, I'm working with an ATtiny84 and an l239d dual h-bridge motor controller, and I'd like to power everything with a 9v battery. As both boards require 5v for board power, I have an L7805 5v regulator which works just fine. The battery is connected to only the regulator and the Vin of the motor controller.

I would very much like to control speed. In the past, I have sent a PWM to the enable pin using my Arduino, and it worked just fine for speed control.

Now, with the 9v powering both the boards and the motors, I'm worried the motor is drawing too much current away from the board, as it starts and stops randomly when I'm using the PWM for speed. When I attach the enable pin directly to 5v, it works fine, but it appears there's not enough current to do PWM, or something.

In the past, I worked on a project involving a motor, transistor(w/ PWM), a piezo buzzer, and an ATtiny85. When the motor started, it would interrupt/restart the board over and over again and just throttle to full speed. I'm worried that same thing may be the case here.

P.S.- I'm using a 9v because I want the circuit to be as small as possible

The 9v battery has only a small current capacity. You will probably find it is too small to drive much load for long.

Weedpharma

Well I'm aware the 9v contains a smaller overall capacity, as in mAh, but what about current draw at any given time?

Not too high.
You really need a LiPo, LiFe, LiIon in there for it's current capacity.

9V batteries tend to have a fairly high internal resistance. That translates to not too much output current. The problem is worst when you try to start the motor, while stopped it has a very high current draw that drops when running. To test if that is the problem, get a 9V wall adapter that is regulated, and substitute it in for the battery.

Do you have a volt meter available?

-fab

P.S. For little more than the cost of a 9v battery, you can buy a switching regulator to get down to 5V. That alone will save you many batteries over the 7805 reg.

I do have a multimeter, why?

To measure the voltage to see if it drops off under load.

Weedpharma