शनिवार, 10 अप्रैल 2021

keypad interfacing with arduino.

 *** download circuit diagram and complete keypad (4*3) interfacing code.***

1. circuit diagram ......

   


2.**** for more information watch video ****


 

3. *******complete code ******* by sani edu technical*****

// Including LCD library

#include<LiquidCrystal.h>


// Setting (RS,E,D4,D5,D6,D7) for particular pin number

LiquidCrystal lcd(6, 5, 4, 3, 2, 1);


int c1 = 11, c2 = 12, c3 = 13;

int r1 = 10, r2 = 9, r3 = 8, r4 = 7;

int del = 600;


void setup() {

  lcd.begin(16, 2);

  lcd.setCursor(0, 0);

  lcd.print("Hello !");

  delay(1000);

  lcd.clear();


  /* use input pull-up  *//

    

  */

  pinMode(c1, INPUT_PULLUP);

  pinMode(c2, INPUT_PULLUP);

  pinMode(c3, INPUT_PULLUP);


  // Set r1,r2,r3,r4 pins to OUTPUT mode

  pinMode(r1, OUTPUT);

  pinMode(r2, OUTPUT);

  pinMode(r3, OUTPUT);

  pinMode(r4, OUTPUT);

}


void loop() {

 row1();

  row2();

  row3();

  row4();

}


void row1() {

 digitalWrite(r1, LOW);

  digitalWrite(r2, HIGH);

  digitalWrite(r3, HIGH);

  digitalWrite(r4, HIGH);


  

  if (digitalRead(c1) == LOW) {   //print 1,2,3

    lcd.print("1"); delay(del);

  }

  else if (digitalRead(c2) == LOW) {

    lcd.print("2"); delay(del);

  }

  else if (digitalRead(c3) == LOW) {

    lcd.print("3"); delay(del);

  }

}


void row2() {

  digitalWrite(r1, HIGH);

  digitalWrite(r2, LOW);

  digitalWrite(r3, HIGH);

  digitalWrite(r4, HIGH);


  if (digitalRead(c1) == LOW) {    //print 4,5.6

    lcd.print("4"); delay(del);

  }

  else if (digitalRead(c2) == LOW) {

    lcd.print("5"); delay(del);

  }

  else if (digitalRead(c3) == LOW) {

    lcd.print("6"); delay(del);

  }

}



void row3() {

  digitalWrite(r1, HIGH);

  digitalWrite(r2, HIGH);

  digitalWrite(r3, LOW);

digitalWrite(r4, HIGH);


  if (digitalRead(c1) == LOW) {    ///print 7,8,9

    lcd.print("7"); delay(del);

  }

  else if (digitalRead(c2) == LOW) {

    lcd.print("8"); delay(del);

  }

  else if (digitalRead(c3) == LOW) {

    lcd.print("9"); delay(del);

  }

}


void row4() {

  digitalWrite(r1, HIGH);

  digitalWrite(r2, HIGH);

  digitalWrite(r3, HIGH);

  digitalWrite(r4, LOW);


  if (digitalRead(c1) == LOW) {   ///print *,0,#

    lcd.print("*"); delay(del);

  }

  else if (digitalRead(c2) == LOW) {

    lcd.print("0"); delay(del);

  }

  else if (digitalRead(c3) == LOW) {

    lcd.print("#"); delay(del);

  }

}



गुरुवार, 8 अप्रैल 2021

arduino based voice control home automation ..

 download circuit and code and android app....
1. voice control android app link-https://drive.google.com/drive/folders/1JsOYFbFTBohRFdC0Ins6f8khoelZj6Ce?usp=sharing
2. circuit diagram-




4. watch video for more details..




5. download code complete code..


String voice ;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
while(Serial.available()){
  delay(3);
  char c = Serial.read();
  voice+=c;
}

if(voice.length() >0)
{
  Serial.println(voice);
  if(voice == "turn on LED")
  {
  digitalWrite(12, HIGH);
  }
 else if(voice == "turn off LED")
  {
  digitalWrite(12, LOW);
  }
   else if(voice == "turn on fan")
  {
  digitalWrite(11, HIGH);
  }
   else if(voice == "turn off fan")
  {
  digitalWrite(11, LOW);
  }
  voice = "";
}

}


plz like and share this tutorial.

3.5 " TFT LCD shield

                                                                                                                                            ...