 Hello, Myself Ravindra Chauhan, Assistant Professor, Department of Electronics Engineering, Vulturenist of Technology, Solaapur. So in this session, we will discuss how to interface touch sensor with the microcontroller 8051. Outcome of this session, the student will be able to develop the microcontroller based system using touch sensor. In the end of the session, we will first discuss the working pinout and the specification of the particular touch sensor. And then we will see how to interface this touch sensor with the widely used microcontroller 8051. So we will discuss about one of the easily available touch sensors TTP-223B. So when you touch the sensor pad, the capacitance of the circuit is changed and is detected. So in the schematic, you will see the touch pad is provided here. So when you touch this particular pad, its internal capacitance will be changed and then this change in the capacitance is detected and the output is provided. So when you touch the sensor pad, there is change in the capacitance and this change in capacitance is detected and which results in the output changing states. So in the normal state, means when there is no touch, this module outputs the low voltage. And when a finger touches the corresponding position, means this particular touch pad, then this module output high. And if not touched for 12 seconds, again output will switch to the low. The specifications of this sensor TTP-223B, its operating voltage is from 2-hole to maximum 5.5-hole. Operating current is 2 microampere and maximum up to 4 microampere, okay. So when the sensor is operated at 3-hole, then the current is about 2 microampere. The response time, it is nearly about 60 milliseconds at fast mode and 220 milliseconds at low power mode. Response time means it is the time taken by the sensor to produce the output after touch is happened, that is called the response time. So we can operate this sensor in two modes, the fast mode and the low power mode. And to select this one of the mode, the one option is provided on LPMB pin. And operating temperature of the sensor is minus 20 to plus 70 degree centigrade, okay. Now the pinout of the touch sensor TTP-223B, the three pins are provided. Out of these three pins, two pins are the power supply pin, that is the VCC and ground, okay. So VCC is to be connected to plus 2-hole to 5.5-hole. So VCC we are operating at 3-hole and ground is connected to the ground and the output pin is defined as SIG stands for signal, okay. So if it detects the touch, this will be high. SIG will be high when touch is detected, otherwise it will be at logic 0, okay. Now coming to the interfacing with the 8051, the possible connection we can do like this. As far as the touch sensor is concerned, VCC is to be connected to plus 5-hole. The ground pin should be grounded and the SIG pin is here as an example, we will connect to P3.0 pin of the 8051 and then to display whether the touch is happened or not on the LCD, we will interface the LCD also. So you just pause the video and recall the LCD control signals, okay. So mainly the LCD is having the three control signals. The first one is the RS stands for register select, those RS here it is connected to P2.0. So RS should be kept low while sending the command to the LCD and RS should be at logic 1 when we are sending the actual character to be displayed. Then the read-write control signal, okay, so the read-write pin of the LCD here, it is connected to the P2.1 of the 8051. So read-write pin decides the operation. So for write operations mean when we are sending either command or data to the LCD, this read-write should be 0. And to read the status of the LCD, this read-write signal must be at logic 1. Then to enable the LCD data pins, the enable control signal is there which is connected to P2.2, okay. And then the 8 data lines of the LCD is connected to P1.0 to P1.7. So port 1 of the 8051 is connected to the data pins of the LCD. So this is the interfacing schematic which shows the touch sensor TTP223B. It is interfaced with the 8051 controller and then whether the touch is happened or not that information we can display on this 16 by 2 LCD. So the data pins of the LCD are connected to the port 1. The three control signals RS, read-write and enable are connected to P2.0, P2.1 and P2.2. And this signal output of the touch sensor is connected to P3.0. So when this module touch sensor outputs high voltage at pin signal that means touch is happened. If this signal SIG is low that means if P3.0 detects low that means the touch is not happened. Then the program for this particular interfacing, okay. So the four bits are defined here so that is the touch which is connected to the P3.0, RS which is connected to P2.0, okay. So the P2.0 is defined as a bit RS, P2.1 is defined as read-write and P2.2 is defined as enable. And it is required to include the register file of the 8051 that is REG51.h. Now as far as the program for this is concerned the four different functions are defined. One is to initialize the LCD then second function is defined where we will write the instructions to send the command. Similarly, the one more function LCD underscore data this is to be returned to send the different instructions while required to send the data and then the delay subroutine. Now this is the function main function, okay. So first the LCD is initialized by calling the function LCD underscore initialize, okay. Now this infinite loop is there that is the while one, okay. And then continuously we are checking the status of the P3.0 which is connected to the signal output of the touch sensor. If this touch is one, okay, then first send the required command to the LCD and then display the message touch is detected, okay. If touch is not equal to one means if touch is zero means there is no touch. So if touch is equal to zero send the series of the command, okay. And then display the message no touch on the screen, okay. So here in this presentation only the structure of the program is shown the detail subroutines are not written. So you just try to complete this particular entire program. So references used for this presentations is the data sheet of the touch sensor TTP223B, then the application note AN10675 and the 8051 book by Majidi and Majidi. Thank you.