Yahoo Groups archive

AVR-Chat

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

Message

Re: Using a capacitor to convert PWM to a voltage

2012-10-01 by raoul.palma

--- In AVR-Chat@yahoogroups.com, Philippe Habib <phabib@...> wrote:
>
> I need to generate a 0-10V signal to control some dimmable LED
drivers.  I know I could do it with a DAC, but I think I might be able
to save a part by generating a PWM signal and smoothing it out with a
capacitor to make a voltage out of it.  My problem is, I don't know how
to properly size the capacitor to get a reasonably smooth signal.  The
output would change slowly.  A full 0-100 or 100-0 transition would take
at least a minute and usually many minutes.
>
> Can someone provide some guidance about how to size the capacitor and
what type of capacitor is best suited for this type of thing?
>
> Thank you.
>

All the previous suggestions will like drive you crazy if you try get
them working !  You can not "save a component" and have a decently
working circuit.

-) First off, the nature of an LED is that it is a current-driven
device, not a voltage driven one. Trying to drive it with voltages is
harder than driving it with currents.

-) A nice and simple single IC DAC is very easy to design into a circuit
and even simpler to program with an MCU. It's best that you toss the
PWM-driving idea. This is why Atmel includes a ADC on some of there
MCUs, but never a D/A.  it's very easy to implement externally.

-) You're going to need a signal amplifier. That can be a nice simple
CMOS opamp. Trying to use a single transistor as a signal amplifier will
likely to drive you crazy, too. Transistors are very nonlinear devices,
but you need a linear amplifier. Even the cheapest, simplest, lowest
bandwidth, low-power opamp circuit excels at this. An opamp I've used
with great success is the National Semiconductor LMC6482AIM dual CMOS
opamp.

-) The opamp signal amplifier circuit can take the voltage output from
the DAC and, with just a few resistors, output a linear current
amplifier. Since your LEDs are driven by a "high" voltage, a suitable
low power "drive transistor" should be part of the opamp
voltage-to-current signal amplifier.
  [277]
The DAC drives the current amplifier and the current amplifier drives
the LEDs.
  [389]






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

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.