Bluetooth Tutorial 1 - Thermometer

Introduction

PSoC Setup

  1. Connect Header J2, pin P3[0] Header J3, pin VREF with a jumper wire.

PSoC Creator

  1. Open PSoC Creator and selct file –> Code Example… from the top menu.

    Open a Code Example
    Open a Code Example

  2. Search for “BLE”. Select “BLE_Temperature_measurement”

    Search for “BLE”
    Search for “BLE”

  3. Click the World Icon to download the code example

  4. Create a new project using the defaults

    Create a new project
    Create a new project

  5. A .pdf tutorial will open that you can follow along with, in conjunction with this tutorial.

    A pdf tutorial
    A pdf tutorial

  6. In the project workspace, right click on the project

    Open the Device Selector
    Open the Device Selector

  7. Select the BLE module plugged into your Pioneer Board

    Select your BLE module
    Select your BLE module

  8. The project will update, mapped to your selected microcontroller

  9. In your top design, double-click on the BLE module, go to GAP Settings, and check ```Silicon generated “Company assigned” part of the address" to make your BLE UUID unique.``

  10. Download your project to the PSoC

    Download your project
    Download your project

CySmart PC App

  1. Open the CySmart app.

    Open CySmart
    Open CySmart

  2. Plug in the BLE Dongle

    BLE Dongle
    BLE Dongle

    Select the CySmart BLE Dongle
    Select the CySmart BLE Dongle

    Press the Reset Button
    Press the Reset Button

    The LED will rapidly flash blue
    The LED will rapidly flash blue

    The LED will remain on green
    The LED will remain on green

  3. Select Start Scan.

    Select Start Scan
    Select Start Scan

  4. Select the closest “Thermometer” Item and then click “Connect”

    Connect
    Connect

  5. Select “Discover all Attributes”

    Discover all Attributes
    Discover all Attributes

  6. Select “Pair” to pair with the device. A dialog box will pop up notifying you if it is successful.

    Pair with the Device
    Pair with the Device

![Pairing Successful](tutorial044.png)
  1. Select “Enable all Notifications” to receive updates from the BLE device. You may need to resize the attributes window to see the icon.

    Enable all Notifications
    Enable all Notifications

  2. Observe the values being received in the status window at the bottom. The address of some of these messages should correspond with the “Temperature Measurement” address listed in the Attributes list above.

    Receiving Messages
    Receiving Messages

Phone App

  1. Open the LightBlue App in your phone

    Select the LightBlue App
    Select the LightBlue App

    Press the Reset Button
    Press the Reset Button

    The LED will rapidly flash blue
    The LED will rapidly flash blue

    The LED will remain on green
    The LED will remain on green

  2. Select the “Thermometer” device with the strongest signal. That is most likely the closest device. The device screen will open.

    Select the Thermometer
    Select the Thermometer

  3. A notification dialog should pop up asking if you would like to pair with the device. Select “pair and connect”

    Select Pair and Connect
    Select Pair and Connect

  4. Confirm to Pair the Device

    Confirm
    Confirm

  5. Select the “Temperature Measurement” Item

    Select Temperature Measurement
    Select Temperature Measurement

  6. Click Subscribe

    Subscribe
    Subscribe

  1. A stream of values will incrementally stream to your device. Click unsubscribe to stop.

    Image
    Image