Electronic – arduino – LDR circuit does not change sound frequency

arduinoldr

I am a complete beginner in the field of electrical engineering. In the Arduino cookbook, there is this circuit:

I have been trying to reproduce it, and I do hear a sound after uploading the software, but it does not change at all regardless of the light intensity. I think I got buildup right, but I did not have a 4.7k resistor, so I used one with 3.3k (problem here?).

Here is a schematic of how I put the lower part together (I assume the upper part is not the problem, otherwise I probably would not be hearing anything); please excuse my poor drawing skills.

schematic

I would appreciate a hint on why this is not working as expected. Thanks in advance.

Best Answer

There's no such thing as a generic LDR. They're available in a wide range of resistances. This one varies from 30k\$\Omega\$ to 5M\$\Omega\$, while this one varies between 11k\$\Omega\$ and 150k\$\Omega\$. They will give you a completely different output range, which the software may or not may detect properly.

The first one will give a voltage between 3mV and 0.5V. If you have an LDR like this the output voltage may be too low.
The second one, on the other hand, will give you a voltage between 0.1V and 1.15V, which is already a bit better. A 4.7k\$\Omega\$ resistor will raise this to 1.5V.