Hi,
[...] I found out the measurement can stand still (varying) for both the condition.
What do you man by "stand still (varying)"? Sounds like a contradiction
For while at the bright the measurement around 3 Kohm or 340 ohm at sunshine
It makes sense that you measure a range, rather than a single value, unless you can set up the bright condition to always be the exact same.
and while at dark sometimes 1,5 M ohm 6ohm (dark cabinet) but sometimes read as OL (over limit). I used the digital multimeter (automated one). Does anybody know why this condition happend ?
Just as with the bright condition, the amount of light hitting the LDR will vary when you change even the slighest amount of door opening etc.
Your DMM probably have a range of 2MOhm max. so when the value read gets above 2MOhm, it will display the overrange condition.
What I chose for the resistor value is 70k ohm because R = sqrt ( 3 k x 1.5 M). Is that right ? What will happend if we don't choose the correct value for the resistor
It should come to 67kOhm with
68kOhm as the nearest standard value
It won't matter much if you get it somewhat off, as the formula you used, finds the value that is an equal percentage from either values, which allow the largest discrepancies while still working as intended.
However...Before you settle for 68k, you might wanna re-measure, using the actual conditions that your 'bot will see. Assuming you're making a line follower, the LDR will be pointing towards the floor and see the light reflected off either light or dark lines/floor, which won't get to the extremes you measured (you aren't gonna run it inside a closed cabinet).
So keep the LDR in a position like it will be on the 'bot and with the same amount of shading from direct light.
Then take a piece of paper (or a light floor tile or whatever you're gonna run it on) and add some black duct tape and measure it "looking" down at both dark and light surfaces and both when in the brightest light it will see and in the dimmest light it will see, for a total of 4 values.
calculate the percentile mean for both the bright and the dim conditions and do it once more for the resulting two valuess - that way you get the best value for any condition you'll run it in.