19. Design pull-down input

Circuit

Loading simulator…

Design Approach

A digital input needs a defined voltage even when its switch is open. A pull-down resistor holds GPIO_IN near 0 V until SW1 deliberately connects it to VCC = 3.3 V.

How the Circuit Works

  1. Define the open state. With SW1 open, no supply current reaches the input. A resistor from GPIO_IN to ground prevents it from floating and gives a reliable LOW.
  2. Set the closed-state current. The required current is about 0.33 mA. The resistor value is:R1=3.3V0.33mA=10kΩR_{1} = \frac{3.3\,\mathrm{V}}{0.33\,\mathrm{mA}} = 10\,\mathrm{k}\Omega
  3. Complete the connections. The solution adds R1 = 10 kΩ between GPIO_IN and GND. The existing SW1 and I_SW connect the node to VCC when closed.
  4. Read both states. With the switch open, GPIO_IN≈0V\mathrm{GPIO\_IN} \approx 0\,\mathrm{V} and I_SW is negligible. Closed, the node rises to 3.3 V and I_SW reads approximately 0.33 mA through the pull-down resistor.

Verify the Circuit

Toggle SW1 open and closed in EWsim. Observe approximately 0 V/open and 3.3 V/closed at GPIO_IN; current appears only when the switch closes. Try 1 kΩ for the pull-down and observe the higher closed-state current.

Key Learnings

  • Pull resistors establish predictable logic levels when switches are open.
  • Lower pull resistance improves noise immunity but increases current when the switch connects the opposite supply.