the inverting input v to comparator u 1 is also affected by the position of the wiper arm on a potentiometer r the potentiometer 39 s wiper arm is connected physically to the movable portion of a mechanical device the motion of the movable portion of the mechanical device will then reflect itself in changing resistance values of r 1 and r 2 the preferred embodiment shown in the fig1 sets up comparator u 1 with its output being sent to a controller such as a microprocessor the controller is able to store the output curve for comparator u 1 the non inverting input v to comparator u 1 is set as a reference level in this case the reference level is 1 3 vcc the inverting input v to u 1 receives its voltage level from a network which is made up of resistor r 4 connected between the supply voltage vcc and the inverting input v resistor r 3 and a discharging loop connected to node d resistor r 3 is connected between the inverting input v to u 1 and the discharging loop at node d the discharging loop is made up of a switching transistor q 1 which receives its input command from the controller at node a a potentiometer r and a capacitor.