• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoUse light intensity sensor on Arduino
Previous Next

Use light intensity sensor on Arduino

Posted by: Alvin Jin , March 3, 2014

[vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Module introduction” tab_id=”1393830389-1-56″][vc_column_text]Light intensity sensor is the main use of photosensitive resistance, the photosensitive resistance value vary linearly with the light intensity , So the size of the resistance value can reflect the size of the light intensity.

wifi0s01149744381393824331876

[/vc_column_text][/vc_tab][vc_tab title=”Accessories required for the experiment” tab_id=”1393830389-2-31″][vc_column_text]One Arduino UNO

One Light intensity sensor

Three Male to Female Dupont Line

Circuit connection as shown below:

wifi08[/vc_column_text][/vc_tab][vc_tab title=”Experimental code” tab_id=”1393830629717-2-8″][vc_column_text]

int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;
void setup() {
  pinMode(ledPin, OUTPUT); 
  Serial.begin(115200);
}
void loop() {
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue); 
  //Serial.write(sensorValue);
  digitalWrite(ledPin, HIGH); 
  delay(100);         
  digitalWrite(ledPin, LOW);  
  delay(100);                 
}

[/vc_column_text][/vc_tab][vc_tab title=”The experimental results” tab_id=”1393830630875-3-6″][vc_column_text]When there is light

ZRGL35HDU91EZHP2HQL2

There is no light

q[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]

Tags: Arduino

Share!
Tweet

Alvin Jin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors