Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Using a PIC16F84 to read the position of a pot

Using a PIC16F84 to read the position of a pot

The routines described here read the position of a potentiometer by a ratio technique. The measured value is scaled to a value between 0 and max, using a successive approximation technique.
The two halves of the pot are measured and the two measured values are added togther to get the range. These values vary due to component tolerences and variation in supply voltage. However these are greatly nullified by the scaling routine.

Starting with the measured value of range, it is itterated down to the measured value of B. The same itteration decisions are applied to Max value, resulting in value so that:

value = MaxValue * B / range

Tests show that the ratio: ( value / position of Pot ) can be much more accurate than the component tolerences would suggest. The values of A and B are measured by the circuit below.

Visit Here for more.

 

More Articles to Read

Vertical Pole Climbing Robot
Vertical Pole Climbing Robot
ESP8266 Weather Station Projects
ESP8266 Weather Station Projects
Single tube Lethal Nixie clock
Single tube Lethal Nixie clock
How to make a simple 1 watt audio amplifier (LM386 based)
How to make a simple 1 watt audio amplifier (LM386 based)
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Dot² isn’t your typical coffee table
Dot² isn’t your typical coffee table
Debugging ARM Cortex-M0+ HardFaults
Debugging ARM Cortex-M0+ HardFaults
EMP Jammer build
EMP Jammer build
A 3D-printed e-drum pad
A 3D-printed e-drum pad
Interactive geodesic LED dome = extreme geometric fun!
Interactive geodesic LED dome = extreme geometric fun!

Top




Shares