Tricky Circuit

上拉电阻与数字输入

让按钮有明确的答案

上拉电阻通过电阻将输入连接到电源正端。数字输入区分高、低电压。按下按钮会把输入连接到地,即电路的 0 V 参考点。

打开互动实验

实验台

改变电路设置,预测读数,再检查挑战结果。这些是教学模型,每课都会说明模型的假设。

登录以保存学习进度. 访客进度保存在此设备上.

在完整窗口中打开实验室

工作原理

理想输入不取电流,闭合开关电阻为零。不模拟漏电、触点抖动或不确定的逻辑阈值。

松开:输入等于电源电压,电阻电流为零。按下:输入为 0 V,电流 I = V/R 流过电阻和按钮。

难度
  1. 搭建 · 搭建

    通电,设置 5 V、10 kΩ,松开按钮,观察输入 5 V。

    需要提示?

    5 V; 10 kΩ → 5 V

  2. 探索 · 改变一个参数

    保持 5 V、10 kΩ,按下按钮,观察 0 V 和 0.50 mA。

    需要提示?

    5 V; 10 kΩ → 0 V; 0.50 mA

  3. 独立解题 · 完成挑战

    在 5 V 且按钮按下时,将电流降低到 0.100–0.125 mA。

    需要提示?

    5 V; 40 kΩ → 0.125 mA

延伸阅读与电路配方

让按钮有明确的答案

有用的规律

较大的上拉电阻可减少按住按钮时的电流。

模型之外

没有上拉或下拉时,悬空输入的电压可能无法可靠确定。

值得避开的误区

这里高电压表示按钮松开;程序可以反转这个含义。

在 5 V 且按下时,把 10 kΩ 改为 20 kΩ,电流会……

  1. 减半
  2. 加倍
  3. 不变
延伸阅读

按钮仍把输入保持在 0 V,电阻加倍使 V/R 减半。

Arduino

Temu affiliate offers

Find your next electronics project

Explore these do-it-yourself project kits. Check the selected option, included parts and instructions on each offer.

Tricky Circuit may earn a commission if you buy through these Temu affiliate links. These are product ideas; they have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

Supplier photo of an assembled infinity mirror light cube illuminated on a dark background.

Supplier product photo

Build an infinity light cube

Listing specifies 5-volt direct current. Soldering required; battery and glue not included.

View kit on Temu

Supplier photo of a breadboard, jumper wires and assorted electronic components in a plastic storage case.

Supplier product photo

Try breadboard experiments

Breadboard, wires and assorted parts. Arduino controller board not included.

View kit on Temu

Supplier photo of an assembled blue surface-mount soldering practice board with a circular ring of small lights.

Supplier product photo

Solder a chasing-light board

Surface-mount soldering practice. Battery and battery holder not included.

View kit on Temu