BNSS - IoT & Robotics Training

OBJECTIVE

Sensing the light intensity and learn how LDR Sensor works

MODULES REQUIRED

SCHEMATIC DIAGRAM

Following connection are made in inbuilt circuit, so there no need made these connection:

ARDUINO CODE
JavaScript
int LEDPin = 3;
int LDRPin = 9;
int HIGH2 = 0;
int LOW2 = 1;
void setup(){
pinMode(LEDPin, OUTPUT);
digitalWrite(LEDPin, LOW2);
pinMode(LDRPin, INPUT_PULLUP); }
void loop(){
int detection = !digitalRead(LDRPin);
if (detection == HIGH2){
digitalWrite(LEDPin , HIGH2);
}
if (detection == LOW2){
digitalWrite(LEDPin , LOW2);
} }

INSTRUCTIONS

WORKING

IOT Projects

SMART LIGHT

/ /

SMART LIGHT

OBJECTIVE

Sensing the light intensity and learn how LDR Sensor works

MODULES REQUIRED

SCHEMATIC DIAGRAM

Following connection are made in inbuilt circuit, so there no need made these connection:

ARDUINO CODE
JavaScript
int LEDPin = 3;
int LDRPin = 9;
int HIGH2 = 0;
int LOW2 = 1;
void setup(){
pinMode(LEDPin, OUTPUT);
digitalWrite(LEDPin, LOW2);
pinMode(LDRPin, INPUT_PULLUP); }
void loop(){
int detection = !digitalRead(LDRPin);
if (detection == HIGH2){
digitalWrite(LEDPin , HIGH2);
}
if (detection == LOW2){
digitalWrite(LEDPin , LOW2);
} }

INSTRUCTIONS

WORKING