Adjust LDR with potentiometer

How to adjust level of light detected by LDR with potentiometer. This LDR changes brightness of LED.

I attached schematic below. Is it correct???

Schematic.jpg

Unless you need a user to be able to alter a threshold in a finished produce (without re-programming) then you should alter the code to get the range you need. Use constrain to limit the range of returned values and map to map them to a different scale/range.

Do you want to change the value the led is turned on ? You can do that in a sketch. Do you want to get a much bigger range for very dark and very light ? Then I use Arduino pins to power the LDR via resistors. For example a pin with 1k and a pin with 100k. I simply average the result of both.

In your schematic, when the potentionmeter is turned to zero ohm, and there is very bright light on the LDR, there is no limit for the current.

If your goal is a potentionmeter to adjust the light for the led, then I would use a fixed resistor for the LDR and the potentiometer to an analog pin. Then you can change the curve between the potiometer and the led in every way.

Yes, that will work.

You might want to use an even higher resistance value for the potentiometer, and even put a fixed resistor in series with the potentiometer, so that you can't turn it down to zero.

Maximum sensitivity will occur when the resistance of the pot. is equal to the resistance of the LDR.

Take your multimeter, you do have one, and measure the resistance of the LDR under medium illumination. Pick the closest fixed resistor and use that in the ground of the LDR circuit. Now take your pot and connect one end to 5V the othe to ground and the wiper to another analogue input pin. Then your sketch reads the pot and the LDR and if one is bigger than the other you turn the LED on.

I’d say measure at maximum illumination and multiply the measured resistance by about 5 to 10,
what the eye sees as “medium illumination” could easily be < 5% of bright, which would give you
almost no resolution at high brightnesses. LDR’s response is roughly that the conductance
varies with illumination intensity (ie the resistance is proportional to the reciprocal of illumination).