# How to get the "max" from two inputs?

Question: Is there any way that I can change the signals from two inputs into the max signal from those inputs?

Such as,

0, 1 => 1
0, 0 => 0
1, 0 => 1
1, 1 => 1


Extra info: One input is a reed switch, the other is from an ESP8266 GPIO pin. Once the reed switch is activated, the ESP8266 is reset (the reed is connected to the reset and ground pin). During startup, power is applied to the ESP8266 GPIO pin until the ESP finished processing so that the device is being kept alive until it is done.

Current problem is, when the reed switch closes too quickly, GND is applied to RST, keeping the ESP in a state of non-deep-sleep and inability of finishing its process. So in order to solve this, I'd need to combine the MAX of those inputs.

Requirements: The "max" operation should not require extra power, so that when the ESP is in deep sleep, there is no extra power drain for this "max" operation (such as a reed switch doesn't require power to complete/open a circuit)

• Look up "OR gate"
– Mike
Jan 27, 2017 at 8:46
• you need to draw a schematic of what you have so far, I'm not sure how I can guess you've got it wired up so that one input resets the 8266. Jan 27, 2017 at 8:48
• I would do an OR gate with diodes. Each input has a series diode and the output of the diodes goes to a pull down. If any voltage is high the output if high, if both are low both diodes do not conduct and the input is pulled down. Jan 27, 2017 at 8:50
• @ClaudioAviChami How did I miss that! Of course it's an OR lol. I think you're right, diodes seem like the right way to go. If you post an answer I will accept it. Also, do you have any idea what kind of diodes I should be using? Would a 1N4004 work? Jan 27, 2017 at 9:11