Switch or Whiskers pulled up to 3.3, or pulled down to 0 when open.
Martin_H
Posts: 4,051
I'm planning to do is add whiskers to a robot controlled via a propeller chip, and I'm wondering if I should pull up or pull down via a 10 k resistor. The learn.parallax.com site shows them pulled up, but I want to know how much freedom I have here. From what I've read a pin in input mode has a high impedance, so it would only be sourcing or sinking current a small amount of current either way.
Is the choice purely personal preference or are there other factors to consider?
Is the choice purely personal preference or are there other factors to consider?
Comments
Robert
With battery operation,
use pull-down OR up so that in ~95% of the time switch etc is NOT allowing
current thru the resistor to gnd, just through resistor to Prop input pin.
Pull up or down makes no difference, its just your preference.
Yow asked about freedom of choice for the resistor, I assume the value.
10K is a common value but any value from 1K to 100K would work,
as long as the pullup or switch is connected to the prop's VDD or 3.3V.
There is another factor to consider.
Switches come in many types. In this case they generally come in:
1. Low voltage "Signal" types, usually plated with Gold, or other precious metal,
2. "AC" types, often rated for 120VAC or so. These generally have silver or other metal contacts.
The gold plated contacts on the signal types don't corrode so the the contacts
close reliably. Assuming the current is not excessive which would arc through
and destroy the gold plating.
AC types do have the ability to corrode. AC switched depend on at least a small
arc to essentially clean the contact. Often these fail in low voltage low current
applications as the corrosion can be high in resistance because no arcing occurs.
There is a fix for this. Add a small capacitor, I usually use 0.1uF, across the contact.
This small capacitor will provide a tiny spark to clean the contact.
BTW, don't use the capacitor on the gold plated switches as the spark can
damage them.
AC = use the cap.
Signal = no cap.
Duane J
However, for failsafe applications I usually recommend the switch be:
NC, Normally Closed, and open when activated.
If there was corrosion on the contact the NO, Normally Open, switch would
not be able to sense the sensing condition.
Also, if there is a broken wire the closing of the switch will have no effect.
Duane J