rpiloverbd
Published

Metal and life detector

I made a metal and life detector using Arduino UNO and Metal-life sensor.

BeginnerProtip30 minutes388
Metal and life detector

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Buzzer
Buzzer
×1
Metal/Human Touch Switch Sensor Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

metal_life_schematic_1ik0S8LUuc.jpg

metal_touch_tylww6Ld0d.jpg

Code

Metal and life detector

Arduino
const int buzzerPin =  11; 
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  pinMode(buzzerPin,OUTPUT); 
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1000);        // delay in between reads for stability
  if(sensorValue<1000)
  {
   digitalWrite(buzzerPin,HIGH); 
  }

  else
  {
    digitalWrite(buzzerPin,LOW); 
  }
}

Credits

rpiloverbd

rpiloverbd

2 projects • 0 followers

Comments