Difference between revisions of "The Use of Light Sensor"

From Microduino Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
|
 
|
 
==Outline==
 
==Outline==
Microduino-Light adopts photosensitive resistor. It uses a resistor that is based on semiconductor's photoelectric effect and is able to change along with the intensity of t the incident light. The photosensitive resistor is generally applied in light measurement, light control and photoelectric conversion. 
+
The Microduino Light Sensor uses a photosensitive resistor to detect the amount of ambient light present. The sensor is effectively a resistor that changes in value as the light intensity surrounding it changes. The sensor will output a voltage value that corresponds to the amount of light detected by the sensor.
 +
 
 +
Couple the sensor to an LED and you have a smart light that illuminates a room as it gets dark!
 +
 
 
==Specification==
 
==Specification==
*Electrical features
+
*Electrical Specifications
**The brighter the light is, the bigger the output voltage gets.
+
**Analog Output Device
**Output analog quantity  
+
**Analog Output: 0-1023 (with Microduino Core modules)  
*Tech parameter
+
*Technical Specifications
**Bright Resistance(10Lux): 8-20KΩ
+
**Bright Resistance(up to 100Lux): 8-20kΩ
 
**Dark Resistance: 1MΩ
 
**Dark Resistance: 1MΩ
**Sensitivity: Under the light of 10Lux and 100Lux, the resistance rate is (R10/R100) =0.8
+
**Sensitivity:
*Size
+
***Given light intensity of 10Lux and 100Lux, with corresponding resistances (R10 and R100), the sensitivity factor is 0.8. This gives you a sense of how resistance changes with a given quantitative change in the amount of light present.
**Size of the Board: 20mm*10mm
+
*Dimensions
**1.27mm-pitch 4Pin interface;
+
**Board: 20mm x 10mm
*Connection method
+
**Connector: 4-Pin interface, 1.27mm-pitch
**Pin Description: GND, VCC, signal and NC. It needs analog port(A0-A7)to detect.
+
*Connection Interface
 +
**Pins: Signal, VCC (power), GND (ground) and NC (not connected)
 +
**'''''NOTE''''': Sensor must be connected to analog capable ports (i.e. A0-A7)
 
[[File:sensor-light.jpg|center|400px]]
 
[[File:sensor-light.jpg|center|400px]]
  
Line 38: Line 43:
  
 
===Preparation===
 
===Preparation===
*Setup 1:Connect Microduino-Light and the A0 analog port of the Hub.   
+
*Setup 1: Connect Microduino-Light and the A0 analog port of the Hub.   
 
[[file:mCookie-pir-sensor.JPG|600px|center]]
 
[[file:mCookie-pir-sensor.JPG|600px|center]]
*Setup 2:Connect the CoreUSB, Hub and Light to the computer with a USB cable.  
+
*Setup 2: Connect the CoreUSB, Hub and Light to the computer with a USB cable.  
 
[[file:mCookie-Light-pc.JPG|600px|center]]
 
[[file:mCookie-Light-pc.JPG|600px|center]]
  
Line 63: Line 68:
 
}
 
}
 
</source>
 
</source>
* Select the right board from Tools→Serial Port in Arduino IDE and download the program. [[file:upload.JPG|500px|center]]
+
* Select the right board from Tools→Serial Port in Arduino IDE and download the program. [[file:uploadlight.JPG|600px|center]]
*After the download, you can open the serial monitor. The disp
+
[[file:uploadlight1.JPG|600px|center]]
After the download, you can open the serial monitor. The displayed value reflects the current light intensity.  
+
*After the download, you can open the serial monitor. The displayed value reflects the current light intensity.  
[[file:mCookie-pir-res.JPG|500px|center]]
+
[[file:uploadlight3.JPG|600px|center]]
 
*Result  
 
*Result  
The stronger the light is, the greater the output value becomes. Therefore, you can build some projects controlled by light intensity change.  
+
The stronger the light is, the greater the output value becomes. Therefore, you can build some projects controlled by light intensity change.
  
 
===Program Debugging===
 
===Program Debugging===
*#define  sensorPin  A0”defines sensor interface.  
+
*"#define  sensorPin  A0" defines sensor interface.  
*Use“analogRead(sensorPin);”function to read the output analog value of the sensor and therefore, to judge light intensity change.  
+
*Use"analogRead(sensorPin);"function to read the output analog value of the sensor and therefore, to judge light intensity change.  
  
 
==Application==
 
==Application==
*Light-control street lamp
+
*Couple the Light Sensor with an LED and you can automate the intensity of the LED based on how bright or dark it is in a room.
 
==Video==
 
==Video==
  
 
|}
 
|}

Latest revision as of 06:43, 30 September 2016

Outline

The Microduino Light Sensor uses a photosensitive resistor to detect the amount of ambient light present. The sensor is effectively a resistor that changes in value as the light intensity surrounding it changes. The sensor will output a voltage value that corresponds to the amount of light detected by the sensor.

Couple the sensor to an LED and you have a smart light that illuminates a room as it gets dark!

Specification

  • Electrical Specifications
    • Analog Output Device
    • Analog Output: 0-1023 (with Microduino Core modules)
  • Technical Specifications
    • Bright Resistance(up to 100Lux): 8-20kΩ
    • Dark Resistance: 1MΩ
    • Sensitivity:
      • Given light intensity of 10Lux and 100Lux, with corresponding resistances (R10 and R100), the sensitivity factor is 0.8. This gives you a sense of how resistance changes with a given quantitative change in the amount of light present.
  • Dimensions
    • Board: 20mm x 10mm
    • Connector: 4-Pin interface, 1.27mm-pitch
  • Connection Interface
    • Pins: Signal, VCC (power), GND (ground) and NC (not connected)
    • NOTE: Sensor must be connected to analog capable ports (i.e. A0-A7)

Development

Equipment

Module Number Function
mCookie-CoreUSB 1 Core board
mCookie-Hub 1 Sensor pin board
Microduino-Light 1 Photosensitive sensor
  • Other Hardware Equipment
    • One USB cable
Module-light.jpg

Preparation

  • Setup 1: Connect Microduino-Light and the A0 analog port of the Hub.
MCookie-pir-sensor.JPG
  • Setup 2: Connect the CoreUSB, Hub and Light to the computer with a USB cable.
MCookie-Light-pc.JPG

Experiment: Detect analog Brightness Value

  • Open Arduino IDE and copy the following code into IDE.
#define  sensorPin  A0

int state;

void setup()
{
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
}
void loop()
{
  state = analogRead(sensorPin);
  Serial.print("state:");
  Serial.println(state);
  delay(100);
}
  • Select the right board from Tools→Serial Port in Arduino IDE and download the program.
    Uploadlight.JPG
Uploadlight1.JPG
  • After the download, you can open the serial monitor. The displayed value reflects the current light intensity.
Uploadlight3.JPG
  • Result

The stronger the light is, the greater the output value becomes. Therefore, you can build some projects controlled by light intensity change.

Program Debugging

  • "#define sensorPin A0" defines sensor interface.
  • Use"analogRead(sensorPin);"function to read the output analog value of the sensor and therefore, to judge light intensity change.

Application

  • Couple the Light Sensor with an LED and you can automate the intensity of the LED based on how bright or dark it is in a room.

Video