Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| pullup_resistor [2011/06/18 17:07] – created mattb | pullup_resistor [2026/04/07 18:27] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Home automation often involves interfacing with contact closure type switches. Some examples include: alarm magnetic reed door/window switches, water float level switches, push button switches, etc. | ||
| + | |||
| + | Some input hardware can be directly wired to these switches, such that the INPUT pin/ | ||
| + | |||
| + | However, some TTL based input hardware will have a " | ||
| + | |||
| + | The solution in this case is to use a pull-up resistor (RadioShack will have the 10K resistor needed) so that the INPUT pin is never left in a floating, or unconnected, | ||
| + | |||
| + | {{: | ||
| + | |||
| + | When the closure switch is in the open state, the INPUT pin is pulled up to +5V through the 10K resistor. When the closure switch is in the closed state, INPUT will be forced to GND (+0V). Note the 10K resistor is needed so that there isn't an unloaded (no resistance) short between +5V and GND when the switch is closed. By using a 10K resistor, only a tiny amount of current will flow from +5V to GND when the switch is closed. | ||
| + | |||
| + | Note the above circuit will have INPUT pulled to +5V when the circuit is open, and INPUT will be GND when the circuit is closed. If this is the opposite of what you want, then you can use a pull-down resistor circuit instead: | ||
| + | |||
| + | {{: | ||