Resistivetouch screen

Using LabVIEW and NI RIO hardware to communicate with I2C devices is simplified with downloadable source code. Download the LabVIEW FPGA I2C IP from the VI Package Manager.

After the data transmission, the master issues the stop condition by changing the SDA line from low to high while keeping the SCL clock line high. When this occurs, the bus is considered free again for another master to initiate a data transfer.

Image

If the master detects an ACK signal, it starts transmitting or receiving data. To transmit data to a device, the master places the first bit onto the SDA line and generates a clock pulse to transmit the bit across the bus to the slave. To receive data from a device, the master releases the SDA line, allowing the slave to take control of it. The master generates a clock pulse on the SCL line for each bit, reading the data while the SCL line is high. The device is not allowed to change the SDA line state while the SCL line is high.

In a mutual-capacitance touch screen, transparent conductors are always patterned into spatially separated electrodes in two layers, usually arranged as rows and columns. Because the intersections of each row and column produce unique touch-coordinate pairs, the controller in a mutual-capacitance touch screen measures each intersection individually (see right Fig). This produces one of the major advantages of mutual-capacitance touch screens – the ability to sense a touch at every electrode intersection on the screen. Because both self-capacitance and mutual capacitance rely on the transfer of a charge between the human body capacitance and either a single electrode or a pair of electrodes, this method of capacitive sensing is most commonly called “charge transfer.”

Serial Data (SDA)—This is a bidirectional pin used to transfer addresses and data into and data out of the device. It is an open drain terminal, therefore, the SDA bus requires a pull up resistor to VCC. (typically 2.2 or 4.4 kOhm)  For normal data transfer, SDA is allowed to change only during SCL low. Changes during SCL high are reserved for indicating the Start and Stop conditions.

Capacitive touch screenexamples

A device that supports 10-bit addressing receives the address across two bytes. The first byte consists of the Philips-designated 10-bit slave addressing mode code (11110), the 2 MSBs of the device address, and the Read/Write bit. The next data byte sent across the bus contains the eight LSBs of the address.

There are two types of sensing methods in projected capacitive technology. They are GRID type and wire sensing type. GRID type will be introduced here. The human body is conductive since it contains a lot of water. When a finger comes close to the patterning of X and Y electrodes, a capacitance coupling will occur between the finger and the electrodes. The capacitance coupling makes the electrostatic capacitance between the X and Y electrodes change. The touch sensor detects touched points as it checks where on the electrode lines the electrostatic capacitance changed.

Capacitive touch screen displayprice

Image

Capacitive touch screen displayamazon

◆ Projected capacitive is susceptible to electrical noise due to its detection mechanism. Noise from LCD can influence the touch sensor, however  various methods have been developed to improve tolerance to noise.

Surface capacitive can detect touches by fingers only. It does not detect input by a gloved hand. Some surface capacitive touch screens may detect touches by a thin-gloved hand, but they do not support the combination use of bare finger and gloved finger. Some surface capacitive touch screens support pen writing,

Write-Protect (WP)—This pin must be connected to either VSS or VCC. If tied to VSS, write operations are enabled. If tied to VCC write operations are inhibited but read operations are not affected.

Capacitive touch screendiagram

Self-Capacitance is based on measuring the capacitance of a single electrode with respect to ground. When a finger is near the electrode, the human-body capacitance changes the self-capacitance of the electrode. In a self-capacitance touch screen, transparent conductors are patterned into spatially separated electrodes in either a single layer or two layers. When the electrodes are in a single layer, each electrode represents a different touch coordinate pair and is connected individually to a controller. When the electrodes are in two layers, they are usually arranged in a layer of rows and a layer of columns; the intersections of each row and column represent unique touch coordinate pairs. However, self-capacitance touch-screen controllers do not measure each intersection; they only measure each row and column;

Image

Capacitive touch screens are made of single or multiple layers of material that are coated with a conductor such as Indium Tin Oxide. A protective cover seals the assembly off from the environment.

Transparent conductive coating is on the base glass sheet, and glass protective coating is placed over it. Electrodes are placed on the four corners. The same phase voltage is imposed to the electrodes on the four corners, then a uniform electric field will  form over the panel. When a finger touches the panel, an electrical current will flow from the four corners through the finger. The ratio of the electrical current flowing from the four corners will be measured to detect the touched point. The measured current value will be inversely proportional to the distance between the touched point and the four corners.

Each device connected to the I2C bus has a unique 7-bit I2C address to facilitate identification and communication by the master. Commonly, the upper four bits are fixed and assigned to specific categories of devices (for example, 1010 is assigned to serial EEPROMs). The three lower bits are programmable through hardware address pins, allowing up to eight devices of the same type to be connected to a single I2C bus.

Each device on the bus (both master and slave) can be a receiver and/or transmitter. For example, an LCD is typically only a receiver, while an EEPROM is both a transmitter and receiver.  Temperature sensors are commonly transmitters in function.

Capacitive touch screenadvantages and disadvantages

When another electrical conductor, like a bare fingertip or a stylus, touches the surface, an electric circuit is completed at that location. Sensors embedded in the glass then detect the location of the flow of current, which is then registered as a touch event.

Typical I2C devices use a 7-bit addressing scheme. I2C also defines an extended 10-bit addressing scheme that allows up to 1,024  addresses to be connected to the I2C bus. This 10-bit addressing scheme does not affect the existing 7-bit addressing, allowing both 7-bit and 10-bit addressed devices to share the bus.

Mutual Capacitance is a more common type of pro-cap today, which allows an unlimited number of unambiguous touches, produces higher resolution, is less sensitive to EMI, and can be more efficient in its use of sensor space. Mutual capacitance makes use of the fact that most conductive objects are able to hold a charge if they are very close together. If another conductive object, such as a finger, comes close to two conductive objects, the charge field (capacitance) between the two objects changes because the human body capacitance “steals” some of the charge.

