hallcurrent21  2.1.0.0
Main Page

Hall Current 21 Click

Hall Current 21 Click is a compact add-on board designed for precise current measurement across a wide frequency range, ideal for fast and accurate monitoring applications. This board features the ACS37030, a galvanically-isolated current sensor from Allegro Microsystems. It provides bidirectional current sensing with a range of ±65A and a sensitivity of 20.3mV/A, offering high isolation of 3500VRMS and a working voltage of up to 840VRMS. It also features low noise and a wide operating bandwidth, making it suitable for high-speed switching current and control loop monitoring. This Click board™ is perfect for power supplies in servers, data centers, and solar DC-DC converters.

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Oct 2024.
  • Type : SPI type

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of Hall Current 21 Click board by reading and displaying the input current measurements.

The demo application is composed of two sections :

Application Init

Initializes the driver and calibrates the data resolution at 3A load current.

void application_init ( void )
{
log_cfg_t log_cfg;
hallcurrent21_cfg_t hallcurrent21_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
hallcurrent21_cfg_setup( &hallcurrent21_cfg );
HALLCURRENT21_MAP_MIKROBUS( hallcurrent21_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == hallcurrent21_init( &hallcurrent21, &hallcurrent21_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_printf( &logger, " Calibrating data resolution in 5 seconds...\r\n" );
log_printf( &logger, " Keep the load current set at %.1fA during the calibration process.\r\n",
for ( uint8_t cnt = 5; cnt > 0; cnt-- )
{
log_printf( &logger, " %u\r\n", ( uint16_t ) cnt );
Delay_ms ( 1000 );
}
{
log_error( &logger, " Calibrate resolution." );
for ( ; ; );
}
log_printf( &logger, " Data resolution calibration DONE.\r\n" );
log_info( &logger, " Application Task " );
}

Application Task

Reads the input current measurements and displays the results on the USB UART approximately once per second.

void application_task ( void )
{
float current = 0;
if ( HALLCURRENT21_OK == hallcurrent21_read_current ( &hallcurrent21, &current ) )
{
log_printf( &logger, " Current : %.1f A\r\n\n", current );
Delay_ms ( 1000 );
}
}

Note

The measurement range is approximately: +/- 65A.

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

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.


hallcurrent21_cfg_t
Hall Current 21 Click configuration object.
Definition: hallcurrent21.h:172
HALLCURRENT21_ERROR
@ HALLCURRENT21_ERROR
Definition: hallcurrent21.h:195
hallcurrent21_read_current
err_t hallcurrent21_read_current(hallcurrent21_t *ctx, float *current)
Hall Current 21 read current function.
application_task
void application_task(void)
Definition: main.c:81
hallcurrent21_t
Hall Current 21 Click context object.
Definition: hallcurrent21.h:156
HALLCURRENT21_CALIBRATING_CURRENT
#define HALLCURRENT21_CALIBRATING_CURRENT
Definition: main.c:30
hallcurrent21_calib_resolution
err_t hallcurrent21_calib_resolution(hallcurrent21_t *ctx, float calib_current)
Hall Current 21 calib resolution function.
HALLCURRENT21_OK
@ HALLCURRENT21_OK
Definition: hallcurrent21.h:194
HALLCURRENT21_MAP_MIKROBUS
#define HALLCURRENT21_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: hallcurrent21.h:142
application_init
void application_init(void)
Definition: main.c:35
hallcurrent21_cfg_setup
void hallcurrent21_cfg_setup(hallcurrent21_cfg_t *cfg)
Hall Current 21 configuration object setup function.
hallcurrent21_init
err_t hallcurrent21_init(hallcurrent21_t *ctx, hallcurrent21_cfg_t *cfg)
Hall Current 21 initialization function.
hallcurrent21_read_voltage_avg
err_t hallcurrent21_read_voltage_avg(hallcurrent21_t *ctx, uint8_t channel, uint16_t num_conv, float *voltage_avg)
Hall Current 21 read average voltage level function.