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

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 कर सकते हैं


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


















खुद से programming करके mobile से बनाये edge avoiding + obstacle avoidance robot

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

   इस ब्लाॅग में edge & obstacle avoiding robot की coding एवं circuit diagram  किस प्रकार से होता है इस ब्लाॅग में show किया गया है । 

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





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

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


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


#include <Servo.h>   // servo library
Servo servo;

#define trigpin 6
#define echopin 7
#define rightm1 2
#define rightm2 3
#define leftm1 4
#define leftm2 5
#define buzzer 13
#define irsensor 9

long duration, distance;
int sensorval;
int angle;

#include <SPI.h>   //Oled library
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(-1);

void setup()
{ pinMode(trigpin,OUTPUT);
    pinMode(echopin,INPUT);
    pinMode(rightm1,OUTPUT);
    pinMode(rightm2,OUTPUT);
    pinMode(leftm1,OUTPUT);
    pinMode(leftm2,OUTPUT);
    pinMode(buzzer,OUTPUT);
   pinMode(irsensor,INPUT);
   
    servo.attach(8);  
   
    display.begin(SSD1306_SWITCHCAPVCC,0x3C);   
     }

void loop()
{
    sensorval = digitalRead(irsensor);
    if (sensorval == LOW){
   
    digitalWrite(trigpin,LOW); //pulse
    delayMicroseconds(2);
    digitalWrite(trigpin,HIGH);
    delayMicroseconds(10);
    digitalWrite(trigpin,LOW);
 
  duration = pulseIn(echopin,HIGH);
    distance = duration*0.034/2;
   
    if (distance>22){ digitalWrite(rightm1,LOW); // Farward
  digitalWrite(rightm2,HIGH);
  digitalWrite(leftm1,LOW);
  digitalWrite(leftm2,HIGH);      
           
  display.clearDisplay(); // for oled
  display.setTextSize(2);
  display.setTextColor(WHITE);              
  display.setCursor(0,0); 
  display.println("Hello...");
   display.display() ;                   
  
           
             }
   
    if (distance<21)
    {
    tone(buzzer,1340,500);
   
    digitalWrite(rightm1, LOW); //Stop
    digitalWrite(rightm2, LOW);
    digitalWrite(leftm1, LOW);
    digitalWrite(leftm2, LOW);          
   
           
     display.clearDisplay(); // for oled
  display.setTextSize(2);
  display.setTextColor(WHITE);              
  display.setCursor(20,10); 
  display.println("Object");
   display.display() ;                   


           
for(int i = 0;i<3;i++)  //head rotation
  {
for(angle = 90; angle<120; angle++){
     servo.write(angle);
      delay(8)  ;     }
for (angle = 120;angle>90; angle--)
      {servo.write(angle);
         delay(8); }    }
      delay(1500); 
     servo.write(110) ;   //see straight
 
   digitalWrite(rightm1, HIGH);//moveback
   digitalWrite(rightm2, LOW);
   digitalWrite(leftm1, HIGH);
   digitalWrite(leftm2, LOW);
   delay(500);   
          
    digitalWrite(rightm1, LOW); //Stop
    digitalWrite(rightm2, LOW);
    digitalWrite(leftm1, LOW);
    digitalWrite(leftm2, LOW);          
    delay(500);
    digitalWrite(rightm1, LOW);//right
    digitalWrite(rightm2, LOW);
    digitalWrite(leftm1, LOW);
    digitalWrite(leftm2, HIGH); 
        delay(500);
       
    }}
   
  else{
       
    digitalWrite(rightm1, LOW); //Stop
    digitalWrite(rightm2, LOW);
    digitalWrite(leftm1, LOW);
    digitalWrite(leftm2, LOW);
       
       
        tone(buzzer,462,500);
  
  display.clearDisplay(); // for oled
  display.setTextSize(2);
  display.setTextColor(WHITE);              
  display.setCursor(0,0); 
  display.println("Edge");
   display.display() ;                   
 
for(int j = 0;j<3;j++)  //head rotation
   {
for(angle = 120; angle<160; angle++){
     servo.write(angle);
      
  delay(8)  ;     }

for (angle = 160;angle>120; angle--)

      {servo.write(angle);

         delay(8); }    }

       delay(1500); 

     servo.write(110) ;  //see straight


  digitalWrite(rightm1, LOW); //leftmback

    digitalWrite(rightm2, LOW);

    digitalWrite(leftm1, HIGH);

    digitalWrite(leftm2, LOW);

      delay(500);}}

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

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

इस रोबोट full video👇👇

https://youtu.be/hW8kEaZgOxk


Code ka image👇




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


















Simple obstacle avoiding robot

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

   इस ब्लाॅग में Simple obstacle avoiding robot की coding एवं circuit diagram  किस प्रकार से होता है इस ब्लाॅग में show किया गया है । 

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



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

इसकी coding इस प्रकार से हुई है


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


#define trigpin 6

#define echopin 7

#define rightm1 2

#define rightm2 3

#define leftm1 4

#define leftm2 5


#define buzzer 13

long duration, distance;


void setup()

{ pinMode(trigpin,OUTPUT);

    pinMode(echopin,INPUT);

    pinMode(rightm1,OUTPUT);

    pinMode(rightm2,OUTPUT);

    pinMode(leftm1,OUTPUT);

    pinMode(leftm2,OUTPUT);

    pinMode(buzzer,OUTPUT);

   Serial.begin(9600);

     }

void loop()

{

    digitalWrite(trigpin,LOW);

    delayMicroseconds(2);

    digitalWrite(trigpin,HIGH);

    delayMicroseconds(10);

    digitalWrite(trigpin,LOW);

    duration = pulseIn(echopin,HIGH);

    distance = duration*0.034/2;

    Serial.println(distance);

    if (distance>19){ digitalWrite(rightm1,LOW); // Farward

  digitalWrite(rightm2,HIGH);

  digitalWrite(leftm1,LOW);

  digitalWrite(leftm2,HIGH);

             }

    

    if (distance<18)

    {

    tone(buzzer,1340,500);

    

    digitalWrite(rightm1, LOW); //Stop 

    digitalWrite(rightm2, LOW);

    digitalWrite(leftm1, LOW); 

    digitalWrite(leftm2, LOW);           

    delay(700);

  

   digitalWrite(rightm1, HIGH);//moveback

   digitalWrite(rightm2, LOW);

   digitalWrite(leftm1, HIGH); 

   digitalWrite(leftm2, LOW);

   delay(500);    

           

    digitalWrite(rightm1, LOW); //Stop 

    digitalWrite(rightm2, LOW);

    digitalWrite(leftm1, LOW); 

    digitalWrite(leftm2, LOW);           

    delay(500);

    digitalWrite(rightm1, LOW);//turnleft

    digitalWrite(rightm2, HIGH);

    digitalWrite(leftm1, LOW); 

    digitalWrite(leftm2, LOW);  

        

        

    }

    

}

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

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

इस robot की full video👇👇

https://youtu.be/TSBDzwaClVc


Code Ka image














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

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