Shop OBEX P1 Docs P2 Docs Learn Events
I'm trying to control a motor that only draws 1A with a BS2 — Parallax Forums

I'm trying to control a motor that only draws 1A with a BS2

liquid12341234liquid12341234 Posts: 3
edited 2008-03-31 14:30 in BASIC Stamp
hi everybody. This I'd the first time I'm using a BS2 to control something. I'm trying to control a motor that only draws 1A. The circuit is done and I'm at the programming stage. My main power source is a 9 Volt battery. I installed a pushbutton on pin 8 as an input. I want the circuit to behave in a way where, when I press the button the time I hold the button is recorded into a variable. Thenthe controller will take this value and run my motor automatislly with the same duration I held the button. I was thinking of using a counter to record how long I held the button then decrement so the motor will run by itself. Any suggestions on how I should up about my little project? Thanks guys

[noparse][[/noparse]descriptive Subject Added]

Post Edited By Moderator (Chris Savage (Parallax)) : 3/31/2008 8:47:58 PM GMT

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2008-03-31 13:20
    A nine-volt battery will not run a 1 amp motor. Unless it's a NiCad nine-volt rechargeable.

    And even then, you'll need some "power" transistor to drive the motor -- like a TIP120 or TIP220.
  • liquid12341234liquid12341234 Posts: 3
    edited 2008-03-31 13:35
    I have a H-bridge driver. that can support that.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-31 14:30
    You didn't say anything about the range of times involved. Assuming the resolution is on the order of 20-50ms, you'd use a PAUSE statement as your time tick. You'd have a simple loop that starts when the button is pushed and stops when it is released. Each time through the loop, your program executes a PAUSE statement and increments a counter with a maximum count (using the MAX operator) of whatever maximum time you want. That will give you the button down time in units of the PAUSE delay (approximately). To run the motor, you turn on the H-bridge, loop the same number of times with the same size PAUSE, then turn off the motor.

    allenlane5 is very right. You need a battery pack with enough current capacity to sustain 1A for whatever time period you're planning.

    Get the hardware running, then build the program a piece at a time, testing as you go.
Sign In or Register to comment.