Getting 0-9 digits by using potentiometer

hi,

i would like to use analog port of 16f877 to get digits chosen by a user using potentiometer. First of all i wonder whether such a one-turn potentiometers are used for that purpose. Generally i have seen dip switches or BCD switches, however one should use so many pins of pic for getting a single digit. To make the matter more clear, the user will choose a number by turning the one-turn potentiometer; lets say it is "6" and 2.2 V [10111011] obtained by the analog port of the pic. If that binary that is in the range of "6" a variable in the pic will be set to 6 [00000110].

It seems pretty easy at first look, but i do not know the reliability of the system. Does anyone help me in understanding possible failure of that application ? and have they ever seen a smd one-turn potentiometer with 10-step resistor [ i mean when you turn it becomes 0 - 1k ohm - 2 ohm - 3 ohm -....10k ohm]

Reply to
nospam
Loading thread data ...

A potentiometer is an analog device, with either a linear or logrithmic resistance change as the wiper is moved.

If you can find some type of detent device that provides specific stops during the rotation, you might achieve the stepped resistance change you seek. Otherwise, you will have to do some interpreting, such as the range 4.6K to 5.5K is seen as "5", etc.

You could use a dip or bcd switch to switch a resistor network such that the values have a "step" relationship.

John

Reply to
John

To get repeatable results with a continously-variable device is going to be hit-or-miss. Add 10 resistors to a rotary switch to make your own stepped pot and you will get the detents that John mentioned while having only 1 point to monitor.

Reply to
JeffM

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.