pwrmeter2  2.0.0.0
Main Page

PWR Meter 2 click

PWR Meter 2 click is a compact and accurate power monitoring Click boardâ„¢, capable of measuring and monitoring voltage up to 24V and current up to 5A.

click Product page


Click library

Software Support

We provide a library for the PwrMeter2 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for PwrMeter2 Click driver.

Standard key functions :

Example key functions :

Examples Description

This app measuring and monitoring voltage up to 24V and current up to 5A.

The demo application is composed of two sections :

Application Init

Initializes device.

void application_init ( void )
{
log_cfg_t log_cfg;
// Logger initialization.
log_cfg.level = LOG_LEVEL_DEBUG;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----\r\n" );
// Click initialization.
PWRMETER2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
pwrmeter2_init( &pwrmeter2, &cfg );
pwrmeter2_default_cfg( &pwrmeter2 );
log_printf( &logger, "PWR Meter 2 is initialized \r\n" );
Delay_ms( 200 );
}

Application Task

Gets calculated voltage, current and power data every 500 miliseconds and shows results on UART.

void application_task ( void )
{
int32_t voltage_res;
int32_t current_res;
uint32_t power_res;
pwrmeter2_get_data( &pwrmeter2, &voltage_res, &current_res, &power_res );
log_printf( &logger, "U = %d mV \r\n", voltage_res );
log_printf( &logger, "I = %d mV \r\n", current_res );
log_printf( &logger, "P = %u mV \r\n", power_res );
Delay_ms( 500 );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.