PWM Level Shifting

Discussion in 'Homework Help' started by El-Papo, Jun 23, 2014.

  1. El-Papo

    Thread Starter New Member

    Nov 28, 2012
    I am working on a project where I would like to level shift a PWM signal, from a microcontroller I have ether a 5v or 3.3v (not super stable voltage) 1kHz PWM signal, this I would like to shift to a voltage from a stable and precise reference (2.048v, 2.5v or other) then it goes through a R/C Filter so I get a smooth stable analog output.

    The part I can’t figure out is how to level shift a PWM signal so it can be used in an R/C Filter
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    I am probably missing something, probably a lot of something. However, it sounds to me like you actually want a DAC.
  3. crutschow


    Mar 14, 2008
    Use the precision voltage to provide power to a digital switch such as a logic-level N-MOSFET inverter, which is driven by the PWM signal. The output of this circuit will then be the PWM signal with an amplitude equal to the precision voltage. You could also use a CMOS inverter/buffer if the precision voltage for its supply is at least 3V.
  4. dougc314


    Dec 20, 2013
    In general a level shifter is an adder, that adds to, and possibly scales another voltage. What you really want is a circuit that puts out a more precise pulse train, that is independent of the voltage logic levels of the micro-controller.

    A comparator can do that.

    What they do is compare the input against a reference and then put out one voltage (Usually power V+) or another (usually power V-, or ground), depending on whether the pos input is higher or lower than the input. In your case you almost could run an appropriate comparator off of your desired out voltage and ground. I say almost because you want as low as 2.048 Volts, and that is pretty low as a VCC for most comparators to work well.

    What you could do instead, and depending on your desired is run the comparator off a higher precision voltage and divide the output with a resistor divider. The R parrallel value of your Rs can be the R part of your R-C filter. The LM761 is just one of a huge number of potential comparators.

    Attached is a suggest schematic, although don't pay to much attention to the actual comparator part number, I just used it for it's symbol. In this case R4 and R3 divide 5V to 2.048V. You could use about 240K for R3 and a 250K pot connected as a variable resistor for R4, and then measure exactly 2.048 when the input signal was a steady high, or set for 1.024 with 50% duty cycle.

    I didn't show the C but it would go in parallel with R4. The "R" is the parallel combination of R3 and R4.