Getting Started with Light Sensor Module (SN-LIGHT-MOD)

Last Updated on 6 July 2017
This article is written by internship student Tian Fu Loke


INTRODUCTION

Photosensitive resistor module(SN-LIGHT-MOD) is most sensitive to environmental light intensity. This SN-LIGHT-MOD is generally used to detect the ambient brightness and light intensity. The user can adjust the sensitivity accordingly. Turning on board potentiometer clockwise will increase the sensitivity and further increase the detection range. This SN-LIGHT-MOD is compatible with 5V or 3.3V power input.

FEATURES of Light Sensor Module (SN-LIGHT-MOD)

  • Comes with a high-quality light dependent resistor.
  • Equipe with an on-board potentiometer to adjust light brightness threshold.
  •  Digital output
  • Fixed bolt hole for convenient installation
  • Uses LM393 wide voltage comparator
  • LED indicator – ON when ambient light is more than threshold
  • Operating Voltage is 3.3-5 V
  • Dimensions: 3.2cm x 1.4cm

OBJECTIVE

To introduce the basic steps on how to use SN-LIGHT-MOD with Arduino UNO to detect the light brightness in the environment and decide to switch OFF or ON light.

HARDWARE REQUIREMENT

SOFTWARE REQUIREMENT

Arduino IDE

HARDWARE SETUP

Set up your hardware based on the picture below (Analog and Digital pin assignment may vary according to your needs.)

SAMPLE CODE

int ldrPin = 7;
int ledPin= 12;
int val = 0;
void setup() {
pinMode(ldrPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int val = digitalRead(ldrPin);
Serial.println(val);
if(val == HIGH ){
digitalWrite(ledPin, HIGH);
Serial.println("LED ON");
}
else{
digitalWrite(ledPin, LOW);
Serial.println("LED OFF");
}
}

VIDEO

Note: For further inquiry, please visit our technical forum as we seldom check the comment here. 🙂

, , , , ,

Related Post

Getting Started with Colour Sensor Module (SN-COLOUR-MOD)

Getting Started with Tilt Sensor (SN-TILT)

Getting Started with Vibration Sensor Module (Normally Off) (SN-VIBRATE-MOD)

Getting Started with IR Distance Click

Leave a Reply

Your email address will not be published. Required fields are marked *