Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.02 KB

LDR.md

File metadata and controls

38 lines (25 loc) · 1.02 KB

Light Dependent Resistor

  • KEYWORDS: LDR,Light,Light Dependent Resistor,Photoresistor,Light,Sensor,GL5537

Datasheet

Light Sensor

An LDR is a resistor that varies resistance with the amount of light shining on it. The GL5537 changes resistance from 25k in darkness to around 200 Ohms when lots of light shines on it.

Connect as follows:

10k Resistor Sensor Espruino
1st pin 3.3v
1st Pin 2nd pin A1
2nd Pin GND

Note: any Analog pin will do.

You can then easily read the analog value. Because of the way the sensor is wired, the value you'll get will be near 0.5 in darkness, and 1 when there is a lot of light.

var light = analogRead(A1);
console.log(light);

Using

  • APPEND_USES: LDR

Buying