Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: OpenDrain with high voltage

  1. #1
    Junior Member
    Join Date
    Jun 2021
    Posts
    2

    OpenDrain with high voltage

    Hi everyone,

    I did not find my answer on the forum or I did not understand exactly the others posts that are talking about this, so here I am.

    I have a teensy 3.5 and need to control a 10V output with PWM. I tried using a PNP transistor but what I did does not work, I already have bought the PCB so I can just make a few corrections (yes maybe next time I will think a bit more about what I do).
    Here is the schematics that I have:
    Click image for larger version. 

Name:	PNP alone.PNG 
Views:	21 
Size:	12.8 KB 
ID:	24976

    Currently the output is always to 10V, I think the 3.3V of the teensy are not enough to make the transistor commutate.

    My idea would be to add a pull-up resistor to the input of the transistor and to control the pin with the open drain mode. As I understood, the open drain mode allows to use a different voltage than 3.3V, as long as this voltage is supported. Do you think that the teensy will support 10V on one GPIO with the OUTPUT_OPENDRAIN mode? If not, do you have any idea that could save me? ^^'
    Here is the schematics that I would have:
    Click image for larger version. 

Name:	PNP with Pull-up.PNG 
Views:	19 
Size:	13.3 KB 
ID:	24977

    Thanks!
    Alexandre

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,482
    Quote Originally Posted by Alexandre T View Post
    As I understood, the open drain mode allows to use a different voltage than 3.3V, as long as this voltage is supported. Do you think that the teensy will support 10V on one GPIO with the OUTPUT_OPENDRAIN mode?
    No, definitely not. The pin is 5V tolerant. It's not 10V tolerant!

  3. #3
    Junior Member
    Join Date
    Jun 2021
    Posts
    2
    Okay, good thing I asked before trying then.

    Thank you!

  4. #4
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,003
    I'm curious - is there some amount of series resistance where a teensy 3.5 output does become 10V tolerant?

    You could add a diode to limit the voltage seen by the teensy pin.

  5. #5
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,112
    I wouldn't have expected a PNP to be useful for level conversion to a higher voltage - NPN common-emitter inverter
    circuit is what's used - in other words low-side switching. Since BJTs turn on at around 0.65V, 3.3V is plenty, just
    set the base resistor so that the base current will be about 5 to 10% of the desired collector current.

Posting Permissions

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