This project demonstrates using Cypress PSoC 4 AFE Shield with CYW920819EVB-02 Kit, to collect data from different sensors present on the shield board and send it over Bluetooth using a custom GATT service to the peer device.
Project Technology Focuses
- CYW20819 MCU
- CYW920819EVB-02 Evaluation Kit
- CY8CKIT-032 PSoC® Analog Front End (AFE) Arduino® Shield
- BLE USB Dongle
The objective of this project is to read the values from sensors on PSoC 4 AFE shield board and send it to peer BLE GATT Client using GATT notifications.
AFE shield board has temperature sensor, humidity sensor, ambient light sensor, CapSense, push buttons, potentiometer and an OLED display. PSoC 4 on AFE Shield processes the data from all the components mentioned above. The values are stored in PSoC 4 registers. Refer the AFE Shield kit guide for more information. CYW20819 reads data from AFE shield through I2C. A custom GATT server is configured on CYW20819 to frame the sensor data as shown below.
GATT notification data format
Byte (0 -3)
Byte (4 -7)
Byte (8 -11)
Byte (12 -15)
Once the peer device subscribes for notifications, the sensor data is sent using GATT notification for every 500 milliseconds. Also, the data is displayed on the OLED and UART terminal console.
Running the Demo
Download the project files attached with this post (ccm02_source.zip) and import into Eclipse IDE for ModusToolbox. Refer the user guide for importing existing projects into Eclipse IDE for ModusToolbox Flash the firmware and pair the board with CySmart windows/android/iOS application. Go to GATT DB and enable the notification in the app to see all the sensor values.