element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Achievement Levels
    • Benefits of Membership
    • Feedback and Support
    • Members Area
    • Personal Blogs
    • What's New on element14
  • Learn
    Learn
    • eBooks
    • Learning Center
    • Learning Groups
    • STEM Academy
    • Webinars, Training and Events
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Arduino Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Project Groups
    • Raspberry Pi Projects
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • 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
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs First Steps with the Cypress BLE Pioneer Kit - CapSense Proximity Sensing
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 5 May 2015 6:03 PM Date Created
  • Views 346 views
  • Likes 4 likes
  • Comments 1 comment
  • bluetooth
  • ble
  • pioneer
  • cy8ckit-042
  • cypress_semiconductor
  • bluetooth_low_energy
  • capsense
  • bluetooth®
  • cypress
  • feature_tutorial
Related
Recommended

First Steps with the Cypress BLE Pioneer Kit - CapSense Proximity Sensing

Jan Cumps
Jan Cumps
5 May 2015

I'm a BLE beginner. Never developed anything for bluetoothRegistered, let alone the low energy variant.

I received a Bluetooth Low Energy Pioneer Kit ( cy8ckit-042-BLE ) a few weeks ago.

 

I'm testing the CapSense proximity sensor and the BLE payload.

 

related posts:

First Steps with the Cypress BLE Pioneer KIT - Unboxing and BLE Sniffing

 

image

 

CapSense?

 

The Cypress PSoC and PRoC have fabric on them that's specialized in capacitive sensing.

This module delivers the  functionality behind the capacitive slider on the base board. It is also configurable as a proximity sensor.

image

The base board has a header where you can plug in one side of a wire ring..

The wire acts as the sensor. It will react on your hand moving close to it.

You don't have to touch it. It will react from some distance.

The spec says that the diameter of your sense wire has impact. I'll test that in this post.

 

The Proximity Sensor header is directly connected to P2.0 of the BLE modules.

image

On our PSoC or PRoC chip, that's pin 37. We'll find that back later when we define the routing.

image

In the PSoC Creator IDE we'll take care that this signal P2.0 is implemented as a CapSence Proximity Sensor.

 

Configuring the Proximity Sensor

 

In today's exercise I'll use the Programmable Radio on Chip module. I have no particular reason to choose this module. But I've used the PSoC the previous time.

We'll have to select a CapSense component in the PScO Creator, and configure it as a Proximity Sensor.

 

I'm using the CapSense Proximity example from my kit's Kit Guide.

The annotated board picture and schematic snippets also come from this guide.

 

image

A nice touch of the IDE is that you have direct access to the datasheet of that component.

The pdf explains how to configure and use the CapSense component.

It also defines some specific requirements in the source code of the on-board ARM microcontroller to enable the sensor.

 

image

In the IDE, you also define the routing to the pin 37 of the BLE PRoC/PSoC

image

 

There are a number of other configurations happening (the BLE module, wake up button, led, ...). I'm not covering them in this article except a little part of BLE.

The special initialization requirement to enable the Proximity Sensor is handled in main.c.

image

 

Configuring BLE

 

The constants related to the BLE payload (attributes) are defined in BLE_gatt.c.

{ 0x000Eu, 0xCAA1u /* CapSense Proximity                  */, 0x00001000u /* ntf    */, 0x0010u, {{0x0001u, (void *)&cyBle_attValues[32]}}   },

 

All the handling of BLE notifications for sensor value changes are handled in BLEApplication.c.

We'll have to enable the notification from the BLE client (in our case this is the USB dongle that comes with the kit) or the BLE module won't send info.

But once that's done, the functions in BLEApplication.c will send notifications with sensor data over BLE.

 

Listen to Proximity Sensor Data

 

Just like in the previous exercise, we're using the USB dongle and CySmart to enable notifications and snoop data.

To make this a bit more interesting - and because the datasheet mentions it - I'm going to test with three different wire loops.

I'm going to make a big shortcut here and jump directly to the notification part.

The Kit Guide has an excellent step-by-step guide on how to get there.

 

image

 

 

My loops have a diameter if 2.5, 4 and 10 cm. I'll measure when the sensor starts sensing, and how close I have to reach to get a full reading (0xFF).

The first step is to enable the notification.

image

Once we write 01:00 to this attribute, our BLE module gets informed that it has to enable the notification for our proximity sensor.

From than on, the data is streaming. The BLE module will send a notification when it detects a change in sensor data.

image

 

And here are the measurements with the 3 wire sensors:

2.5 cm4 cm10 cm
imageimageimage
start detecting3 cm3.5 cm9 cm
full scale1 cm2.5 cm2.5 cm

.

Fun little exercise.

  • Sign in to reply

Top Comments

  • DAB
    DAB over 8 years ago +1
    Very good post Jan. I was wondering how the detection range changed with a simple cap sense antenna. I am also impressed with how simple it is to activate the capability on the BLE device. Good work, …
  • DAB
    DAB over 8 years ago

    Very good post Jan.

     

    I was wondering how the detection range changed with a simple cap sense antenna.

     

    I am also impressed with how simple it is to activate the capability on the BLE device.

     

    Good work,

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • 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 © 2023 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