TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136713 times)
  2. FAT32 Library (69924 times)
  3. Network Ethernet Library (55936 times)
  4. USB Device Library (46259 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41148 times)
  7. GSM click (28979 times)
  8. PID Library (26410 times)
  9. mikroSDK (26355 times)
  10. microSD click (25353 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

PWR Meter 3 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: Measurements

Downloaded: 112 times

Not followed.

License: MIT license  

PWR Meter 3 Click is a compact add-on board that measures voltage and current through the connected load. This board features the ACS37800, an I2C-configurable power monitoring solution from Allegro MicroSystems, which simplifies the addition of power monitoring to many AC/DC powered systems. The ACS37800’s Hall-effect-based current sensing technology achieves reinforced isolation ratings (4800 VRMS) alongside a reliable ±90A bidirectional current sensing. It also has two LED indicators for the realization of visual detection of some anomalies in operation, such as under/overvoltage and fast overcurrent fault detection.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "PWR Meter 3 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "PWR Meter 3 click" changes.

Do you want to report abuse regarding "PWR Meter 3 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


PWR Meter 3 click

PWR Meter 3 Click is a compact add-on board that measures voltage and current through the connected load. This board features the ACS37800, an I2C-configurable power monitoring solution from Allegro MicroSystems, which simplifies the addition of power monitoring to many AC/DC powered systems. The ACS37800’s Hall-effect-based current sensing technology achieves reinforced isolation ratings (4800 VRMS) alongside a reliable ±90A bidirectional current sensing. It also has two LED indicators for the realization of visual detection of some anomalies in operation, such as under/overvoltage and fast overcurrent fault detection.

pwrmeter3_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Oct 2022.
  • Type : I2C type

Software Support

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

Standard key functions :

  • pwrmeter3_cfg_setup Config Object Initialization function.

    void pwrmeter3_cfg_setup ( pwrmeter3_cfg_t *cfg );
  • pwrmeter3_init Initialization function.

    err_t pwrmeter3_init ( pwrmeter3_t *ctx, pwrmeter3_cfg_t *cfg );
  • pwrmeter3_default_cfg Click Default Configuration function.

    err_t pwrmeter3_default_cfg ( pwrmeter3_t *ctx );

Example key functions :

  • pwrmeter3_get_dio0_pin This function returns the DIO0 pin logic state.

    uint8_t pwrmeter3_get_dio0_pin ( pwrmeter3_t *ctx );
  • pwrmeter3_get_dio1_pin This function returns the DIO1 pin logic state.

    uint8_t pwrmeter3_get_dio1_pin ( pwrmeter3_t *ctx );
  • pwrmeter3_read_average_rms This function reads the voltage and current RMS measurements averaged from a specified number of samples.

    err_t pwrmeter3_read_average_rms ( pwrmeter3_t *ctx, float *v_rms, float *i_rms, uint16_t num_avg );

Example Description

This example demonstrates the use of PWR Meter 3 click board by reading and displaying the voltage, current, and power RMS measurements.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration which sets the DC measurement and VRMS thresholds to about 28V for overvoltage and about 9.3V for undervoltage flag.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    pwrmeter3_cfg_t pwrmeter3_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    pwrmeter3_cfg_setup( &pwrmeter3_cfg );
    PWRMETER3_MAP_MIKROBUS( pwrmeter3_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == pwrmeter3_init( &pwrmeter3, &pwrmeter3_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( PWRMETER3_ERROR == pwrmeter3_default_cfg ( &pwrmeter3 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Reads the voltage and current RMS values averaged from 500 samples, then calculates the power from it and displays the results on the USB UART. Also if an UV or OV flag is detected it will be logged accordingly.

void application_task ( void )
{
    float v_rms, i_rms;
    if ( PWRMETER3_OK == pwrmeter3_read_average_rms ( &pwrmeter3, &v_rms, &i_rms, PWRMETER3_DEF_AVG_SAMPLES ) )
    {
        if ( !pwrmeter3_get_dio0_pin ( &pwrmeter3 ) )
        {
            log_printf ( &logger, " Over-voltage detected!\r\n" );
        }
        if ( !pwrmeter3_get_dio1_pin ( &pwrmeter3 ) )
        {
            log_printf ( &logger, " Under-voltage detected!\r\n" );
        }
        log_printf ( &logger, " Voltage: %.2f V\r\n", v_rms );
        log_printf ( &logger, " Current: %.2f A\r\n", i_rms );
        log_printf ( &logger, " Power: %.2f W\r\n\n", i_rms * v_rms );
    }
}

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

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.


ALSO FROM THIS AUTHOR

IR Gesture 3 click

0

IR Gesture 3 Click is a compact add-on board that provides contactless gesture recognition. This board features the ADPD1080, a photometric front-end from Analog Devices. The IR Gesture 3 Click allows gesture recognition in two dimensions, with a built-in optical filter and a sharp visible light cutoff. It eliminates the need for external lenses and preserves the dynamic range of the sensor when placed under sunlight or indoor lighting. It does not require a precise alignment because its sensor maintains a linear response within the ±35° angular field of view.

[Learn More]

LED Driver 12 click

0

LED Driver 12 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the PCA9532, a 16-bit I2C-configurable I/O expander optimized for dimming LEDs in 256 discrete Red/Green/Blue (RGB) steps from NXP Semiconductors. The PCA9532 offers high efficiency, supporting up to 16 LED channels and delivering a maximum of up to 25mA of LED current per channel. It contains an internal oscillator with two user-programmable blink rates and duty cycles coupled to the output PWM. Any bits not used for controlling the LEDs can be used for GPIO expansion, which provides a simple solution when additional I/O is needed for some sensors, push-buttons, or alarm monitoring. This Click board™ is suitable for color mixing and backlight application for amusement products, LED status signalization, home automation projects, and many more.

[Learn More]

Illuminance click

0

Illuminance Click is a compact add-on board that mimics how humans perceive light. This board features ams AG’s TSL2583, a very-high sensitivity light-to-digital converter that transforms light intensity to a digital signal output capable of the direct I2C interface. It combines one broadband photodiode (visible plus infrared) and one infrared-responding photodiode on a single CMOS integrated circuit capable of providing a near-photopic response over an effective 16-bit dynamic range (16-bit resolution).

[Learn More]