Multi turn switch to analog input

Hi

Iam trying to use the following circuit to convert 7 position switch to analog input.


I follow as per the picture using 2K resistor in place

the output I get is
position - analog value
0 - 0
1 - 700
2 - 1580
3 - 2446
4 - 3500
5 - 4095
6 - 4095
7 - 4095

the issue is I get 6 and 7 as 4095 only.

So kindly help to choose the resistor value or any other mistake I did.

i am using esp32
voltage across switch is 5V

regards
Santhosh

I moved your topic to an appropriate forum category @sksanthosh.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Use 3.3 volt across the switch. Else You might damage the analog input or more.

4 Likes

Railroader is right on. It is very possibly you have already damaged your processor. When using processors you need to be aware of there limitations, this you get from looking at the specifications etc. Had you spent some time reading the forum you would have found this. Also many adds selling them state that. A big hint very few if any processors have internal A/Ds will take a voltage greater then there Vcc. I recommend you remove your 5V connection and re-connect to a 3V3 volt connection and see what happens.

1 Like

Show your circuit diagram.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.