12V PWM to 5V PWM converter

Discussion in 'Automotive Electronics' started by sujith.g, Nov 14, 2015.

  1. sujith.g

    Thread Starter Member

    Jul 7, 2015
    48
    0
    12-5PWM.png Hi All,

    I am currently working on an automotive application. I need to convert a 12V PWM signal sent from the ECU to a 3.3V PWM signal. In other words I need to level shift the PWM signal as my controller operates in 3.3V. Can I just use a NPN transistor where I feed 12V PWM signal to base and use a 3.3V collector voltage so that I get a 3.3V PWM output. Please correct me if I am wrong. Please see my attached circuit.
     
    Last edited: Nov 14, 2015
  2. PeterCoxSmith

    Member

    Feb 23, 2015
    148
    38
    Your circuit will invert the signal.
    You could use a non-inverting buffer like MC74VHC1GT50. The input will need a voltage divider to limit the swing to safe level.
     
  3. sujith.g

    Thread Starter Member

    Jul 7, 2015
    48
    0
    Hi Peter,
    Thanks for the reply. What if I could correct the re-inverted output in software logic. I am only concerned if we can feed a 12V PWM input to the base of a npn transistor. The chosen transistor is BC817. Actually we have a space constrain on our board so a transistor would take the least space. However reliability is our priority.
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    Your circuit will be fine, if you do the PWM inversion in software, but I would increase the value of R1 to somewhere in the 1k to 10k range.
     
    sujith.g likes this.
  5. PeterCoxSmith

    Member

    Feb 23, 2015
    148
    38
    Depends what the 12V PWM can drive. Can it supply the base current? Also depends what the 3.3V PWM is used for, whether you can invert it in your application. The buffer is a tiny chip no bigger than a transistor; so no problem with size. Buffer Timing may be better than the transistor which has passive turn on/off characteristics.
     
    sujith.g likes this.
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    What is wrong with the obvious?
    299.gif
     
    sujith.g, panic mode and JoeJester like this.
  7. sujith.g

    Thread Starter Member

    Jul 7, 2015
    48
    0
    Hi Mike,
    Thanks for your reply. This was my first thought. But since it would be an automotive application, there is a possibility that the 12V PWM signal coming from the ECU of the vehicle may fluctuate. In that case the output after the resistor divider may in turn fluctuate beyond 3.3V which may damage the 3.3V microcontroller IC that is receiving the signal. The microcontroller receiving the PWM operates on 3.3V.
     
    Last edited: Nov 14, 2015
  8. sujith.g

    Thread Starter Member

    Jul 7, 2015
    48
    0
    Hi Alec,

    Thank you for the reply. So I might as well proceed according to your suggestion. :)
     
  9. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    12V to 3V3 Pwm Converter_ScottWang.gif
     
    sujith.g likes this.
  10. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    783
    You could also add a second transistor stage to invert it back again.
     
Loading...