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 - Read ADC (Ambient Light Sensor) using Cypress PSoC Creator
  • 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:45 PM Date Created
  • Views 1226 views
  • Likes 2 likes
  • Comments 0 comments
  • RoadTest
  • cypress psoc6 wi-fi bt pioneer kit
  • psoc6
  • cypress
Related
Recommended

PSoC®︎ 6 WiFi-BT Pioneer Kit - Read ADC (Ambient Light Sensor) using Cypress PSoC Creator

mahmood.hassan
mahmood.hassan
29 Jun 2019

This 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 post we have learn how to successfully build and test the Hello World project based on UART_printf example. And also created a new project of Blinky LED without using any pre-built examples. Now we will built learn how to read ADC of PSoC6 MCU.

Read ADC (Ambient Light Sensor)

As we have already know that one of the major feature of PSoC6 MCU is its Analog signal handling capabilities. It has SAR ADC, op-amp, low power comparator, analog MUX, current and voltage DAC. In this project we will learn how to use SAR ADC of PSoC6 in continuous sampling mode to read the analog output voltage of ambient light sensor (figure 2) available on TFT shield of this kit. Its schematic is also shown in figure 3.

image

Figure 2: Ambient Light Sensor (datasheet: HERE) Available on TFT Shield

image

Figure 3:TEMT6000 Analog Ambient Light Sensor Available on TFT Shield (source HERE)

 

After reading the analog value, it will be transmitted to PC through UART. In this project we will use the previously created HELLO WORLD project and add the ADC functionality in it so that we can monitor the output of ALS. In this Project we will also use hardware samples averaging feature of PSoC6 ADC module. All the steps with detail are given below (Skipping all those steps that are previously mentioned). In this example void CyDelay(uint32 milliseconds) (figure 4) delay function is used to slow down the UART ADC data transmission.

image

Figure 4: Builtin delay function in PSoC Creator (source HERE)

 

Open the UART_printf project in PSOC Creator add scanning SAR ADC component in existing TopDesign schematic.

image

Double on newly added ADC component to Configure it. Modify the VRef Select, Number of Channels and Input Mode.

image

Go to Common tab in ADC configuration dialog and ADC Sample Mode should be Continuous and Click OK

image

ADC component will look like this after Configuration

image

Add Analog Input pin

image

Open the Analog Input Pin configuration dialog and rename it to ALS_Shield and change its configuration if required

image

Before selecting the Hardware pin for analog input. Find the ALS of TFT shield connection to PSOC6 Pioneer Board. It is connected to P10_0/A0 of PSoC6 Pioneer Board.

image

Assign the P10_0 to Analog Input Pin added into TopDesign Schematic.

image

Add the following lines before the forever for loop in int main() function in main_cm4.c file

image

Modify the forever for loop in main_cm4.c file to continuous read the ALS value and transmit it to PC through UART

image

Build and Program the PSoC6 pioneer board and verify the Ambient light sensor ADC value in UART monitor

image

Change the Number of Samples Averaged to 64 in ADC component configuration dialog to get the smooth values of ALS. After modifying it build and reprogram the PSoC6 Pioneer board to test the result.

image

ALS values will become smooth after increasing the number of sample averaged.

image

  • 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