PDA

View Full Version : Appropriate size pull up resistor?



Chris_D
06-03-2010, 05:08 PM
Hey all,

I am wondering what is a good value pull up resistor.· Normally I use 10k on 5 volt micros and in rare cases that is a bit too high.· With the prop and 3.3v, I am not sure what to use - I have used 10k but also have had a bit of trouble with false triggers on some inputs.

Thanks
Chris

Timothy D. Swieter
06-03-2010, 06:45 PM
I've used 10Ks or even 100Ks on some of my Propeller pull-ups. I guess it all depends on how "hard" of a pull-up you want. The false triggers you are seeing, is it possible it is from noise in another part of the circuit or perhaps the lack of debounce in switches?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com (http://www.brilldea.com) - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
www.tdswieter.com (http://www.tdswieter.com)

Chris_D
06-03-2010, 10:15 PM
Hi Tim,

Thanks for responding.· The particular inputs I am dealing with are used for limit switches on a motion system.· While I certainly do have contact bounce on the snap acting switch, I am able to deal with that in software.· These switches switch to ground when made so the only thing holding them high is that 10k resistor.· I probably am dealing with some noise as this is a small machine with a lot of wires running in close proximity to each other.· Shielded cables are used on the limit switches to help with noise too.· I suspect a lower value resistor would help eliminate the false triggers but just don't have enough "smarts" to select a strong pull-up signal without over loading the input pin.

Chris

heater
06-03-2010, 10:22 PM
Your switch is the limiting factor here not the input pin. (Assuming the pull up goes to 3.3v not something higher).

A pin as an input is not driving or sinking any current. So lowering the pull up resistance only increases the current through the switch.

Next limit is your power supply, the lower your pull up values the more juice is consumed, worth thinking about for battery operated equipment.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

T Chap
06-04-2010, 01:02 AM
Do you have a cap on the pin? 10k should be fine for a limit switch, add a .1 cap from the pin(at the prop) to GND and see what happens. It is easy to debounce in software as you said though, just look at the pin a few times before determining that it has changed. If your switch is SPDT then you could wire it reversed, have it normally closed and let it go high when pressed. This gives the added feature of detecting that the switch is in fact working and present when powering up the system to avoid damage when homing if a wire is damaged or switch is bad.

Chris_D
06-04-2010, 03:46 AM
GRRRR, I do not have the schematic or layout in front of me at the moment, but one of you mentioned "Assuming 3.3V" to the input.· As soon as I read that it dawned on me that I think I am using 5 volts to the pull up resistor.· This means that I am driving that input with 5 volts (and have been for about a year now).· I do not have a series resistor either!· If I am right, I need to include a 1k series resistor between the point at the pull-up and the input pin.· Can someone confirm this for me?



Regarding the .1 uF cap on the input pin, will this help with the debounce effectively?· This board is nearly all surface mount so experimenting is a bit on the difficult side.·

Chris

Sapieha
06-04-2010, 05:30 AM
Hi Chris_D.


You said.
"If I am right, I need to include a 1k series resistor between the point at the pull-up and the input pin. Can someone confirm this for me?"

Yes - You are correct!

Regards

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


Sapieha

T Chap
06-04-2010, 06:17 AM
Not sure why you need a series resister on an input if the voltage is 3v3.

Timothy D. Swieter
06-04-2010, 09:01 AM
If the voltage is 3.3V you don't need the series resistor. If the voltage is 5.0V, you should use it to protect too much current on the input pin.

The cap would help with debounce. the size of the cap will vary based on the circuit characteristics.

Depending on the length of the run of wires to the switch and the type of switch it is, it may have trouble making or breaking with the small current. Each time contact make or break there are tiny, tiny, tiny arcs (or sometimes big arcs). Contact is made when the circuits are electrically connected, which sometimes may require more current. You may be loosing umph if your limit switch is a fair distance from the pull-up resistor or the cable is sized improperly.

It sounds like your system has been running for sometime, so it is obviously working - but maybe perhaps there are enhancements to make and thus the reason for your questions.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com (http://www.brilldea.com) - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
www.tdswieter.com (http://www.tdswieter.com)