Rotary switch with resistor; getting weird values/unexpected.


i setting 11 positions rotary switch; using resistors. i've got bunch of 20k resistors, , added them between connections, leaving common without (so 11 positions, 10 x 20k resistors).

now, reading values, , weird results. expect linear increase/decrease form 0 1023 on analog pin, instead inconsistent readings.

at position 0 0; yay; things change, while head position 11.

0   -> 0
1   -> between 10 , 32
2   -> between 29 , 47
3   -> between 29 , 78
4   -> between 41 , 83
5   -> between 49 , 99
6   -> between 41 , 102
7   -> between 29 , 106
8   -> between 908 , 956
9   -> between 960 , 1010
10 -> 1023

i expecting find consistent increase in sort of linear progression, while seems not that. doing wrong? these straight values coming out of analogread of pin; connected common on rotary switch.
the other 2 ends connected ground , 3.3v

some questions pop up:

what values expected?

did check voltages multimeter?

if switch, how time takes ad stabilize?

how current flow though resistors?      [ohms law 3.3v / 200k = 15 uamps]
is enough "load" ad convertor in time?

if make resistorladder 1k resistors behave same? better? or worse?





Arduino Forum > Using Arduino > General Electronics > Rotary switch with resistor; getting weird values/unexpected.


arduino

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???