I'm trying to do the following, not sure if it's possible or not, and I'm not really sure what it's called so I can't search for it.

I have a pi 2 B+. Let's say I have two push buttons, A and B.

A is connected to the GPIO (and I've tested it with an LED to make sure it turns on and off when A is pressed).

B is connected to a different powered device. I've added two wires out of push button B (in addition to whatever it is already connected to).

When I press A, I want to somehow send a signal to B, using the two wires I added, to simulate a button press of B.

Not sure if that is possible, if I need to connect B to the GPIO, or what? :|

(I need to connect A to B via the GPIO as there is a motion sensor that I want to use as well, to activate B - i.e. I can't just connect A to B directly).

Thanks in advance!

  • It depends on the "different powered device" and how button B is connected to it (more detail?). You may be able to connect to a GPIO pin set as output, or you may need to add a relay in between.
    – rosscova
    Jun 11, 2016 at 4:29
  • I don't understand. Could you add a diagram to your post?
    – joan
    Jun 11, 2016 at 7:46
  • @rosscova it's a monitor, and it's connected via it's own separate little circuit board. I don't know much about relay's but I think that sounds like the right track.. I'll do some more research. Thanks!
    – yhax
    Jun 12, 2016 at 0:51
  • It sounds like you're trying to turn the monitor on and off via the pi, is that right? If so, and depending on the monitor itself, you may be well served with a relay controlling the power input to the monitor. Don't dive in adding a relay to your mains power unless you know what you're doing, but if there's a low-voltage input to your monitor, you'd likely be able to play with that a little more safely.
    – rosscova
    Jun 12, 2016 at 2:26
  • If not a relay (and you don't mind some possible soldering) a simple transistor (NPN) might be all you need.
    – linuxgnuru
    Jun 14, 2016 at 18:26

1 Answer 1


Use one of the commercially-available Pi Relay Boards (Google) and use the output wires of the relay to connect to the wires you have on button B. When you use the GPIO on the Pi to turn the relay on, that simulates a button press on Button B.

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.