pot position digitizing

 I've been using this idea for a long time:




from page 199 of a book called: The Best of Byte:

https://archive.org/details/best_of_byte_volume_1_1977_06

At first I used it with the Z-80 based Exidy Sorcerer using the 555 circuit.  But then I remembered the idea while coding the original Island Keyer kit:

http://wb9kzy.com/ikeyr.htm

However instead of using a 555 timer I just used an I/O pin of the microcontroller (at first the Motorola 68HC705J1A and then the various PIC keyer chips).

  The idea was to:

1) charge up a timing cap (in parallel with the pot) to +5 volts with the I/O pin set to output

2) then change the I/O pin to an input and wait (while keeping track of the elapsed time) until the capacitor had discharged through the pot below the switching level of the pin

3) then the elapsed time would provide a good idea of the position of the pot which could then be used to set the keyer code speed

It works well providing a linear readout of the pot position and uses no current with the I/O pin set to an input.  The only problem is that it does require a calibration step for best results.  A series 1k ohm resistor connected to the pot is included to prevent a dead short across the I/O pin if the pot is turned to zero ohms.

The same idea has been used for the speed pot on the other keyers (except the Island Keyer II):

from the PK-Basic schematic



Using an A/D pin for pot position readout has advantages but will use more power unless the pot is powered from a source that can be turned off when not reading the pot position.  Usually another I/O pin is used to "power" the pot and can actually power several pots at the same time.

Best Regards,
Chuck, WB9KZY
http://wb9kzy.com/ham.htm