Introduction: How Does Work Touch Sensor With Arduino
Today we will learn about the touch sensor.
What is a touch sensor?
These sensors can be simply described as electronic devices that detect the touch of the human body. They also operate in the form of electronic switches. Also, these sensors are activated on factors such as touch and pressure. Many of the devices we use every day include a touch sensor. For example, we can take a smartphone.
There are two main types of these sensors.
- Capacitive touch sensor.
- Resistive touch sensor.
Capacitive touch sensor
These sensors are activated using capacitance measurements. These sensors are integrated into portable devices. They are also designed to be durable and robust. These sensors include two parallel conductors and an insulator between them. Therefore, these sensors are acting as a capacitor. When this is touched by the fingers, our finger acts as a conductive object. When this happens, the value of the capacitor increases. Therefore, the circuit that measures the capacitance value of the sensor detects it and outputs a signal. These sensors are included in mobile phones and iPods.
Resistive touch sensor
These sensors are activated by measuring the pressure applied to the surface. Also, these sensors include two indium tin oxide-coated conductors. The two conductors are separated by a very small distance. Also, a voltage is applied to the two conductors. When we touch this sensor, the upper conductive membrane touches the lower conductive membrane. Then a voltage drop occurs. It is then detected by a controlling circuit and a signal is generated. These sensors include keypads, touchscreens, and musical instruments.
Supplies
The required components are as follows.
- Arduino Uno board x 1
- Touch sensor x 1
- Led bulb x 1
- 180-ohm resistor x 1
- Jumper wires
- Breadboard x 1
Step 1:
So let’s connect these components using the circuit diagram below.
Step 2:
Okay, now look at the code below.
- The complete program of this project – Download
First, the sensor pin and LED pin are defined, and then three Boolean variables were created.
This code sets the touchPin as an input pin and LEDpin as an output pin.
The following code reads the sensor value and inserts it into the “val” variable. Then, it is tested using the if condition, the LED bulb turns on if the touch variable is equal to 1, and the LED bulb turns off if the touch variable is equal to 0.
Step 3:
OK, now select the board, and port correctly. Then click the upload button.
OK, enjoy this project. The full video guide is below.
So we hope to see you in the next project.