0

I've been reading about how to use the GPIO to toggle a button on a thing I've taken apart.

It's like this: Amazon

I watched a video of a guy using an opto-coupler, what are the basics here? I'm kind of new to circuitry.

  • 2
    Are you asking for advice on how to control the button, or on how to use an opto-coupler? Have you tried Google for the latter? What did you find and what did it leave unanswered? – Mark Smith Jun 22 at 6:51
  • Ah, this is neat. Suppose you have 3 Rpi's and you wish to select which Rpi to display on the one and only one HDMI monitor, using Rpi GPIO pin to "press" the button, instead of using the human hand to press the button. To do this you need to (1) open the box, (2) find the two contact points of the button, (3) check the nature of the switch, (4) if it is a mechanical switch, you can use a cheapy Rpi GPIO controlled 5V relay to do the switching. So you can now do both manual and Rpi software select. (5). /to continue, ... – tlfong01 Jun 22 at 8:45
  • (5) I have such a switch, with 5V power inputt. That means the button controls a 5V high low signal. This is a bit complicated. If the button is a "pull up" type, then you can use one GPIO pin, step up 3V3 logical signal to 5V, and connect to the button pull up resistor contact point, and that is it. WARNING: mess things at your own risk: I don't guarantee your HDMI mon will not explode! :) PS1 - If the button circuit is not pull up type, but sort of push/pull type, then sorry I can't help, because my broken English can't do. PS2- I am only guessing. I have NOT tried it myself! – tlfong01 Jun 22 at 9:01
  • Thank you all for your answers and edits! Much appreciated. Will read through when I get the time. – Quinn Finney Jun 22 at 18:07
0

Question

How can Rpi GPIO toggle the HMDI selection button?

Short Answer

Yes, if your HDMI selector button is connected to a pull down resistor, and pressing the button pulls input signal at resistor to ground, releasing button pulls resistor to 5V.

What you need to do is to extract two wires from the button contacts, one is 5V logic input signal, the other wire is ground.

Since Rpi GPIO logic level is 3V3, so you need to use a level converter, such as the 2N2222 transistor pull up circuit, to pull Rpi GPIO 3V3 signal to 5V, then input to the HDMI button selector input. You can read more details of the wiring in the long answer below.

hdmi selector

Long Answer

Suppose you have 3 Rpi's and you wish to select which Rpi to display on the one and only one HDMI monitor, using Rpi GPIO pin to "press" the button, instead of using the human hand to press the button. To do this you need to:

  1. open the box,

  2. find the two contact points of the button,

  3. check the nature of the switch,

  4. if it is a mechanical switch, you can use a cheap Rpi GPIO controlled 5V relay to do the switching. So you can now do both manual and Rpi software select.

  5. I have such a switch, with 5V power input. That means the button controls a 5V high low signal. This is a bit complicated. If the button is a "pull up" type, then you can use one GPIO pin, step up 3V3 logical signal to 5V, and connect to the button pull up resistor contact point, and that is it.

hdmi switch

WARNING: mess around things at your own risk: I don't guarantee your HDMI mon will not explode! :)

Update 2019jun22hkt2023

My cheapy US$7 HDMI splitter actually IR remote control

HDMI Switch 3 Port Video Splitter 3 In 1 Out IR Remote Control - US$7

hdmi switch

So I think it is much safer and easier to DIY a Rpi GPIO IR remote controller, than to mess around with the electronic button circuit.

References

Raspberry Pi Zero Universal Remote Instructable – bbtinkerer, instructables 2018

AliExpress Universal TV Remote Control US$2.34

TSAL6200e IR LED Datasheet – Vishay

TSOP38238 IR Receiver – Vishay

HBS838 IR Receiver Module

HobbyElectronics HX1838 Infrared Remote Control Module and Receiver - £5.4

TaoBao HX1838 Infrared Remote Control Module and Receiver - ¥2

Appendices

Appendix A - Rpi GPIO controlled IR Universal Remote

rpi ir remote

Appendix B - HDMI selector button connection

button schematic

Update 2019jul08hkt2114

Appendix C - IR Modules

  1. 5V IR Encoder/Decoder NEC Code transceiver receiver

  2. IR Remote Control Kit HX1838 Remote

  3. Smart Robot B&W Line Tracing IR Blocking

  4. IR Anti Collision Module

  5. Two Channel IR Transmitter

  6. IR Remote Control Tool (NEC) 25th March 2015

  7. IR Remote Control Receiver 3rd April 2015

  8. NEC Protocol

  9. LIRC

  10. Rpi IR Receiver and RaspBMC Media Centre - Pi Hut

  11. Building Serial Port IR Receivers [Using 38kHz Vishay TSOP 1838 ] - lirc.org

  12. Building Serial Port IR Transmitters - lirc.org

  13. Infrared Shield for Raspberry Pi by LinkSprite

  14. Tutorial of Infrared Shield for Raspberry Pi by LinkSprite 2014apr29

  • Thank you for the detailed answer I will ask some questions when I get the time!! – Quinn Finney Jun 22 at 18:08
  • Do you wire the GPIO to the IR remote controller, or would you use an IR reader to read what it is sending and replicate it? That solution sounds much better and would also allow actual control of 1 2 or 3 instead of toggling between. – Quinn Finney Jun 22 at 21:04
  • @Quinn Finney, I have added a reference section with universal remote.stuff. You might like to skim through them to get a rough idea of how things work. The first reference uses RpiZero to DIY a remote is OK for newbies. – tlfong01 Jun 23 at 1:28
  • Thanks, these are really helpful. – Quinn Finney Jun 23 at 3:28
1

1) substitute a relay for the button press - that way you don't need to worry about voltages, common grounds, pull ups, or pull downs. Eg https://www.instructables.com/id/Control-Any-Remote-From-a-Raspberry-Pi-and-Amazon-/ 2) Or find an HDMI switcher with a computer input, for example the ATEN HDMI switcher has an RS232 input.

The button on the HDMI switcher you're using is a toggle which cycles round the inputs. unless you also read back the LED to know which one is selected, you're likely to miss a keypress, get out of synch, and not know which input you have switched to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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