LDR's are slow. IIRC the response time is on the order of 10 ms. Is that right?
What I wonder is if one will "blend" PWM signal into a smooth-ish analog output or if the response is close to the input only like 10 ms later? Would the ripple filter out with just a cap and a resistor kind of easy?
I don't have a lot experience with LDR, but I guess they are slow in their change in resistance due to illumination. They are still linear Ohmic resistors for a given illumination, though.
If you are looking for a passive that acts "slow" in the sense you are looking for, you are looking for an inductor. You are essentially building a buck converter then.
How you smooth out PWM strongly depends on
the impedance of what you are driving (i.e., how much current do you need to supply)
the demands on how smooth the result has to be
the required speed for changing the voltage level
I recommend playing with a simulation. (The link points to an initial circuit that has not a lot to do with your project, don't be confused. It is just what the simulator starts with by default.)
Stefflus:
Not sure what you mean by slow and where a RC circuit fits
OP wants a smooth analog signal from PWM, as far I understand.
An RC circuit can be used for that, but has the disadvantage that it cannot drive loads but works only with high impedance inputs, and it is slow in changing the voltage level. Both will also apply to your interpretation of the LDR circuit.
We really need to know what the OP expects. Eventually, I2C DAC are cheap.
Sorry but this would be an I thought cheap & easy way to smooth PWM led flashing and maybe get close to no ripple. The cap and resistor would be to flatten the ripple, that's about how much filter I know off the top of my head.
But when controlling power comes up I get to realize that it'd only be good for low power if that, FETs should be ON or OFF.
Yes I could cookbook a filter to smooth PWM. It'd only take how many components to make a smooth signal I'd use to control a BJT and maybe run a small DC motor without using an H-bridge.
The I2C DAC sounds way better than my Rube Goldberg fantasy anyway.
But when controlling power comes up I get to realize that it'd only be good for low power if that, FETs should be ON or OFF.
Yes I could cookbook a filter to smooth PWM. It'd only take how many components to make a smooth signal I'd use to control a BJT and maybe run a small DC motor without using an H-bridge.
The same is true with a BJT. You can use either one "linearly" (as a variable-analog device) but you end-up heating the device and wasting power. And... It takes more than one transistor or MOSFET to make a linear amplifier (such as an audio amplifier).
Most DC motor-speed controllers use (unfiltered) PWM.. Class-D audio amplifiers and switching power supplies/regulators use high-speed switching, similar to PWM, but with inductive or L-C filtering after the transistor/MOSFET.
The I2C DAC sounds way better than my Rube Goldberg fantasy anyway
DACs are low-current so you'd still need an amplifier to drive a motor. I've never actually seen a "motor amplifier", but it's probably been done.
Back to your LDR question... If you are "feeding" the Arduino ADC you can use [u]Software Smoothing[/u].
Very small motors don't usually draw much current but I'd rather not waste.
Now that I think of it, even the ULN280x circuits I've seen are full ON or OFF. I have Paul Bergman's book from the 90's, bought it from him at a Trenton Fest workshop.
I know a good bit about H-bridges through an article series named H-bridge secrets. If I read it a couple more times I might pick up more on the control modes, so far I've worked through the one that cycles collapsing coil current back into the motor during PWM LOW intervals (instead of draining through the protection diodes the whole time).
It'd still be data to know if LDRs have a kind of response inertia even if I have no app. So far all I know is "response" time.. if that's the max output change then hey, isn't that how fast it can ripple? In that case I dunno how a steady 500 Hz PWM could make any ripple in the output at all. A steadily changing PWM, yeah I can see how it could.
Have none-a-yinz ever just wanted to know something?