Shop OBEX P1 Docs P2 Docs Learn Events
Does the BS2sx Float pins? — Parallax Forums

Does the BS2sx Float pins?

beazleybubbeazleybub Posts: 102
edited 2008-10-27 15:28 in BASIC Stamp
Question,

When the bs2sx microcontroller pin logic is "0" is it floating?
Is a pulldown resistor necessary for the bs2sx?

I am driving a NPN transistor as a switch for a relay with one of my pins and have a protection diode in the circuit but wonder if I should be using a pulldown resistor to ensure·the pin is grounded when it is not on.

Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-27 04:58
    For all the Stamps and the SX and the Propeller, any I/O pin has 3 settings: 1) Logic high output - set to Vdd (approximately), 2) Logic low output - set to Vss (approximately), 3) Logic input - a high impedance ("floating").

    You generally need a pulldown (or pullup) resistor for the 3rd case, when the I/O pin is set to input mode (the default after a reset).

    If you're using an NPN (or PNP) transistor, you probably don't need a pulldown (or pullup) resistor since bipolar transistors are current controlled and there's no current present when the I/O pin is set to input mode. If you're using an MOSFET, you will need a pulldown (or pullup) because these are voltage controlled and nearby voltages can induce a voltage in the high impedance input circuitry attached to the MOSFET causing it to conduct.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-10-27 07:42
    Mike, I must respectfully disagree, though only a little. The period between the time the base drive circuitry stops supplying charge to the base of the transistor, and the time when cutoff is complete (doesn't happen until the base charge is depleted), is the most stressful time for the transistor. Its current is high, and the voltage will spike right then, even with a protective diode across the inductive load. Very brief, but very localized, heating can occur if the circuit does not force the transistor to cut off quickly. The way to cut it off quickly is to reverse-bias the B-E junction, or at least to assure that it is as nearly zero-biased as possible, quickly. Give that base charge some place to go! Floating the base may cause the transistor to cut off quite slowly, leading to gradual degradation each time the transistor shuts off -- especially if the transistor was deep in saturation (lots of excess base charge) just before cutoff, which of course we specifically wish to be the case for least power dissipation while conducting. Watch the current and voltage on an x-y scope sometime, and you may see a pretty wide hysteresis loop in the transient load line. Interestingly, the area inside this hysteresis loop [noparse][[/noparse]which is a measure of energy dissipated during the transition] can often be reduced considerably by adding a small capacitance across the protective "kick" diode, to accept current before the diode turns on.

    I'd always add a pulldown. It is lkely unnecessary at the power levels we're talking about, especially if the transistor is a robust type, but it's cheap insurance. I have seen adding one radically increase MTBF, years ago when I was designing medical lab equipment that had a lot of relays (and other solenoids) controlled by bipolars.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-10-27 11:55
    Usually, Carl, people don't "turn off" their transistor's by converting the BS2 pin into an input (== "floating the base") -- they usually turn off their transistor by setting the BS2 pin as an output, low.

    What you say is interesting, though, I was not aware of these transient effects. And "always adding a pull-down" couldn't hurt.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-27 13:34
    Carl,
    Thanks for the information. I've always thought about the sorts of effects you mentioned as something for high power / high frequency / etc. applications and not for the garden variety "turn on a small relay" or "control a small DC motor". The effect on MTBF is something I hadn't expected.
  • beazleybubbeazleybub Posts: 102
    edited 2008-10-27 15:24
    Then pulldown it is! tongue.gif

    Carl you made my brain hurt!!!!

    I really wish I could find a way to go to electronics school.
    I work nights 50 hours a week and have no time for school right now which really sucks a bucket of rusty nails.

    Thanks for you guys generosity.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 10/27/2008 3:29:30 PM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-10-27 15:28
    allanlane5 said...
    Usually, Carl, people don't "turn off" their transistor's by converting the BS2 pin into an input (== "floating the base") -- they usually turn off their transistor by setting the BS2 pin as an output, low.

    What you say is interesting, though, I was not aware of these transient effects. And "always adding a pull-down" couldn't hurt.
    Quite true, Allan.· However, suppose you hit Reset?· But I must admit that I had not considered that most times you won't be floating the base.· Thanks for reminding me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
Sign In or Register to comment.