How to Amplify Current?

General discussion on mikroC.
Post Reply
Author
Message
yoboy
Posts: 34
Joined: 03 Dec 2009 18:38

How to Amplify Current?

#1 Post by yoboy » 01 Apr 2010 18:52

Hi guys,

I am trying to run a simple geared DC motor from a PIC mikrocontroller. This DC motor has high torque and slow speed. When I connect this motor directly to a 5V supply with 0V reference, the motor would run. But I need this motor to spin in both direction. So I connected this motor to two PIC pins (PORTE 1 and 2), and I would set one high and another low at a time, and to spin the other direction I'd do otherwise. The thing is, the motor does not spin when I connect it this way. To test if my program was correct, I connected two LEDs at the same port (one connected in the reverse direction), and the LED would blink one at a time correctly.

Does that mean the PIC is not supplying enough current to the motor? I did try to connect one side of the motor to a direct 5V and another one to the PIC pin. When I set this Pin to high, the motor wouldnt run, and when I set it to low, the motor would run (expected result). But unfortunately I wont' be able to make the motor spin at both direction this way even though I could control the motor's start and stop rotation through a microcontroller.

My guess is that the PIC is not supplying enough current to the motor. Im a noob, im not sure how I should handle this matter. Ive heard about current amplification using transistors. Does anyone know how I can do this? Or is there any other suggestion to make this motor spin at both direction by using a PIC?

Thanks alot guys, any suggestions are welcomed. Ive ran out of ideas.

womai
Posts: 239
Joined: 16 Apr 2008 07:45

Re: How to Amplify Current?

#2 Post by womai » 06 Apr 2010 22:15

Please read the datasheet of your PIC. The outputs are only rated to 20mA current maximum. Any more and you risk killing your PIC. 20mA is much less than what a motor typically requires.

What you need is a so-called H-bridge (google for the term). Basically 4 transistors (typically power FETs = field effect transistors, but for small motors you can also use bipolar transistors) wired up similar to the letter "H" with the motor sitting at the crossbar. Then you can use the PIC to control this H-bridge and make the motor move forwards, backwards, or stand still. There are also ICs that implement such a bridge.

st5
Posts: 192
Joined: 04 Jan 2011 14:14
Location: 3090 Belgium

Re: How to Amplify Current?

#3 Post by st5 » 13 Jan 2011 22:27

Basic info about a H-bridge:

http://en.wikipedia.org/wiki/H-bridge
This can best be combined with PWM modulation

Dont forget run-free-diodes fot practical applications.

.
3x PicPlc16V6 1x EasypicV7

Going from programming on PC to embedded programming is like working in the dark with sunglasses on.

Post Reply

Return to “mikroC General”