Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have six buttons going into a microcontroller on six IO pins. I have a seventh pin that acts as an interrupt and wakes the microcontroller, which is always asleep until a button is pressed (this is for a remote control). Is this circuit a legitimate way of doing it so that pressing any of the buttons will wake the microcontroller, and what kind of diode (Schottky, Zener, switching, rectifier) should I use?

I thought about doing SPDT switches but those are much more expensive than SMT diodes.

circuit of simple microcontroller with six buttons and an interrupt

share|improve this question
In the microcontrollers I'm familiar with, the whole port (D0-D7) can be set to interrupt. So the diodes and separate interrupt pin aren't necessary. – markrages Dec 5 '12 at 8:30
up vote 2 down vote accepted

As the input signals are from manually operated push-buttons, switching rates required are not very high. presumably any debouncing will be taken care of in software.

The circuit:

  • Adding a weak pull-down resistor (10K perhaps) to pin 19 would help: A button being pushed will turn the diode on, line will be pulled high, but there is nothing to pull the line back down when the button is released. So it will take time going back low if the input is high impedance.
  • Depending on length of wire / trace to the buttons and diodes from the microcontroller, capacitors at the inputs may be useful to bypass any ESD the lines pick up, preventing false triggers.
  • Depending on the MCU used, internal programmable weak pull-ups / pull-downs may be available on inputs. If programmable pull-ups are available (e.g. AVR), the circuit and corresponding code logic can be reversed to save on the pull-down resistors in the schematic, as well as the additional one on pin 19.
  • Is this the best way to do this? I'm not sure, but many MCUs allow for a wake-up due to state change on any digital GPIO, hence all this may be redundant.

The diodes:

  • Pretty much any forward biased small-signal silicon, germanium or Schottky diode with a low forward voltage will do. As price is a factor, just go for inexpensive.
  • Silicon diodes will pull the line up to around 2.6 Volts, typically enough to be recognized as high on 3.3 Volt logic parts. Germanium or Schottky diodes would allow an even higher signal on pin 19 when active, not that it is necessary.
  • Zener diodes won't help (they are typically used reverse biased, reverse breakdown voltages are 2.x Volts and up) as the goal is to have as low a voltage drop as possible.
  • A switching rectifier isn't ideal, the name tells you they are optimized for rectification, not small-signal purposes like this one.
share|improve this answer
whoops. nice catch on the missing pull-down. I have a question in to the manufacturer about wake-up on any GPIO; there's a middle layer of firmware that I don't control that may limit it. Thank you for clarification on the diodes. – Bob Baddeley Dec 6 '12 at 18:34
@BobBaddeley Which MCU is it? – Anindo Ghosh Dec 6 '12 at 20:34
it's a BLE112 - I'm doing Bluetooth Low Energy. It turns out that their documentation is misleading and any of the pins will wake it from sleep, so this is a moot point. – Bob Baddeley Dec 11 '12 at 21:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.