Shop OBEX P1 Docs P2 Docs Learn Events
Trying to work with 2 DC motors Need Advice — Parallax Forums

Trying to work with 2 DC motors Need Advice

ArchiverArchiver Posts: 46,084
edited 2004-06-09 14:55 in General Discussion
Hello Everyone. I'm new here and this is my first Microcontroller
project. I bought the "What's a Microcontroller" kit and that's what
I'm working with. I'm in the middle of building a mini robo sumo from
scratch (not using a kit) I have everything figured out except how to
power the motors. The stamp will source 20mA and sink 25mA if the
documentation I have is correct. The motors I have require about 52mA
free running and as much as 600mA stalled. I'd like to run them at 9
volts but I'm not sure how to interface them with the stamp. I looked
around the internet for a driver circuit that I could build but
didn't have much luck.

Can someone provide some insights? I would be very grateful.
Unfortunately cost is VERY Much and issue so I was hoping to do it on
the cheap. I can build just about any circuit you can show me and I
already have plenty of components but not many IC's.

Thanks
Bill

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-06-08 08:14
    --- In basicstamps@yahoogroups.com, "billdoser2003"
    <billdoser2003@y...> wrote:
    > Hello Everyone. I'm new here and this is my first Microcontroller
    > project. I bought the "What's a Microcontroller" kit and that's
    what
    > I'm working with. I'm in the middle of building a mini robo sumo
    from
    > scratch (not using a kit) I have everything figured out except how
    to
    > power the motors. The stamp will source 20mA and sink 25mA if the
    > documentation I have is correct. The motors I have require about
    52mA
    > free running and as much as 600mA stalled. I'd like to run them at
    9
    > volts but I'm not sure how to interface them with the stamp. I
    looked
    > around the internet for a driver circuit that I could build but
    > didn't have much luck.
    >
    > Can someone provide some insights? I would be very grateful.
    > Unfortunately cost is VERY Much and issue so I was hoping to do it
    on
    > the cheap. I can build just about any circuit you can show me and I
    > already have plenty of components but not many IC's.
    >
    > Thanks
    > Bill


    Hi Bill,

    Very common question on here.

    To power an external device, you can use a transistor. A 2n2222 will
    handle up to about 60 volts and between 500 and 600mA depending on
    manuufacturer.

    The unit can be driven (switched) with a 5 volt output from the stamp.

    You can use a multi-pack or IC style version called the ULN2803 with
    8 channels in a simple package, and that too handles up to about
    500mA per channel.

    A TIP122 or similar will handle about 5 amps, and this is the big
    brother to the 2222 for our switching purposes.

    From there, move into MODFETS. You can get a MOSFET rated for about
    27 amps and 600 volts, so these have a pretty high limit.

    Anyway, back to your needs.

    Google H-bridge and pick a circuit you like.

    Since you are looking to keep the costs down, Glitchbuster.com offers
    all the above.

    IIRC, a dozen 2222's are 99 cents
    a UNL2803 is 39 or 79 cents or something.
    A TIP120 is 39 cents
    and a MOSEFET with a high amp rating is about 79 cents.
    P channel will be more across the board.

    Now, before you get too excited, you will need more than a few to
    make an H-Bridge. the 2222 can drive the MOSFETS so a mix and match
    will keep prices low.

    Also if you want to make a charge pump, you can use all N-channel
    parts. The trade off is more complexity and more parts that cost
    less.

    Dave
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-08 13:44
    --- In basicstamps@yahoogroups.com, "Dave Mucha" <davemucha@j...>
    wrote:
    > --- In basicstamps@yahoogroups.com, "billdoser2003"
    > <billdoser2003@y...> wrote:
    > > Hello Everyone. I'm new here and this is my first Microcontroller
    > > project. I bought the "What's a Microcontroller" kit and that's
    > what
    > > I'm working with. I'm in the middle of building a mini robo sumo
    > from
    > > scratch (not using a kit) I have everything figured out except
    how
    > to
    > > power the motors. The stamp will source 20mA and sink 25mA if the
    > > documentation I have is correct. The motors I have require about
    > 52mA
    > > free running and as much as 600mA stalled. I'd like to run them
    at
    > 9
    > > volts but I'm not sure how to interface them with the stamp. I
    > looked
    > > around the internet for a driver circuit that I could build but
    > > didn't have much luck.
    > >
    > > Can someone provide some insights? I would be very grateful.
    > > Unfortunately cost is VERY Much and issue so I was hoping to do
    it
    > on
    > > the cheap. I can build just about any circuit you can show me and
    I
    > > already have plenty of components but not many IC's.
    > >
    > > Thanks
    > > Bill
    >
    >
    > Hi Bill,
    >
    > Very common question on here.
    >
    > To power an external device, you can use a transistor. A 2n2222
    will
    > handle up to about 60 volts and between 500 and 600mA depending on
    > manuufacturer.
    >
    > The unit can be driven (switched) with a 5 volt output from the
    stamp.
    >
    > You can use a multi-pack or IC style version called the ULN2803
    with
    > 8 channels in a simple package, and that too handles up to about
    > 500mA per channel.
    >
    > A TIP122 or similar will handle about 5 amps, and this is the big
    > brother to the 2222 for our switching purposes.
    >
    > From there, move into MODFETS. You can get a MOSFET rated for
    about
    > 27 amps and 600 volts, so these have a pretty high limit.
    >
    > Anyway, back to your needs.
    >
    > Google H-bridge and pick a circuit you like.
    >
    > Since you are looking to keep the costs down, Glitchbuster.com
    offers
    > all the above.
    >
    > IIRC, a dozen 2222's are 99 cents
    > a UNL2803 is 39 or 79 cents or something.
    > A TIP120 is 39 cents
    > and a MOSEFET with a high amp rating is about 79 cents.
    > P channel will be more across the board.
    >
    > Now, before you get too excited, you will need more than a few to
    > make an H-Bridge. the 2222 can drive the MOSFETS so a mix and
    match
    > will keep prices low.
    >
    > Also if you want to make a charge pump, you can use all N-channel
    > parts. The trade off is more complexity and more parts that cost
    > less.
    >
    > Dave

    Thanks for the reply Dave. I tried to use a 2n3904 transistor. I
    connected the base of the transistor to one of the pins on the stamp
    and i connected the collector to my motor through Vdd. I connected
    the emmiter to Vss. I was able to get an LED to blink this way but no
    reaction from the motor.
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-08 17:31
    > Thanks for the reply Dave. I tried to use a 2n3904 transistor. I
    > connected the base of the transistor to one of the pins on the
    stamp
    > and i connected the collector to my motor through Vdd. I connected
    > the emmiter to Vss. I was able to get an LED to blink this way but
    no
    > reaction from the motor.


    I'm assuming you missed something in your post ? it sounds like you
    have the NPC transistor connected to Vcc and Vss and nothing in-
    between ?


    The motor would connect to Vss, then the 3904 collector.

    The 3904 would connect to the motor on the collector and Vss on the
    emiter.

    The Stamp would connect to the Base of the 3904 with a 220 or 330 ohm
    resistor.

    The 3904 would connect to the resistor to the base.


    The motor can be connected to your higher voltage as only the
    collector and emitter see that higher voltage.

    And, power ground and logic ground need to be tied together. ie:
    emitter and Vss of the Stamp.

    Is this what you tried ?

    just as a thought, I expect your motor spins when connected directly
    to power ? I mentioned that on the off-chance it is a stepper. : )

    Dave
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-09 04:10
    --- In basicstamps@yahoogroups.com, "Dave Mucha" <davemucha@j...>
    wrote:
    >
    > > Thanks for the reply Dave. I tried to use a 2n3904 transistor. I
    > > connected the base of the transistor to one of the pins on the
    > stamp
    > > and i connected the collector to my motor through Vdd. I
    connected
    > > the emmiter to Vss. I was able to get an LED to blink this way
    but
    > no
    > > reaction from the motor.
    >
    >
    > I'm assuming you missed something in your post ? it sounds like
    you
    > have the NPC transistor connected to Vcc and Vss and nothing in-
    > between ?
    >
    >
    > The motor would connect to Vss, then the 3904 collector.
    >
    > The 3904 would connect to the motor on the collector and Vss on the
    > emiter.
    >
    > The Stamp would connect to the Base of the 3904 with a 220 or 330
    ohm
    > resistor.
    >
    > The 3904 would connect to the resistor to the base.
    >
    >
    > The motor can be connected to your higher voltage as only the
    > collector and emitter see that higher voltage.
    >
    > And, power ground and logic ground need to be tied together. ie:
    > emitter and Vss of the Stamp.
    >
    > Is this what you tried ?
    >
    > just as a thought, I expect your motor spins when connected
    directly
    > to power ? I mentioned that on the off-chance it is a stepper. : )
    >
    > Dave


    Ok. I'll try to be a little more clear. Yes the motor does spin when
    connected to a battery. I used a nine volt. As for the circuit I
    built.

    I connected pin 8 of the stamp to the base of the transistor.
    I connected one wire from the motor to Vdd. I connected the other
    wire to the collector of the transistor.
    I connected the emitter to Vss.

    When I do this with an LED I can get it to flash. (I added about 50k
    resistance)It will not work with the motor I was wondering if I did
    something wrong. I did not use a resister from pin 8 to the base. The
    schematic I have didn't show one. Is that a problem? Can you maybe
    post a link or two to other driver circuits that have been known to
    work for my situation. I tried building an H bridge that I found in
    the book "Bug Bots, Junk Bots and Bots on Wheels" but didn't get any
    results.

    Thanks for the help.
    Bill
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-09 14:55
    --- In basicstamps@yahoogroups.com, "billdoser2003"
    <billdoser2003@y...> wrote:
    > --- In basicstamps@yahoogroups.com, "Dave Mucha" <davemucha@j...>
    > wrote:
    > >
    > > > Thanks for the reply Dave. I tried to use a 2n3904 transistor.
    I
    > > > connected the base of the transistor to one of the pins on the
    > > stamp
    > > > and i connected the collector to my motor through Vdd. I
    > connected
    > > > the emmiter to Vss. I was able to get an LED to blink this way
    > but
    > > no
    > > > reaction from the motor.
    > >
    > >
    > > I'm assuming you missed something in your post ? it sounds like
    > you
    > > have the NPC transistor connected to Vcc and Vss and nothing in-
    > > between ?
    > >
    > >
    > > The motor would connect to Vss, then the 3904 collector.
    > >
    > > The 3904 would connect to the motor on the collector and Vss on
    the
    > > emiter.
    > >
    > > The Stamp would connect to the Base of the 3904 with a 220 or 330
    > ohm
    > > resistor.
    > >
    > > The 3904 would connect to the resistor to the base.
    > >
    > >
    > > The motor can be connected to your higher voltage as only the
    > > collector and emitter see that higher voltage.
    > >
    > > And, power ground and logic ground need to be tied together. ie:
    > > emitter and Vss of the Stamp.
    > >
    > > Is this what you tried ?
    > >
    > > just as a thought, I expect your motor spins when connected
    > directly
    > > to power ? I mentioned that on the off-chance it is a
    stepper. : )
    > >
    > > Dave
    >
    >
    > Ok. I'll try to be a little more clear. Yes the motor does spin
    when
    > connected to a battery. I used a nine volt. As for the circuit I
    > built.
    >
    > I connected pin 8 of the stamp to the base of the transistor.
    > I connected one wire from the motor to Vdd. I connected the other
    > wire to the collector of the transistor.
    > I connected the emitter to Vss.
    >
    > When I do this with an LED I can get it to flash. (I added about
    50k
    > resistance)It will not work with the motor I was wondering if I did
    > something wrong. I did not use a resister from pin 8 to the base.
    The
    > schematic I have didn't show one. Is that a problem? Can you maybe
    > post a link or two to other driver circuits that have been known to
    > work for my situation. I tried building an H bridge that I found in
    > the book "Bug Bots, Junk Bots and Bots on Wheels" but didn't get
    any
    > results.
    >
    > Thanks for the help.
    > Bill


    What type of motor are you trying to run ? DC ? stepper ?

    will it run directly on the 9 volt batt ?

    Check the pin connections on the transistor. Make sure it is not
    upside down. (been there, done that)

    Does the motor draws more current than the transistor can deliver and
    the motor is just not getting enough power ?


    Can you post a shcematic of the h-bridge you are trying to use ?

    Dave
Sign In or Register to comment.