Preset potentiometer

The preset potentiometer module supplies an analogue signal which, for simple applications, can also be interpreted as a digital signal. It is very useful for setting variable values in a programme. When the preset control is rotated anti-clockwise, it outputs a high signal. When the preset control is rotated clockwise, it outputs a low signal. At intermediate positions, the module outputs a voltage roughly proportional to the amount of rotation. Used digitally, the point at which the output signal changes between high and low is approximately at half rotation.

Preset potentiometer PCB layout
Circuit details

Preset potentiometer design symbol

Preset potentiometer circuit details
Programming
Reading the state of the preset potentiometer digitally, requires the same code as reading the state of a push button. Details are given here
Example1
Reading the angular position of the preset potentiometer requires the use of the PIC's analogue to digital converter (ADC). To read and store the angular value of the preset potentiometer use the ReadADC box.

On the 20 pin PIC the ADC is only wired to inputs 1, 2 3 and 7 so you must use input connectors labelled D1, D2, D3 or D7. The ReadADC box properties need to be set like this . . .


A series of decision boxes can be used to take different action according to the ADC value stored in variable A (or what ever variable is selected in the ReadADC properties box). For example, the following flowchart switches one of three output on according to the pot setting.

Example 2
Suppose a light dependant resistor is used on a line following buggy to sense the presence of a black line. The control system for one of the drive motors might be . . .

One problem with this flowchart is that if the light sensor needs to be re-calibrated, perhaps due to different ambient light level, then the software has to be changed. (i.e the number in the decision box)
A preset pot can provide a useful way of setting a variable for use by the programme for example, for calibrating a light sensor. The following flowchart modifies the example shown above by making the value in the decision box variable - it is set by the preset pot.

In this example, the pot setting is only measured once at the start of the programme and it needs to be rotated to the required position before powering up the PIC. If this is undesirable, then flowchart control can be returned to the start (instead of after reading the pot value). This would add extra processing to the control loop which can make it a bit less responsive due to the time it takes for the ADC to complete its conversion.