0

I have ldr module with 4 pins 1. Vin 2. Gnd 3. AO 4. DO

I want to know how can i take advantage of DO suppose i want to turn on lcd display when light falls on the ldr sensor!

enter image description here I have noticed when light falls on ldr sensor the Green led with DO written next to it lights up.

asked May 12, 2020 at 22:53
5
  • I bet if you look where you bought that little board from they have some sort of instructions on how to use it. They usually do. Commented May 12, 2020 at 23:10
  • I bought it long time back i dont even remember now :( Commented May 12, 2020 at 23:37
  • it is digital out ... do some experimenting Commented May 12, 2020 at 23:54
  • So go look online for a similar one. Check and see if it has some numbers or something on it that you can google. Be smart about this. Commented May 13, 2020 at 0:14
  • what is the problem? wire and code it as button Commented May 13, 2020 at 5:11

1 Answer 1

1

The DO pin gives a Digital Output that is HIGH when the light falling on the LDR is above a threshold, and LOW when it's below a threshold. Just connect it to a digital input pin and read that pin with digitalRead().

You can change the threshold by adjusting the small blue trimpot.

answered May 13, 2020 at 9:22
2
  • fwiw, this is problematic because the LDR can get "accustomed" to a light level and change responsiveness, so the threshold adjustment won't always keep the same objective light level (lux) setting as a trigger level, but it should be enough for "is it light or dark". It would be better done in software, so you can work around such fatigue and surging values from the LDR with debouching, self-calibration via computed averages, and actually seen high/low values as a min/max. Commented May 13, 2020 at 16:43
  • @dandavis, for that there is AO (analog output). but why would one buy a module for LDR and one resistor. Commented May 14, 2020 at 4:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.