यह ब्लॉग खोजें

Fully automatic energy saving street light & staircase light | programming with mobile | science

  हैलो दोस्तों ,

   इस ब्लाॅग में energy saving fully automatic smart street light  की coding एवं circuit diagram  किस प्रकार से है. उसे इस ब्लाॅग में show किया गया है । 

इसका सर्किट का कनेक्शन कुछ इस प्रकार से हुआ है-




Charging circuit-

Setup-




Circuit में कुछ समझ न आया हो तो YouTube के comment box में comment करके पुछ सकते हैं

इसकी coding c language में कुछ इस प्रकार से हुई है-


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#define ir1 A0
#define ir2 A1
#define ir3 A2
#define ir4 A3
#define ldr A5
#define led1 2
#define led2 3
#define led3 4
#define led4 5
#define led5 6
#define led6 7
#define led7 8
#define led8 9
#define led9 10
#define led10 11

void setup(){
   
    pinMode(ir1,INPUT);
    pinMode(ir2,INPUT);
    pinMode(ir3,INPUT);
    pinMode(ir4,INPUT);
    pinMode(ldr,INPUT);
    pinMode(led1,OUTPUT);
    pinMode(led2,OUTPUT);
    pinMode(led3,OUTPUT);
    pinMode(led4,OUTPUT);
    pinMode(led5,OUTPUT);
    pinMode(led6,OUTPUT);
    pinMode(led7,OUTPUT);
    pinMode(led8,OUTPUT);
    pinMode(led9,OUTPUT);
    pinMode(led10,OUTPUT);
    }

void loop (){
   
    int sensorval1 = analogRead(ir1);
    int sensorval2 = analogRead(ir2);
    int sensorval3 = analogRead(ir3);
    int sensorval4 = analogRead(ir4);
    int sensorval5 = analogRead(ldr);
   
    if (sensorval5<100 ){
       
        if(sensorval1<500  ){
            digitalWrite(led1,HIGH);
            delay(150);
            digitalWrite(led2,HIGH);
            delay(150);
            digitalWrite(led3,HIGH);
            delay(150);
            digitalWrite(led4,HIGH);
            delay(150);
            digitalWrite(led5,HIGH);
            delay(150);
           
        }
if(sensorval2 <500 ){
            delay(200);
            digitalWrite(led1,LOW);
            delay(200);
           
            digitalWrite(led2,LOW);
            delay(200);
            digitalWrite(led3,LOW);
            delay(200);
            digitalWrite(led4,LOW);
            delay(200);
            digitalWrite(led5,LOW);
            delay(200);
           
        }

        if (sensorval3 < 500){
           
            digitalWrite(led10,HIGH);
            delay(150);
            digitalWrite(led9,HIGH);
            delay(150);
            digitalWrite(led8,HIGH);
            delay(150);
           
            digitalWrite(led7,HIGH);
            delay(150);
            digitalWrite(led6,HIGH);
            delay(150);
           
                      }
         if (sensorval4<500 ){
             digitalWrite(led10,LOW);
            delay(200);
           
            digitalWrite(led9,LOW);
            delay(200);
            digitalWrite(led8,LOW);
            delay(200);
           
            digitalWrite(led7,LOW);
            delay(200);
            digitalWrite(led6,LOW);
            delay(200);
             }}
   
    else{
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
digitalWrite(led7,LOW);
digitalWrite(led8,LOW);
digitalWrite(led9,LOW);
digitalWrite(led10,LOW);
     }}


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Programming image👇



Code with details
~~~~~~~~~~~~~~~~~~~

#define ir1 A0
//define ir sensor one and connect with analog pin A0 of arduino

#define ir2 A1
//define ir sensor two and connect with analog pin A1 of arduino

#define ir3 A2
//define ir sensor three and connect with analog pin A2 of arduino

#define ir4 A3
//define ir sensor four and connect with analog pin A3 of arduino

#define ldr A5
//define ldr and connect with analog pin A4 of arduino

#define led1 2
//define led 1 and connect with digital pin 2 of arduino

#define led2 3
//define led 2 and connect with digital pin 3 of arduino

#define led3 4
//define led 3 and connect with digital pin 4 of arduino

#define led4 5
//define led 4 and connect with digital pin 5 of arduino

#define led5 6
//define led 5 and connect with digital pin 6 of arduino

#define led6 7
//define led 6 and connect with digital pin 7 of arduino

#define led7 8
//define led 7 and connect with digital pin 8 of arduino

#define led8 9
//define led 8 and connect with digital pin 9 of arduino

#define led9 10
//define led 9 and connect with digital pin 10 of arduino

#define led10 11
//define led 10 and connect with digital pin 11 of arduino

