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 " );
}
#define HALLCURRENT7_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition hallcurrent7.h:105
void application_init(void)
Definition main.c:34

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 );
}
#define HALLCURRENT7_VREF_5000_mV
Definition hallcurrent7.h:76
int16_t current
Definition main.c:32
void application_task(void)
Definition main.c:65

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.