Unlock data-driven decisions with precise weight measurements in diverse settings
A
A
Hardware Overview
How does it work?
Load Cell 2 Click is based on the NAU7802, a precision low-power 24-bit analog-to-digital converter (ADC) from Nuvoton, with an onboard low-noise programmable gain amplifier (PGA), onboard RC or Crystal oscillator, and a precision 24-bit sigma-delta (Σ-Δ) analog to digital converter (ADC). The NAU7802 device can perform up to 23-bit ENOB (Effective Number Of Bits). This device provides a complete front-end solution for bridge/sensor measurement, such as in weigh scales, strain gauges, and many other high-resolution, low-sample rate applications. The NAU7802 has many built-in features, which enable high-performance applications with low external
parts count. Additionally, operating current and standby current are low, and many power management features are included. These enable powering only those elements of the chip that are needed and operate at greatly reduced power if the full 23-bit ENOB performance is not required. The Programmable Gain Amplifier (PGA) provides selectable gains from 1 to 128. The A/D conversion is performed with a Sigma-Delta modulator and programmable FIR filter, which provides a simultaneous 50Hz and 60Hz notch filter to improve interference immunity. Also, this device provides a standard 2-wire interface compatible with I2C protocol for simple and straightforward
connection to and interoperation with a wide range of possible host processors. Calibration is not required for low-accuracy applications but may be needed in sensitive applications. When calibration is used, the system designer has three options (details in NAU7802 datasheet). This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
Nucleo 32 with STM32F031K6 MCU board provides an affordable and flexible platform for experimenting with STM32 microcontrollers in 32-pin packages. Featuring Arduino™ Nano connectivity, it allows easy expansion with specialized shields, while being mbed-enabled for seamless integration with online resources. The
board includes an on-board ST-LINK/V2-1 debugger/programmer, supporting USB reenumeration with three interfaces: Virtual Com port, mass storage, and debug port. It offers a flexible power supply through either USB VBUS or an external source. Additionally, it includes three LEDs (LD1 for USB communication, LD2 for power,
and LD3 as a user LED) and a reset push button. The STM32 Nucleo-32 board is supported by various Integrated Development Environments (IDEs) such as IAR™, Keil®, and GCC-based IDEs like AC6 SW4STM32, making it a versatile tool for developers.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M0
MCU Memory (KB)
32
Silicon Vendor
STMicroelectronics
Pin count
32
RAM (Bytes)
4096
You complete me!
Accessories
Click Shield for Nucleo-32 is the perfect way to expand your development board's functionalities with STM32 Nucleo-32 pinout. The Click Shield for Nucleo-32 provides two mikroBUS™ sockets to add any functionality from our ever-growing range of Click boards™. We are fully stocked with everything, from sensors and WiFi transceivers to motor control and audio amplifiers. The Click Shield for Nucleo-32 is compatible with the STM32 Nucleo-32 board, providing an affordable and flexible way for users to try out new ideas and quickly create prototypes with any STM32 microcontrollers, choosing from the various combinations of performance, power consumption, and features. The STM32 Nucleo-32 boards do not require any separate probe as they integrate the ST-LINK/V2-1 debugger/programmer and come with the STM32 comprehensive software HAL library and various packaged software examples. This development platform provides users with an effortless and common way to combine the STM32 Nucleo-32 footprint compatible board with their favorite Click boards™ in their upcoming projects.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for Load Cell 2 Click driver.
Key functions:
loadcell2_get_weight
- Get weight functionloadcell2_get_result
- Get results functionloadcell2_calibration
- Calibration function
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief LoadCell2 Click example
*
* # Description
* Load Cell 2 click is a weight measurement click
* which utilizes a load cell element,
* in order to precisely measure the weight of an object.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes I2C driver and performs the device reset,
* and performs the device reset, set power on and default configuration.
* Sets tare the scale, calibrate scale and start measurements.
*
* ## Application Task
* This is an example which demonstrates the
* use of Load Cell 2 Click board.
* Display the measurement of scales in grams [g].
* Results are being sent to the Usart Terminal
* where you can track their changes.
* All data logs write on USB uart changes for every 1 sec.
*
* \author Nenad Filipovic
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "loadcell2.h"
// ------------------------------------------------------------------ VARIABLES
static loadcell2_t loadcell2;
static log_t logger;
static loadcell2_data_t cell_data;
static float weight_val;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
loadcell2_cfg_t cfg;
/**
* 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.
loadcell2_cfg_setup( &cfg );
LOADCELL2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
loadcell2_init( &loadcell2, &cfg );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Load cell click \r\n");
log_printf( &logger, "-------------------------\r\n");
Delay_ms( 100 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Reset all registers \r\n");
loadcell2_reset( &loadcell2 );
Delay_ms( 100 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Power On \r\n");
loadcell2_power_on( &loadcell2 );
Delay_ms( 100 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Set default config. \r\n");
loadcell2_default_cfg( &loadcell2 );
Delay_ms( 100 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Calibrate AFE \r\n");
loadcell2_calibrate_afe( &loadcell2 );
Delay_ms( 1000 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Tare the scale : \r\n");
log_printf( &logger, "- - - - - - - - - - - - -\r\n");
log_printf( &logger, " >> Remove all object << \r\n");
log_printf( &logger, "- - - - - - - - - - - - -\r\n");
log_printf( &logger, " In the following 10 sec \r\n");
log_printf( &logger, " please remove all object\r\n");
log_printf( &logger, " from the scale. \r\n");
Delay_ms( 10000 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Start tare scales \r\n");
loadcell2_tare ( &loadcell2, &cell_data );
Delay_ms( 500 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Tarring is complete \r\n");
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Calibrate Scale : \r\n");
log_printf( &logger, "- - - - - - - - - - - - -\r\n");
log_printf( &logger, " >>> Load etalon <<< \r\n");
log_printf( &logger, "- - - - - - - - - - - - -\r\n");
log_printf( &logger, " In the following 10 sec \r\n");
log_printf( &logger, "place 1000g weight etalon\r\n");
log_printf( &logger, " on the scale for \r\n");
log_printf( &logger, " calibration purpose. \r\n");
Delay_ms( 10000 );
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Start calibration \r\n");
if ( loadcell2_calibration ( &loadcell2, LOADCELL2_WEIGHT_1000G, &cell_data ) == LOADCELL2_GET_RESULT_OK )
{
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Calibration Done \r\n");
log_printf( &logger, "- - - - - - - - - - - - -\r\n");
log_printf( &logger, " >>> Remove etalon <<< \r\n");
log_printf( &logger, "- - - - - - - - - - - - -\r\n");
log_printf( &logger, " In the following 10 sec \r\n");
log_printf( &logger, " remove 1000g weight \r\n");
log_printf( &logger, " etalon on the scale. \r\n");
Delay_ms( 10000 );
}
else
{
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Calibration Error \r\n");
for ( ; ; );
}
log_printf( &logger, "-------------------------\r\n");
log_printf( &logger, " Start measurements : \r\n");
log_printf( &logger, "-------------------------\r\n");
}
void application_task ( void )
{
weight_val = loadcell2_get_weight( &loadcell2, &cell_data );
log_printf(&logger, " Weight : %.2f g\r\n", weight_val );
Delay_ms( 1000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:Force