Discover the ultimate tool for precision resistance measurement – our Wheatstone bridge circuit solution is here to empower your journey towards accurate and reliable data.
A
A
Hardware Overview
How does it work?
Wheatstone Click is based on the MAX4208, an ultra-low offset/drift, precision instrumentation amplifier, from Analog Devices. A Wheatstone bridge is an electrical circuit used to measure an unknown electrical resistance by balancing two branches of a bridge circuit, one branch of which includes the unknown component. The primary benefit of the circuit is its ability to provide extremely accurate measurements, in contrast with a simple voltage divider. The R2, R3, and R4 are resistors of known resistance (1k ohm), while the resistance R1 is brought to the terminal block and therefore it is changeable. With no resistance connected to the terminal block, the bridge on this Click board™ is in balance. At this point, the voltage between the two midpoints (IN- and IN+) will be zero. Therefore the ratio
of the two resistances in the known branch (R1 and R3) is equal to the ratio of the two resistances in the unknown leg (R2 and R4). If the external resistance is connected to the terminal block, bridge is unbalanced, and the voltage on the midpoints is proportional to the external resistor value. Wheatstone click is based around the MAX4208 IC, which is connected to an onboard Wheatstone bridge circuit, in order to precisely measure the resistance of an external element. The mentioned IC uses a spreadspectrum, autozeroing technique that constantly measures and corrects the input offset, eliminating drift over time and temperature and the effect of 1/f noise. This technique achieves less than 20μV offset voltage, allows ground-sensing capability, provides ultra-low CMOS input bias current and increased
common-mode rejection performance. It also provides high-impedance inputs, optimized for small-signal differential voltages (±100mV), which makes it ideal for an application such as wheatstone bridge disbalance measurement. This Click board™ also has TPL0501 onboard - 256-Taps, Single-Channel, Digital Potentiometer With SPI Interface, from texas instruments. It is connected to the MAX4208 in a way that it serves an gain adjust instead of with two external resistors The power supply voltage selection for the logic section is done by moving the SMD jumper labeled as VCC SEL to a desired position: left position to select 3.3V, right position to select 5V. This will allow both 3.3V and 5V MCUs to be interfaced with the Click board™ directly.
Features overview
Development board
Curiosity HPC, standing for Curiosity High Pin Count (HPC) development board, supports 28- and 40-pin 8-bit PIC MCUs specially designed by Microchip for the needs of rapid development of embedded applications. This board has two unique PDIP sockets, surrounded by dual-row expansion headers, allowing connectivity to all pins on the populated PIC MCUs. It also contains a powerful onboard PICkit™ (PKOB), eliminating the need for an external programming/debugging tool, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, a set of indicator LEDs, push button switches and a variable potentiometer. All
these features allow you to combine the strength of Microchip and Mikroe and create custom electronic solutions more efficiently than ever. Each part of the Curiosity HPC development board contains the components necessary for the most efficient operation of the same board. An integrated onboard PICkit™ (PKOB) allows low-voltage programming and in-circuit debugging for all supported devices. When used with the MPLAB® X Integrated Development Environment (IDE, version 3.0 or higher) or MPLAB® Xpress IDE, in-circuit debugging allows users to run, modify, and troubleshoot their custom software and hardware
quickly without the need for additional debugging tools. Besides, it includes a clean and regulated power supply block for the development board via the USB Micro-B connector, alongside all communication methods that mikroBUS™ itself supports. Curiosity HPC development board allows you to create a new application in just a few steps. Natively supported by Microchip software tools, it covers many aspects of prototyping thanks to many number of different Click boards™ (over a thousand boards), the number of which is growing daily.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
2048
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 Wheatstone Click driver.
Key functions:
wheatstone_set_potentiometer
- Set potentiometer ( 0 - 100k )wheatstone_read_an_pin_voltage
- This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
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 Wheatstone Click example
*
* # Description
* This example demonstrates the use of Wheatstone click board by measuring the input
* resistance.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and logger and sets the default potentiometer (gain) level.
*
* ## Application Task
* Reads the AN pin voltage and calculates the input resistance from it.
* All data are being displayed on the USB UART where you can track their changes.
*
* @note
* The following formulas you may find useful:
* AN_PIN(V) = ( ( 1kOhm + R_INPUT(kOhm) ) / ( 1kOhm + 2*R_INPUT(kOhm) ) - 1/2 ) * VCC(V) * GAIN
* VOUT(V) = AN_PIN(V) / GAIN
* R_INPUT(kOhm) = ( VCC(V) * GAIN - 2*AN_PIN(V) ) / ( 4*AN_PIN(V) )
* R_INPUT(kOhm) = ( VCC(V) - 2*VOUT(V) ) / ( 4*VOUT(V) )
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "wheatstone.h"
// ------------------------------------------------------------------ VARIABLES
static wheatstone_t wheatstone;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
wheatstone_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.
wheatstone_cfg_setup( &cfg );
WHEATSTONE_MAP_MIKROBUS( cfg, MIKROBUS_1 );
wheatstone_init( &wheatstone, &cfg );
wheatstone_set_potentiometer ( &wheatstone, WHEATSTONE_POT_MAX );
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
float an_pin_v = 0;
float vout = 0;
float r_kohm = 0;
if ( WHEATSTONE_OK == wheatstone_read_an_pin_voltage ( &wheatstone, &an_pin_v ) )
{
vout = an_pin_v / wheatstone.gain;
if ( 0 != vout )
{
r_kohm = ( WHEATSTONE_VCC_5V - 2 * vout ) / ( 4 * vout );
}
log_printf( &logger, " VCC : %.3f V\r\n", WHEATSTONE_VCC_5V );
log_printf( &logger, " GAIN : %.3f\r\n", wheatstone.gain );
log_printf( &logger, " AN_PIN : %.3f V\r\n", an_pin_v );
log_printf( &logger, " VOUT : %.3f V\r\n", vout );
log_printf( &logger, " R_INPUT : %.3f kOhm\r\n\n", r_kohm );
Delay_ms( 1000 );
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END