I am the n00bist of n00bs please excuse me if this is stupid. I have scoured forums and can't find anything.
As a stepping stone to a more complicated project, I'm trying to set up a 10k potentiometer with my UNO rev 3 as specified in the AnalogRead/serial write tutorial, which is here:
I have the two outer pins connected to +5 and GND respectively, and the wiper connected to analog 0. When I execute the code and view the serial read in the IDE, the numbers displayed jump around randomly and never stay the same for two consecutive reads. Unless there is some crazy algorithm going on, it looks like turning the knob on the pot has zero impact whatsoever on the serial read. Any suggestions? I'm at a loss. I haven't found my problem anywhere online.
Thanks a ton. And sorry if I'm being lame. Please call me out if I could have found the answer somewhere else.
Quite simply you have not wired it up like the tutorial said. It sounds like the wiper is not making contact. That is what happens when you read a pin with nothing attached. This is called a floating input.
As far as a connection issue, that was my initial thought, but I don't see how that could be. I soldered 22 gauge wire to the pins on the pot and I'm having the same issue. I also tried both a 10k slide potentiometer (the one I need to use in my final project) in addition to a cheapo RadioShack pot to no avail. I also tried multiple analog inputs (changing the code appropriately, of course). The issue is persisting.
The read is jumping around a few hundred at a time, not just a couple that I could attribute to noise.
I could pick up a capacitor, but I assume it should be able to work without one at least to some extent, right?
The next step is definitely a multimeter. Mine is at home. I'll check back in when I can test that way.
Is there any way to verify that the analog inputs on my board are working without having a known-working potentiometer?
I was stuck with the very same problem for a few hours just now. The problem seems to be that I had attached the jumper cables from GND and 5V to one end of the breadboard, and put the trimpot at the opposite end. Moving these cables much closer towards the trimpot seem to have worked. Yay!
Now I'm curious as to why this problem occurred. Is there such a thing as a faulty breadboard? I think I've had problems spacing LED's too far apart, which I didn't notice till I tried the potentiometer test.
In some breadboards the power rails go all the way from one end to the other, in others they are divided in sections. Use a multimeter to check for connections, and where the splits are.