Author Topic: connecting pushbutton to IC  (Read 1115 times)

0 Members and 1 Guest are viewing this topic.

Offline fiszTopic starter

  • Contributor
  • Posts: 11
connecting pushbutton to IC
« on: October 21, 2016, 09:23:39 am »
From what I understand, to connect a pushbutton to a microcontroller, it is enough to do it like this:
http://playground.arduino.cc/CommonTopics/PullUpDownResistor
When shorted, the pushbutton connects either Vin or ground directly to input pin, and when open it connects to ground via pulldown or to Vin via pullup resistor respectively.

However, I came across this schematics:
https://www.cooking-hacks.com/media/cooking/images/documentation/tutorial_ir/ir_remote_pushbuttons_small.png
(source: https://www.cooking-hacks.com/documentation/tutorials/control-hvac-infrared-devices-from-the-internet-with-ir-remote/)

Could someone explain the purpose of it (especially the R20 and R21 resistors)?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: connecting pushbutton to IC
« Reply #1 on: October 21, 2016, 09:37:11 am »
Its likely to be to reduce the 5V  signal from the switch to 3.3V logic levels, though IMHO the 1K5 resistor should be increased to 1K8 (nearest preferred value to 1.7K).  Also the 10K pulldown resistors are redundant if it is driving a 3.3V MCU.  It will be problematic with most 5V MCUs (out of spec logic '1' level) unless they either have TTL compatible input thresholds, or the 3K3 resistors are removed and the 10K resistors are kept.

The other thing it does is put 1.5K between any ESD at the switch and the MCU input pin, which will vastly increase its ESD tolerance, by limiting the peak current its internal protection diodes have to clamp.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf