Intermediate
30 min

Adjust every aspect of your systems easily with PT10MV11-103A2020-S and PIC18F97J60

Fine-tune your world: Meet the precision of trimmer potentiometers

POT Click with UNI-DS v8

Published Oct 10, 2023

Click board™

POT Click

Dev Board

UNI-DS v8

Compiler

NECTO Studio

MCU

PIC18F97J60

We're dedicated to providing you with the tools to fine-tune and optimize your devices for better performance and accuracy, and our trimmer potentiometers are at the heart of this dedication

A

A

Hardware Overview

How does it work?

POT Click is based on the MCP1501, a precision voltage reference IC from Microchip is used to provide the voltage of 2.048V. This voltage is routed to the small SMD jumper labeled as OUT SEL. By moving the jumper to the REF position, 2.048V will be applied to one end of the potentiometer. Otherwise, the potentiometer will be connected to the 3.3V rail of the mikroBUS™. The other end of the potentiometer is tied to GND, allowing to select voltage either from 0 to 2.048V range (VREF) or from 0 to 3.3V range. The adjustable voltage is available on both AN pin of the mikroBUS™ and 1x2-pin header on the upper edge of the Click board™, which is labeled as VOUT. The potentiometer itself is labeled as PT10MV11-103A2020-S. It is a high-quality potentiometer from Piher Sensing Systems. This company is otherwise known for their high-quality potentiometers, used in many industries. The

potentiometer has a carbon-based resistive surface with the resistance of 10 kΩ. It is a single-turn linear potentiometer, with 50% of resistance achieved when in the middle position. It has 10mm in diameter. Its turning knob is not fixed: the potentiometer has a hole with flat surfaces instead (hexagonal shape), and a small pole with the matching shape can be inserted. This makes possible using both fingers and some other precision tool (screwdriver, hex keys, and more). The output of the potentiometer is fed to the non-inverting input of the OPA344, a rail-to-rail single supply operational amplifier, from Texas Instruments. This operational amplifier is a perfect choice for this design, as it allows rail-to-rail operation, uses a single power supply of 5V, and has a stable unity gain. The OPA344 is used as a buffer, providing a constant input and output impedance. Without buffer, variable impedance

would affect the reference voltage. The reference voltage can provide less than 10 mA, with the significant voltage drop for output currents exceeding 2 mA. Therefore, the OPA344 ensures good stability of the circuit. The current output of this Click board™ is limited by the circuit at the output, which consists of two BJT transistors. When the output load is too large, a voltage drop will appear across the base-emitter resistor on the Q2 transistor, which in turn starts to conduct, reducing the voltage across the feedback loop, limiting the max current this way. Q1 transistor is otherwise used to provide enough current to the output load, preventing the damage to the buffer and the rest of the circuit. Therefore, in the case of short circuit, this transistor will start dissipating heat. It is dimensioned so that it can withstand short circuit on the output. The connected load can draw up to 100mA of current.

POT Click hardware overview image

Features overview

Development board

UNI-DS v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different STM32, Kinetis, TIVA, CEC, MSP, PIC, dsPIC, PIC32, and AVR MCUs regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over WiFi. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, UNI-DS v8 provides a fluid and immersive working experience, allowing access anywhere and under any

circumstances at any time. Each part of the UNI-DS v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector. Communication options such as USB-UART, USB

HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. UNI-DS v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

UNI-DS v8 horizontal image

Microcontroller Overview

MCU Card / MCU

default

Type

8th Generation

Architecture

PIC

MCU Memory (KB)

128

Silicon Vendor

Microchip

Pin count

100

RAM (Bytes)

3808

Used MCU Pins

mikroBUS™ mapper

Analog Output
PF0
AN
NC
NC
RST
NC
NC
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
NC
NC
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Schematic

POT Click Schematic schematic

Step by step

Project assembly

Fusion for PIC v8 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the UNI-DS v8 as your development board.

Fusion for PIC v8 front image hardware assembly
GNSS2 Click front image hardware assembly
SiBRAIN for PIC32MZ1024EFK144 front image hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
v8 SiBRAIN Access MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
NECTO Compiler Selection Step Image hardware assembly
NECTO Output Selection Step Image hardware assembly
Necto image step 6 hardware assembly
Necto image step 7 hardware assembly
Necto image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto PreFlash Image hardware assembly

Track your results in real time

Application Output

After pressing the "FLASH" button on the left-side panel, it is necessary to open the UART terminal to display the achieved results. By clicking on the Tools icon in the right-hand panel, multiple different functions are displayed, among which is the UART Terminal. Click on the offered "UART Terminal" icon.

UART Application Output Step 1

Once the UART terminal is opened, the window takes on a new form. At the top of the tab are two buttons, one for adjusting the parameters of the UART terminal and the other for connecting the UART terminal. The tab's lower part is reserved for displaying the achieved results. Before connecting, the terminal has a Disconnected status, indicating that the terminal is not yet active. Before connecting, it is necessary to check the set parameters of the UART terminal. Click on the "OPTIONS" button.

UART Application Output Step 2

In the newly opened UART Terminal Options field, we check if the terminal settings are correct, such as the set port and the Baud rate of UART communication. If the data is not displayed properly, it is possible that the Baud rate value is not set correctly and needs to be adjusted to 115200. If all the parameters are set correctly, click on "CONFIGURE".

UART Application Output Step 3

The next step is to click on the "CONNECT" button, after which the terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.

UART Application Output Step 4

Software Support

Library Description

This library contains API for POT Click driver.

Key functions:

  • pot_read_an_pin_value - This function reads results of AD conversion of the AN pin

  • pot_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 Pot Click example
 * 
 * # Description
 * Click board with the accurate selectable reference voltage output.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Performs logger and Click initialization.
 * 
 * ## Application Task  
 * Makes the averaged results by using the desired number of samples of AD conversion.
  The averaged results will be calculated to millivolts [mV] and sent to the uart terminal.
 * 
 * *note:* 
 * The AD conversion will be performed on the analog (AN) pin on the mikrobus 1.
 * 
 * \author Nemanja Medakovic
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "pot.h"

// ------------------------------------------------------------------ VARIABLES

static pot_t pot;
static log_t logger;

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    pot_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.

    pot_cfg_setup( &cfg );
    POT_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    if ( pot_init( &pot, &cfg ) == ADC_ERROR )
    {
        log_info( &logger, "---- Application Init Error. ----" );
        log_info( &logger, "---- Please, run program again... ----" );

        for ( ; ; );
    }
    log_info( &logger, "---- Application Init Done. ----\n" );
}

void application_task ( void )
{
    float an_voltage;

    an_voltage = pot_read_voltage( &pot );

    log_printf( &logger, " AN [V] : %.2f\r\n", an_voltage );
    Delay_ms( 1000 );
}

void main ( void )
{
    application_init( );

    for ( ; ; )
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources