0

I am doing a project with Arduino, making a synthesizer, in which an LDR is used.

Before connecting the Arduino to a power source and use the project, do I need to calibrate the LDR like it is explained in Arduino website ?

asked Feb 19, 2020 at 14:00
1
  • 1
    Either pick some values and hopes if works in most cases. Or have the software keep track of the minimum and maximum values, and use that to 'scale' the light input to a normalize range. You could have the user do a "calibration" routine before using it, by putting their hand over the sensor, and removing their hand completely, and thus getting the max and min values. Commented Feb 19, 2020 at 16:22

2 Answers 2

2

An LDR is a pretty inaccurate device. It just gives you a number which relates to darkness or brightness. How do those numbers relate to darkness and brightness? Well, only in a very vague way. All you can really say with any confidence is that bigger numbers mean brighter light, and smaller numbers mean darker darkness.

Even after "calibration" the numbers are pretty meaningless in any real-world sense.

All the "calibration" does is give a rough guide to the range of the numbers produced in any given lighting situation. It's then up to you to program your sketch in such a way that it works within the ranges of those numbers.

And yes, those numbers will change depending on the current lighting situation.

You could incorporate some form of "calibration" routine in your sketch to adjust any relevant values and calculations, or you could just provide some interface for tweaking values. Or your system may just really not care. It's impossible to know until you actually start creating your system.

answered Feb 19, 2020 at 14:12
1
  • 2
    A good example of this is if you want a program that detects when an object is placed over the sensor and blocks the light. In that case you wouldn't normally want to write the code such that it looks for some particular value that means darkness, because the number you get from a particular level of darkness changes. So instead of writing code to look for some particular darkness threshold, you would write the code such that you look for large negative changes in the reading. Maybe anytime it changes by more than a certain amount in some short time consider it covered. Commented Jul 18, 2020 at 19:59
1

My application was a little different. My illumination/light source was fixed (and exact). I compensated the sensor for temperature. The results I obtained were very exact and repeatable.

Here are my temperature compensation results.

Temp Compensation of LDR sensor

answered Oct 22, 2022 at 12:32

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.