How does a potentiometer work in a PIC microcontroller?

How does a potentiometer work in a PIC microcontroller?

In this circuit, we will show how to connect a potentiometer to a PIC microcontroller. The potentiometer serves as an analog input to the microcontroller. Being that a potentiometer can have any value from 0Ω to its rated resistance, it can have any voltage value from 0V up to the full voltage supplied to it.

How many values can be read from a PIC potentiometer?

Since the PIC18F1220 contains a 10-bit analog-to-digital converter (ADC), it can hold a possible 1024 values, because 2 10 is 1024. Therefore, the value that we read from the ADC can vary from 0 to 1023. This means the potentiometer can return anywhere from 0 to 1023. This, again, is stored in the analog_reading variable.

How is the voltage of a potentiometer dynamic?

Being that a potentiometer can have any value from 0Ω to its rated resistance, it can have any voltage value from 0V up to the full voltage supplied to it. Therefore, with a potentiometer, we can input any voltage from 0V to full voltage on the positive rail. So it’s very dynamic.

How many terminals are there in a potentiometer?

The potentiometer has 3 terminals. There are 2 end terminals and a wiper terminal. One side of the end terminals connects to +5V and the other end connects to ground. The wiper terminal, whose resistance adjusts, connects to analog pin ANO, which is pin 1 of the microcontroller.

How to shift resistance range of linear potentiometer by X?

If you want to have your potentiometer going from 10k to 20k, simply hook a 10k after the potentiometer (e.g. where you get your changed Voltage). Formula: Potentiometer range: From x to 10k+x: Add a resistor of x to the potentiometer. If you want to extend the range, then you have to use another approach.

How is the wiper used in a potentiometer?

Recall that a potentiometer (or pot) is a three-terminal resistor with a sliding or rotating contact that can be used to dynamically vary resistance. Video. This animation shows how the wiper can be used to vary resistance in a rotary potentiometer. The figure on the right is the formal electrical symbol.

How many legs does a potentiometer have?

Potentiometers have three legs: the resistance between the outer two legs (Leg 1 and Leg 3) will not vary. For example, if you are using a 10kΩ potentiometer, then the resistance between Legs 1 and 3 will always be 10kΩ regardless of wiper position (Leg 2).