Wet & Dry Waste Smart Dustbin for House | Best science Project | Harish Projects

Image
 Watch Full Detailed video 👇🏻 Diagram in Video👆 //Arduino Code// //YouTube: Harish Projects //Order Electronic Parts & Project kit:  HarishProjects.com // #include <Servo.h> Servo servo1; const int trigPin = 12; const int echoPin = 11; long duration; int distance=0; int potPin = A0; //input pin int soil=0; int fsoil; void setup()  {   Serial.begin(9600); //Serial.print("Humidity"); pinMode(trigPin, OUTPUT);  pinMode(echoPin, INPUT);  servo1.attach(8); } void loop()  { //YouTube: Harish Projects //Order Electronic Parts & Project kit:  HarishProjects.com //      int soil=0;   for(int i=0;i<2;i++)   { digitalWrite(trigPin, LOW); delayMicroseconds(7); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); delayMicroseconds(10); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2+distance; delay(10);   }   distance=distance/2;   Serial.println(distance); if ...

How To make simple RC Boat at your home | Arduino nano RC boat | Harish Projects

 




COMPONENTS AND SUPPLIES


ABOUT THIS PROJECT

I am fond of playing RC Boat when I was little. Now, I have the ability to make an unique Boat on my own. I gained a sense of achievement and entertainment in the process of making it.

Application:- Jrobot Controller

Contact us for support


//Arduino Code//

 //  2020/1/3 adapted by Zach
 
 int outPin1 = 5;     //motor1
 int outPin2 = 6;    //motor1

 int outPin3 = 10;   //motor2
 int outPin4 = 11;   //motor2
 int red = 2;
 int white=3;

 char bt = 0;       //BT 
 

 void setup()
 {
   Serial.begin(9600);
   
   pinMode(outPin1,OUTPUT);
   pinMode(outPin2,OUTPUT);
   pinMode(outPin3,OUTPUT);
   pinMode(outPin4,OUTPUT);
   pinMode(red,OUTPUT);
   pinMode(white,OUTPUT);
 }
 void loop()
 {
   if (Serial.available() > 0) //save incoming data to variable 'bt'
   {
     bt = Serial.read();

     digitalWrite(white,HIGH);

   
     if(bt == 'F')           //move forwards
     {
       digitalWrite(outPin1,HIGH);
       digitalWrite(outPin2,LOW);
       digitalWrite(outPin3,LOW);
       digitalWrite(outPin4,LOW);
       digitalWrite(red,LOW);
     }
     else if (bt == 'B')      //move backwards
     {
       digitalWrite(outPin1,LOW);
       digitalWrite(outPin2,HIGH);
       digitalWrite(outPin3,LOW);
       digitalWrite(outPin4,LOW);
       digitalWrite(red,HIGH);
     }
     else if (bt == 'S')     //stop!!
     {   
       digitalWrite(outPin1,LOW);
       digitalWrite(outPin2,LOW);
       digitalWrite(outPin3,LOW);
       digitalWrite(outPin4,LOW);
       digitalWrite(red,LOW);
       
     }
     else if (bt == 'R')    // turn wheels right
     {
       digitalWrite(outPin3,LOW);
       digitalWrite(outPin4,HIGH);
       digitalWrite(outPin1,LOW);
       digitalWrite(outPin2,LOW);
       digitalWrite(red,LOW);
     }
     else if (bt == 'L')     //turn wheels left
     {
       digitalWrite(outPin3,HIGH);
       digitalWrite(outPin4,LOW);
       digitalWrite(outPin1,LOW);
       digitalWrite(outPin2,LOW);
       digitalWrite(red,LOW);
     }
     else if (bt== 'G')      //move forward left
     {
      digitalWrite(outPin1,HIGH);
      digitalWrite(outPin2,LOW);
      digitalWrite(outPin3,HIGH);
      digitalWrite(outPin4,LOW);
      digitalWrite(red,LOW);
     }
     else if (bt== 'I')      //move forward right
     {
      digitalWrite(outPin1,HIGH);
      digitalWrite(outPin2,LOW);
      digitalWrite(outPin3,LOW);
      digitalWrite(outPin4,HIGH);
      digitalWrite(red,LOW);
     }
     else if (bt== 'H')      //move backward left
     {
      digitalWrite(outPin1,LOW);
      digitalWrite(outPin2,HIGH);
      digitalWrite(outPin3,HIGH);
      digitalWrite(outPin4,LOW);
      digitalWrite(red,LOW);
     }
     else if (bt=='J')       //move backward right
     {
      digitalWrite(outPin1,LOW);
      digitalWrite(outPin2,HIGH);
      digitalWrite(outPin3,LOW);
      digitalWrite(outPin4,HIGH);
      digitalWrite(red,LOW);
     }
      
   }
   
 }
//Project Diagram//





Comments

Popular posts from this blog

Smart Bridge - Automatic Hight increase when flooding | Best science Project

How to make Phone control RC car using Arduino #phoneControlCar

Inspire Award Project | Train accident Prevention project | Best science Project / Harish Projects