Hi everyone.
I've received my Arduino this morning and I'm already having some amazing results. I'm a sound artist and my electronics knowledge is next to none, however I'm surprised how easy it is to implement some very powerful interactivity features into my work! Top stuff!
Spec:
Min. resistance @ 10lux: 9k[ch937]
Max. resistance @ 10lux: 22k[ch937]
Typ. resistance @ 100lux: 7k[ch937]
Dark resistance after 1 sec.: 0.05M[ch937]
Dark resistance after 5 sec.: 0.15M[ch937]
It works, however the readings I'm getting in Pure Data (using Pduino) are of incredibly low values! Something like 0.001-0.020 when lit with flashlight from about 1-0.5 cm distance. I bump it up digitally (multiply by 1000) to get higher numbers, but then I'm getting horrible step increments. Is there a way to increase sensitivity of this component? Or is this a software configuration issue?
I'm using a 1k resistor in the chain. Could this be an issue?
Did I get a wrong type of LDR?
By the way, I used a potentiometer as well and there the problem is that as I rotate it, it remains at 0 and I only get values to change at the last couple of degrees. So it quickly changes from 0 to 0.956 or something. Hmm...
I think I've solved the mystery. It wasn't a component-related issue, I had it all connected the way you suggested. So I've decided to give SimpleMessageSystem a go instead of Pduino, just to see if it makes a difference...
Now I'm getting correct values! Both the LDR and the potentiometer now transmit values within a full range of 0-1024! 10-bit! Excellent stuff!
The only thing I'm not very happy with is latency (I guess that's due to value sampling rate or something) - if I twist the knob rather quickly, values jump in huge steps. Like 0-100-300-600-1000-1024 (6 steps). Is there a way to smooth value changes? I've implemented a workaround within Pure Data, but it's not very responsive (values change smoothly, but with a noticeable delay, so not ideal for real-time audio applications). Anyway, I guess I shouldn't be complaining. It's only set me back £20 to build this interface. I can certainly live with that...
Any smoothing will introduce latency, it's a matter of balance. You can smooth with software Arduino Playground - Smooth or with hardware by putting a capacitor between ground and the analogue input.