METAL TOUCH SENSOR
METAL TOUCH SENSOR
A metal touch sensor is a electronic device which detects the metal when it touches the metal.It has NPN transistor which is used for detecting the metal.The bare wire bent
over the transistor is the base of the transistor.We can interface
metal touch sensor with Arduino to automatically identify presence of metal.
Sample Project With Arduino:
In this we going to turn ON the LED whenever the metal touch sensor is detected.
Materials required:
- Metal touch sensor
- Arduino UNO
- Bread board
- LED
- 220 ohm resistor
- Jumper wires
Circuit:
Code:
int sensorpin = 9;
int LED = 7;
void setup()
{
pinMode(sensorpin, INPUT);
pinMode(sensorpin, OUTPUT);
digitalWrite(LED, LOW);
}
void loop()
{
if(digitalRead(sensorpin) == LOW)
{
digitalWrite(LED, HIGH);
}
else
{
digitalWrite(LED, LOW);
}
}
Comments
Post a Comment