LDR showing constant value

HI !
I was performing a project on light monitoring system but my sensor LDR is showing same value-5 throughout in the line graph.
LDR one leg to 5V second leg to A0 pin
an 330 OHM one leg to GND and another to A0.

CODE configuration

Hi, try another connection as given below:

LDR one leg to 3v3 pin and another one in A0 pin
and take resistance of 10k ohm.
And also make sure that in coding section the line ‘plotChart(“time_stamp”,“variable_name”);’ should have correct variable name(which you gave in hardware section tab). you can check the variable name given in right side of the page.
Hope it would help you.


Can you share a clear pic of the connections that you have made? Also share the code that you have written in the product configuration setup?

You can upload the images over google drive and share the link here.

follow the steps:
1.make the connections were right
2.while creating product select input and GPIO
3.select analog pin and name it and in code section write the code and save it
4.link the bolt wifi module to that product
5.In devices click deploy the code
6.It shows the notification whether the code is deployed or not
If the above process doesnt work try to repeat again from step 1
(For different values try to show the some flash from you phone to LDR sensor)

This all steps I have done my question is it’s showing constant 5 value everytime.why so?


Are you using the 10k ohm resistor in the above circuit?

No i am using 330ohm resistor which came with the bolt IOT kit.


I think the resistor that was used in this case was the one with brown black orange color code as mentioned in the hardware connections part in the course. I too had the same problem having a constant value of 1.02 at every single refresh but when I went for the one other resistor, the Orange orange brown one (also provided in the kit) just to explore its effects on the circuit, I was successfully able to witness some noticable changes(values shown were in between 800-900) in the values on refreshing the table.

Hope this was helpful :slight_smile:

1 Like

I too have used that one included in the kit orange orange brown code resistor.

I think your graph is a straight line because you did not vary the intensity of light in your room, try putting different lighting in front of your sensor and I hope it will give some variations in your graph.

Well this is very obvious I tried varying the intensity with Mobile flash and even in sunlight


Can you use the 10k ohm resistor as the as per the instructions?


I’ll get back to you on this by tomorrow EOD if the issue still persists. We might have to get on a screen sharing session.

Did you try replacing the ends of the “Resistor”
For example A_B is the terminal currently, try doing B_A

Hope this helps :slight_smile:

I have used the 10K ohm resistor and made the connection to breadboard this time the value changed from 5 to 6 but then again it droped to 5.
Refer the graph below

Please make sure all connections are taken good, and if you don’t mind you can make connections again and deploy your configuration. Please don’t put it in one place…Change them according to the light variation places

This might me happening because you are not exposing the LDR to different light intensity and are keeping it in same light intensity throughout. Try changing the angle of LDR to light source and you will observe different values.


The connections should be like this :point_down:
3.3v - LDR - a0 Pin - 330 - gnd.

  • If u are getting the constant value you better place your finger on LDR sensor and collect the data and remove your finger and do this for some time u can see the changes in the graph.
  • or LDR must be focused to a bright light for his case u can turn on your flash on your moblie phone for better experience you can switch off lights in your room and focus the flash on LDR. hope u can definetly find the solution for u problem.

thank you

Don’t know if this is the cause of LDR failure, but your circuit may have a basic flaw: Too much current can flow.
You may have to make the circuit again and rewrite the code, also because with a lower supply, your circuit will be less sensitive.