3v3 PWM to 0-5V analog out

Status
Not open for further replies.

Cicero

Active Member
Anyone got any clever ideas as to how to do this elegantly? Everything I come up with seems too bulky.

I should add: And try keep it as linear as possible.

PWM @ 30-40kHz
 
Last edited:
Is this close enough?

The graphs are for PWM duty cycles of 10% to 90% at 10% intervals.
 

Attachments

  • LevelShiftedPWMtoVoltage.asc
    1.6 KB · Views: 112
Ah nice Alec - that'll work. I had a similar version, but I think my cap was too big because it didn't work very well.

I tried an opamp version, low pass into amplifier, but unless its properly rail to rail you lose a lot.
 
Here's an alternative, giving a better approximation to linear :-
 

Attachments

  • LevelShiftedPWMtoVoltage2.asc
    1.4 KB · Views: 85
Go to a parts vendor and search for this:
logic translator OR logic level shifter

Attached is one I use. It is bidirectional which you don't need so ground the DIR pin.
They come 1/IC or 2, 3,4 8, or 16.
This one converts up or down but some only go one way. There are some that only do the 3.3 to 5.0 translation.
 

Attachments

  • sn74lvc1t45.pdf
    1.3 MB · Views: 137
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…