In the video we explaining how to convert light depending resistor into sensor using arduino

We are separated this experiment into two section are

1. 5V DC power sourse 

2. 240V AC power sourse 


1. 5V DC POWER SOURSE




first connect the ldr and 220ohm resistor in series and first end for ldr is connect to the 5v DC pin

in arduino and one end of resistor is connect to the ground of the arduino uno board.connect the 

middle of ldr and resistor in A0 (analog 0 pin ) of arduino. connect LED positive terminal in d3

(Digital pin 3) and connect the negative terminal in ground of arduino


*CODING*

 void setup()

{

  pinMode(3, OUTPUT);

  Serial.begin(9600);

}

void loop(){ 

  int a= analogRead(A0);

  Serial.println(a);

  if (a<=20){

    digitalWrite(3,HIGH);

    Serial.println("LED ON");

  }

  else

    digitalWrite(3,LOW);

    Serial.println("LED OFF");

  {

    delay(1000);

  }


}  


                            To download coding and simple circuit diagram select below button






2. 240 V AC POWER SOURSE




       The second experiment is same concept but circuit design is different and coding also same

first built the first experiment circuit on that circuit disconnect the 2.5 V LED for the circuit 

and place BC547 transistor connect the collector to the digital o/p 3 and connect 1k resistor to the

base terminal and connect emitter to the  6V relay coil pin 1 and connect 5v supply to relay coil pin 2

now ground the 1k resistor connect 240v supply to Vo pin of the relay and connect 240 v return supply 

to NO of the relay


BC547 TRANSISTOR TERMINAL


 6V DC RELAY TERMINAL


                

COMPONENTS PRICE AND ORDER DETAIL


1.LDR......................................................................................2.RESISTOR...........................................................................

3. RELAY................................................................................ 

4. BC547...................................................................................









Comments

Popular Posts