Shop OBEX P1 Docs P2 Docs Learn Events
Can Someone Give Me Hand — Parallax Forums

Can Someone Give Me Hand

JustSomeGuyJustSomeGuy Posts: 8
edited 2005-12-28 23:36 in BASIC Stamp
First off I'd like to state that I'm new to microcontrollers and fairly new to electronics. Now,·I've made a simple Transistor On/Off circuit identical to the one on page 265 of the "What's a Microcontroller?" book. This circuit works well, however when I use external batteries in place of Vdd and Vss my circuit doesn't work. The difference between the Vdd and Vss terminals I believe is 5v, so I've tried 1.5v, 3v, 6v, and 9v batteries, none of which has produced any results. Ive tried two types of transistors 2N3904 (the one included with the kit) and some I picked up from radioshack labeled "NPN type switching transistors". Eventually I will use this circuit with the 6v battery (4 AA batteries in series) to drive a small dc motor, however I'm currently troubleshooting on an led.

I've spent about an entire day working on this little problem and any help would be much appreciated. I've been researching transistor circuits and searching this forum looking for some snippet to help me but have not found my problem.

Thanks in advance

·

Comments

  • BeanBean Posts: 8,129
    edited 2005-12-23 03:00
    JSG,
    Do you have the grounds connected together ? That is the ground of the power supply for the stamp and the ground of the battery power supply ? I assume you are using two different power sources ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Forget about the past, plan for the future, and live for today.
    ·
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-23 03:08
    haha Thank You
    That worked
    I've spent an entire day on a problem that you helped fix in 1 minute.
    I do not usually like to ask for help, but in this case it was definitely worth it.
    O well, I've learned alot today, off to figure out why this worked. Would you care to elaborate on·why exactly the grounds need to be connected?

    As I've said I am fairly new to this

    Thanks

    -Spencer
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-23 03:11
    Heres a picture of what this dc motor runs. Now all I have to do is program some correography into it, maybe I'll add some infrared sensors. Basically its just a fully automatic airsoft gun with two servos, some wood, and a jiffy peanut butter lid. Kinda fun for a first robotics project and a great learning experience.
    500 x 374 - 46K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-23 03:22
    Not sure of your exact wiring, but when you're controlling an external device with a single I/O line, the circuit you're connected can't sense the voltage or signal level without a reference...A ground reference.· How many volts is the signal in relation to ground?· That's the concept.· =)· Hope it helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-23 04:39
    Aye,

    So I was a bit quick to assume that this was my last problem. This made my circuit work with a 3v battery and an led, however when I changed the led with the motor leads and the 3v for a 6v the circuit no longer works,·do motors have any special properties im not aware of. I've tried directly connecting the motor to the 6v battery and it runs, so the battery and the connection are good.

    Any Ideas?
    ·
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-23 04:54
    ok so I changed back to the original working led 3v battery circuit and plugged up the motor leads alongside the led. The result is that neither the led glows or the motor turns. I have no clue as to why this is happening except for possibly the motor leads are shorting the led, and I'm 99% sure this is not the case. So I'm at a loss right now and I'm going to go on tinkering until this works.

    Any help is appreciated.
    I'm so close to being done.
    Thanks for your time
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-23 05:49
    Hello,

    ·· Once again there is no indication of what you have connected where so we can see what's going on?··· Perhaps if you cannot draw a schematic you should describe your connections in detail.· Otherwise it's all guess work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-23 22:58
    Here's my·schematic detailing what I was trying to explain.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    PAUSE 1000
    HIGH 1
    PAUSE 4000
    LOW 1
    PAUSE 1000
    end

    heres how I was testing this circuit

    Any Ideas?

    Thank you


    -Spencer
    640 x 550 - 57K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-23 23:58
    Okay, this sheds new light on things.· First of all there's no need to use two (2) 100K resistors in parallel like that.· You could use a 50K resistor instead, but then there's your problem.· You're not providing enough bias current to give sufficient current to the motor through the transistor.· Try using a 1K resistor instead of the two 100K resistors.· The colors would be Black, Brown Red, Gold.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-24 01:30
    First off I'd like to thank you for your help and support thus far.

    So I've replaced the (2) 100K resistors with (1) 1K and still no luck. The only change is that when I try the led and motor circuit (bottom left in previous schematic picture, but with 1K) I get a single led flicker at the beginning of the "HIGH 1" command but this does not last the duration that pin 1 is receiving 5v.

    Should I buy a larger transistor maybe?
    Although the one I'm currently using is rated Max: 30v / 800mA

    Also you mentioned bias current in your previous post so I have been reading up on them. I am using two different power sources and have the grounds connected, am I missing something?

    Thanks

    JSG
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-24 02:43
    You can't run an LED in parallel with the/a motor (it's the winding of the motor VS. the LED's higher impedance and the wire/winding will "win out", this is what's know as current-hogging.)· Also, you need a current-limiting resistor in series with the LED, you can't have it run (for very long) without it/one [noparse][[/noparse]in your·3V circuit, 470 ohms should work.]

    Change the base resistor to a 1K.· As I see it, you still need to have a diode in parallel with the motor (kind of like you did with the LED, only place it reverse-biased -- with the cathode to + and the anode to the collector.)

    Also, see if your motor works with the 3V all by itself (no STAMPs or transistors.)

    N.B. It's either a motor OR an LED, but not both.

    see schematic/pic


    Post Edited (PJ Allen) : 12/24/2005 2:53:30 AM GMT
    338 x 494 - 27K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-25 06:55
    Okay, the circuit I referred to was the one with just the motor, which is what I thought you couldn't get going.· If the 1K resistor doesn't work, try a 220 ohm resistor.· Make sure the motor will spin off the 3V direct, and make sure the transistor is working (Or try another).·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • JustSomeGuyJustSomeGuy Posts: 8
    edited 2005-12-28 23:36
    Ok, nearly a week after my original post I have finally gotten this to work.
    My problem was that not enough current was reaching the base of the transistor. Even wiring the I/O pin directly to the base did not provide enough current, I believe this is because I'm using the homework board which has built in resistors. I finally got the motor to run by making a darlington pair (something I've read about from day 1 while researching my problem).

    Anyways Thank you Bean, Chris Savage, and PJ Allen for your help.
Sign In or Register to comment.