Driving a DC motor /w 16f84a


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Lilmanmgf's Avatar
    Lilmanmgf Guest

    Default Driving a DC motor /w 16f84a

    I'm trying to drive a DC motor with a 16f84a. I am currently using a push pull circuit with a tip125 and tip122. For a few seconds it should function as it should, but the PIC shortly stops executing the program. I am assuming this is because I used the same power supply for both the PIC and the motor. Due to the specifications of the project I am working on I am only able to use a total of 9 volts. I do not really need speed control as this is supposed to be a "sumo bot," capable of pushing another robot. Would a PIC function with only 4.5 volts? Also do you guys have any recommendation for Mosfets? The transistors are getting quite hot, and even with a large heat sink I'm not sure I would be able to dissipate enough heat. Thank you in advance.


    -Chris

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Depending which version of PIC, some may work down to 2-3 volts. Usually it's written on the first datasheet. I have quoted it for you...
    CMOS Enhanced FLASH/EEPROM
    Technology:
    • Low power, high speed technology
    • Fully static design
    • Wide operating voltage range:
    - Commercial: 2.0V to 5.5V
    - Industrial: 2.0V to 5.5V
    We need to know what kind of power supply you're using, motor's current need, and if possible your schematic. I have few idea, but guessing is not always my cup of tea.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    On the assumption you are using PP3 type 9v batteries, and that the FETs are getting hot, I would conclude that a fair amount of amps are being drawn and possibly taking the voltage down causing the PIC to shut down. Again, as Steve says, without a schematic and or details of the code its hard to give a more exact answer.

  4. #4
    Lilmanmgf's Avatar
    Lilmanmgf Guest


    Did you find this post helpful? Yes | No

    Default

    I don't know how to post pictures here, so here is a link to the circuit. Sorry it looks bad, but I only had ms paint.

    http://69.65.40.73/lilman/motorpushpull.jpg

    At the moment I was just using on-off to keep the motor on. I wasn't sure if the 16f84a was capable of PWM. The circuit will only run for 15 second intervals. Thank you for all the help.
    -Chris

    Edit- I'm using two AA batteries to power the PIC. The datasheet said it can operate between 2v and 5.5v. I was thinking of using a separate 5v or 6v battery for the motor and transistors.
    Last edited by Lilmanmgf; - 29th April 2007 at 17:59.

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    I came across this on a web site, which sounds similar to what you describe. Note it suggest the use of a seperate supply to the motor

    http://www.tigoe.net/pcomp/code/arch...4/000294.shtml

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    A couple of things:

    Unless you want the motor to have dynamic braking, you don't need the "bottom" transistor.

    You could reduce your dissiplation (heat generation) somewhat by putting the PNP transistor in the "top" position, and connecting the emitter directly to the +5V source, and the collector to the motor. If you build the circuit this way, you should also connect a 1K (or so) from the base to the emitter to guarantee that the transistor completely shuts off. Pulling the base LOW will turn the motor on. Make certain that you leave the 1K resistor (that you already show in your schematic) in place.

    The darlington transistors you use will certainly dissipate more heat than FETs in this application because the transistors will have a saturation voltage of at least 1V. If the motor draws 2A, then you will dissipate 2A X 1V = 2W.
    The motor will also get a maximum of 4V (or so) in this circuit as well.

    FETs will improve the circuit. Choose "logic level" FETS with a low ON resistance. If you use an N-channel FET (recommended), put it in series with the GROUND side of the motor. You won't need a resistor between the PIC output pin and the FET gate, although a 1-10K resistor between the gate and 5V will improve the circuit because it will insure a full 5V on the gate when the PIC pin is high. The ON resistance of the FET can be as low as 20 milli-ohms. That means that if your motor draws 2A, then the voltage drop across the FET will be 40mV and the dissipation will be .040 * 2 = 80mW. It will barely get warm - even without a heatsink.

    Regardless of the transistors used, you should always put a diode across the motor in the "reverse" direction. This is just good practice and prevents turn-off transients from destroying the transistors.

    And as to whether or not your chip supports PWM - any PIC can do PWM in software. You could have looked in the manual and found if supports hardware PWM in less time than it took you to make your post.
    Charles Linquist

  7. #7
    Lilmanmgf's Avatar
    Lilmanmgf Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    FETs will improve the circuit. Choose "logic level" FETS with a low ON resistance. If you use an N-channel FET (recommended), put it in series with the GROUND side of the motor. You won't need a resistor between the PIC output pin and the FET gate, although a 1-10K resistor between the gate and 5V will improve the circuit because it will insure a full 5V on the gate when the PIC pin is high. The ON resistance of the FET can be as low as 20 milli-ohms. That means that if your motor draws 2A, then the voltage drop across the FET will be 40mV and the dissipation will be .040 * 2 = 80mW. It will barely get warm - even without a heatsink.
    What FET would you recommend in this application?

Similar Threads

  1. DC to AC convertor
    By The Master in forum Off Topic
    Replies: 11
    Last Post: - 6th February 2010, 17:44
  2. Replies: 24
    Last Post: - 1st December 2009, 08:01
  3. from 5v dc to 1.00v dc precise vref 10mA ?
    By phoenix_1 in forum Schematics
    Replies: 10
    Last Post: - 28th July 2009, 08:11
  4. PIC data along dc line
    By sswcharlie in forum General
    Replies: 0
    Last Post: - 30th August 2008, 08:38
  5. H-Bridge control DC motor
    By Paul F in forum General
    Replies: 8
    Last Post: - 11th March 2005, 12:50

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts