Difference between revisions of "Light Sensor Brick"

From ITEAD Wiki
Jump to: navigation, search
(Specifications)
(Overview)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Overview==
 
==Overview==
 
[[File:Light sensor.jpg|thumb|400px|right]]
 
[[File:Light sensor.jpg|thumb|400px|right]]
 +
 +
What is an electronic brick? An electronic brick is an electronic module which can be assembled like Lego bricks simply by plugging in and pulling out. Compared to traditional universal boards and circuit modules assembled with various electronic components, electronic brick has standardized interfaces, plug and play, simplifying construction of prototype circuit on one’s own. There are many types of electronic bricks, and we provide more than twenty types with different functions including buttons, sensors, Bluetooth modules, etc, whose functions cover from sensor to motor drive, from Ethernet to wireless communication via Bluetooth, and so on. We will continue to add more types to meet the various needs of different projects.
  
 
Electronic brick of light sensor is mainly used to detect the light intensity in the environment. The control board can get the current light intensity information via analog pins. Generally speaking, the resistance of photoresistor decreases with the increase of the light intensity.
 
Electronic brick of light sensor is mainly used to detect the light intensity in the environment. The control board can get the current light intensity information via analog pins. Generally speaking, the resistance of photoresistor decreases with the increase of the light intensity.
 +
 +
Go shopping [http://imall.iteadstudio.com/im120710017.html Light Sensor Brick (IM120710017)]
  
 
==Features==
 
==Features==
Line 29: Line 33:
 
|}
 
|}
  
''Note 1: D for digital output port, A for analog output port, S for analog/digital output port ( defined according to the switch), V and G for voltage at the common collector and ground respectively
+
''Note 1: D for digital output port, A for analog output port, S for analog/digital output port ( defined according to the switch), V and G for voltage at the common collector and ground respectively''
  
Note 2: When setting as analog output, output range is 0-3.3V or 0-5V according to the working voltage (V,G); when setting as digital output, output is 0/3.3V or 0/5V according to the working voltage (V,G).''
+
''Note 2: When setting as analog output, output range is 0-3.3V or 0-5V according to the working voltage (V,G); when setting as digital output, output is 0/3.3V or 0/5V according to the working voltage (V,G).''
  
 
==Electrical Characteristics==
 
==Electrical Characteristics==
 +
{| class="wikitable"
 +
|-
 +
| align="center" style="background:#f0f0f0;"|'''Parameter'''
 +
| align="center" style="background:#f0f0f0;"|'''Min.'''
 +
| align="center" style="background:#f0f0f0;"|'''Typical'''
 +
| align="center" style="background:#f0f0f0;"|'''Max.'''
 +
| align="center" style="background:#f0f0f0;"|'''Unit'''
 +
|-
 +
| Working voltage|| 2.1|| 5|| 5.5|| VDC
 +
|-
 +
| Analog output voltage(VCC=5V)|| 0|| Vout|| 5|| V
 +
|-
 +
| Digital output voltage(VCC=5V)|| 0|| -|| 5|| V
 +
|-
 +
| Working current(VCC=5V)|| -|| 5|| -|| mA
 +
|-
 +
| Photoresistor(light intensity is 10lux)|| 5|| -|| 10|| kohm
 +
|-
 +
| Threshold hysteresis ΔUth|| -|| VCC*0.09|| -|| V
 +
|}
 +
 +
http://imall.iteadstudio.com/media/wysiwyg/Products/ElectronicBrick/IM120710017_6.jpg
  
 
==Hardware==
 
==Hardware==
 +
http://imall.iteadstudio.com/media/wysiwyg/Products/ElectronicBrick/IM120710017_7.jpg
  
 
==Switch and indicator==
 
==Switch and indicator==
 +
1. Regulating of threshold voltage:
 +
 +
The threshold voltage is a voltage for comparison. When the light intensity value read by the sensor is above the threshold value, a low level (0V) will be digitally output; when the light intensity value read by the sensor is below the threshold value, a high level (3.3V or 5V) will be digitally output. In this way, the digital pin can be used directly to read the current light intensity value in the environment to see if it is above the threshold or not. The threshold voltage can be regulated by simply twisting the potentiometer which is shown in Figure 1, and it increases by rotating to left side and decreases by rotating to right side.
 +
 +
http://imall.iteadstudio.com/media/wysiwyg/Products/ElectronicBrick/IM120710017_8.jpg
 +
 +
2. Switch to shift between analog and digital output
 +
 +
For S pin in 4-pin Grove interface and 2.54mm 3-pin interface, it outputs analog signals when switch is pushed to A terminal and digital signals when pushed to D terminal. When there is analog signal output, it can read the specific light intensity value; when there is digital signal output, it can only indicate whether the light intensity value is above threshold value or not.
  
 
==Demo==
 
==Demo==
 +
1. Push the snap switch of sensor to analog output, connect S port to A0 port of Arduino board, and we will use the following program to read the analog value of light intensity and send it to computer for display via the serial port.
 +
 +
  int ASignal = A0;
 +
  void setup() {
 +
  Serial.begin(9600);
 +
  }
 +
 +
 +
  void loop() {
 +
  int sensorValue = analogRead(ASignal);
 +
  Serial.println(voltage);
 +
  }
 +
 +
2. Push the snap switch of sensor to digital output, connect S port to D2 port of Arduino board, and we will use the following program to read the digital value of light intensity and send the threshold to computer for display .
 +
 +
  int DSIGNAL = D2;
 +
  void setup()
 +
  {
 +
  Serial.begin(9600);
 +
  pinMode(DSIGNAL, INPUT);
 +
  }
 +
 +
  void loop()
 +
  {
 +
  int DsignalState = digitalRead(DSIGNAL);
 +
  Serial.println(DsignalState);
 +
  delay(100);     
 +
  }
  
 
==Download==
 
==Download==
 +
[ftp://imall.iteadstudio.com/Electronic_Brick/IM120710017/DS_IM120710017.pdf Datasheet for Light Sensor Brick]
 +
 +
[ftp://imall.iteadstudio.com/Electronic_Brick/IM120710017/SCH_IM120710017.pdf Schematic for Light Sensor Brick]
 +
 +
[ftp://imall.iteadstudio.com/Electronic_Brick/IM120710017/DEMO_IM120710017.zip Demo code for Light Sensor Brick]
  
 
==Useful Links==
 
==Useful Links==

Latest revision as of 06:39, 11 June 2014

Overview

Light sensor.jpg

What is an electronic brick? An electronic brick is an electronic module which can be assembled like Lego bricks simply by plugging in and pulling out. Compared to traditional universal boards and circuit modules assembled with various electronic components, electronic brick has standardized interfaces, plug and play, simplifying construction of prototype circuit on one’s own. There are many types of electronic bricks, and we provide more than twenty types with different functions including buttons, sensors, Bluetooth modules, etc, whose functions cover from sensor to motor drive, from Ethernet to wireless communication via Bluetooth, and so on. We will continue to add more types to meet the various needs of different projects.

Electronic brick of light sensor is mainly used to detect the light intensity in the environment. The control board can get the current light intensity information via analog pins. Generally speaking, the resistance of photoresistor decreases with the increase of the light intensity.

Go shopping Light Sensor Brick (IM120710017)

Features

1. Plug and play, easy to use. Compatible with the mainstream 2.54 interfaces and 4-Pin Grove interfaces in the market. IM120710017_2.jpg

2. With use of M4 standard fixed holes, compatible with M4-standard kits such as Lego and Makeblock. IM120710017_3.jpg

3. With switch to shift between analog and digital output. Able to read the specific light intensity information (analog) or the over-bright or over-dark information according to the threshold (digital). The adjustable potentiometer is used to set the light intensity threshold. With hysteresis comparator circuit for more stable digital output voltage. IM120710017_4.jpg

4. Detecting direction can be rotated for better adaption IM120710017_5.jpg

Specifications

PCB size 36.0mm X 24.0mm X 1.6mm
Working voltage 3.3 or 5V DC
Operating voltage 3.3 or 5V DC
Compatible interfaces 2.54 3-pin interface and 4-pin Grove interface(1)

Note 1: D for digital output port, A for analog output port, S for analog/digital output port ( defined according to the switch), V and G for voltage at the common collector and ground respectively

Note 2: When setting as analog output, output range is 0-3.3V or 0-5V according to the working voltage (V,G); when setting as digital output, output is 0/3.3V or 0/5V according to the working voltage (V,G).

Electrical Characteristics

Parameter Min. Typical Max. Unit
Working voltage 2.1 5 5.5 VDC
Analog output voltage(VCC=5V) 0 Vout 5 V
Digital output voltage(VCC=5V) 0 - 5 V
Working current(VCC=5V) - 5 - mA
Photoresistor(light intensity is 10lux) 5 - 10 kohm
Threshold hysteresis ΔUth - VCC*0.09 - V

IM120710017_6.jpg

Hardware

IM120710017_7.jpg

Switch and indicator

1. Regulating of threshold voltage:

The threshold voltage is a voltage for comparison. When the light intensity value read by the sensor is above the threshold value, a low level (0V) will be digitally output; when the light intensity value read by the sensor is below the threshold value, a high level (3.3V or 5V) will be digitally output. In this way, the digital pin can be used directly to read the current light intensity value in the environment to see if it is above the threshold or not. The threshold voltage can be regulated by simply twisting the potentiometer which is shown in Figure 1, and it increases by rotating to left side and decreases by rotating to right side.

IM120710017_8.jpg

2. Switch to shift between analog and digital output

For S pin in 4-pin Grove interface and 2.54mm 3-pin interface, it outputs analog signals when switch is pushed to A terminal and digital signals when pushed to D terminal. When there is analog signal output, it can read the specific light intensity value; when there is digital signal output, it can only indicate whether the light intensity value is above threshold value or not.

Demo

1. Push the snap switch of sensor to analog output, connect S port to A0 port of Arduino board, and we will use the following program to read the analog value of light intensity and send it to computer for display via the serial port.

 int ASignal = A0;
 void setup() {
 Serial.begin(9600);
 }


 void loop() {
 int sensorValue = analogRead(ASignal);
 Serial.println(voltage);
 }

2. Push the snap switch of sensor to digital output, connect S port to D2 port of Arduino board, and we will use the following program to read the digital value of light intensity and send the threshold to computer for display .

 int DSIGNAL = D2;
 void setup() 
 {
 Serial.begin(9600);
 pinMode(DSIGNAL, INPUT);
 }

 void loop() 
 {
 int DsignalState = digitalRead(DSIGNAL);
 Serial.println(DsignalState);
 delay(100);      
 }

Download

Datasheet for Light Sensor Brick

Schematic for Light Sensor Brick

Demo code for Light Sensor Brick

Useful Links