0
\$\begingroup\$

Hey all I have 6 buttons that have the following voltage:

enter image description here

I want to hook up a 4N25 to each one of these so I can use the ESP32 as a "virtual push" to each of these buttons. When the button is pressed the 3.2vdc goes to ground.

enter image description here

To minimize the amount of wire going to each one I have come up with the following:

enter image description here

Is it possible to just hook 1 of the buttons left/bottom pins to all of the 4N25 chips so that I dont have to run 2 wires per button? Or is there a better way of doing this that will minimize the amount of wires?

\$\endgroup\$
12
  • \$\begingroup\$ Use a resistor ladder, google it. It takes only two wires. \$\endgroup\$
    – Codebeat
    Commented May 1, 2023 at 6:06
  • \$\begingroup\$ @Codebeat How does that help to simulate pushing buttons of an existing device? \$\endgroup\$
    – Justme
    Commented May 1, 2023 at 6:09
  • \$\begingroup\$ @Justme You don't mention clearly in your question you need it to control another device. Better go for a vactrol (google it) because that doesn't require a common ground to get the virtual push to work so your ESP is really isolated from the device. Tie all grounds together and you have one wire for ground or use an existing ground plane. \$\endgroup\$
    – Codebeat
    Commented May 1, 2023 at 6:17
  • \$\begingroup\$ @Codebeat It's not my question. And the optoisolator already isolates ESP from the device. What would an opto-isolator made from LED and LDR achieve better? \$\endgroup\$
    – Justme
    Commented May 1, 2023 at 6:22
  • \$\begingroup\$ See my answer to this question: electronics.stackexchange.com/questions/601603/… \$\endgroup\$
    – Codebeat
    Commented May 1, 2023 at 6:28

1 Answer 1

1
\$\begingroup\$

If all buttons share the ground like you say, then ground is the common and it can be one wire to optoisolators.

Same for the optoisolator inputs, you can share a common ground return wire.

\$\endgroup\$

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.