AXE to control volume level of LM386?

BeanieBots

Moderator
Jez, can't see anything wrong with your circuit except what you are already of, 50%(or some value) to 100%. What's so wrong with 0% to 100%?

Well done Boriz for actually trying it out and publishing the results.
Can't say that I agree with your comment about PWM though.
Using PWM is a good, efficient, digital solution to power control problems. I think smoothing it before it does any work is a step in the wrong direction. Better just to use higher frequencies I think.
Absolutely nothing wrong with smoothing/filtering if/when it does what is required.
 

Jeremy Leach

Senior Member
Great analysis ...that settles it then ;) Can you say the duty steps for the diff freqs if you've got them to hand? The white LED/ dab paint tip is great too - thanks.

(BB, in my second diagram I was just thinking that sometimes you might want to only change the bightness & LDR resistance over a certain range, and this circuit might allow you to use the full range of duty values to cover this limited range)
 
Last edited:

boriz

Senior Member
40KHz = 100 steps (1% each step). Doubling the frequency halves the number of steps. So 80KHz = 50 (2% steps) and 20KHz = 200 (0.5% steps). It’s all in the PWM wizard. Set the duty to 100% and the last number in the generated PWMOUT statement is the number of steps available at that frequency.
 

Jeremy Leach

Senior Member
I was being lazy, thanks ! Just another thing to say re my analogue approach: could always bung a transistor in too, so the cap wouldn't have to be large. But then the component count goes up. But the advantage I can see of doing this, is that I think you could get very very low ripple and more steps. Not sure how the cost and steps compares to digital pot either. Depends on the overall requirement.
 

boriz

Senior Member
I just built and tested a white LED version. Dunno the mcd figure, but certainly many thousands. Ran the same tests.

Using a 270R LED ballast resistor (about 6.5mA LED current), I measured LDR at about 270R for 80% duty and about 1K5 for 5%.

Using a 1K LED ballast resistor (about 2mA LED current), I measured LDR at about 500R for 80% duty and about 3K2 for 5%.

Because of the lower resistances, I used 1k for the bottom leg of the divider. I’m getting consistently higher ripple across the whole spectrum. I think it might be coz the more modern LED has a faster rise time. The difference between the ripple amplitudes for 80% and 5% was more pronounced than for the older red LED, probably because the phosphor afterglow spreads out the fall time, but not the rise time.

LDRs seem to react quickly at the leading and falling edges of light change. More quickly for the leading edge. The ripple amplitude seems to be coupled much more closely to the frequency than the intensity. A bit like a high pass filter. This would indeed make them suitable for optical RPM meters and such. Yes they have a sort of memory effect causing them to take a while to stabilise at their final value, but they are actually quite fast at reacting to step changes.

For audio modulation/attenuation, 40KHz or more should be fine.
 

BeanieBots

Moderator
This is very good work Boriz. So refreshing to have somebody actually trying things out for real and not just stuffing it in a simulator and stating "it works, my job here is done."
While you're in the mood for trying things out, how about taking it to the next step and trying it out on audio. If willing, you could compare the LDR option with the RC->FET option for ACTUAL audio quality.

There might be some surprises yet to come. For example, once the LDR is put in place as part of a potential divider, the voltage across that divider will be changing (with the music) and hence, so will the current through the LDR. This may have an effect on the characteristics of the LDR. I don't know except to say I have been caught out by similar events with semiconductor devices. eg diode recovery rates.
 

Jeremy Leach

Senior Member
LDRs seem to react quickly at the leading and falling edges of light change.
Here's a quote out of that link I gave earlier, that's interesting..
AOIs (Analog Optical Isolators) are not high speed devices.
Speed is limited by the response
time of the photocell. With rise and fall times on the order of 2.5 to
1500 msec, most AOIs have bandwidths between 1 Hz and 200 Hz

One of the characteristics of photocells is that their speed of response
increases with increasing levels of illumination.1 Thus the bandwidth of
Vactrols is somewhat dependent upon the input drive level to the LED.
In general, the higher the input drive the wider the bandwidth.
The turn-off time and turn-on time of photocells are not symmetrical.
The turn-on time can be an order of magnitude faster than the turn-off
time. In the dark (no input), the resistance of the cell is very high,
typically on the order of several megohms. When light is suddenly
applied, the photocells resistance drops very fast, typically reaching
63% (1-1/e conductance) of its final values in under 10 msec.
When the light is removed, the resistance increases initially at an
exponential rate, approximately tripling in a few milliseconds. The
resistance then increases linearly with time.
The fast turn-on and slow turn-off characteristics can be used to
advantage in many applications. This is especially true in audio
applications where a fast turn-on (attack) and a slow turn-off (release)
is preferred. For example, the typical AOI can be made to turn-on in
100 to 1000 μsec. In a limited circuit this is fast enough to catch high
peak amplitudes but not so fast as to cause obvious clipping. The turnoff
will take as much as 100 times longer so the audio circuit will return
to a normal gain condition without a disturbing “thump” in the speaker.
 
Top