The perfect solution for athletes and fitness enthusiasts, providing advanced monitoring and analysis of heart rate variability during exercise
A
A
Hardware Overview
How does it work?
ECG 5 Click is based on the AD8232, an integrated heart rate monitoring front-end, by Analog Devices. This IC is targeted toward wearables and battery-operated applications. The heart-rate impulses are naturally weak and in the range of just a few millivolts, even microvolts. Therefore, any external interference might obscure them. The interferences might be induced in the human body itself, or they might appear as the result of the activity of other muscles, such as skeletal muscles. Therefore, the input signal from the electrodes is processed by several filtering sections until it is amplified to a value suitable for sampling. However, the correct placement of the measurement electrodes is crucial for accurate readings. ECG 5 Click features a 3.5mm jack connector connecting three electrodes. One of the electrodes is a so-called right leg drive electrode (RLD), used to set the patient's body to the same potential as the rest of the system. In addition, it is used to reduce the noise resulting from the human body acting as an antenna (picking up
50/60Hz hum from the mains). Along with the integrated 2-pole high-pass and RFI filtering sections, the IC effectively reduces the overall system noise. Lead-off detection is very important for accurate ECG measurements. Therefore, this IC is equipped with the dedicated LOD pin, set to a HIGH logic level when any of the electrodes is missing. Lead-off circuitry is a comparator that ensures the body stays within 0.5V from the positive rail. By featuring two separate LOD pins, it is possible to determine the exact electrode that may be missing. In DC lead-off detection mode, all three electrodes must be connected. The LOD+ is routed to the mikroBUS™ INT pin, while the LOD- is routed to the mikroBUS™ PWM pin. The pins are labeled as LO+ and LO- respectively, on this Click board™. Due to the signal filtering within the AD8232 IC, the settling time for the connected electrodes may be too long. Therefore this IC features the fast restore option (FR pin is pulled to a HIGH logic level on ECG 5 click), which dynamically sets the cutoff frequency
to a higher value, speeding up the settling time, which may be in the magnitude of several seconds (for example, when the electrodes are connected). The IC can be driven to a low power consumption mode. If the SDN pin is pulled to a LOW logic level, the IC will enter the standby mode, greatly reducing the power consumption. Utilizing the LOD pins, the MCU can be programmed to enter the standby mode along with the AD8232, which is ideal for battery-powered applications. SDN pin is routed to the mikroBUS™ CS pin and is labeled as SDN. The OUT pin of the AD8232 is routed to the AN pin of the mikroBUS™. It provides the amplified and filtered signal from the electrodes, which can be used directly on the A/D peripheral of the host MCU. The AD8232 can drive both resistive and capacitive loads, so no additional buffering IC is required. In addition, ECG 5 click is equipped with a LED labeled as ECG, which can be used as a visual indicator of the output signal.
Features overview
Development board
EasyPIC v7 is the seventh generation of PIC development boards specially designed to develop embedded applications rapidly. It supports a wide range of 8-bit PIC microcontrollers from Microchip and has a broad set of unique functions, such as a powerful onboard mikroProg programmer and In-Circuit debugger over USB-B. The development board is well organized and designed so that the end-user has all the necessary elements in one place, such as switches, buttons, indicators, connectors, and others. With four different connectors for each port, EasyPIC v7 allows you to connect accessory boards, sensors, and custom electronics more efficiently than ever. Each part of
the EasyPIC v7 development board contains the components necessary for the most efficient operation of the same board. An integrated mikroProg, a fast USB 2.0 programmer with mikroICD hardware In-Circuit Debugger, offers many valuable programming/debugging options and seamless integration with the Mikroe software environment. Besides it also includes a clean and regulated power supply block for the development board. It can use various external power sources, including an external 12V power supply, 7-23V AC or 9-32V DC via DC connector/screw terminals, and a power source via the USB Type-B (USB-B) connector. Communication options such as
USB-UART and RS-232 are also included, alongside the well-established mikroBUS™ standard, three display options (7-segment, graphical, and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from PIC10F, PIC12F, PIC16F, PIC16Enh, PIC18F, PIC18FJ, and PIC18FK families. EasyPIC v7 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
28
RAM (Bytes)
2048
You complete me!
Accessories
3-wire ECG/EMG cable comes with a convenient 3.5mm phone jack, and it is designed for electrocardiogram recording. This 1m cable is a practical companion for medical professionals and enthusiasts. To complement this cable, you can also use single-use adhesive ECG/EMG electrodes measuring 48x34mm, each equipped with an ECG/EMG cable stud adapter. These electrodes ensure a seamless experience when paired with our ECG/EMG cable and guarantee reliable ECG/EMG signal transmission for comprehensive cardiac monitoring. Trust in the accuracy and convenience of this setup to effortlessly record electrocardiograms and electromyograms with confidence.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for ECG 5 Click driver.
Key functions:
ecg5_setMode
- Mode Setting functionecg5_check_LOD_negative
- LOD- Checking functionecg5_check_lod_positive
- LOD+ Checking function
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file main.c
* @brief ECG 5 Click Example.
*
* # Description
* This is an example which demonstrates the use of ECG 5 Click board.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes ADC and GPIO.
*
* ## Application Task
* Reads ADC value and sends results on serial plotter every 5 ms.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "ecg5.h"
static ecg5_t ecg5; /**< ECG 5 Click driver object. */
static log_t logger; /**< Logger object. */
static uint32_t time;
void application_init ( void ) {
log_cfg_t log_cfg; /**< Logger config object. */
ecg5_cfg_t ecg5_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
ecg5_cfg_setup( &ecg5_cfg );
ECG5_MAP_MIKROBUS( ecg5_cfg, MIKROBUS_1 );
if ( ADC_ERROR == ecg5_init( &ecg5, &ecg5_cfg ) ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void ) {
uint16_t ecg5_an = 0;
if ( ADC_SUCCESS == ecg5_read_an_pin_value( &ecg5, &ecg5_an ) ) {
log_printf( &logger, " %u,%lu\r\n ", ecg5_an, time );
}
time += 5;
Delay_ms( 5 );
}
void main ( void ) {
application_init( );
for ( ; ; ) {
application_task( );
}
}
// ------------------------------------------------------------------------ END