Why is my project not working?

I am not able to congifure.I tried twice.is my code wrong?

Hi @h.kanekar

Before plotting the graph, you have to set the chart library, chart type and chart title. Please try the below code and let us know if you still face any issue.

setChartLibrary('google-chart');
setChartTitle('Light Intensity Monitor');
setChartType('areaGraph');
setAxisName('Time','Light');
setCrosshair(true);
setAnimation(true);
plotChart("time_stamp","light");

I think this is your first project LDR, make sure your hardware connections are as per the instructions, please try again. I am sure it works.

Hi Hrishikesh,

I noticed your problem. It seems correct, but it’s essential to double-check your hardware connections.
Make sure the connections follow the sequence below:

  • 3.3v - LDR - A0 Pin | A0 Pin - 10k - GND
    or,
  • 3.3v - LDR - A0 Pin | A0 Pin - 330 - GND.

Warning: Also, ensure that the 3.3V and GND pins never touch each other. Provide a significant gap between them. If they get shorted, you’ll end up damaging the module.

There shouldn’t be any problem if it’s sorted correctly. You can try this code to get the result:

setChartLibrary('google-chart');
setChartTitle('Light Intensity Monitor');
setChartType('areaGraph');
setAxisName('Time','Light Intensity');
setCrosshair(true);
setAnimation(true);
plotChart("time_stamp","light"); 

Let me know the result.