Driving a DC hobby motor using an AVR and a single power supply

Not sure you need the diode in series with the motor the way you've shown. All it's going to do is drop some voltage and generate heat (unless it's an LED).

You probably do want a diode in parallel with the motor, oriented with the cathode toward the positive supply. The diode will clamp any high voltage excursions caused by inductance in the motor, so that the collector of the pass transistor will never see a voltage higher than one diode drop above the supply voltage.

Also, you should probably have a small capacitor with good high-frequency response tied directly across the motor, to cut down on EMI caused by arcing in the brushes. Usually 0.01uF or 0.1uF disc ceramics are used.

Larger transistors sometimes take a bit more drive, so consider the resistor from PB0 to the base of the TIP 122. Not sure what the specs are for the TIP 122, but you want to make sure that when the level on PB0 is at its high state, the collector should be very close to ground, not more than about 0.2V.

Also, how big is this motor, and how big is the battery? Nine-volt alkaline batteries aren't known for having a lot of current capability, so I'm assuming the motor is quite small. You should be able to take a wire and short across the collector and emitter of the transistor w/o harming anything, and if you do, the motor should turn.


It's possible, sure. Is the 9 V drooping a lot under load and dropping it out of regulation? Is the voltage on both sides of the motor what you expect? You might need bigger capacitors to keep the supplies "stiff", and make sure the voltage drop caused by the motor's current in the ground wire isn't affecting the AVR's ground.

Tags:

Avr

Motor