This appeared in a discussion about exactly this
To do autocalibration, I was thinking that you would send a number of discrete voltage from the uP out to drive the LED in the LDR (via a resistor), and then measure the resistances of the LDR in order to map the characteristic curve automatically by using the ADC of the uP. The problem is that while your attenuator wants to be a log device (say 0 to -50dB), the DACs and the ADCs of your uP is linear (say 8 bit). So at the low current or low resistances end, you have poor resolution, and hence low accuracy due to quantisation. A multimeter with autorange, on the other hand, would have little problem covering say 50 ohm to 5kohm with 4 digit resolution. But once you have mapped, you could store the transfer function in a look up map, and then you know how much voltage would would need to drive the LED (with serial resistance) to achieve what resistance at the LDR.
And this:
I agree you need more than 8 bits precision which is why I suggested a cheap 16-bit sigma-delta type ADC.
You could also build the ADC in software using a comparator and counting the time it takes to charge a RC network. By wiring it in the right way you can linearize the log characteristic. It would be megacheap.
What do you think? My thoughts were that the main listening range of the vol control is not at the extremes so no need for extreme accuracy there. I thought in fact that the vol control could be a tailored one with less steps at low & high vol & most steps around the listening level.
This gets complicated when you get into it, doesn't it?