A touch sensor is an electronic sensor that is used to detect the touch when it is touched it acts as a switch. It is used in various places like it can be used over the touch screen ( i.e group of touch sensors are used to form a touch screen ). These are also user friendly.
We are going to discuss to sensors that are
Capacitive touch sensor
Metallic touch sensor
Capacitive touch sensor
The name itself says that the capacitor is involved in this touch sensor. When we touch the sensor capacitance is being induced between the person and the sensor, and the body(the figure that used to touch) and the body of the sensor act like a parallel plate capacitor and the charge is induced between the plates. The charge is taken by the sensor and it is converted to a button press. As we remove the finger the capacitance which is developed is lost and the circuit breaks.
The most commonly used capacitive touch sensor is TTP223 touch sensor Ic. The equivalent circuit diagram is given below, if we bring our tip of the finger near the module then a capacitor is built. The new capacitor is parallel to the capacitor c1, then the capacitance is increased. The induction that is taken by the sensor as a button press.
We just take our finger near to the touch plate but not to touch
Metallic touch sensor
It is based on MOSFET, the gate of the MOSFET is left open and its source is connected to the operational amplifier. When the gate is touched it starts conducting also the operational invert the input threshold voltage and the operational amplifier conducts and a variable resistor is used to set the threshold value. The schematic diagram is given below
The output of the metallic sensor is I both analog and digital, the analog value depends on the charge in the MOSFET and the digital value is high when we touch and low when it is left alone.
Capacitive sensor with Arduino UNO
The switch will be on when the touch sensor is touched by the finger also the buzzer will produce the sound and then it is off, we can also print how many time it is touched by a small screen
The touch sensor pin is connected to pin 2, the buzzer is connected to pin 9 of the Arduino Uno also both the buzzer and the sensor is powered through the 5-volt output of the Arduino regulator
Source code
a program is written on how the sensor to be worked
int buzzer=9;
int capsensor=2;
void main()
{
Pinmode(buzzer,output);
Pinmode(capsensor,input);
Serial,begin(9600);
}
From the above code, we declared that pin 2 and 9 are capsensor and buzzer and we have given capsensor as the input and the buzzer as the output then we gave the serial number of the Arduino as 9600 in the loop the statement digitalread(capsensor)==high then it checks the touch sensor, if anything id touched to the sensor it shows high on the serial monitor of the Arduino IDE. Then the buzzer will be switched on. After a delay of 1, secondly keeps the buzzer in buzz state for 1 second. After 1 second the control jumps out of the if statement and then buzzer is turned off. The loop function runs for an infinite amount of time so whenever the sensor pad is touched a sound is produced for 1 second.
Metallic touch sensor using Arduino UNO
The metallic touch sensor can be interfaced in two ways both digital and analog form, for the digital interface it is same as the capacitive touch sensor
Source code
IntBuzzer=9;
void setup() {
pinMode(Buzzer, OUTPUT);
Serial.begin(9600);
}
void loop() {
float SenValue;
SenValue=analogRead(A0); //Read the sensor analog value
if(SenValue > 0){ //If sensor is touched
Serial.println("Sensor is touched");
digitalWrite(Buzzer,HIGH);
delay(SenValue*5); //Buzz the buzzer depending on the
//touched analog reading
}
digitalWrite(Buzzer,LOW);
}
Conclusion
The above-discussed information is all about interfacing Arduino with the ttp233 sensor to monitor the touch on the substance. Also, the basic information is discussed above