Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Re: Using a capacitor to convert PWM to a voltage

2012-08-20 by Philippe Habib

Are you saying that I'd do better with the capacitor/resistor combo and a FET than by using a FET to amplify the 0-5V signal out of my DAC?

Cost wise, its not a big difference either way.  Going with a DAC, I'd use a tiny24 to drive a SPI DAC, to get 4 ch of PWM, I'd have to get a bigger part that has the 4 ch of PWM available for more money, but I would skip the DAC and spend that money on a bigger micro.



----- Original Message -----
From: "Jim Wagner" <wagnejam99@comcast.net>
To: AVR-Chat@yahoogroups.com
Sent: Monday, August 20, 2012 3:53:20 PM
Subject: Re: [AVR-Chat] Re: Using a capacitor to convert PWM to a voltage

Some of the brick LED drivers I have used have pretty "stiff" control inputs. BuckPuck is one. Not much current at the high voltage end, but quite a bit (several milliamperes) at the low voltage end. Do not assume they are anything like a high impedance. 


A "single transistor" is very unlikely to give you good results. First, it won't get closer to ground than around 0.3V. Second, its output impedance is likely to be pretty high. And, mediocre linearity (wasting a lot of DAC resolution). Op amps won't do much better because of "rail issues" unless carefully designed. 


A PWM'd FET could get you a long ways in this, pretty low cost, also. 


Jim 

----- Original Message -----
From: "Philippe Habib" <phabib@well.com> 
To: AVR-Chat@yahoogroups.com 
Cc: AVR-Chat@yahoogroups.com 
Sent: Monday, August 20, 2012 3:41:56 PM 
Subject: Re: [AVR-Chat] Re: Using a capacitor to convert PWM to a voltage 






Yes, I knew about that. My plan is to have a 0-5V DAC and a transistor with a gain of 2 as a buffer to drive the LED driver's input. 

Thanks for taking the time to point out some stuff I might not have been thinking of. 

----- Original Message ----- 
From: "Jim Wagner" < wagnejam99@comcast.net > 
To: AVR-Chat@yahoogroups.com 
Sent: Monday, August 20, 2012 3:39:53 PM 
Subject: Re: [AVR-Chat] Re: Using a capacitor to convert PWM to a voltage 

You won't get 10V from a 5V DAC! It will need a 10V reference. 

Jim Wagner 

----- Original Message ----- 
From: "Philippe Habib" < phabib@well.com > 
To: AVR-Chat@yahoogroups.com 
Cc: AVR-Chat@yahoogroups.com 
Sent: Monday, August 20, 2012 3:19:50 PM 
Subject: Re: [AVR-Chat] Re: Using a capacitor to convert PWM to a voltage 

Thanks Don, 

In my case I'm supposed to drive a commercial LED driver's input 0-10VDC control voltage. Since the input impedance of the LED driver bricks will no doubt vary between manufacturers and probably even models from the same manufacturer it sounds like I'll be safer by using the DAC and spending the extra buck. 

----- Original Message ----- 
From: "Don Kinzer" < dkinzer@gmail.com > 
To: AVR-Chat@yahoogroups.com 
Sent: Monday, August 20, 2012 3:14:40 PM 
Subject: [AVR-Chat] Re: Using a capacitor to convert PWM to a voltage 

--- In AVR-Chat@yahoogroups.com , Philippe Habib <phabib@...> wrote: 
> Can someone provide some guidance about how to size the capacitor 
> and what type of capacitor is best suited for this type of thing? 
You need a resistor in addition to the capacitor. The values for the R and C to get good filtering will vary depending the chosen PWM frequency and the impedance of the load. (The PWM signal puts charge into the capacitor during the on time and draws it out during the off time; the load draws charge out of the capacitor.) 

In order to calculate acceptable values for R and C, one would need to know the PWM frequency, the load impedance, the desired responsiveness and the allowable error voltage. For a one-off project, it may be simpler to try some values and determine what works well enough. For example, for a 1KHz PWM signal you might start with 100 ohms and 10uF. An oscilloscope would be useful to be able to "see" the resulting signal. 

Don Kinzer 
ZBasic Microcontrollers 

------------------------------------ 

Yahoo! Groups Links 

[Non-text portions of this message have been removed] 

------------------------------------ 

Yahoo! Groups Links 




[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.