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
Clicker 2 for Kinetis is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4F microcontroller, the MK64FN1M0VDC12 from NXP Semiconductors, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a JTAG programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and
features quickly. Each part of the Clicker 2 for Kinetis development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for Kinetis programming method, using a USB HID mikroBootloader or an external mikroProg connector for Kinetis programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Micro-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or
using a Li-Polymer battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for Kinetis is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M4
MCU Memory (KB)
1024
Silicon Vendor
NXP
Pin count
121
RAM (Bytes)
262144
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