current6  2.0.0.0
Main Page

Current 6 click

Current 6 Click is a compact add-on board providing a precise and accurate current sensing solution. This board features the MAX40080, a fast-response bi-directional current-sense amplifier from Analog Devices. The device features ultra-low 5uV input offset voltage, very-low 0.2% gain error, and includes an analog-to-digital converter with programmable sample rate and 12-bit resolution featuring I2C compatible interface. It also features a wake-up current-threshold and auto-shutdown mode when the I2C is inactive, both designed to minimize power consumption. The current-shunt monitor can measure voltage signals on common-mode voltages ranging from -0.1V (ground sensing) to 36V, independent of the supply voltage. This Click boardâ„¢ delivers higher performance to industrial control and automation applications, load and power supplies monitoring, telecom equipment, and many more.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Nov 2021.
  • Type : I2C type

Software Support

We provide a library for the Current 6 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for Current 6 Click driver.

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of Current 6 click board by reading the input voltage and current measurements.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
current6_cfg_t current6_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
current6_cfg_setup( &current6_cfg );
CURRENT6_MAP_MIKROBUS( current6_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == current6_init( &current6, &current6_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( CURRENT6_ERROR == current6_default_cfg ( &current6 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Waits for the FIFO data interrupt and then reads the measurements of the input voltage and current and displays the results on the USB UART approximately once per second.

void application_task ( void )
{
if ( current6_get_alert_pin ( &current6 ) )
{
uint16_t status;
if ( CURRENT6_OK == current6_get_status ( &current6, &status ) )
{
{
float voltage, current;
if ( CURRENT6_OK == current6_read_data ( &current6, &voltage, &current ) )
{
log_printf( &logger, " Voltage: %.3f V\r\n Current: %.3f A\r\n\n", voltage, current );
}
}
}
}
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Current6

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.


CURRENT6_FIFO_CFG_DATA_OVERFLOW_MASK
#define CURRENT6_FIFO_CFG_DATA_OVERFLOW_MASK
Definition: current6.h:150
CURRENT6_OK
@ CURRENT6_OK
Definition: current6.h:261
current6_cfg_t
Current 6 Click configuration object.
Definition: current6.h:243
application_task
void application_task(void)
Definition: main.c:66
CURRENT6_MAP_MIKROBUS
#define CURRENT6_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: current6.h:207
current6_read_data
err_t current6_read_data(current6_t *ctx, float *voltage, float *current)
Current 6 read data function.
application_init
void application_init(void)
Definition: main.c:30
current6_init
err_t current6_init(current6_t *ctx, current6_cfg_t *cfg)
Current 6 initialization function.
current6_cfg_setup
void current6_cfg_setup(current6_cfg_t *cfg)
Current 6 configuration object setup function.
current6_t
Current 6 Click context object.
Definition: current6.h:221
current6_default_cfg
err_t current6_default_cfg(current6_t *ctx)
Current 6 default configuration function.
current6_get_status
err_t current6_get_status(current6_t *ctx, uint16_t *status)
Current 6 get status function.
current6_get_alert_pin
uint8_t current6_get_alert_pin(current6_t *ctx)
Current 6 get alert pin function.
CURRENT6_ERROR
@ CURRENT6_ERROR
Definition: current6.h:262