How does it work?
LDC 2 Click as its foundation uses the LDC1041, an inductance-to-digital converter that simultaneously measures an LC resonator’s impedance and resonant frequency from Texas Instruments. This Click board™ is easy-to-use, requiring only the sensor frequency within 5kHz and 5MHz to begin sensing, and demonstrates the use of inductive sensing technology to sense and measure a conductive target object’s presence, position, or composition. In addition, the LDC1041 also measures the oscillation frequency of the LC circuit, used to determine the inductance of the LC circuit. The device then outputs a digital value that is inversely proportional to frequency.
The LDC measures the inductance change that a conductive target causes when it moves into the inductor’s AC magnetic field to provide information about the target’s position over a sensor coil. The inductance shift is caused by eddy currents (circulating currents) generated in the target due to the sensor’s magnetic field. These eddy currents generate a secondary magnetic field that opposes the sensor field, causing a shift in the observed inductance, used for precise positioning of the target as it moves laterally over the sensor coil.
Also, the LDC1041 has two power modes: Active and Standby Mode. In Active Mode, the proximity data and frequency data conversion are enabled, while Standby mode represents the default mode on devices’ Power-Up sequence. In Standby Mode, the conversion process is disabled. This Click board™ comes with an example of a PCB sensor coil designed to provide the user with maximum flexibility.
The LDC1041 communicates with MCU using the standard SPI serial interface with a maximum frequency of 4MHz. In addition to this serial interface, one GPIO pin connected to the mikroBUS™ socket is also used. The configurable interrupt pin, routed to the INT pin of the mikroBUS™ socket, may be configured in three different ways by programming the interrupt Terminal mode register with SPI. An interrupt pin provides the ability to act as a proximity switch, as a wake-up feature, or as a data-ready pin indicating a valid condition for new data availability.
This Click board™ operates only with a 5V logic voltage level. The board must perform appropriate logic voltage level conversion before use with MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Inductance
Applications
Can be used for contactless, short-range sensing that enables high-resolution and low-cost position sensing of conductive targets, even in harsh environments.
On-board modules
LDC1041 – inductance-to-digital converter that simultaneously measures an LC resonator’s impedance and resonant frequency from Texas Instruments
Key Features
Low power consumption, short-range sensing technology, high durability, high flexibility, supports wide frequency range from 5kHz to 5MHz, high performance, reliability, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
5V
Pinout diagram
This table shows how the pinout on LDC 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
LDC 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 5 | – | V |
Sensor Frequency | 5 | – | 5000 | kHz |
Inductance Measurement Resolution | – | 24 | – | bits |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the LDC 2 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 LDC 2 Click driver.
Key functions:
ldc2_cfg_setup
– Config Object Initialization function.ldc2_init
– Initialization function.ldc2_default_cfg
– Click Default Configuration function.
Example description
This example demonstrates the use of LDC 2 Click board.
void application_task ( void ) { uint8_t prox_data = 0; float rp_data = 0; float freq = 0; float inductance = 0; if ( LDC2_OK == ldc2_measure_resonance_impedance( &ldc2, &prox_data, &rp_data ) ) { log_printf( &logger, " Proximity: %urn Resonance Impedance: %.3f kOhmrnn", ( uint16_t ) prox_data, rp_data ); } if ( LDC2_OK == ldc2_measure_inductance( &ldc2, &freq, &inductance ) ) { log_printf( &logger, " Sensor Frequency: %.3f MHzrn Inductance: %.6f uHrnn", freq, inductance ); } Delay_ms( 200 ); }
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.LDC2
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.