• An other multi part series

    This conversation covers some leg work to be done for next steps in * DIY Marine GPS using enhanced GPS Module, u-blox NEO-6M GPS receiver, and ILI9341 Module controlled 2.8" Color TFT LCD* project (http://forum.espruino.com/conversations/­255759) and Exploring 2.8" Color TFT Touch LCD by PacMan Game attempt project (http://forum.espruino.com/conversations/­127039).

    In both projects I intend to use the touch capability of the display.

    The touch screen is a resistive touch screen. A good description you can find at https://www.sparkfun.com/datasheets/LCD/­HOW%20DOES%20IT%20WORK.pdf.

    Basically, a touch screen consists of two stacked 'sheets' with a small gap in between. When touching the (flexible) top sheet, it will touch the (rigid) bottom sheet in the area of the touch point.

    Cross cut / side view:
    
    Flexible top sheet:              --------------------------------------      
    small gap                                                                    
    Rigid bottom sheet:              --------------------------------------
    

    When touching the (flexible) top sheet, it will touch the (rigid) bottom sheet in the are of the touch point.

    Because the sheets' facing sides are coated with a conductive material with significant resistance versus a plain wire, and one sheet is put under current with one edge all along the edge to ground (0 Volts) and the opposite edge to supply (3.3 Volts), the other sheet senses at the touch point something in between 0 and 3.3 Volts.

    Cross cut / side view:                              Touched area             
                                                              |                   
                                                              V                   
    Flexible sheet under power:  0 V |--------------------.   @   .-------> 3.3 V
    small gap                                              \_____/               
    Rigid sheet sensing touch: 2.2 V <-----------------------^^^-----------
    

    The sensing sheet is connected to a pin (for example, C2) with an analog-to-digital converter (ADC), which provides through analogRead(C3); a voltage-related floating point value from roughly 0.000 to 1. Of course, the edges of the sheet under power are also connected to pins of which one is set to Ground (0 Volts) with C0.reset();, and the other one is set to supply (3.3 Volts) using C1.set(); in order to set that sheet under power.

    Assuming a screen of 240 horizontal (x) by 320 vertical (y) resolution and below axis configuration with origin {x:0,y:0} in the top left corner of the screen, and the top sheet's left edge to ground (0 V) at x=0 and right edge to supply (3.3 V) at x=239, a touch point sensing (2.2 V) is about 2 thirds in at about x=160.

    Top view:
    
      0V, C0   pins  C1, 3.3V
      |                  |   
      V  ---> x-Axis     V   
      .------------------.   
      |0              240|   
    | |      Touch       |   
    | |      point       |--.
    V |           \      |  |
    y |            @     |  |
    - |            :     |  |
    A |            :     |  |
    x |            :     |  |
    i | top        :     |  |
    s | powered    :     |  |
      |            :     |  |
      |320         :     |  |
      '------------------'  |
         | bottom  |        |
         | sensing |        |
         '---------o--------' 
                   |         
                   V         
       ADC pin C3, 2.2V
            --> x value
    

    But this is only the x-axis value... - what about the y-axis value?

    Ingeniously, the the bottom sheet has 90 degrees turned edge connectors as well - at the top and the bottom - of which only the bottom is used for the sensing.

    But: now roles of the sheets are flipped:

    1. The bottom sheet is now put under power by connecting the top edge to ground (0 V) through pin C2 and the bottom edge to (3.3 V) through pin C3.
    2. The top sheet is now the sensing sheet and connected (by either left or right edge) to the pin with the analog-to-digital converter.

    Et voila: we get the value y for the y-axis, because the a touch at the top is (0 V) and corresponds to y=0, and a touch at the bottom corresponds to (3.3 V) and corresponds to y=240; and a touch point a quarter way down will provide (0.825 V = 3.3 / 4 V) corresponding to a value of y=80.

    Top view:
    
      V  ---> x-Axis                   
      .------------------.             
      |0              240|             
    | |      Touch       |    pin C2   
    | |      point       |--.<----0V   
    V |           \      |  |          
    y |            @ ----o---->0.825V  
    - |                  |  |  pin C1  
    A |                  |  |  ADC     
    x |                  |  |  --> y
    i |                  |  |  value   
    s |                  |  |          
      |                  |  |          
      |320   top sensing |  |          
      '------------------'  |          
         |                  |          
         |   bottom powered |          
         '------------------'<---3.3V   
                               pin C1  
                                       
    

    I said basically... because looking into the produced values, it is not that a clear cut - at least not for all values.

    There is also much more to the building if a touch screen - for example: In order that the sheets to not accidentally touch by sagging or vibration over a too wide area, very small insulating spacers spread in the gap. But because the top is flexible, touching happens between the spacers (S)... --- Ignore the forum's syntax coloring... ;-)

    Cross cut / side view:
    
                \                             /
                 \     Touching Object:      /
                  \   'Soft, Fat' Finger    /
    ------------.  '-.___.-----._________.-'  .--------
                 \       _______             /
        S         '-----'   S   '-----------'     S
    ----------------^^^-------------^^^^^---­-----------
                     ^                ^
                     |                |
                     |                |
                   Multiple Touch 'Points'
    

    Edit 2018-07-21: Found attached pic on https://www.epectec.com/articles/the-tec­hnology-within-touch-panels.html:


    1 Attachment

    • touch_r_epectecDotCom.png
About

Avatar for allObjects @allObjects started