Friday, 6 December 2024

Best Cool Arduino Projects for Beginners At Home



 Obstacle Avoiding Car Using Ultrasonic :- 

#include <Servo.h>          //Servo motor library. This is standard library

#include <NewPing.h>        //Ultrasonic sensor function library. You must install this library


//our L298N control pins

const int LeftMotorForward = 7;

const int LeftMotorBackward = 6;

const int RightMotorForward = 4;

const int RightMotorBackward = 5;


//sensor pins

#define trig_pin A1 //analog input 1

#define echo_pin A2 //analog input 2


#define maximum_distance 200

boolean goesForward = false;

int distance = 100;


NewPing sonar(trig_pin, echo_pin, maximum_distance); //sensor function

Servo servo_motor; //our servo name



void setup(){


  pinMode(RightMotorForward, OUTPUT);

  pinMode(LeftMotorForward, OUTPUT);

  pinMode(LeftMotorBackward, OUTPUT);

  pinMode(RightMotorBackward, OUTPUT);

  

  servo_motor.attach(10); //our servo pin


  servo_motor.write(115);

  delay(2000);

  distance = readPing();

  delay(100);

  distance = readPing();

  delay(100);

  distance = readPing();

  delay(100);

  distance = readPing();

  delay(100);

}


void loop(){


  int distanceRight = 0;

  int distanceLeft = 0;

  delay(50);


  if (distance <= 20){

    moveStop();

    delay(300);

    moveBackward();

    delay(400);

    moveStop();

    delay(300);

    distanceRight = lookRight();

    delay(300);

    distanceLeft = lookLeft();

    delay(300);


    if (distance >= distanceLeft){

      turnRight();

      moveStop();

    }

    else{

      turnLeft();

      moveStop();

    }

  }

  else{

    moveForward(); 

  }

    distance = readPing();

}


int lookRight(){  

  servo_motor.write(50);

  delay(500);

  int distance = readPing();

  delay(100);

  servo_motor.write(115);

  return distance;

}


int lookLeft(){

  servo_motor.write(170);

  delay(500);

  int distance = readPing();

  delay(100);

  servo_motor.write(115);

  return distance;

  delay(100);

}


int readPing(){

  delay(70);

  int cm = sonar.ping_cm();

  if (cm==0){

    cm=250;

  }

  return cm;

}


void moveStop(){

  

  digitalWrite(RightMotorForward, LOW);

  digitalWrite(LeftMotorForward, LOW);

  digitalWrite(RightMotorBackward, LOW);

  digitalWrite(LeftMotorBackward, LOW);

}


void moveForward(){


  if(!goesForward){


    goesForward=true;

    

    digitalWrite(LeftMotorForward, HIGH);

    digitalWrite(RightMotorForward, HIGH);

  

    digitalWrite(LeftMotorBackward, LOW);

    digitalWrite(RightMotorBackward, LOW); 

  }

}


void moveBackward(){


  goesForward=false;


  digitalWrite(LeftMotorBackward, HIGH);

  digitalWrite(RightMotorBackward, HIGH);

  

  digitalWrite(LeftMotorForward, LOW);

  digitalWrite(RightMotorForward, LOW);

  

}


void turnRight(){


  digitalWrite(LeftMotorForward, HIGH);

  digitalWrite(RightMotorBackward, HIGH);

  

  digitalWrite(LeftMotorBackward, LOW);

  digitalWrite(RightMotorForward, LOW);

  

  delay(500);

  

  digitalWrite(LeftMotorForward, HIGH);

  digitalWrite(RightMotorForward, HIGH);

  

  digitalWrite(LeftMotorBackward, LOW);

  digitalWrite(RightMotorBackward, LOW);

 

  

  

}


void turnLeft(){


  digitalWrite(LeftMotorBackward, HIGH);

  digitalWrite(RightMotorForward, HIGH);

  

  digitalWrite(LeftMotorForward, LOW);

  digitalWrite(RightMotorBackward, LOW);


  delay(500);

  

  digitalWrite(LeftMotorForward, HIGH);

  digitalWrite(RightMotorForward, HIGH);

  

  digitalWrite(LeftMotorBackward, LOW);

  digitalWrite(RightMotorBackward, LOW);

}





