The features such as the low power consumption, two operational modes used to fine-tune the overall performance vs power consumption, consistency over a wide range of sampling frequencies, industry standard SPI communication interface, make this device a perfect solution for using it in various applications which depend on linear and accurate analog-to-digital conversion, such as the instrumentation and control applications, conversion of the analog data from various sensors, remote data acquisition, and similar.
How does it work?
The ADC 5 click is equipped with the ADC121S021, a 12-bit CMOS ADC device from Texas Instruments. This AD converter is using a reference voltage obtained from the LP2985 LDO regulator from the same company, which provides a clean and accurate regulated voltage on its output, perfectly suited to be used as the reference voltage for this converter. Since the reference voltage is set to 3.3V, the maximum value of the input voltage is also 3.3V.
The device uses the SPI communication. The MOSI pin does not exist, since no communication from the MCU to the click board™ is going on. The reading speed, also known as the sample rate, directly depends on the clock rate of the SCK line. The sample rate over which the specified electrical performance is ensured is 50 Ks/s to 200 Ks/s. The ADC121S021 has the ability to use any clock signal frequency up to the rated maximum frequency, with no significant deviations from the specifications stated in the datasheet: it is specified over a wide range of sample rates, maintaining a good linearity and high signal to noise ratio (SNR).
In general, ADC (analog to digital converters) are the most commonly used devices for converting the voltage signals into an information, which can be then processed in the digital domain. There are many types of ADC converters commercially available. They can vary in bit depth, sample rate, used approximation algorithm (SAR, delta-sigma…) and so on. Those attributes affect how accurately the sampled voltage will be translated into the digital world.
The sample rate is usually the determining factor when the maximum frequency of the input signal is considered. The aliasing of the input signal can occur as the input signal frequency is nearing half the sample rate of the converter. The bandwidth of the input signal is limited by this frequency, also called the Nyquist frequency, so using input frequencies near or above the Nyquist frequency, results with a very inaccurate conversion.
The ADC121S021 AD converter uses the SAR, or the successive approximation method for the conversion, which consists of comparing the input voltage with a series of internally generated voltage values. At each step in this process, the approximation is stored in a successive approximation register. The comparing steps are continued until the desired resolution is reached.
The ADC click board is also equipped with the screw terminal which can be used for easy and secure connection of the input voltage rail. Although the reference voltage is 3.3V, it is powered only by the 5V rail from the mikroBUS™, used as the input for the LDO regulator.
Specifications
Type
ADC
Applications
ADC 5 click can be used to digitally convert input voltage signals up to 3.3V so that the signals can be analyzed by various algorithms on the CPU or a MCU.
On-board modules
ADC121S021 a single channel, 50ks/s to 200Ks/s, a 12-Bit SAR ADC, LP2950 – micropower voltage regulator with low voltage drop, both made by Texas Instruments.
Key Features
The ADC 5 click specified to work with sample rates from 50Ks/s to 200Ks/s. It uses a precise LDO as a reference voltage source and SAR approximation method of sampling
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
5V
Pinout diagram
This table shows how the pinout on ADC 5 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
ADC 5 click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Vin (analog input) | 0 | 3.3 | V | |
ADC reference voltage | 3.3 | V |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | – |
Power LED indicator
|
TB1 | TB1 | – | Analog input terminal |
Software Support
We provide a library for ADC 5 click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Key functions
adc5_getData
– Returns raw 10-bit data
adc5_getVoltage
– Returns measured voltage in millivolts
Examples Description
The demo application is composed of three sections:
- System Initialization – CS GPIO as the output pin, initializes SPI and UART for logging.
- Application Initialization - Initializes ADC 5 driver.
- Application Task (code snippet) – Sequential reading of the voltage. Information about the current voltage is logged to UART. The operation is repeated every second.
void applicationTask() { ADC_Value = adc5_getVoltage(); WordToStr( ADC_Value, text ); mikrobus_logWrite( "Voltage:", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( " mV", _LOG_LINE ); Delay_1sec(); }
The full application code, and ready to use projects can be found on our LibStock page.
Other MikroElektronika libraries used in the example:
- UART
- Conversions
- String
Additional notes and information
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.