Rotary switch pot only outputting 0

Hello Arduino.cc peoples,
I have built a flight sim throttle using a potentiometer, but I found that it was very lacking because it required discrete states to switch between. By reading a few posts on here, I discovered I needed a rotary switch pot, so I found and bought these:

and used this guide to solder a few 10k ohm resistors into place:
https://learn.sparkfun.com/tutorials/rotary-switch-potentiometer-hookup-guide

also here is my entire sketch:

void setup() {
  Serial.begin(9600);
  pinMode(A2, INPUT);
}

void loop() {
  auto var = analogRead(A2);
  Serial.println(var);
  delay(100);
}

I connected wiper to pin A2, CCW to 5V and CW to ground. I am using an Arduino nano.
Now my issue is when I wire it up and try to get a simple output from it, I am only getting 0 as output. What could have went wrong?

Easy to find out what went wrong by using your DVM Ohmmeter to verify the resistance values as you rotate the switch.

2 Likes

Also double check your soldering

1 Like

Does this match the IDE baud rate?

1 Like

@Paul_KD7HB I'm trying to test the circuit using a ohmmeter. Unfortunately, my meter has a screw stuck in there. Will test once that issue is resolved.
@J-M-L I've double checked my soldering and I still think it looks alright. But i'm biased and still and newbie in soldering. I can post an image (or a bunch) if it would help narrow it down.
@dougp the baud rate is not the issue. I suspected that and is set properly.

Good idea!

I hope these images narrow down the issue. Sorry if they are a bit blurry. Taking pictures of things this small with detail is apparently hard.



It helps to have lots of light, a steady hand, and a macro lens.

On my samsung phone I have installed a lense/magnifier app. It makes pictures using the built in flash. Really useful.

Solder points 2, 3 and 6 need more solder.
.

1 Like

I see no reason why using a pot should cause an issue; however

there is an open circuit connection at some point in the circuit to the CCW 5V.

Position your camera to Take the picture from a distance and touch the screen (if on a smartphone) to set the focus point. You can resize the picture later to remove the unwanted background and the piece will be in focus

An unusually poor decision by Adafruit to use 10K resistors. 1K resistors would have been a better impedance match for most Arduino analog inputs.

they justified it by saying

We don't want the divider to consume too much current, so we want the overall series resistance to be reasonably high. Using 10KΩ resistors gives us 90KΩ total. It will draw a modest 55 µA from 5V.

which is debatable...

1 Like

Ah, I missed that. And I suppose it's fair enough. Mismatching the impedance will potentially produce more noise/error in the ADC reading, but here, only one of 10 distinct values is expected anyway. The gaps between those values will be about 100, so the additional noise won't really be a problem. My apologies to Adafruit!

Why are you blaming Adafruit for something that SparkFun has done?

1 Like

Oh c**p. I need more coffee.

Apologies to Sparkfun!

:coffee: :coffee: :coffee: :coffee:

A lot more coffee is needed...

1 Like

Hi,
@icefreezer7
PCB;
image

Tom... :smiley: :+1: :coffee: :australia:

Hi, @icefreezer7
To check your board.
With it not connected to anything.
Put you DMM on OHMs and measure between CCW and CW, you should measure 90K Ohms.

Then measure resistance between CWW and W, start the control fully CCW and note the resistance readings for each position.

Can you post some images of your project?
So we can see your component layout.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

1 Like