First, sorry, I am a total hardware beginner (and 20 years since I had some electronics classes on the uni).

I want to replace a mechanical switch (well two switches…) with something driven by a 3.3v based ESP8266 board. And power consumption is a concern (I would like to minimise it if possible; I want to use deep sleep of the board which gets the power consumption to nearly zero). The problem is that the voltage which the physical button is currently switching is only 1.3V (3 wires, 2 with 1.3V against the third, button shorts one of the 1.3V to ground; it is wired through some custom wiring and RJ45 socket into a proprietary box, probably some microcontroller inside).

The board has two GPIO pins that stay in high impedance state through reset (= wakeup from deep sleep) that could be used to drive the switch.

I see one easy way and that is to use one of those 5v powered relays with 3.3v vcc in, however it seems to me that those have the optoelectric member and a transistor which must be draining a lot of electricity from the 5V pin over time.

Other idea was to use NPN transistor for switching, while connecting grounds between board power source and the ground wire (is this even possible?). But afaik there is a pretty large (0.6V?) voltage drop on the side being switched even in transistor's saturated state, and that is like 50% of the signal level.

I do not want to mess a lot with the outputs, as I do not want to fry the proprietary box somehow.

Please what is the best way how to solve this?

  • \$\begingroup\$ Please post a circuit diagram. \$\endgroup\$
    – Reinderien
    Commented May 6, 2022 at 17:49
  • \$\begingroup\$ A BJT transistor as a switch would not have 0.6V. More like 0.2V, and that's with plenty of current, so likely less. A FET would have even less voltage. If you intend to connect grounds, you could use a GPIO pin directly. But it depends how the switches are arranged, is it just a button to ground, button connects resistance to ground for reading an analog voltage, or is the button a part of a scanned keyboard matrix. You need to figure it out how it works before you can connect anything to it. \$\endgroup\$
    – Justme
    Commented May 6, 2022 at 18:28
  • 1
    \$\begingroup\$ use a logic level mosfet. source-ground, drain to button input, gate to GPIO. it will work better than a button (lower resistance) and won't draw any more power than the button does. \$\endgroup\$
    – dandavis
    Commented May 6, 2022 at 21:23
  • \$\begingroup\$ thanks guys, very informative. FYI I have no clue how the buttons work, this is my stand up desk, the buttons are simple up/down triangle switches, and I do not want to pry the buttons module open; I only access the rj45 that is plugged to the managment unit. Every idea you have mentioned is novel for me and a path to pursue. \$\endgroup\$
    – Natris
    Commented May 7, 2022 at 7:51
  • \$\begingroup\$ @Justme with connected grounds if its just a button to ground is there a risk using a GPIO pin directly? I'm doing an extremely similar project to sit between this controller (movetec.dk/wp-content/uploads/2021/11/…) and the box it normally plugs into. \$\endgroup\$
    – birarduh
    Commented Jun 27, 2022 at 1:31

1 Answer 1


It's hard to say without knowing anything more than the voltage across the open switches. You could get some idea of the impedance of the inputs by putting a resistor between them and ground and seeing how much voltage you get. For example, if you used a 1k resistor and the voltage measured 0.65V (half) you would have a Thevenin equivalent circuit of 1.3V and 1k. That would give you a little better idea of what kind of load you're dealing with.

As an electronic switch, you're probably best off with a mosfet.

Have a look at this related question.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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