# LDR value doesn't go above 10

**URL:** <https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453>\
**Category:** General Guidance\
**Created:** [April 4, 2025, 4:21pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453 "2025-04-04T16:21:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 4, 2025, 4:21pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/1 "2025-04-04T16:21:37Z")

</div>

I'm doing a solar tracker based on Arduino, but my LDR analog read values are always either 0 or very close to 0 (max 10), no matter the level of light. I have checked the wiring, code but can't find the issue.  
I copied configuration from here: [https://www.instructables.com/Arduino-Solar-Tracker/](https://www.instructables.com/Arduino-Solar-Tracker/)  
but without potentiometers (instead I made const dtime = 150 and tolerance = 20). My LDRs go like this: 5V -\> LDR -\> Ax (x number from 0 to 3) -\> 10kOhm resistor -\> GND. Just like in the link. Could you help identify where the issue might be?

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [April 4, 2025, 4:28pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/2 "2025-04-04T16:28:07Z")

</div>

First, make sure that you know how to use just one LDR (in a voltage divider) to make useful illumination measurements.

The resistor value is important and should be chosen to roughly match the LDR resistance in moderate levels of illumination.

[This tutorial](https://www.circuits-diy.com/ldr-light-sensor-arduino-tutorial/) is a fine place to start.

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [April 4, 2025, 5:20pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/3 "2025-04-04T17:20:12Z")

</div>

> [@kover9](#):
>
> Could you help identify where the issue might be?

His code is wrong.  
The pin numbers are A0, A1, A2, A3. not 0,1,2,3

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 4, 2025, 5:20pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/4 "2025-04-04T17:20:24Z")

</div>

So I have tried doing the tutorial and then started gradually adding more and more LDRs. I found that the more LDRs I had connected, the lower their readings became. For the same lighting level with 1 LDR it was around 500, with 2 around 300, with 3 around 110, and finally with 4 all readings became 0. It does not matter to which GND the wires are connected to. However now even after disconnecting 3 LDRs (so I have 1 connected right now) the readings are still showing 0. How can I solve this problem?

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [April 4, 2025, 5:20pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/5 "2025-04-04T17:20:53Z")

</div>

See post #3

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 4, 2025, 5:21pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/6 "2025-04-04T17:21:39Z")

</div>

I immeditely changed the analogreads from 0,1,2,3 to A0, A1, A2, A3 when adapting the code. The problem was still present

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [April 4, 2025, 5:23pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/7 "2025-04-04T17:23:59Z")

</div>

> [@kover9](#):
>
> How can I solve this problem?

- You could show us good images of your actual wiring.  
🙄

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 4, 2025, 5:26pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/8 "2025-04-04T17:26:51Z")

</div>

I removed all wires to test LDRs one by one. I made wiring the same as in the link in post #1 but without the potentiometer (and all wires connected to it).

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [April 4, 2025, 5:29pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/9 "2025-04-04T17:29:52Z")

</div>

You can't power servos from the Uno 5V out, they draw too much current.  
Disconnect the servos and put come print statements in the code and see if the LDRs work

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 4, 2025, 5:44pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/10 "2025-04-04T17:44:09Z")

</div>

Can Uno power 4 LDRs at the same time?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [April 4, 2025, 5:49pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/11 "2025-04-04T17:49:32Z")

</div>

Yes (unless you connect them incorrectly).

If connected correctly, they should need no more than about half a milliamp each.

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [April 4, 2025, 6:15pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/12 "2025-04-04T18:15:29Z")

</div>

Connect like this see if your code reads the LDRs

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/8/2/e/82e98377737e8694576082a299e5441856660cdf.png)

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 4, 2025, 6:38pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/13 "2025-04-04T18:38:58Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/9/e/b/9ebb3e25f6d75454a86014416ebf7993cec46a22.jpeg)  
Here is my wiring image. The gray wire is connected pin of all LDRs. It still outputs zeroes. Code I used to output is below:

