Shop OBEX P1 Docs P2 Docs Learn Events
Help with simple Motor control — Parallax Forums

Help with simple Motor control

logan996logan996 Posts: 281
edited 2010-04-07 13:16 in BASIC Stamp
Hi, i am using a BS2 homeworkboard to try and control a small motor (about 3/4 the size of a 9V), The motor runs great when connected to a 4x AA holder and will run using the BS2's Vdd and Vin when the BS2 is connected to the batteries instead of a 9v. I have tried powering the BS2 with the 4 AA batteries using a simple circut that has the motor connected to a a pin (pin 8) and ground, i tried to put the poin pn high to turn it on but that wouldnt work, but it does work when it is directly connected to the Vdd and Vss. I gave that up and took the transistor (2N3904) in my WAM? kit and used a schematic in the kit that uses a pot and the transistor to change the brightness of the LED, i tested the circut with the LED and made it work, but when i connected the motor it failed to work (with the AA's or the 9v), i tried again disconnecting the motor from the BS2 and made it run off 4 external AA's (the BS2 was on a 9v) and it still wouldnt twitch, so i replaced the pot with a dierct connection to the BS2 I/O pin, i tested the LED (worked) then tried the motor again and it didnt work then i tried the external AA's and still it would not work!!!· Is this beacause of the transistor rating? or what? ans also the batteries were brand new out of the box and the transistor is sold by parallax (look up it up on their store for the data sheet) and the schematic for the circut i used is on page 273 in the What's a Microcontroller book pdf on the store page on the parallax store.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When the government is afraid of the people there is liberty, when the people are afraid of the government, there is tryanny"

· Thomas Jefferson
·

Comments

  • legoman132legoman132 Posts: 87
    edited 2010-03-14 17:28
    Perhaps you could try a bigger transistor, as a motor (even a small one) uses much more power than a LED. Could you give a part number or something like that on the motor?
  • logan996logan996 Posts: 281
    edited 2010-03-14 17:38
    umm no there is no part number, it is actulley a motor on a old jeep RC car that i have gutted, all that is left is the motor in the gearbox, and it is very small, like a standard cheap motor in kids toys. and the trnsistor says it can handle pritty big loads

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When the government is afraid of the people there is liberty, when the people are afraid of the government, there is tryanny"

    · Thomas Jefferson
    ·
  • stamptrolstamptrol Posts: 1,731
    edited 2010-03-14 17:47
    No way the Stamp pin can drive the motor directly. Not designed to deliver that kind of current.

    Also, the transistor you are using is only good for about 200 mA, so its marginal at best. Even a 2n2222 would be a better choice.


    Do this:

    1. Connect + of your battery pack to one lead of your motor.
    2 Connect the other lead of the motor to the Collector of the transistor.
    3. Connect the Emitter of the transistor to 0 volts of your battery pack. ( Some call it ground). Also tie this point to 0 volts on the Stamp.
    4 From your Stamp pin, go to one side of a 2.2K resistor. (any value from 1K to 10K should work).
    5 From the other side of the resistor, go to the base of the transistor.
    6. Put a diode across the motor terminals, cathode to the positive side.
    6 When the pin is HIGH, the motor will turn on.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • WRD5WRD5 Posts: 9
    edited 2010-04-04 05:04
    I too am trying to power a small motor (RS-360SH) using a BS2pe MoBo and a Power I/O daughterboard.· I have tried the above set up, using a variety of transistors to no avail, with a pair of AA batteries.· Between the Emitter or Drain of the Transistor, i have a Red LED which lit up very brightly when i had the circuit powered, but the motor does not budge.· The transistors i have used: 9014B, MPF102 FET and an IRF 630B.

    The resistor between the white pin on the daughterboard and the base of the transistor is 2.2K ohms.

    Prior to this, i was trying to using the transistor to power a small relay without any success either.· The relay is a radio shack 5VDC relay (275-0240 or OEG OUAZ-SS-105D)

    Do i need to use a larger voltage supply, like 4 AA batteries?· Or am i doing something else wrong?

    Any help would be much appreciated.

    Thank you!

    B
  • ercoerco Posts: 20,256
    edited 2010-04-04 16:09
    wrd5:·Your particular 5-volt relay requires 89 mA and the Stamp can only source about 25. You can drive that with a transistor, but a more direct way is to use the 250-ohm reed relay at http://www.radioshack.com/product/index.jsp?productId=2062478, which·should work fine. It only needs 20 mA.·Always·practice safe switching (!) and use a flyback diode·across a relay coil for Stamp protection. Sketch attached. Most any diode except an LED will work. Note that is installed "backwards". It doesn't do anything operationally to the circuit, but it absorbs high-voltage switching transients from the relay coil from backfiring into the Stamp and zapping it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
    450 x 225 - 13K
  • WRD5WRD5 Posts: 9
    edited 2010-04-04 23:39
    Thank you for this help.· Will attempt as soon as Radio Shack is open and i can purchase one!

    Curious why my current transistors will not do the task gating current to the motor, and leaving the relay out of the circuit entirely?

    thanks,

    bd
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-04-05 14:23
    You can use a medium power transistor: TIP 120

    Or I like these.......a power Mosfet: IRF 510

    Both available from Radio Shack. The problem you might have is, the motor will pull A LOT more power starting that it does at idle. Use the relay, or a larger transistor. Either of those two I listed above will scoff at your little motor [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • WRD5WRD5 Posts: 9
    edited 2010-04-07 04:14
    Spiral 72
    IT WORKS LIKE A CHARM!!!!! AWESOME! Bought ALL of the above electronics, but started with the TIP 120 and it works great. The motor spins reliably and i can hear the click of the relay, even with it being so small!
    THANK YOU FOR THE HELP!!!!
    Since my BS2pe appears to only put out 15mA from the pin i am using, i was not sure the Reed Relay would work, since erco state it might need 20mA to flip the relay. Still....may try it to see how it performs.
    bd
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-04-07 13:16
    Hey man, you shouldn't need the relay to fire the TIP 120..... but the relay is surely good to have for other stuff! If you DO remove the relay and fire the TIP 120 directly, make sure you use a resistor on the BS pin!


    Now play with PWM.....Pulse Width Modulation..... to control the speed of the motor [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
Sign In or Register to comment.