Electronic – arduino – use this switch with pull-up inputs

arduinogpiombedmicrocontroller

I'm currently using the mbed Application Shield on an Arduino-type board. I want to use the centre button as an input for interrupts but the internal pull-up resistors are causing me problems.

While debugging, however, I couldn't understand why I would read 2.7 V on the input when the switch was not pressed when I expected to read 3.3 V regardless of whether the switch was pressed or not.

Schematic of switch configuration

Is it possible to make this configuration work or will I have to make a separate circuit for a push-button?

Best Answer

The internal pullup resistors on an MCU are typically in the 30K to 50K ohm range. If you are seeing the 2.7V level on the GPIO lines to the MCU then it would seem likely that one of several things are at play here:

  1. Are the pulldown resistors really 4.7K? If they are populated wrong at say 47K this could be the problem. If so remove them and replace with smaller value resistors.
  2. This could also be a problem with the common connections of those 4.7K pulldown resistors not being properly connected to the GND of the MCU. Check it with an ohm meter when all the power is off.
  3. You may very well have the GPIO pins that these connect to setup as output pins in the high ('1') state. The nominal 4.7K pulldown on these pins may be making the output drive be 2.7V and then the switch just pulls the output all the way up to 3.3V. If this is the case make those GPIO pins be inputs instead of outputs.