```arduino
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}
void loop() {
  // reads the input on analog pin A0 (value between 0 and 1023)
  int analogValue0 = analogRead(A0);
  Serial.print("Analog reading0: ");
  Serial.println(analogValue0); // the raw analog reading
  int analogValue1 = analogRead(A1);
  Serial.print("Analog reading1: ");
  Serial.println(analogValue1); // the raw analog reading
  int analogValue2 = analogRead(A2);
  Serial.print("Analog reading2: ");
  Serial.println(analogValue2); // the raw analog reading
  int analogValue3 = analogRead(A3);
  Serial.print("Analog reading3: ");
  Serial.println(analogValue3); // the raw analog reading

  delay(500);
}

```

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [April 4, 2025, 6:56pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/14 "2025-04-04T18:56:10Z")

</div>

> [@anon95813201](#):
>
> The pin numbers are A0, A1, A2, A3. not 0,1,2,3

When you _analogRead_() and pass 0, it is interpreted as A0. Same with 1, 2 and 3.

I know instructables can be bad, but it would surprise me if they were so very bad that the published code had zero chance of being correct.

a7

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [April 4, 2025, 7:53pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/15 "2025-04-04T19:53:22Z")

</div>

> [@anon95813201](#):
>
> His code is wrong.  
> The pin numbers are A0, A1, A2, A3. not 0,1,2,3

No, the Arduino IDE also accepts channel number for analog inputs.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [April 4, 2025, 7:58pm UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/16 "2025-04-04T19:58:40Z")

</div>

> [@kover9](#):
>
> Here is my wiring image.

Where are the LDRs? Please post an photo of the entire circuit.

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 5, 2025, 5:29am UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/17 "2025-04-05T05:29:03Z")

</div>

> Please post an photo of the entire circuit.

I noticed that 5V wire fell out, but I fixed it immediately after and it didn't change results, still 0

 ![8abcd884-f133-4e02-b625-ae352286551e](https://europe1.discourse-cdn.com/arduino/original/4X/6/4/0/64079832010767e40c02e7b2d10b22d59286f814.jpeg)  
 ![5ef5a31c-6c3d-4425-97b2-199f367294c7](https://europe1.discourse-cdn.com/arduino/original/4X/7/c/e/7ce9822b13c13faf2738300d570877b7b76a38e4.jpeg)  
 ![29034e84-5529-4114-a290-93eb19621a04](https://europe1.discourse-cdn.com/arduino/original/4X/a/6/b/a6bcf35d61803c27843e4a5bf87ae82864ed2aab.jpeg)

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 5, 2025, 6:06am UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/18 "2025-04-05T06:06:54Z")

</div>

Hi, @kover9  
Welcome to the forum.

Do you have a DMM? (Digital MultiMeter)

Measure the voltage at A0, A1, A2 and A3 with respect to the the gnd.  
Also check that you have 5V at the grey wire on the protoboard and at the red wire behind the LDRs in your sensor assembly.

Tom.... 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![kover9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kover9/32/1126423_2.png) [@kover9](https://forum.arduino.cc/u/kover9)\
**Post date:** [April 5, 2025, 6:12am UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/19 "2025-04-05T06:12:48Z")

</div>

Hello TomGeorge, I don't have a DMM but I had some relative to check the board and LDRs and he said they worked. The red and grey wires are connected together as an extension, I didn't have any red wires left so I had to use the grey one

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 5, 2025, 6:22am UTC](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453/20 "2025-04-05T06:22:56Z")

</div>

> [@kover9](#):
>
> The red and grey wires are connected together as an extension, I didn't have any red wires left so I had to use the grey one

That's fine, you need to get an inexpensive DMM to help you, it is an invaluable tool.

Try this;  
Connect A0 to 5v and then to gnd, note the readings on the serial output.  
Do this with a jumper from A0 to 5V and gnd ON THE UNO.  
Then;  
Do it to the protoboard end of your wiring, that is the A0 wire to the 5V wire then A0 wire to gnd, all on the protoboard.

This will check the basic continuity between UNO and the board.

Hope that makes sense.

Tom.... 😃 👍 ☕ 🇦🇺

[Next page](https://forum.arduino.cc/t/ldr-value-doesnt-go-above-10/1370453.md?page=2)
