Resistors !?

I'm a newbie and was having trouble running simple led switch sketches (e.g. Button) until I finally (!) tested the resistor I was using. It was supposed to be 10k, but ohmed out to about 3.5k which wasn't enough.

I'm now using one marked 47k but it only ohmed out to about 20k which seems to work great.

Lesson learned = don't buy cheap resistors (at least not without double checking them first!).

I suspect a problem with your DMM, or you are not reading the resistor color code correctly. Bad resistors are exceedingly rare, especially if they're new. The fact that you have two resistors both of which read dramatically low (and by about the same amount) is very suspicious.

Can't comment on your specific application, since you haven't told us much about it.

It was supposed to be 10k, but ohmed out to about 3.5k which wasn't enough.

I'm now using one marked 47k but it only ohmed out to about 20k which seems to work great.

If you measure a resistor in a circuit it can read low because there may be something else in parallel. And, if you measure in a circuit with power applied you can get all kinds of useless-unreliable readings.

Or, you DMM may be defective or it may need a new battery.

...3.5k which wasn't enough.

Strange... Can you give us the code and a link to the schematic? As a pull-up (or pull-down) resistor for a pushbutton, almost any resistor would work.

If I was going to guess, you may be using an external pull-down resistor while enabling the internal pull-up resistor. In that situation the resistors are "fighting each other" and a lower-value resistor would work better. The correct solution would be to disable the pull-up, or better yet, take out the external resistor and re-wire the switch to use the internal pull-up.

As a current-limiting resistor for an LED, those values are all high. (Higher resistance = dimmer LED.)

Did your resistors come from a salvaged device, or are they from "new old stock"? Carbon resistors made before perhaps 1970 have probably changed value. My technician, now retired, once gave me a metal display box full of packaged resistors from the 1950's. They are all way off the marked value.

I also have seen problems when the 9 volt battery in my DVM is needing to be replaced. Always reads low!

Paul