Arduino Digital Clock :- 

const int clock = 11;
const int data = 10;
uint8_t digits[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f };
void setup()
{
  setupInterrupt();
  pinMode(clock, OUTPUT);
  pinMode(data, OUTPUT);
  start();
  writeValue(0x8c);
  stop();
  write(0x00, 0x00, 0x00, 0x00);
}
byte tcnt2;
// set current time by editing the values at line 16 and 17
  unsigned long int setMinutes = 9; // set minutes
  unsigned long int setHours = 9;  // set hours
  unsigned long time = (setMinutes * 60 * 1000) + (setHours * 3600 *1000);
void setupInterrupt()
{
  TIMSK2 &= ~(1<<TOIE2);
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
  TCCR2B &= ~(1<<WGM22);
  ASSR &= ~(1<<AS2);
  TIMSK2 &= ~(1<<OCIE2A);
  TCCR2B |= (1<<CS22)  | (1<<CS20); 
  TCCR2B &= ~(1<<CS21);
  tcnt2 = 131;
  TCNT2 = tcnt2;
  TIMSK2 |= (1<<TOIE2);
}
ISR(TIMER2_OVF_vect) {
  TCNT2 = tcnt2;
  time++;
  time = time % 86400000;
}
void loop()
{
  unsigned long t = (unsigned long)(time/1000);
  uint8_t minutes = (byte)((t / 60) % 60);
  uint8_t hours = (byte)((t / 3600) % 24);
  uint8_t seconds = (byte)(t % 60);
    write(digits[hours / 10], digits[hours % 10] | ((seconds & 0x01) << 7), digits[minutes / 10], digits[minutes % 10]);
}
void write(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth)
{
  start();
  writeValue(0x40);
  stop();
  start();
  writeValue(0xc0);
  writeValue(first);
  writeValue(second);
  writeValue(third);
  writeValue(fourth);
  stop();
}
void start(void)
{
  digitalWrite(clock,HIGH);
  digitalWrite(data,HIGH);
  delayMicroseconds(5);
  digitalWrite(data,LOW);
  digitalWrite(clock,LOW);
  delayMicroseconds(5);
}
void stop(void)
{
  digitalWrite(clock,LOW);
  digitalWrite(data,LOW);
  delayMicroseconds(5);

  digitalWrite(clock,HIGH);
  digitalWrite(data,HIGH);
  delayMicroseconds(5);
}
bool writeValue(uint8_t value)
{
  for(uint8_t i = 0; i < 8; i++)
  {
    digitalWrite(clock, LOW);
    delayMicroseconds(5);
    digitalWrite(data, (value & (1 << i)) >> i);
    delayMicroseconds(5);
    digitalWrite(clock, HIGH);
    delayMicroseconds(5);
  }
  digitalWrite(clock,LOW);
  delayMicroseconds(5);
  pinMode(data,INPUT);
  digitalWrite(clock,HIGH);
  delayMicroseconds(5);
  bool ack = digitalRead(data) == 0;
  pinMode(data,OUTPUT);
  return ack;
}

Wednesday, 20 November 2024

Arduino Clap Light Switch Using Sound Sensor

 Sound sensor Arduino project,  Arduino clap light switch using sound sensor.



Project Code :- 

#define MicAO 8

int ledPin = 13;

int clap = 0;

long detection_range_start = 0;

long detection_range = 0;

boolean status_lights = false;

void setup() {

  pinMode(MicAO, INPUT);

  pinMode(ledPin,OUTPUT);

  }

void loop() {

int status_MicAO = digitalRead(MicAO);

if (status_MicAO == 0)

{

if (clap == 0)

{

detection_range_start = detection_range = millis();

clap++;

}

else if (clap > 0 && millis()-detection_range >= 50)

{

detection_range = millis();

clap++;

}

}

if (millis()-detection_range_start >= 400)

{

if (clap == 2)

{

if (!status_lights)

{

status_lights = true;

digitalWrite(ledPin, HIGH);

}

else if (status_lights)

{

status_lights = false;

digitalWrite(ledPin, LOW);

}

}

clap = 0;

}

}

