I have an existing circuit with a bi-directional momentary switch that controls a 12V DC motor, commanding it to go in either forward or reverse directions. The center position of the switch is off - no motion. I don’t want to disturb that circuit. How can I use those signals to control a different circuit where I want to make one connection if the switch is pressed one way and a different connection if the switch is pressed the other way? In the center switch position I don’t want to have any connection in my second circuit. I have been trying to think of a way to do this with two SPST relays but I’m either overthinking it or missing something about how to wire them so that I don’t end up with a short or both relays being tripped. Is there an easier/better way to accomplish what I’m trying to do? Smaller is better in this application, too.
So the motor moves only when you hold the switch pushed?
What's the voltage of this "secondary circuit"?
Draw some circuit diagram .
Optocouplers are small...
Does the 12V go through the switch or this is just feeding a logic signal to some driver ?
Correct - the motor only moves if you press and hold the switch in one direction or the other.
Voltage of the second circuit - unknown actually. It’s a black box bluetooth controller. It has two signal wires and a ground. If I connect one signal wire to ground I get the effect I want from the switch in one direction. If I connect the other signal wire to ground I get the effect I want from the switch pressed in the other direction.
I have messy circuit drawings on paper. I can try to clean them up and upload images. I don’t have the Arduino app on the computer I’m using but maybe I can install it and make the circuit that way.
I think 12V goes through the switch. That’s my understanding anyway.
Seems to be a safety (deadman) switch.
Ohh, at least we know color.. ![]()
Anyway it looks like job for two optocouplers.
So arduino doesn't have role here?
Sort of. It is black. I was using that more as a way to say that I don’t know exactly what goes on inside the bluetooth box.
No job for an Arduino here. I have another couple of projects that have used Arduino but this isn’t one of them.
I’ve had a little exposure to optocouplers but it was a long time ago. I guess I viewed them like a relay, which is sort of what they do. I hadn’t investigated exactly how they work though. That might do it if I’m reading the schematic right - basically a diode (LED) that trips the connection.
Sort of, I guess. I wasn’t trying to keep secret what the circuit does. Just trying to simplify for the sake of understanding. The switch currently controls the roadbook on my rally motorcycle. Push the switch forward and the roadbook advances until I get to the next instruction in the roadbook. Push the switch backward and the roadbook rolls back to the previous direction. This is for a paper roadbook. I’m working on converting it to a digital setup using a tablet. I have a bluetooth control box that talks to the tablet but it wants one connection made for ‘roadbook forward’ and a different connection made for ‘roadbook back’. There are different buttons/switches that would talk to the bluetooth box directly but I am trying to avoid changing those controls for now and would prefer to use the existing switch and circuitry if possible.
Thank you for your help with this! I found solid state relays that use optocouplers (seems like most would?). That simplifies packaging a little bit for me in this application too.
You are welcome. The fact that solid state (and mechanical) relays use optocouplers doesn't mean that they are ideal choices for signal switching. And they are commonly quite much bigger than plain opto. But if correctly wired, safe to try. I personally would go with plain one for "black boxes". ![]()
Most SSR only function on AC. Rare ones will be DC only and they are really mosfets.
I was looking for something relatively quick and available. The ones I found seem to be for DC and mention optocoupler isolation. Is it okay to post an Amazon link? It’s these: (10pcs)12V 5V 3v 3.3V Solid State Relay 1a,dc SSR,Input:3-32Vdc,Output:5-60Vdc,41Fdd,Non-Contact,Mini,Slim Ac dc-dc,Micro for ESP32 Raspberry Pi Arduino ebike: Amazon.com: Industrial & Scientific
Yes, one of those will be fine. I have some similar in the junk box removed from commercial equipment.
Electricians call these retractive switches e.g. one gang, two way, centre off with spring return.
Commonly used for opening and closing windows or blinds.
Available as plate switches or in sub-miniature form.
While I’m waiting on components I thought it might be useful to try creating a schematic to make sure I’m headed in the right direction. I’m also trying out KiCAD. It doesn’t have a good symbol for a Center-Off, momentary DPDT switch so you have to imagine the two switches operating together such that they default to the off position and they are only connected 2-1 on both switches or 2-3 on both switches.
A couple of additional questions based on my inexperience and being a bit out of practice -
- Do I need an additional 2 diodes to protect the PC817 internal LEDs in this circuit?
- Is there any reason I shouldn’t use a resistor value as low as 1k Ohm? Charging voltage (represented with a battery) could get as high as about 14V. It could go really high if the regulator/rectifier fried itself but that’s rare. At 14V that only gives the PC817 ~5mA with a 2.2k Ohm resistor. Or is there something I’m missing here?
Edit to add - I received what I needed and tested the circuit. It works! Thanks again to all of those who helped on this!
H-Bridge ?
That’s basically what I have but I needed to take those motor control signals and turn them into something more like a digital signal (one wire to ground or a different wire to ground, depending on the direction the motor would spin). The optocoupler solution works perfectly so far. I made a little 3D printed housing and soldered the components together without a PCB. It’s on the bike and working. I’ll have to do some durability testing. It would also be nice to find a source for potting compound to really make it robust.
Is your printed housing able to hold potting compound so it can’t leak out while hardening?
Takes 24 hours and gets quite hot!I used to buy two-part epoxy potting compound on Ebay. Probably still can.
The current design that I’m using wouldn’t work but it would be easy enough to redesign. And I have 58 more optocouplers to use! ![]()