To initiate a transfer, the master issues a start condition by changing the SDA line level from high to low while keeping the SCL clock line high. When this occurs, the bus is considered busy, and all devices on the bus get ready to listen for incoming data.

This document presents an overview of the I2C (Inter Integrated Circuit) bus, which is commonly used for communication between integrated circuits or sensors. The tutorial discusses the low-level basics of the bus, which includes data transfers, arbitration, and addressing. It also discusses the basic read/write operations and where to find LabVIEW examples and IP. Additional web page links show how to communicate to I2C based devices using the LabVIEW FPGA Module and the I²C/SPI Interface Device  from a common programming interface model.

This works well when only a single finger is touching the screen. For example, in this picture, a single-finger touching location X2,Y0 can be sensed accurately by measuring all the X electrodes and then all the Y electrodes in sequence. Measuring individual electrodes rather than electrode intersections is the source of one of the major disadvantages of two-layer self capacitance touch screens – the inability to unambiguously detect more than one touch. Two fingers touching in locations X2,Y0 and X1,Y3 produce four reported touch points. However, this disadvantage does not eliminate the use of two finger gestures with a self-capacitance touch screen. The secret is in software – rather than using the ambiguous locations of the reported points, software can use the direction of movement of the points. In this situation it does not matter that four points resulted from two touches; as long as pairs are moving away from or toward each other (for example), a zoom gesture can be recognized. Mutual Capacitance Touch

With I2C, a line (both SDA and SCL) is either driven low or allowed to be pulled high. When a master changes a line state to high, it must sample the line afterwards to make sure it really has been pulled high. If the master samples the SDA bus after setting it high, and the sample shows that the line is low, it knows another master is driving it low. The master assumes it has lost arbitration and waits until it detects a stop condition before making another attempt to start transmitting.

Capacitive touch screenvs resistive

◆ Sensitivity of the sensor can be adjusted. If sensitivity is adjusted to high level, the touch screen can be operated over a cover glass or cover plastic sheet. These cover sheets provide additional durability, environmental resistance, and a lot of flexibility in design.

Refer to Understanding I2C with LabVIEW and the USB-8451 to learn how to communicate to I2C devices with the USB-845x and LabVIEW.

◆ Projected capacitive requires an advanced technology to measure electrostatic capacitance and achieve precise locational information from it. Unlike resistive technology, it does not work simply by connecting a touch screen with a controller sourced from somewhere. A projected capacitive touch screen and controller need to be designed together.

When the master attempts to make SCL high to complete the current clock pulse, it must verify that it has really gone high. If it is still low, it knows a slave is holding it low and must wait until it goes high before continuing.

A0, A1 and A2 Chip Address Inputs—The A0, A1 and A2 inputs are used for multiple device operations. The logic levels on these inputs are compared with the corresponding bits in the slave address. The chip is selected if the compare is true. Up to eight devices may be connected to the same bus by using these different Chip Address bit combinations.  For applications in which these pins are controlled by a microcontroller or other programmable logic device, the chip address pins must be driven to logic ‘0’ or logic ‘1’ before normal device operation can proceed.

Capacitive touchbutton

Because the master controls the clock, the I2C specification provides a mechanism to allow the slave to slow down the bus traffic when it is not ready. This mechanism is known as clock stretching. During any SCL low phase, a slave may additionally hold down SCL to prevent it from rising high again to slow down the SCL clock rate or pause I2C communication.

A device that ACKs must pull down the SDA line during the ACK clock pulse in such a way that the SDA line is stable low during the high period of the ACK related clock pulse. Of course, setup and hold times must be taken into account. During reads, a master must signal an end of data to the slave by NOT generating an ACK bit on the last byte that has been clocked out of the slave. In this case, the slave will leave the data line high to enable the master to generate the Stop condition.

Next, the master sends the 7-bit address and 1-bit for data transfer direction on the bus to configure for the appropriate data transfer. All slaves compare the address with their own address. If the address matches, the slave produces an ACK (acknowledge) signal.

Projected capacitive touch panels are often used for smaller screen sizes than surface capacitive touch panels. The internal structure of these touch panels consists of a substrate incorporating an IC chip for processing computations, over which is a layer of numerous transparent electrodes positioned in specific patterns. The surface is covered with an insulating glass or plastic cover. When a finger approaches the surface, electrostatic capacity among multiple electrodes changes simultaneously, and the position where contact occurs can be identified precisely by measuring the ratios between these electrical currents.

The LabVIEW FPGA Module is a graphical development environment for easily configuring FPGAs on NI reconfigurable I/O (RIO) hardware such at CompactRIO, NI single-board RIO or other reconfigurable hardware to implement functionality that usually requires custom hardware. One such function is implementing digital communication protocols such as I2C.

Much information can be found online presenting an overview of I2C.  This document explains I2C using LabVIEW. The I2C bus is a two-wire, half-duplex serial interface. The two lines, Serial Data (SDA) and Serial Clock (SCL), are both bidirectional. The I2C specification defines three speeds: standard, 100 kHz; fast, 400 kHz; and high speed, 3.4 MHz.

When two masters are trying to control the bus simultaneously or if a second master joins the bus in the middle of a transfer and wants to control the bus, the I2C bus has an arbitration scheme to guarantee no data corruption.

The I2C is a multi master bus, meaning that multiple masters can be connected to the bus at the same time. While a master is initiating a transfer on the bus, all other devices, including other masters, are acting like slaves. However, if another master is trying to control the bus at the same time, I2C defines an arbitration mechanism to determine which master gets control of the bus.