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
Project14
  • Challenges & Projects
  • More
Project14
Blog PSoC®︎ 6 WiFi-BT Pioneer Kit - Building an IOT Project
  • Blog
  • Forum
  • Documents
  • Theme Suggestions
  • Polls
  • Members
  • More
  • Cancel
  • New
Join Project14 to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mahmood.hassan
  • Date Created: 29 Jun 2019 8:30 PM Date Created
  • Views 914 views
  • Likes 2 likes
  • Comments 0 comments
  • cypress psoc6 wi-fi bt pioneer kit
  • adafruit io
  • psoc6
  • iot
  • cypress
Related
Recommended

PSoC®︎ 6 WiFi-BT Pioneer Kit - Building an IOT Project

mahmood.hassan
mahmood.hassan
29 Jun 2019

This project blog post is also the Part of PSoCRegistered 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WIFI-BT) - Review Product LinkProduct Link (Figure 1). This post is also related to previous ones so for better understanding kindly take a look at those too.

 

image

Figure 1: PSoC6 WiFi-BT Pioneer Kit (details)

 

In the previous posts we have learnt how to successfully build and test different programs for PSoC6 using Cypress PSoC Creator, WICED Studio and Modus Tool Box. Now we will learn how to built an IOT Project using WICED Studio.

Building an IOT Project

In this project we will use Adafruit IO platform as mqtt broker, to store data and remotely interact with our PSoC device. And then add triggers to turn ON or OFF the LED light based on ambient light sensor value for easy and autonomous control of our remote device. Also designed a simple GUI for TFT LCD display for easy to understandable information display. This project can also be used with any other mqtt broker by just replacing the broker, feeds and client ID information and also adding the username and KEY if required. (Also Tested with IBM bluemix)

Main features of this project are;

  • ON/OFF the RGB LED light.
  • Control the Brightness of LED
  • Choose the Color of RGB Light
  • Ambient Light Sensor Monitoring
  • Activity Viewer (TFT LCD Display)

WICED Studio has all the necessary libraries required to built any IOT project. In this project MQTT and Ugui (Graphics) libraries are used. All the steps required to built this project are given below and project files are also attached.

 

The project directory contains main .c file, .mk file along with TFT display driver .c & .h files and custom wifi configuration file for this project as shown below.

image

To connect with any MQTT broker we need its address, feeds path and unique client ID. For secure connection we need some additional information like username and key (not the password). All the required information to connect with Adafruit IO is shown below.

image

We can only connect with any MQTT broker if we have access to any network. In this project WiFi network is used for internet access and to connect with remote MQTT broker. We can also add the WiFi network settings in >include/default_wifi_config_dct.h and it can be used by every project. But in out project we used custom header file to keep its access to our project only.

image

After making the above mentioned changes we can build and run it on PSoC6 kit.

To interact with MQTT broker we need to create feeds and a GUI to interact with our device remotely. On Adafruit IO create four feed in default group as shown below. Any unique name can be used for these feeds. The only requirement for successful communication is using the same feed names in both PSoC code and AIO.

image

After creating the required feeds, create a new dashboard using these feed for interactive remote operation of PSoC device.

image

During debugging and testing we can also add the log widget to view all four feeds (up to 5 feeds) in AIO dashboard.

image

To add remote triggers based action, create trigger using on board ambient light sensor value to turn on or off the RGB led remotely without any user intervention.

image

To turn on the LED create new trigger on ALS feed and choose publish a ON message to LED switch as its action if its value is less than 10 (any other value can be used).

image

 

To turn off the LED create another trigger on ALS feed and choose publish a OFF message to LED switch as its action if its value is greater than 100 (any other value can be used).

image

After downloading the program on PSoC6 kit we test all the communication between device and remote MQTT broker using UART monitor or on board TFT Display.

UART monitor showing WiFi network information and all the communication happening between device and remote mqtt broker.

image

image

Similar information is also displayed on TFT LCD display but with less details. Device initialization and WiFi network details displayed on TFT LCD display are shown below.

image

After successfully device and WiFi network setup, the initialization of communication and its status between device and MQTT broker is displayed as shown below.

image

When communication and subscription of required MQTT feed is successful the main GUI is displayed on TFT LCD as shown below. At startup RGB led is OFF with white color and maximum brightness settings but these can be changed through AIO dashboard without turning ON the LED.

image

LED color is set to Blue and brightness level to 90% before turning the RGB LED.

image

Demo

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

 

Auto turn ON of LED light when ALS values goes below certain (10lx) level using Adafruit IO triggers.

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

 

Auto turn OFF of LED light when ALS values goes above certain (100lx) level using Adafruit IO triggers.

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

 

Gallery

Image gallery with different LED colors and brightness settings along with respective values displayed on GUI.

{gallery} PSoCRegistered 6 WiFi-BT Pioneer Kit - IOT Project DEMO

image

IMAGE TITLE: LED Set to White Color and Maximum Brightness

image

IMAGE TITLE: LED Set to White Color and High Brightness

image

IMAGE TITLE: LED Set to White Color and Half Brightness

image

IMAGE TITLE: LED Set to White Color and Low Brightness

image

IMAGE TITLE: LED Set to RED Color and Half Brightness

image

IMAGE TITLE: LED Set to Green Color and Half Brightness

image

IMAGE TITLE: LED Set to Blue Color and No Brightness

image

IMAGE TITLE: LED Set to Blue Color and Low Brightness

image

IMAGE TITLE: LED Set to Blue Color and Half Brightness

image

IMAGE TITLE: LED Set to Black Color and Medium Brightness

image

IMAGE TITLE: LED Set to Black Color and Low Brightness

image

IMAGE TITLE: RGB LED Closeup View While Set to White Color and Low Brightness

Attachments:
AdafruitIO.zip
  • Sign in to reply
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