hallcurrent7  2.0.0.0
Main Page

Hall Current 7 Click

Hall Current 7 Click is a compact add-on board that provides economical and precise solutions for AC or DC current sensing. This board features the ACS770, a thermally enhanced, fully integrated, Hall effect-based high precision linear current sensor with 100µΩ current conductor from Allegro MicroSystems. Applied current flows directly into the integrated conductor generating a magnetic field, and an integrated low-hysteresis core concentrates the magnetic field sensed by the Hall element with a typical accuracy of ±1% and 120 kHz bandwidth.

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Aug 2021.
  • Type : I2C type

Software Support

We provide a library for the HallCurrent7 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 HallCurrent7 Click driver.

Standard key functions :

Example key functions :

Example Description

This example shows the capabilities of the Hall Current 7 Click board.

The demo application is composed of two sections :

Application Init

Initalizes I2C driver and makes an initial log.

void application_init ( void ) {
log_cfg_t log_cfg;
hallcurrent7_cfg_t hallcurrent7_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
hallcurrent7_cfg_setup( &hallcurrent7_cfg );
HALLCURRENT7_MAP_MIKROBUS( hallcurrent7_cfg, MIKROBUS_1 );
err_t init_flag = hallcurrent7_init( &hallcurrent7, &hallcurrent7_cfg );
if ( I2C_MASTER_ERROR == init_flag ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Measuring current passing through the on board Hall Effect Sensor and displaying data every two seconds.

void application_task ( void ) {
log_printf( &logger, "Current: %d mA\r\n", current );
log_printf( &logger, "------------------------\r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}

Note

In order to get correct calculations user should change "v_ref" value to his own power supply voltage.

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.HallCurrent7

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.


hallcurrent7_read_voltage
uint16_t hallcurrent7_read_voltage(hallcurrent7_t *ctx, uint16_t v_ref)
Read voltage function.
hallcurrent7_t
Hall Current 7 Click context object.
Definition: hallcurrent7.h:117
application_task
void application_task(void)
Definition: main.c:65
HALLCURRENT7_VREF_5000_mV
#define HALLCURRENT7_VREF_5000_mV
Definition: hallcurrent7.h:76
hallcurrent7_avg_current
int16_t hallcurrent7_avg_current(hallcurrent7_t *ctx, uint16_t v_ref)
Calculate Average current function.
application_init
void application_init(void)
Definition: main.c:34
hallcurrent7_calc_current
int16_t hallcurrent7_calc_current(hallcurrent7_t *ctx, uint16_t v_ref)
Calculate current function.
HALLCURRENT7_MAP_MIKROBUS
#define HALLCURRENT7_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: hallcurrent7.h:105
hallcurrent7_init
err_t hallcurrent7_init(hallcurrent7_t *ctx, hallcurrent7_cfg_t *cfg)
Hall Current 7 initialization function.
hallcurrent7_cfg_t
Hall Current 7 Click configuration object.
Definition: hallcurrent7.h:131
current
int16_t current
Definition: main.c:32
hallcurrent7_cfg_setup
void hallcurrent7_cfg_setup(hallcurrent7_cfg_t *cfg)
Hall Current 7 configuration object setup function.