element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#015 – CapSense Proximity Detection
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 20 replies
  • Subscribers 31 subscribers
  • Views 3564 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#015 – CapSense Proximity Detection

cy.wbz
cy.wbz over 12 years ago

Hello!

 

This example demonstrates to users how to create a CapSense proximity sensor. This example will use the proximity sensor value to mix a color on an RGB LED. The user will also be able to read the data out using the UART and Bridge Control Panel.

 


image

 

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:

  • CapSense
  • UART
  • PWM
  • CyClock
  • CyPin

 

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.

 

The example project firmware implements a proximity sensor, which is available in the CapSense component under the configuration GUI.

 

The example project endlessly reads the proximity values from the sensor and calibrates a proximity maximum range. This value is used to calculate the LED color using the LED RGB driver module.You will remember that we used this LED Driver module in example #014.

 

The hue for the LED is calculated using the proximity value and then passed to the APIs defined in the LED RGB driver file. The value of the hue is then also passed to the UART as two 8 bit values to be displayed in the Bridge Control Panel.

 

To monitory the values from the UART the user will need to launch the Bridge Control Panel and select the COM port from the port list. This will automatically select the RX8 (UART) radio button. In my example the COM port is COM13. Enter in the following UART command into the Bridge Control Panel and then hit the repeat button.

 

RX8 [h=43] @1prox @0prox

 

You will see the UART data displayed in the output window. Navigate to the Chart tab to see the proximity values displayed in the chart window. Move your hand around the proximity wire and see the values change in the chart. In the below image you see a plot of the values from the UART. The peaks are when my hand is close to the proximity sensor.

 

image

 

A key point when using the Bridge Control Panel. The PWM value is a 16 bit value in your application but it is broken into two 8 bit values when transmitted. Here the Bridge Control Panel reads those values and reassembles the two 8 bit values into a single 16 bit value. It accomplishes this by using the '0' and '1' leading values on the read variables.

 

RX8 [h=43] @1prox @0prox

 

In the above command we have a variable named 'prox'. We add a leading 1 and 0 to the variable to indicate that these two values should be stitched together to create a single value and assign that value to 'prox'. If the '0' and '1' values are placed after 'prox', for example prox1 or prox0 then this indicates two separate variables. For more information on this please take a look at the Bridge Control Panel user guide.

 

Hardware Connections:

 

The user will need to connect a single wire to the P1[0] pin on the Pioneer Kit. The P1[0] is on the J2 header. This wire should be long and be pointed vertically away from the board. This help to reduce noise on the proximity detection.

 

Also connect a single wire to the PSoC 4 pin P4[1] and the Pin 9 on the header J11. This will connect the UART of the PSoC 4 to the UART Bridge on the PSoC 5LP. This wire will enable the Bridge Control Panel UART data collection. In this example we only need the TX connection from the PSoC 4 as we are not sending values to the PSoC 4.

 

Test Your Project:

 

Once the kit is programmed wait until the LED transitions from White to Red. The proximity detector is finding the minimum and maximum values. Once it transitions to Red move your hand close to the wire and see that the LED changes color as you get closer to the wire. Use the Bridge Control Panel to read the proximity value.

 

I hope this example can help you out in your design.

 

Best,

Matt

Attachments:
KIT042_Proximity.cydsn.zip
3817.Project Images.zip
  • Sign in to reply
  • Cancel

Top Replies

  • DAB
    DAB over 12 years ago +1
    A very good way to teach people about the capacitive touch technology. They get a "feel" for the sensor sensitivity and they could experiment with using different types of gloves that could be used with…
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to DAB +1
    Hello Matt. escellent example, i can learn about of capacity sensors, and DAB have reason , it will be a very interesting project to the comprehensive study to look at the changes in capacitance over time…
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to jesusantoniocar +1
    Hello Matt. Thanks, i found the application , initially I tested the program using hyerterminal, but i test the application with Bridge Control Panel and runs great, best regards, jesus antonio
  • DAB
    DAB over 12 years ago

    A very good way to teach people about the capacitive touch technology.

     

    They get a "feel" for the sensor sensitivity and they could experiment with using different types of gloves that could be used with the sensor.

     

    It would be cool to set up this example and measure how the sensor works during different conditions during the year.

    I doubt anyone has done a comprehensive study to look at the changes in capacitance over time.

     

    Another good example.

    Thanks

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to DAB

    Hello Matt.

    escellent example, i can learn  about of capacity sensors, and DAB have reason , it will be a very interesting project to  the comprehensive study to look at the changes in capacitance over time, so i am very interesting in use psoc 4 and the display shield to build and design an application  that can control  temperature in a room and graphics its change in the display shield.

     

    best regards,

     

    Jesus antonio

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to jesusantoniocar

    Hello Matt.

    Where can i get the Bridge Control Panel software?

     

    thanks

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to jesusantoniocar

    Hello Matt.

    Thanks, i found the application, initially I tested the program using hyerterminal, but i test the application with  Bridge Control Panel and runs great,

     

    best regards,

     

    jesus antonio

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • cy.gul
    cy.gul over 12 years ago

    Glad you folks are enjoying these projects! Capacitive touch is very prevalent as billions of mechanical buttons around the world are being replaced by reliable CapSense technology.

    Cypress has been the industry leader in capacitive touch sensing for over a decade now and we have integrated our best CapSense IP into the PSoC 4.

     

    We've also authored a detailed CapSense Design Guide for PSoC 4, available here - http://www.cypress.com/?rid=78578

     

    regards,

    -Gagan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago

    Hello,

     

    When I try and run the "RX8 [h=43] @1prox @0prox" command the bridge says there is a syntax error.  Any ideas?  Thanks.

     

    -Walt

    .

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cy.gul
    cy.gul over 12 years ago in reply to Former Member

    Hi Walter,

    Corrected Response -

     

    The variable name by default is "Key1". By going to "Chart > Variable Settings" you can rename it to "prox" or whatever else you'd like.

    When doing so, please also remember to change the variable type to "Int" and check the "active" box --> this is important!

     

    The default syntax would be "RX8 [h=43] @1Key1 @0Key1" (if you don't change variable name).

     

    Hope that solves your problem!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to cy.gul

    Hello Gagan.image

    it is the new mesage in the display:

     

    Best regards,

     

    Jesus.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cy.gul
    cy.gul over 12 years ago in reply to jesusantoniocar

    Hi Jesus,

     

    please note -

     

    A key point when using the Bridge Control Panel. The PWM value is a 16 bit value in your application but it is broken into two 8 bit values when transmitted. Here the Bridge Control Panel reads those values and reassembles the two 8 bit values into a single 16 bit value. It accomplishes this by using the '0' and '1' leading values on the read variables.

     

    RX8 [h=43] @1prox @0prox

     

    In the above command we have a variable named 'prox'. We add a leading 1 and 0 to the variable to indicate that these two values should be stitched together to create a single value and assign that value to 'prox'. If the '0' and '1' values are placed after 'prox', for example prox1 or prox0 then this indicates two separate variables. For more information on this please take a look at the Bridge Control Panel user guide.

     

    The variable name by default is "Key1". By going to "Chart > Variable Settings" you can rename it to "prox" or whatever else you'd like.

    When doing so, please also remember to change the variable type to "Int" and check the "active" box --> this is important!

     

    The default syntax would be "RX8 [h=43] @1Key1 @0Key1" (if you don't change variable name).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to cy.gul

    Hello Gagan.

    I changed the parameters and right now can see the signal by bridge control panel.

     

    thanks.

     

    Jesus antonio.image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

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 © 2025 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

  • X
  • Facebook
  • linkedin
  • YouTube