Sinking current from 9V into a PIC pin.


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Sinking current from 9V into a PIC pin.

    Quote Originally Posted by sayzer View Post
    Hi Joe,

    My point was not what you meant.
    If a PNP transistor is supplied by 9V, and you drive it with +5V (less than 9V), then the transistor will not be ignited as you expect.

    As easy as having it tested on real circuit.
    Just drive an LED via PNP transistor by a PIC, ON and OFF.
    You will see that LED will not fully turn OFF.
    And for the subject, our friend should use NPN, or for the easniness, use ULN2003, ULN2803.
    The LED *does* turn off ! (ie the PNP tranny is working as I intended/required - real world, not simmed or theorized!) .....ie at a PWM duty cycle of value 255 the LED is visibly off (at a duty cycle value of 250 the LED light is just detectable...the LEDS continue to get brighter all the way to a duty cycle value of 0)

    Re using an NPN....how would that slot into my needs of having a PIC sink the current per LED (in otehr words the suply voltage to the LED anodes needs to be commonised - how to switch that common voltage with an NPN?).

    re using the ULN2003...I have no extra space available! (that's why I want to use a single, SOT23 SMT tranny to switch the 9V to the LEDS)
    Last edited by HankMcSpank; - 22nd March 2011 at 12:21.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Sinking current from 9V into a PIC pin.

    Quote Originally Posted by HankMcSpank View Post
    Re using an NPN....how would that slot into my needs of having a PIC sink the current per LED (in other words the supply voltage to the LED anodes needs to be commonized - how to switch that common voltage with an NPN?).
    ? ? ? Swap the emitter and collector so power flows in correct direction, then invert PWM values (or not), transistor now conducts on positive instead of NEG. Keep those digital transistors, which are avail. from Mouser in mind to save board space too, they are equipped with internal bias resistors for logic level switching, and they are still very small footprint.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Sinking current from 9V into a PIC pin.

    Any base-emitter pair can only be a diode drop apart if the device is working. So, if the emitter is at 9V then the base is at 8.4 V or so. This means that either the PIC RC5 pin would need to be above 8.4V, or tri-stated to an open circuit to turn the transistor off. At 5V or 0V, the transistor is on. So you must be changing the tri-state, not the value (0,1) of the pin.
    The problem with this is that all of the pins are briefly exposed to 9V, albiet through current limiters. Maybe the device has a sense of humour about this, maybe not. If you are making a hobby toy for yourself - have at it. If you are making a product, do the support folks a favour and do a little reading about transistors.
    You have not shown us your code, or which device you are using so we are guessing here, but rest assured the concerns are valid. Just because it *appears* to work, does not mean it still will next week.

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Sinking current from 9V into a PIC pin.

    This is the point where Hank asks for a large dose of humble pie...obviously at some stage in my frenetic breadboarding activity (moving wires around all over the shop), I've actually got 5V going to the PNP emitter (not the 9V I thought was on there).

    Just to prove the point...I put 9V on the emitter...the PIC lived, but the LEDS didn't turn off when the duty cycle went to 255.

    You're all vindicated! (not that I ever doubted you!)

    Charlie...this is just a hobby.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts