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 (136736 times)
  2. FAT32 Library (69950 times)
  3. Network Ethernet Library (55941 times)
  4. USB Device Library (46266 times)
  5. Network WiFi Library (41886 times)
  6. FT800 Library (41170 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26360 times)
  10. microSD click (25376 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

Load Cell 7 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: Force

Downloaded: 83 times

Not followed.

License: MIT license  

Load Cell 7 Click is a compact add-on board representing a weigh scale solution. This board features the ADS1230, a high-precision 20-bit delta-sigma analog-to-digital converter (ADC) with an outstanding noise performance from Texas Instruments. This SPI-configurable ADC (read-only) offers selectable gain and data rate values, supporting a full-scale differential input of ±39mV/±19.5mV and 10SPS/80SPS, respectively. It comes with an onboard low-noise programmable gain amplifier (PGA) and onboard oscillator providing a complete front-end solution.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Load Cell 7 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Load Cell 7 click" changes.

Do you want to report abuse regarding "Load Cell 7 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Load Cell 7 click

Load Cell 7 Click is a compact add-on board representing a weigh scale solution. This board features the ADS1230, a high-precision 20-bit delta-sigma analog-to-digital converter (ADC) with an outstanding noise performance from Texas Instruments. This SPI-configurable ADC (read-only) offers selectable gain and data rate values, supporting a full-scale differential input of ±39mV/±19.5mV and 10SPS/80SPS, respectively. It comes with an onboard low-noise programmable gain amplifier (PGA) and onboard oscillator providing a complete front-end solution.

loadcell7_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Jul 2022.
  • Type : SPI type

Software Support

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

Standard key functions :

  • loadcell7_cfg_setup Config Object Initialization function.

    void loadcell7_cfg_setup ( loadcell7_cfg_t *cfg );
  • loadcell7_init Initialization function.

    err_t loadcell7_init ( loadcell7_t *ctx, loadcell7_cfg_t *cfg );

Example key functions :

  • loadcell7_tare_scale This function calculates the @b ctx->tare_scale which is the raw ADC readings of the empty container.

    err_t loadcell7_tare_scale ( loadcell7_t *ctx );
  • loadcell7_calibrate_weight This function calibrates the weight by calculating the @b ctx->weight_scale for the input calibration weight.

    err_t loadcell7_calibrate_weight ( loadcell7_t *ctx, float cal_weight );
  • loadcell7_get_weight This function calculates the weight of the goods in grams.

    err_t loadcell7_get_weight ( loadcell7_t *ctx, float *weight );

Example Description

This example demonstrates the use of Load Cell 7 click by measuring the weight in grams of the goods from the load cell sensor connected to the click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and reads the tare scale of the empty container, and after that, it calibrates the weight scale with a known calibration weight.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    loadcell7_cfg_t loadcell7_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.
    loadcell7_cfg_setup( &loadcell7_cfg );
    LOADCELL7_MAP_MIKROBUS( loadcell7_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == loadcell7_init( &loadcell7, &loadcell7_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    log_printf( &logger, " Remove all goods from the scale in the following 5 sec.\r\n");
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    log_printf( &logger, " Calculating tare scale...\r\n");
    if ( LOADCELL7_OK == loadcell7_tare_scale ( &loadcell7 ) ) 
    {
        log_printf( &logger, " Tarring complete!\r\n\n");
    }
    else 
    {
        log_error( &logger, " Calculating tare scale.");
        for ( ; ; );
    }

    log_printf( &logger, " Place a %ug calibration weight on the scale in the following 5 sec.\r\n", 
                ( uint16_t ) LOADCELL7_CALIBRATION_WEIGHT_G );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    log_printf( &logger, " Calibrating weight...\r\n");
    if ( LOADCELL7_OK == loadcell7_calibrate_weight ( &loadcell7, LOADCELL7_CALIBRATION_WEIGHT_G ) ) 
    {
        log_printf( &logger, " Calibration complete!\r\n\n");
    }
    else 
    {
        log_error( &logger, " Calibrating weight.");
        for ( ; ; );
    }

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

Application Task

Reads the net weight of the goods in grams approximately once per second and logs the results on the USB UART.

void application_task ( void )
{
    float weight;
    if ( LOADCELL7_OK == loadcell7_get_weight ( &loadcell7, &weight ) ) 
    {
        log_printf(&logger, " Weight : %.2f g\r\n", weight );
    }
}

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

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

SpeakUp 3 click

0

SpeakUP 3 Click is a compact add-on board providing an offline speech recognition solution. This board features the VC-02, a low-cost pure offline speech recognition module developed by Ai-Thinker Technology. The VC-02 module uses an integrated voice chip US516P6 based on a 32-bit RSIC architecture core, a DSP instruction set for signal processing and speech recognition, an FPU arithmetic unit, and an FFT accelerator. The VC-02 supports offline identification of 150 local instructions, RTOS lightweight system, firmware update feature, as well as the selection of the communication method with the module.

[Learn More]

Balancer 4 click

0

Balancer 4 Click is a compact add-on board optimized for overvoltage protection balancing the voltage of serially connected batteries. This board features the MP2672A, a highly integrated, flexible switch-mode battery charger for Lithium-Ion batteries with two cells in series from Monolithic Power Systems (MPS). The MP2672A has a narrow voltage DC (NVDC) power structure and monitors the voltage across each cell, equalizing the cell�s voltages if the difference between the two cells exceeds the mismatch threshold. It also has two selective operating modes with configurable output current up to 2A via register setting via I2C serial interface, alongside selectable MP2672A power supply, LED indication, and protection features allowing a reliable operation.

[Learn More]

Index Counter click

0

Index Counter Click is a simple prototyping high precision Hall-Effect switch solution with direction detection.

[Learn More]