In this tutorial we will see how to use photo-resistor to measure light intensity. For this you will need

  1. Arduino,
  2. Breadboard,
  3. Jumper Wire,
  4. 10K ohms Resistor,
  5. Photo-resistor.

A photo-resistor is a light-controlled variable resistor. The resistance of a photo-resistor decreases with increasing incident light intensity

An analog input converts a voltage level into a digital value. This is circuit diagram make sure it is align in same column. In this circuit diagram we are using voltage divider. A voltage divider is a passive linear circuit that produces an output voltage that is a fraction of its input voltage. Here input voltage is 5V and two resistor are connected in series. One resistor which is fixed 10k ohms resistor. And other is photo resistor which is a light-controlled variable resistor. When light intensity changes the output voltage changes.

Sketch:
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorvalue=analogRead(A1);
Serial.println(sensorvalue);
delay(100);
}
Explanation:

This is Serial.begin (9600) it will create serial connection with Arduino. By this Arduino can send text output.

Serial.begin(9600);

AnalogRead(A1) which will get reading from socket A1. And Store it to local integer value sensorvalue.

int sensorvalue = analogRead(A1);

So whatever A1 get output we will print it through serial.println(sensorvalue). Println will create sensor value in new line.

Serial.println(sensorvalue);

If you use serial.print(sensorvalue) without ln it will print sensor value in the same line. Time delay is in millisecond which is time between each sensor value is printed.

Upload the sketch. Go to tools and serial monitor. Now you can see values.

If i keep my finger it on sensor it will change value. So your values may be different because of lightning condition.

Till then keep learning keep making.

Categories: Arduino

1 Comment

Control Brightness of LED using Photo-resistor – Robotica DIY · July 19, 2019 at 5:05 pm

[…] In this tutorial we will see how to interface photo-resistor sensor with LED light and Control Brightness of LED using Photo-resistor. You can read previous tutorial on photo-resistor with Arduino. […]

Comments are closed.