element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
Connected Cloud Challenge
  • Challenges & Projects
  • Design Challenges
  • Connected Cloud Challenge
  • More
  • Cancel
Connected Cloud Challenge
Blog The Bio Highway – Connecting the heartbeat sensor to CY8CPROTO-062-4343W
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: vlasov01
  • Date Created: 9 May 2020 11:49 PM Date Created
  • Views 585 views
  • Likes 2 likes
  • Comments 0 comments
  • heartbeat
  • adc analog sensor
  • cy8cproto-062-4343w
  • adc
Related
Recommended

The Bio Highway – Connecting the heartbeat sensor to CY8CPROTO-062-4343W

vlasov01
vlasov01
9 May 2020

Disconnecting Thermistor

Last week I've noticed some noise on ADC port, which was connected to thermisotor. This week I’ve removed two connections between ADC and the thermistor by unsoldering R36 and R37.

image

 

Connecting Heartbeat Sensor

 

This allowed me to use P10_1 and P10_2 for other sensors. I’ve connected my heartbeat sensor output to P10_2. And I’ve connected P10_0 to the sensor ground line and P10_3 to the sensor VDD line.

image

Adding Power to the Sensor

I’ve modified the code to power on the sensor by configuring GPIO P10_0 and P10_3 to low

 

void set_my_pins_on(){
    cy_rslt_t rslt;
    /* Initialize pin P10_3 GPIO as an output with strong drive mode and initial value = false (low) */
    rslt = cyhal_gpio_init(P10_3, CYHAL_GPIO_DIR_OUTPUT, CYHAL_GPIO_DRIVE_STRONG, false);

    if (rslt != CY_RSLT_SUCCESS)
    {
        printf("P10_3 failed to set up");
    }
    /* Initialize pin P10_0 GPIO as an output with strong drive mode and initial value = false (low) */
    rslt = cyhal_gpio_init(P10_0, CYHAL_GPIO_DIR_OUTPUT, CYHAL_GPIO_DRIVE_STRONG, false);
    if (rslt != CY_RSLT_SUCCESS)
    {
        printf("P10_0 failed to set up");
    }
}

and than toggling P10_3 to high. So the heartbeat sensor LED is now light up.

set_my_pins_on();
init_adc();
cyhal_gpio_toggle(P10_3);

 

Running the heartbeat sensor on CY8CPROTO-062-4343W

After all initial configuration has been done I've run some tests. The objective of this tests is to identify a strategy to deal the noise on ADC channel.

#define ADC_SAMPLES          16 int int_dec = ADC_SAMPLES; static long accumulator=0L; void read_adc() {      /* Read the 16 bit ADC conversion result for corresponding ADC channel */      uint16_t adc_out = cyhal_adc_read_u16(&adc_chan_0_obj);      accumulator += adc_out;      int_dec--;      if (int_dec == 0) {           int_dec = ADC_SAMPLES;           printf("%hu\r\n", accumulator / ADC_SAMPLES);           accumulator=0L;      } }

 

I've stored results into Excel and visualized them on line diagrams. Here is one of such test, where I'm using 16 samples from ADC reads to reduce noise.

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