destroying my last pic? driving a miniature motor


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1

    Unhappy destroying my last pic? driving a miniature motor

    Hi everyone,
    Please help me if you can....I don't want to destroy my last pic....

    I'll get right on topic:
    I had partial success driving a 4mm motor directly from the 4 pwms of my 16f690. I was using pulse steering to output hpwm signal on 4 pins. Testing this, I realized that this would not allow me enough current on the motor i am using.

    Here's what I did initially:
    I chose 250 ohm resistors for each pwm output because 5v/250ohm is 20 mA the max a pic can source or sink. After the resistor these lines converged going to the positive terminal of the motor. Because I gave moter 4 pwm signals, the resistance to 5v(supplied by PWM) was actually 250/4=62.5ohm.
    My motor has 9.6ohm internal resistance
    62.5ohm divider: 9.6/9.6+62.5ohm x 5V==>motor was only getting .666v….
    Current through the motor 5v/72.1ohm = 69.3mA
    This was not enough to get it spinning nicely...


    Here's where I destroyed 2 pics:
    I quickly tried hooking up one of the 4 pwm signals through a 2n2222 to
    boost the current. Although i thought i had enough protection using diodes when I ran the program, not much happened... Also some sensors on i2c and power lines didn't blink as they normally do at startup. Only removing the pic 16f690 got those sensors blinking again. After adding some more diodes, safer resistor values I tried again with another pic....Same result... Unfortunately I can not reproduce the exact schematics as it was 5am and I was tired a little impatient and yes...drinking...
    I think I may have left the other pwm pins floating, or possibly switched the collector and emitter. All I know is that I didn't even get to see smoke...


    Can anyone advise me on a lowest partnumber/smallest parts solution that would do the beforementioned. HERE IS WHAT I HAVE IN MIND...
    Attached Images Attached Images  
    Last edited by Michael Wakileh; - 5th August 2007 at 13:34. Reason: added schematic

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Question

    That diagram's a little hard to follow.
    Does this look like what you were thinking of?

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1913&stc=1&d=118631783 1">

    Hope not.
    <br>
    Attached Images Attached Images  
    DT

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    With a 2N2222A, here's what I think would work.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1915&stc=1&d=118632654 6">

    If you don't have a good, solid, well filtered power supply, the PIC will have problems. Resetting, or just doing weird stuff.

    And the motor's proximity to the circuit, may have the same effect.
    <br>
    Attached Images Attached Images  
    DT

  4. #4


    Did you find this post helpful? Yes | No

    Thumbs up

    Thanks Darrell... you always come to the rescue.... I will try this out tomorrow. You redrew my schematic nicely, but I did have the emitter going to ground (btw, which program do you use?)... Is there a difference in connecting the load between emitter and ground, or between collector and vdd (besides resistance increasing base to ground when the load is on the emitter side)? For power I try to stay mobile. Here I used just a 9V battery, 7805, 100nFcap, and an electrolytic cap.... Eventually I will be using 4 or 5 of these motors and probably a seperate power supply...

  5. #5
    Join Date
    Jun 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default app note

    Have you had a look at the MicroChip app note AN 893 . Hopefully it might be of some help.

    This should be the link to it.
    http://www.microchip.com/stellent/id...pnote=en012134

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Is there a difference in connecting the load between emitter and ground, or between collector and vdd (besides resistance increasing base to ground when the load is on the emitter side)?
    With transitors, the current you get out is dependant on the current from the base to emitter. If the voltage on the emitter changes, then the base to emitter current will be reduced. So if the load is between the emitter and power, ... as the transistor starts to conduct, the emitter voltage changes and counteracts the base current that's trying to turn it on. While it seems to kinda sorta work a little bit, you always end up with a lower current output.

    So basically, you want the emitter to be at a constant voltage, either GND or V+.

    But the difference is ... if you want to "source" current to the load from V+ (like in the first schem.) you would use a PNP transistor. Then output HIGH from the PIC is OFF, and LOW is ON.

    And as I read this back, it doesn't even make sense to me. (I'm a software guy).

    Alain!!! Help!!!! Anybody!!!
    DT

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Good explanation

    Thanks Darrel,
    I have seen it in print that the transistors should go one way but not the other, but never an explanation as to why.
    Thanks!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default Simple rules ...

    Quote Originally Posted by Darrel Taylor View Post
    And as I read this back, it doesn't even make sense to me. (I'm a software guy).

    Alain!!! Help!!!! Anybody!!!
    Hi, Darrel

    For simplicity :

    1) Motor ( or load ) has one terminal connected to GROUND

    - use a PNP Transistor w/Emitter to POwer ( or P- Mosfet W/ Source to Power ). the "ON" state will be with a LOW state from the PIC.

    2) Motor has one terminal Connected to POWER

    - use a NPN Transistor W/Emitter to GRound ( or N Mosfet w/ Source to GRound ). the "ON" state will be with a HIGH state from the Pic.


    That's all !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Michael Wakileh
    ...You redrew my schematic nicely
    Darrel.... what do you use for schematic drawings?
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Darrel.... what do you use for schematic drawings?
    I guess I forgot to answer that part.
    Or maybe I was unconsciously avoiding it, since the program I use is a constant source of mental anguish.

    I use IVEX WinDraft/WinBoard.

    Ivex went out of business a couple years ago, and now there's no one to fix all the bug's.
    Which is probably why they went out of business in the first place. (there's a lot of bug's).

    And when the company closed, so did it's online Auto-Router server.
    So now everything has to be routed manually. And of course that's hard to do because of the Bug's.

    The last board I did, ... 18F6720, 10 other chips, 101 resistors,35 capacitors, etc. took almost 2 months to route manually.

    I've got to find another program. And PCB123 just doesn't do it for me.
    <br>
    DT

Similar Threads

  1. Controlling stepper motor with PIC
    By The Master in forum Off Topic
    Replies: 3
    Last Post: - 1st July 2008, 10:21
  2. Driving Stepper Motor with PBL3717
    By crhomberg in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th November 2007, 20:59
  3. Replies: 5
    Last Post: - 12th September 2007, 15:59
  4. Driving a DC motor /w 16f84a
    By Lilmanmgf in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 15th May 2007, 12:39
  5. Motor Control PLC with a PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 2nd November 2006, 07:59

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