Shop OBEX P1 Docs P2 Docs Learn Events
I/O pins and power — Parallax Forums

I/O pins and power

p_tp_t Posts: 15
edited 2013-02-21 04:39 in BASIC Stamp
I have some light bulbs that I was trying to power similarly to the LED HIGH and LOW commands and have a problem with power. When I connect the bulb to Vdd and Vss, it works. However, I noticed when I placed the lead in the I/O pin, it wouldn't light up. I did a little investigation of my own and my muilti-meter I noticed when the bulb was in the Vdd and Vss my current reading was .14 amps, the I/O pin only put out .01 amps. How can I get the current I need to power the bulb on the HIGH LOW commands so that I can program it? Thank you.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2013-02-20 17:44
    You will need to use a transistor or mosfet to allow the pin to switch the device. As you found the pins on the stamp can't supply the current you need. There is a Nuts and Volts article on how to do this but I never know how to find them without a lot of searching so someone else (Mike?) will have to give you that info.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-20 17:47
    Nuts and Volts Column #6 discusses this problem and how to deal with it using a switching transistor. As you've noticed, the Stamp I/O pin can only switch about 25mA maximum and there are limits on the current from groups of I/O pins. All of this is described in the datasheet on the PIC16F57 on page 57. This is the microprocessor chip used for the Stamp.
  • p_tp_t Posts: 15
    edited 2013-02-20 19:16
    Mike Green wrote: »
    Nuts and Volts Column #6 discusses this problem and how to deal with it using a switching transistor. As you've noticed, the Stamp I/O pin can only switch about 25mA maximum and there are limits on the current from groups of I/O pins. All of this is described in the datasheet on the PIC16F57 on page 57. This is the microprocessor chip used for the Stamp.

    I searched #6 but couldn't find anything on the switching transistor.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-02-20 19:21
    p_t wrote: »
    I searched #6 but couldn't find anything on the switching transistor.

    IIRC, there's an example of using a transistor to turn on a relay near the end of the article. Instead of turning on the relay, the transistor could be used to turn on a light. There might be other transistor examples in the article but I only remember the relay example.
  • p_tp_t Posts: 15
    edited 2013-02-20 19:33
    Thank you gentlemen for your help. I ended up using Transistor – 2N3904 that I found in my kit. I used a jumper wire from PIN15 to the B, E to Vss, lead of light bulb to the power and the negative of bulb to the C of the transistor and it worked. I must have connected them wrong my first try.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-02-20 19:52
    I'm not sure, but I think you may need at least one resistor in your circuit. I believe the line between the Basic Stamp and the transistor base is supposed to have a resistor. I hope someone corrects me if I'm wrong.

    If too much current is drawn from an I/O pin, it will likely damage the microcontroller. I don't know if the base pin of a 2N3904 will draw enough current to damage the Stamp or not.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-20 20:52
    Nuts and Volts Column #6 clearly shows a resistor (470 Ohms to 1K typically) in the base lead of the transistor. YOU MUST HAVE THAT or you can damage the Stamp.
  • p_tp_t Posts: 15
    edited 2013-02-21 04:39
    Mike Green wrote: »
    Nuts and Volts Column #6 clearly shows a resistor (470 Ohms to 1K typically) in the base lead of the transistor. YOU MUST HAVE THAT or you can damage the Stamp.

    Sorry about that Mike, When you said Nuts and Volts column #6 I was looking at volume #6, no wonder why I couldn't;t find it. I see the article now and thank you for the direction. I appreciate your help and all others who posted here.
Sign In or Register to comment.