void setup(){
    pinMode(ir1,INPUT);
     // ir sensor one as a input using pinMode function
 
      pinMode(ir2,INPUT);
     // ir sensor two as a input
 
      pinMode(ir3,INPUT);
    // ir sensor three as a input
  
     pinMode(ir4,INPUT);
    // ir sensor four as a input
   
      pinMode(ldr,INPUT);
     // ldr  as a input
    pinMode(led1,OUTPUT);
    //led 1 as a output  using pinMode function
   
    pinMode(led2,OUTPUT);
     //led 2 as a output  using pinMode function
  
     pinMode(led3,OUTPUT); 
     //led 3 as a output  using pinMode function
  
     pinMode(led4,OUTPUT);  
    //led 4 as a output  using pinMode function
   
    pinMode(led5,OUTPUT); 
    //led 5 as a output  using pinMode function
  
     pinMode(led6,OUTPUT); 
    //led 6 as a output  using pinMode function
  
     pinMode(led7,OUTPUT); 
     //led 7 as a output  using pinMode function
 
      pinMode(led8,OUTPUT);
      //led 8 as a output  using pinMode function
  
     pinMode(led9,OUTPUT);  
     //led 9 as a output  using pinMode function
   
    pinMode(led10,OUTPUT); 
    //led 10 as a output  using pinMode function
   
  
   
}

void loop (){
   
    int sensorval1 = analogRead(ir1); 
    //value of ir sensor one store in sensorval1 

   int sensorval2 = analogRead(ir2);
      //value of ir sensor two store in sensorval12
   
    int sensorval3 = analogRead(ir3); 
    //value of ir sensor three store in sensorval3
  
    int sensorval4 = analogRead(ir4);
      //value of ir sensor four store in sensorval4
  
    int sensorval5 = analogRead(ldr);
     //value of ir sensor five store in sensorval5
   
    if (sensorval5<100 ){
        //if ldr value is less than 100
      
         //Then
      
         if(sensorval1<500  ){
        //if ir sensor one is less than 500 analog value 
           //Then
         
              digitalWrite(led1,HIGH);
            //LED one on
            delay(150);
              digitalWrite(led2,HIGH);
             //LED 2 on with delay 200 milliseconds
            delay(150);
            digitalWrite(led3,HIGH);
           //LED 3 ON with delay 200 milliseconds
            delay(150);
            digitalWrite(led4,HIGH);
            //LED 4 ON with delay 200 milliseconds
            delay(150);
            digitalWrite(led5,HIGH);
            //LED 5 ON with delay 200 milliseconds
            delay(150);
           
        }
if(sensorval2 <500 ){
  //if ir sensor is low or less than 500
      //Then
            delay(200);
            digitalWrite(led1,LOW);
            // led one off with delay 300 milliseconds
            delay(200);
           
            digitalWrite(led2,LOW);
            //led two off with delay 200 millisecond
            delay(200);
            digitalWrite(led3,LOW);
            //led three off with delay 200 millisecond
            delay(200);
            digitalWrite(led4,LOW);
             //led four off with delay 200 millisecond
            delay(200);
            digitalWrite(led5,LOW);
  //led  five off with delay 200 millisecond
            delay(200);
           
        }

        if (sensorval3 < 500){ //if value of ir sensor 3 is less than 500
         //then  
            digitalWrite(led10,HIGH);  //LED 10 on with delay 200 milliseconds
            delay(150);
            digitalWrite(led9,HIGH);  //LED 9 on with delay 200 milliseconds
            delay(150);
            digitalWrite(led8,HIGH);  //LED 8 on with delay 200 milliseconds
            delay(150);
           
            digitalWrite(led7,HIGH);  //LED 7 on with delay 200 milliseconds
            delay(150);
           digitalWrite(led6,HIGH);  //LED 6 on with delay 200 milliseconds
           
            delay(150);
           
           
            
           
           
           
           
        }
         if (sensorval4<500 ){ //if value of ir sensor 4 is less than 500
           
     //then
             digitalWrite(led10,LOW);//led 10 off
            delay(200);
           
            digitalWrite(led9,LOW);//led  9 off with delay 200 millisecond
            delay(200);
            digitalWrite(led8,LOW);//led  8 off with delay 200 millisecond
            delay(200);
           
            digitalWrite(led7,LOW);//led  7 off with delay 200 millisecond
            delay(200);
            digitalWrite(led6,LOW);//led  6 off with delay 200 millisecond
            delay(200);
           
           
           
          
           
       
    }}
   
    else{ // if LDR value greater than 100

//Then

digitalWrite(led1,LOW); //all LEDS OFF
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
digitalWrite(led7,LOW);
digitalWrite(led8,LOW);
digitalWrite(led9,LOW);
digitalWrite(led10,LOW);
    }}

~~~~~~~~~~~~~~~~~~~~~~~~~~~



    

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

इस project की full video👇👇

https://youtu.be/TbEqz4GFTFI


इस code को आप सीधे ही copy & paste कर सकते हैं


इसकी पूरी जानकारी जल्द ही आने वाली है-


















कोई टिप्पणी नहीं:

एक टिप्पणी भेजें

Fully automatic energy saving street light & staircase light | programming with mobile | science

   हैलो दोस्तों ,    इस ब्लाॅग में energy saving fully automatic smart street light  की coding एवं circuit diagram  किस प्रकार से है. उसे इस...