top of page

 

Photoresistor/photocell test

 

After started with the blinking example in the arduino software, I opened the door behind which was full of novelties that I didn't know before. Actually the first experiment i did was not the blinking example but the photoresistor circuit cuz that was the first sensor I put on my arduinoboard.

 

In this circuit, I connected one side of the photoresistor to the power(5V) and connected the other side to GND with a 10K Ohm resistor. And i also use the Serial.println() function to print out the current value of the photocell voltage on the serial monitor, which represents the brightness of the background light.

 

Here is the arduino coding:

 

int potpin=0;//defining connection pin

int val;//

void setup()

{

  Serial.begin(9600);//setting the communacation frequency

}

void loop()

{

 val=analogRead(potpin);//read analog data

 Serial.println(val);//output the number

}

 

 

This is the picture of the circuit:

 

 

 

 

 

 

bottom of page