Shop OBEX P1 Docs P2 Docs Learn Events
Can the Stepper Motor, part #27964, be directly connected to a BOE? — Parallax Forums

Can the Stepper Motor, part #27964, be directly connected to a BOE?

rmcbrmcb Posts: 39
edited 2012-01-28 09:15 in Robotics
I have a BOE, Rev D, with a Basic Stamp 2 chip. I just recently purchased a 12-Volt Unipolar Stepper Motor (#27964) from Parallax. I have the sample code that was available.

What I can't determine is if I can connect the motor directly to one of the pins on the BOE or if I need another part.

The documentation with the motor states, "The #27964 is a standard, four-phase unipolar stepper motor that is easily controlled with the BASIC Stamp or Javelin Stamp when buffered with an appropriate high-current driver (ULN2003 or similar suggested)."

I've seen other references to a "driver", such as the L293D driver, mentioned in EXPERIMENT #27: STEPPER MOTOR CONTROL, in the StampWorks manual.

So, I'm guessing that I need a driver such as this, true?

Thank you,

Ryan

Comments

  • ercoerco Posts: 20,256
    edited 2011-07-18 09:02
    You definitely need a driver chip. ULN2003 or L293D can work for you.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2011-07-18 09:26
    The page 2 hookup to the ULN2003 in the motor PDF is a good place to start.

    The L293D is a more expensive chip and requires more wiring connections, so for just playing around with a unipolar stepper you don't need it. (You'd want the L293D if your stepper were the bipolar kind, and no that doesn't mean it's manic-depressive.)

    -- Gordon
  • rmcbrmcb Posts: 39
    edited 2011-07-18 11:42
    Thank you both for the replies.

    So I can order a "ULN2803A Darlington Array" and it will fulfill this function? Is there anything else that is needed to control the stepper from the BS?

    Thanks again,

    Ryan
  • ercoerco Posts: 20,256
    edited 2011-07-18 13:40
  • rmcbrmcb Posts: 39
    edited 2011-07-19 13:43
    Erco,

    Thank you. I downloaded that pdf from the part page when I purchased it. So, if I buy a "ULN2803A". does it plug directly into the breadboard area of the BOE? And then I connect the pins from the stepper into the appropriate pins on the BOE?

    Apologies in advance for my 'noob' questions,

    Ryan
  • ercoerco Posts: 20,256
    edited 2011-07-22 12:19
    Yessir, that's a standard DIP 18 chip that should plug right into your breadboard: http://www.datasheetcatalog.org/datasheet/SGSThomsonMicroelectronics/mXssxrt.pdf

    Keep in mind that you'll need quite a battery to run a stepper, large current required. Don't use a 9-volt battery (and certainly not 5V regulated off the BoE). You'll want a seperate battery supply (maybe NiMH batteries) to run your stepper. And you'll connect all your battery negative terminals to ground, your BoE 9V and your motor battery.
  • rmcbrmcb Posts: 39
    edited 2011-07-26 12:55
    Hi Erco,

    Thanks for the tip. I have never used a stepper before and was completely unaware that I couldn't run it off of the BoE power source, in this case a 9-volt battery. Do you know where i can find instructions on how to connect the power to the motor, what kind of battery to use, etc.? I want to control the action of the stepper from the BS2 on the BoE, which up till now I've been powering using the 9-volt.

    Thnx,

    Ryan
  • ercoerco Posts: 20,256
    edited 2011-07-26 13:16
    It's all in the Parallax schematic in that link: http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/Stepper_Motor_27964.pdf

    They show exactly how to hook up a 12V battery and a ULN2003. Could be a 12V SLA, alkalines, NiMH, whatever. They show the 4 pin hookups to your BoE, the only connection not shown is to connect your battery grounds (-) together. Make it happen, Captain!
  • rmcbrmcb Posts: 39
    edited 2012-01-25 13:00
    Hi Erco,

    Circling back to this question, after a long delay. I have the #27964 Parallax stepper motor from Mitsumi, and I have ordered and received a set of ULN2803A chips, and I have purchased a set of 12V Alkaline batteries (Energizer A23). Can I assume that the pin hookups are the same for the ULN2803 as the one's shown in the schematic for the ULN2003? I am thinking that I can insert the ULN2803 into my BoE breadboard and then connect P4 on the Stamp to pin 1 on the ULN, P5 to pin 2, P6 to pin 3, and P7 to pin 4, as shown. Then I connect the four Phase wires from the stepper to pins 13-16 on the ULN as follows: yellow-pin 13, brown to pin 14, orange to pin 15, and black to pin 16. And the RED wire would get connected directly to the positive of the 12V. I see that pin 8 on the ULN goes to ground, Vss, and I see a connection to pin 9 on the ULN but I'm not sure where it's coming from. I'm not sure what you mean when you reference connecting the battery grounds together. I don't see a ground coming out of the stepper, unless that's the black wire that I connected to pin 16 above.

    This noob appreciates any guidance you can provide.

    Thank you
  • ercoerco Posts: 20,256
    edited 2012-01-25 17:13
    Almost right. Which can be quite dangerous with electronics. :)

    The 2003 is a 16-pin chip with 7 channels, the 2803 is an 18-pin chip with 8 channels.

    Using the 2803, ground pin 9. Pin 10 goes to +12V, along with the red stepper motor wire. Your other connections are correct as you describe.

    Your 12V battery negative connection is connected to the Stamp & 2803's Vss (ground) connection, along with the Stamp's battery negative connection.

    See the diagram at
    http://courses.cit.cornell.edu/ee476/FinalProjects/s2008/dmh64_hs284/dmh64_hs284/images/photos/step_control.jpg which is fairly similar to your setup. It's using different channels and 5V, but the general hookup is the same.
  • rmcbrmcb Posts: 39
    edited 2012-01-26 14:24
    Hi Erco,

    As you said, almost right can be quite dangerous, so I'd like to confirm that I've understood correctly before I fry something.

    I've attached a snapshot of the board, the 2803 and the stepper connections to see if I've got it right before I power it up and load my pgm.

    I've got the 2803 inserted in m BoE breadboard area, straddling the channel, in rows 0-8, with the notch on the 2803 at the top, row P8.

    I have a wire in row 0 running from Pin 10 on the 2803 to the positive terminal on my 12V alkaline. I also have the red wire from the stepper plugged in to the same row, 0, as pin 10 of the 2803.
    I have a wire in row 0 running from Pin 9 on the 2803 to the negative terminal on my 12V alkaline. I also have a wire running from pin 9, GND, of the 2803 to Vss.

    Orange wire from the Stepper plugged into pin 15
    Black wire from the Stepper plugged into pin 14
    Yellow wire from the Stepper plugged into pin 13
    Brown wire from the Stepper plugged into pin 12

    I have pin 1 on the 2803 connected to P4 on the stamp.
    I have pin 2 on the 2803 connected to P5 on the stamp.
    I have pin 3 on the 2803 connected to P6 on the stamp.
    I have pin 4 on the 2803 connected to P7 on the stamp.

    I tried to translate the diagram you referred to, comparing it to what we had already discussed, and I think that I have it.

    Thank you,

    Ryan
    DSCN4458.jpg
    1024 x 768 - 77K
  • ercoerco Posts: 20,256
    edited 2012-01-26 15:12
    No, something's cattywompus there. First, that little 12V alkaline won't power a motor for more than a few seconds, if at all. Internal resistance is too high, and the AH capacity is too low. You want nicads or gel cells or a 12V supply.

    Next, your input/outputs don't line up on the 2803, nor do they jibe with the Stamp pinouts at http://www.parallax.com/Portals/0/Do...otor_27964.pdf You said you have the mitsumi motor, the wire color/phase list is in that pdf.

    Change your stepper motor wiring on the right side of the 2803 to this:

    black wire to pin 18 (top right, directly across from pin 1 & jumper to P4)
    orange (pin 17, below the black wire)
    brown (pin 16, below the orange wire)
    yellow (pin 15, below the brown wire)

    So now you have Stamp & stepper connections to the top 4 pins on both sides of the 2803. Let's see that.
  • rmcbrmcb Posts: 39
    edited 2012-01-26 18:20
    Thanks Erco,

    I was looking for a 12V to power the stepper that was also small and portable. The gel cells and SLAs that I know of appear to be too large for the application that I have in mind. Do you think that something like this would provide power for more than a few minutes?

    http://www.onlybatteries.com/showitem.asp?ItemID=16482&cat1=&uid=1228

    I tried to go to the pinout diagram that you mentioned at "http://www.parallax.com/Portals/0/Do...otor_27964.pdf" but that page couldn't be found.

    Instead I used this one: "http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/Stepper_Motor_27964.pdf"

    Would they be the same, except for describing the 2003 instead of the 2803?

    I've wired it as you described:

    27964 2803

    black pin 18
    orange pin 17
    brown pin 16
    yellow pin 15

    Stamp 2803

    P4 pin 1
    P5 pin 2
    P6 pin 3
    P7 pin 4

    GND pin 9
    +12V pin 10

    Picture attached:

    DSCN4460.jpg
    1024 x 768 - 72K
  • ercoerco Posts: 20,256
    edited 2012-01-26 19:22
    Looks good. The 2803 has 2 more pins than the 2003, so the pin #s get confusing. About batteries, size is everything. I'd be surprised if that little A23 battery worked at all. You could get a small lithium cell to work, but you'll recharge it often.
  • rmcbrmcb Posts: 39
    edited 2012-01-27 13:09
    Erco,

    Thanks. If I'm just trying to prototype this and not yet concerned with a permanent solution, do you think that I could string a few of these itty-bitty batteries together to get enough power to test out my basic pgm? The specs on the battery are as follows:

    Battery Size Code:23A; Battery Capacity:55mAh; Battery Voltage:12V

    If, would I connect them in series; positive to negative in a chain, or in parallel, positive to positive (negative to negative) ?

    Thank you,

    Ryan
  • ercoerco Posts: 20,256
    edited 2012-01-27 13:19
    You'd put them in parallel (+ to + and - to -).

    If you're just testing, you might do better with a rechargeable 9 volt battery. Small, higher current output, and rechargeable. That 12V stepper should still work at 9V, with less power output natch.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-27 13:37
    Ryan,

    I thought I'd chime in on the battery issue. A three cell LiPo outputs about 12V when charged. LiPo batteries have the highest charge density of the readily available rechargeable batteries. I have a few of these that I like.

    LiPo do require a special charger though.

    If you go the NiMH route, I'd suggest buying the individual batteries instead of the premade packs. The packs are a pain to repair when one battery goes bad. I just use the battery holders from Radio Shack or other suppliers to build my own packs that can be easily repaired.
  • rmcbrmcb Posts: 39
    edited 2012-01-27 19:28
    @ Erco,

    Thanks, I'll try the rechargeable 9V. Wasn't aware that the stepper would work with those. good to know. thanks very much

    @ Duane,

    Thanks for the tip also. I'm not familiar with the LiPo. How/where would I find these? I like the idea of the homemade battery packs. I'll try that.

    Ryan
  • ercoerco Posts: 20,256
    edited 2012-01-27 19:36
    9.6v battery packs (NiMH, or older Nicads) and trickle charger can often be found in toy stores pretty cheap. Here's a low-end nicad pack under $10:

    http://www.ebay.com/itm/1x-Tamiya-Battery-Pack-9-6V-1000mAh-NiCD-808-Charger-US-/280799646179?pt=LH_DefaultDomain_0&hash=item4160f691e3
  • rmcbrmcb Posts: 39
    edited 2012-01-27 19:44
    Also,

    When you say 9 volt battery, are we talking about the same type of battery that I'm using to power my Stamp, a 9 volt duracell, or are we talking about something heftier?

    Thanks again,

    Ryan
  • ercoerco Posts: 20,256
    edited 2012-01-27 19:52
    Alkalines are your last choice, unless you move up to C or D cells. IMHO you're far better off with a good size 9.6-12v pack premade from NiMH aa cells, but even a tiny rectangular rechargeable 9v is better than any small alkaline.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-27 20:45
    erco wrote: »
    premade from NiMH aa cells

    @erco, You don't have trouble with one cell dying on you? This hasn't happened a lot to me, but the few times it has has made me prefer individual cells.

    @Ryan, I purchase my LiPos from HobbyKing. I linked to one of the battery packs I use. You need a special charger for LiPos so it might not be worth the bother unless you're going to use them for several projects. LiPos are very popular with RC electric airplane and helicopter flyers because of the weight to power ratio.
  • ercoerco Posts: 20,256
    edited 2012-01-28 09:15
    Duane Degn wrote: »
    @erco, You don't have trouble with one cell dying on you? This hasn't happened a lot to me, but the few times it has has made me prefer individual cells.

    Not really. Sounds like Ryan wants a small, simple battery solution and IMO a cheap premade battery & charger fits the bill. Once he nails the stepper problem, we can come back & optimize the battery. :)
Sign In or Register to comment.