Thursday, 17 August 2023

AI Video Monetize Hoga Ya Nahin - AI Video Generator YouTube Monetization


AI video monetize hoga ya nahin? AI video generator YouTube monetization, AI channel monetization or AI video monetized or not? 

Tuesday, 15 August 2023

YouTube Video SEO Kaise Kare 2023 - SEO On YouTube Videos


Optimizing your YouTube videos for search engines is essential to increase their visibility and reach a larger audience. Here are some SEO (Search Engine Optimization) tips specifically tailored for YouTube videos:

Keyword Research:

 Identify relevant keywords and phrases that your target audience might use to search for content like yours. Tools like Google Keyword Planner, YouTube's own search suggestions, and third-party keyword research tools can help.

Title Optimization: 

Craft a descriptive, engaging, and keyword-rich title for your video. It should give viewers a clear idea of what to expect. Place the primary keyword toward the beginning of the title for better SEO.

Video Description:

 Write a detailed and informative description for your video. Include relevant keywords naturally within the first few lines, as YouTube only displays a portion of the description before users have to click "Show More."

Tags: 

Use relevant and specific tags that relate to your video's content. Include both broader and more specific tags. Tags help YouTube understand your video's context and improve its chances of appearing in related searches.

Thumbnail: 

Create a custom, eye-catching thumbnail that accurately represents your video's content. It should be visually appealing and intrigue potential viewers.

Closed Captions (CC): 

Adding accurate closed captions not only makes your video accessible to a wider audience but also provides YouTube with more text to index, enhancing your SEO.

Transcripts:

 Uploading a full transcript of your video's content can help search engines understand your video better and improve its ranking. You can also place important keywords in the transcript.

Engagement Metrics: 

YouTube considers engagement metrics like watch time, likes, shares, and comments when ranking videos. Encourage viewers to engage with your video by asking questions, prompting discussions, or including a call to action.

Playlists: 

Group related videos into playlists. This helps viewers discover more of your content and keeps them engaged with your channel for a longer period, positively impacting SEO.

Channel Authority: 

Consistently upload high-quality content to build your channel's authority. The more credible and relevant your channel becomes, the better your videos' SEO will be.

Social Sharing and Embedding:

 Promote your videos on social media platforms and embed them on relevant blog posts or websites. This can increase the video's reach and potentially generate more engagement.

Subscriber Base: 

Encourage viewers to subscribe to your channel. Subscribers receive notifications about your new content, which can lead to higher initial views and engagement.

YouTube Analytics:

 Regularly review YouTube Analytics to understand which videos are performing well and where your audience is coming from. This data can guide your future content creation and optimization efforts.


Remember that YouTube's algorithm takes time to evaluate and rank videos. Be patient, consistent, and always aim to provide value to your viewers. SEO practices, when combined with compelling content, can significantly improve your YouTube video's visibility and success.

Saturday, 12 August 2023

Copy Paste YouTube Channel Ideas 2023 - Copy Paste Karke YouTube Se Paise Kaise Kamaye


Copy paste karke YouTube se paise kaise kamaye ? Copy paste YouTube channel ideas 2023,google se copy paste youtube channel monetization kaise mil sakte hai?

Wednesday, 9 August 2023

10 High Earning YouTube Channel Ideas 2023


10 high earning YouTube channel ideas 2023 . यूट्यूब चैनल से लाखो कमाए १० बिलकुल नए तरीके से ।

Saturday, 5 August 2023

Dusre Ka Video Apne Youtube Channel Par Kaise Dale - Upload Other Videos...


Dusre ka video apne YouTube channel par kaise dale, upload other videos without copyright strike. दूसरे का वीडियो अपने चैनल पर कैसे डालें? दूसरे का वीडियो अपने चैनल पर कैसे अपलोड करें?