Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Ravi Teja creative catchers !!
Published

Touch based Home Automation || Piezoelectric sensor arduino

Touch based home automation are an beginners level project using arduino where one can control home appliances using touch board instead of

BeginnerFull instructions provided1 hour941
Touch based Home Automation || Piezoelectric sensor arduino

Things used in this project

Story

Read more

Code

code

Arduino
int ledPin = 13;
 

int piezoPin = A0;               
 

int sensor = 0;
 

int ledStatus = LOW;
 

int range = 20;
 

void setup() 
{
 
 pinMode(ledPin, OUTPUT); 

 Serial.begin(9600);
}
 

void loop() 
{
  
  sensor = analogRead(piezoPin);   
 
  if (sensor >= range) 
  {
  
    ledStatus = !ledStatus;
    
    digitalWrite(ledPin, ledStatus);
    
    Serial.println(sensor);
    
  }

  delay(10);
}

Credits

Ravi Teja creative catchers !!
2 projects • 2 followers
Assistant Professor in Engineering college,R&D developer,Youtuber
Contact

Comments

Please log in or sign up to comment.