Experience a new era of accuracy with our resistor measurement solution, designed to provide real-time data on resistor values for a wide range of applications
A
A
Hardware Overview
How does it work?
R Meter Click is based on the AD8616, a precision 20MHz CMOS rail-to-rail input/output operational amplifier from Analog Devices. This dual-channel amplifier features low offset voltage, wide signal bandwidth, and low input voltage and current noise. The analog output is fed to the MCP3201, a 12-bit AD converter with the SPI serial interface from Microchip. The MCP3201 provides a single pseudo-differential input, features on-chip sample and hold, a maximum sampling rate of up to 100ksps, and more. The MCP3201 gets the reference voltage from the MAX6106, a low-cost, micropower, low-dropout, high-output-current voltage reference from Analog Devices. Since the AD converter has a limited min-max range
of 0-2043, the R Meter Click employs the 74HC4053, a triple 2-channel analog multiplexer/demultiplexer from Nexperia. The multiplexer adjusts the input signal to the amplifier and thus allows the same ADC to measure different scopes of values (0-1K, 1K-100K, 100K-1M). The R Meter Click is a handy tool, but it’s not to be used as a precision instrument. The linearity of the OpAmp impacts the measurement. The R Meter Click uses the 3-Wire SPI serial interface of the MCP3201 to communicate with the host MCU, with a frequency of up to 1.6MHz and supporting SPI 0 and SPI 1 modes. The voltage amplified through the AD8616 can be directly monitored through the AN pin of the mikroBUS™
socket. The supplied firmware (available on Libstock) automatically scans the ADC value and switches the multiplexer output based on the resistor place. The multiplexer interfaces directly with the host MCU through the mikroBUS™ socket over S1, S2, and S3 pins. This Click board™ can be operated only with a 5V 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
Curiosity PIC32 MZ EF development board is a fully integrated 32-bit development platform featuring the high-performance PIC32MZ EF Series (PIC32MZ2048EFM) that has a 2MB Flash, 512KB RAM, integrated FPU, Crypto accelerator, and excellent connectivity options. It includes an integrated programmer and debugger, requiring no additional hardware. Users can expand
functionality through MIKROE mikroBUS™ Click™ adapter boards, add Ethernet connectivity with the Microchip PHY daughter board, add WiFi connectivity capability using the Microchip expansions boards, and add audio input and output capability with Microchip audio daughter boards. These boards are fully integrated into PIC32’s powerful software framework, MPLAB Harmony,
which provides a flexible and modular interface to application development a rich set of inter-operable software stacks (TCP-IP, USB), and easy-to-use features. The Curiosity PIC32 MZ EF development board offers expansion capabilities making it an excellent choice for a rapid prototyping board in Connectivity, IOT, and general-purpose applications.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC32
MCU Memory (KB)
2048
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
524288
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via Debug Mode
1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.
2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.
Software Support
Library Description
This library contains API for R Meter Click driver.
Key functions:
rmeter_get_ohms
- Get resistance in OHMs functionrmeter_avg_volt
- Get average voltage functionrmeter_calc
- Calculations function
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief R Meter Click example
*
* # Description
* Demo app measures and displays resistance of a resistor connected
* to the R Meter click board.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initalizes SPI serial communication, LOG module and click driver.
* Also sets the app callback handler.
*
* ## Application Task
* This is an example that shows the capabilities of the R Meter click by
* measuring the target resistance.
*
* *note:*
* R Meter click is a handy tool but it is not to be used as a high precision
* instrument! The linearity of the OP Amplifier impacts the measurement.
* The range of resistance measurement goes from 1 ohm to 1M9 ohms.
*
* \author Nemanja Medakovic
*
*/
#include "board.h"
#include "log.h"
#include "rmeter.h"
static rmeter_t rmeter;
static log_t logger;
void application_callback ( char *message )
{
log_printf( &logger, "- %s\r\n", message );
}
void application_init ( void )
{
log_cfg_t log_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... ----" );
rmeter_cfg_t rmeter_cfg;
// Click initialization.
rmeter_cfg_setup( &rmeter_cfg );
RMETER_MAP_MIKROBUS( rmeter_cfg, MIKROBUS_1 );
if ( rmeter_init( &rmeter, &rmeter_cfg ) == RMETER_INIT_ERROR )
{
log_info( &logger, "---- Application Init Error. ----" );
log_info( &logger, "---- Please, run program again... ----" );
for ( ; ; );
}
rmeter_set_callback_handler( &rmeter, application_callback );
log_info( &logger, "---- Application Init Done. ----\n" );
}
void application_task ( void )
{
uint16_t meas_value = rmeter_auto_scale_range_execution( &rmeter );
float res_value;
if ( rmeter_calculate_resistance( &rmeter, &res_value, meas_value ) == RMETER_OK )
{
log_printf( &logger, " - Resistor value is %.1f ohms\r\n\n", res_value );
}
Delay_ms( 3000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END