How to Use a Photoresistor

How to Use a Photoresistor

This little project will show you how to use a photoresistor. We'll display the analog value on the serial monitor.

  • 34,861 views
  • 2 comments
  • 12 respects

Components and supplies

Apps and online services

About this project

Operation and uses

The photoresistor is an electronic component which resistivity varies according to the amount of light received ( the resistance decreases when exposed to the light ).

The photoresistor is made of cadmium sulphide tape, a semiconductor.

When photons hit the tapes, electrons can pass through the semiconductor.

The main use of the photoresistor is the measurement of the luminous intensity ( camera, detection systems, … ).

Code

In the " void setup " we initialize the serial monitor :

void setup() {  
Serial.begin(9600);
}

Then, we read the analog value coming from photoresistor and we define it as " value " :

void loop() {  
int value = analogRead(A0);  

And we write the value on the serial monitor :

Serial.println("Analog Value :");
Serial.println(value);  
delay(250);
}

Connections

Photoresistor

First pin --> 5V

Second pin --> A0 ( a resistance is connected to the GND and to the photoresistor second pin ).

Code

Photoresistor Arduino
void setup() {
  Serial.begin(9600);
}


void loop() {
  int value = analogRead(A0);
  Serial.println("Analog value : ");
  Serial.println(value);
  delay(250);
}

Comments

Similar projects you might like

Detecting Heart Rate with a Photoresistor

Project tutorial by 3 developers

  • 22,072 views
  • 5 comments
  • 46 respects

Photoresistor Characterization

by 3 developers

  • 12,823 views
  • 4 comments
  • 17 respects

How to Use a Datalogger

by MisterBotBreak

  • 7,976 views
  • 2 comments
  • 21 respects

How to Use a Soil Moisture Sensor

by MisterBotBreak

  • 88,403 views
  • 13 comments
  • 60 respects

Arduino Bluetooth Robot for Android Device

Project showcase by aip06

  • 8,418 views
  • 2 comments
  • 23 respects
Add projectSign up / Login