Project14.Photoresistor Module

Description

Photocell is commonly seen in our daily life and is mainly used in intelligent switch, also in common electronic design. To make it easier and more effective, we supply the corresponding modules.

Photocell is a semiconductor. It has features of high sensitivity, quick response, spectral characteristic and R-value consistence, maintaining high stability and reliability in environment extremely such as high temperature and high humidity. It’s widely used in automatic control switch fields like cameras, garden solar lights, lawn lamps, money detectors, quartz clocks, music cups, gift boxes, mini night lights, sound and light control switches, etc.

Specification - Interface type: analog - Working voltage: 5V - Size: 30*20mm - Weight: 3g

Connect

_images/14_bb.png

Code

int sensorPin = 2;
int value = 0;
int maxValue = 1023; // The maximum value returned by Arduino's analogRead function

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

void loop() {
value = analogRead(sensorPin);
// Invert ADC value
value = maxValue - value;
// You can invert it if you want
// value = -value + maxValue;

Serial.println(value, DEC);
delay(50);
}

Phenomenon

_images/14.jpg