Wednesday 21 March 2018

How To Use Infrared (IR) sensor with Arduino

the code i used is :
int value;
int ledPin = 13;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode (ledPin,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
value  = analogRead(A0);
if (value<100){
  digitalWrite(ledPin,HIGH);
  Serial.println(value);
 
}else {
  digitalWrite(ledPin,LOW);
  Serial.println(value);
}

 delay(1);
}



Saturday 6 January 2018

2018 Beginners Best Top 10 Arduino Projects

In this video, i have chosen the best Arduino projects for beginners for 2018. although some projects may seem a bit difficult but trust me they are simple and easier when you go into their depth.
Please note that All the videos belong to their respective owners.




Friday 5 January 2018

Top 10 Best arduino projects 2018

In this video, i have combined the top ten arduino projects according to me for 2018.
all the videos belong to their own owners.




10 .  blind stick.
         https://www.youtube.com/watch?v=4TVY17DRUzA

9 .   Line following robot
       https://www.youtube.com/watch?v=fIZYdYqyBEM

8.  smart tracker
     https://www.youtube.com/watch?v=-f6FthqPwog

7.  Home automation
      https://www.youtube.com/watch?v=MnaryeiBStM

6 .  Color separator.
       https://www.youtube.com/watch?v=CPUXxuyd9xw

5 .  Obstacle avoidance
       https://www.youtube.com/watch?v=C3GhJmmRY4Y

4  .  Piano click.
       https://www.youtube.com/watch?v=xXOSZ0u6Fyk

3  . Led cube
      https://www.youtube.com/watch?v=2BlVUKW5hL0

2  .  Bluetooth car
        https://www.youtube.com/watch?v=kewza7RyKMQ

1  . Ultrasonic radar
      https://www.youtube.com/watch?v=kQRYIH2HwfY

Thursday 4 January 2018

Arduino Bluetooth Car Project Code

In this video, i have completely explained the code and working of the Arduino Bluetooth car.








The code is:

const int motorA1 = 8;
const int motorA2 = 9;

const int motorB1 = 10;
const int motorB2 = 11;

const int motorAe = 5;
const int motorBe = 6;

char speed = 100;
char change_speed_add = 30;

int command = 0;



void setup() {

  pinMode(motorA1, OUTPUT);
  pinMode(motorA2, OUTPUT);
  pinMode(motorB1, OUTPUT);
  pinMode(motorB2, OUTPUT);
  pinMode(motorAe, OUTPUT);
  pinMode(motorBe, OUTPUT);



  analogWrite (motorAe , 0);
  digitalWrite (motorA1,LOW);
  digitalWrite (motorA2,LOW);

analogWrite (motorBe , 0);
  digitalWrite (motorB1,LOW);
  digitalWrite (motorB2,LOW);

  Serial.begin(9600);



}

void loop() {

  if (Serial.available() > 0){
 
      command = Serial.read();


      if (command == 70){
     
        forward();}

        else if (command == 76){
          left();}

          else if (command == 82){
            right ();}

            else if (command == 66){
              reverse();}
              else {
              stop;}

              Serial.println (command);
  }
     
     
     
     
        }
 
  void forward(){
    Serial.println ("fwd");
 
    analogWrite(motorAe, speed);
    analogWrite(motorBe, speed);
 
    digitalWrite (motorA1, HIGH);
    digitalWrite (motorB1, HIGH);
 
    digitalWrite (motorA2, LOW);
    digitalWrite (motorB2, LOW);


 
    }




  void reverse(){
    Serial.println ("reverse");
 
    analogWrite(motorAe, speed);
    analogWrite(motorBe, speed);
 
    digitalWrite (motorA1, LOW);
    digitalWrite (motorB1, LOW);
 
    digitalWrite (motorA2, HIGH);
    digitalWrite (motorB2, HIGH);


 
    }



  void left(){
    Serial.println ("left");
 
    analogWrite(motorAe, speed +10);
    analogWrite(motorBe, speed - 10);
 
    digitalWrite (motorA1, LOW);
    digitalWrite (motorA2, HIGH);

 
    digitalWrite (motorB1, HIGH);
    digitalWrite (motorB2, LOW);


    }

    void right(){
    Serial.println ("right");
 
    analogWrite(motorAe, speed -10);
    analogWrite(motorBe, speed + 10);
 
    digitalWrite (motorA1, HIGH);
    digitalWrite (motorA2, LOW);

 
    digitalWrite (motorB1, LOW);
    digitalWrite (motorB2, HIGH);

 

 
    }
    void stop (){
      Serial.println("stop");
      analogWrite(motorAe, 0);
    analogWrite(motorAe, 0);
 
    digitalWrite (motorA1, LOW);
    digitalWrite (motorA2, LOW);

 
    digitalWrite (motorB1, LOW);
    digitalWrite (motorB2, LOW);
      }

 

I2C code for LCD


#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd (0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() {

lcd.begin(16, 2);

}
void loop()
{
lcd.print("  Haseebs Corner");
lcd.setCursor(0, 0);
delay(1500);
lcd.clear();
lcd.print("ARDUINO PROJECTS");
lcd.setCursor(0, 1);
delay(1500);
lcd.setCursor(6, 1);
lcd.print("SUBSCRIBE ");
delay(1500);
lcd.clear();
lcd.print("TO MY CHANNEL");
lcd.setCursor(0, 1);
delay(1500);
lcd.print("FOR MORE VIDEOS");
delay(1500);
lcd.clear();
}