element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#034 – Resistive Touch Panel Example
  • Blog
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Cypress Kits requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 12 subscribers
  • Views 235 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#034 – Resistive Touch Panel Example

cy.wbz
cy.wbz over 8 years ago

Hello!

 

Hello today we are going to go through a resistive touch example using the PSoC 4 pioneer kit. This example will interface custom hardware with the Pioneer kit. The pressure sensitive touch screen uses resistive force sensors distributed below the ‘Glass’ to measure applied force, which is analyzed to determine the press location.

 


 

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Zip File of Images
    • Project Schematic
    • Component Configurations

 

Components Used:

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • UART
  • Sar Sequencer
  • ISR
  • PWM
  • CyPins
  • CyClock

 

The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

Force measurement can be very simple or very difficult depending on the constraints of your system. Were this an example for a cell phone, the sensors would need to be very small, screen printable, and cheap. Suitable technology for low cost sensors exists, but we chose to use a similar but more convenient force sensor.

 

Eight Flexiforce A301 sensors are placed underneath the ‘glass’, such that they support the weight.  This ensures that no force escapes, and that the calculation made with this data will be accurate.  A large source of error in these sorts of calculations is unplanned translational forces getting into the measurements, augmenting the location and force of the touch.

 

 

These force sensors, being essentially variable resistors, are measured with a half-bridge configuration.  This configuration removes common mode noise, which is a significant portion of the noise in the measured signals. 10 kOhm resistors are used, as they were about the resistance of the sensor under the target loading.  The middle of each bridge connection is connected to pins on the PSoC4 for measurement, through the Pioneer Kit’s J2 connector.  The PSoC4 simply measures these signals with a sequencing SAR, with the bridge reference tied to the SAR’s reference input.

 

Calculation of the touch location is done using the SAR sequencer measurements and the known sensor locations.  The following equations define the location of a single force applied to the screen. Yp is the vertical location of the touch, and Xp is the horizontal location of the touch.

 


 

These equations are implemented in C, relying primarily on multiply-accumulates, and one divide.  PSoC4’s CM0 core handles these calculations easily.  The code for calculating touch location is shown below.

 

 

Also as part of this touch example we have provided a python GUI script that will display the XY position of the touches on your desk top. We have attached the script to this example. There is a video demonstration below that shows the touch panel in action. You will need a Python emulation environment to run this script. As a general note you may need to update this python script to point to the correct COM port created by the PSoC 5LP.

 

Hardware Connections:

 

The following schematic view capture provides the user the layout and values for the system. Please connect the breadboard or touch system to your PSoC 4 Pioneer kit.

 


Also connect the PSoC 4 UART connections to the PSoC 5LP device so the UART positioning can be relayed up to the host.

 

PSoC 4 P4[1] -> P5LP P12[6]

PSoC 4 P4[0] -> P5LP P12[7]

 

Test Your Project:

 

Program the Pioneer kit and then touch the resistive touch panel you’ve created. Run the python script on your PC to read and display the values from the Pioneer kit. Please see an example of the system in action below.

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

I hope this example can help you in your design.

Best,

Matt

Attachments:
17225.Project Images.zip
touch_plot_single.py.zip
p4_res_touch.cywrk.Archive02.zip
  • Reply
  • Cancel
  • Cancel
  • jesusantoniocar
    jesusantoniocar over 8 years ago

    Hello Matt.

    great project to explore  and make applications with tocuh panels tecnologies.

     

    best regards,

     

    Jesus antonio.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • DAB
    DAB over 8 years ago

    Is there a programable device for the Psoc to support a four wire touch screen device? 

    Or am I getting ahead of your planned demos?

     

    DAB

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • cy.wbz
    cy.wbz over 8 years ago in reply to DAB

    Don,

     

    Short answer is no. We will not be doing any ITO based glass panel examples. Cypress does support capsitive touch handset and tablet solutions for those markets, but they are driven by a lot of IP and are not part of our platform PSoC solutions.

     

    The above example can be added to a glass panel, but is more of a mechanical engineering challenge to implement the pressure sensors and panel. We are planning on adding support for the following shield towards the end of the 100 projects series: http://www.adafruit.com/products/376. This is a resistive touch screen.

     

    Let me know if I answered the Four Wire Touch screen question. I'm not sure if you meant capsitive or resistive touch screens.

     

    -MattB

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • DAB
    DAB over 8 years ago in reply to cy.wbz

    Hi Matt,

     

    I was guessing that it was resistive touch panels.

    I have a very cheap Samsung Tablet, which my wife killed when she plugged in the wrong charger.  No smoke, but the battery and voltage regulator circuit went DOA.

    When I disassembled it to see if I could fix it, I noticed that it had a four wire connection for the touch screen.

    I also saw a similar four wire touch screen on another device I picked up at a garage sale, so I was guessing that the design must be pretty standard.

    I know that Cypress has some very good chips for the capacitive sensing, but given this example I was just curious if anyone had thought of using your programmable analog compomnents to build a reusable interface.

    If I can find some time, I may try this out using the above example as a template.  Who knows, could be another great use for your Magic Wand.

     

    Thanks for the reply,

    DAB

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube