Connect old toggle switch to new Tuya smart switch

Hi, I’m currently remodeling my house. The dining room has been wallpapered, and I want to quickly connect the light switch when I notice that the two-way switch no longer works as usual. A Tuya button and changeover switch, how do I get them together if I can no longer get to the junction box.

So I thought about building a circuit that would allow me to do this. That’s basically the electrics.

What do I need:

  1. Power supply 220v to 5V,
    Screenshot (82)

  2. optocoupler 220v to 5V,

  3. bistable relay 5V,
    Screenshot (83)

4, and a link from the optocoupler , a pulse generator to switch the relay.
Screenshot (84)

I hope someone can help me find the appropriate assembly or component.
Regards

This has nothing to do with KiCad, it’s a generic electronics/project question and better asked in some other forum. I’ll close this thread because we try to keep this forum focused directly on KiCad.

1 Like

Your two way switches should work if you swap the wires in your “new” box to the below diagram.


I have now drawn my circuit diagram, for the question mark I have chosen a HF41F-5-ZS power relay board. The C4 I don’t know yet whether I need it or what kind of type / value it has to be.
Do I have gross blunders in there?
The doubles L and N are for the outlet.

Parts list:
U1 1x optocoupler LTV 814 (AC input)
C1 1x capacitor 100nF
C2 1x Elko 1µF/63V
C3 1x capacitor MKS 4 0.047µF 1000V
C4 1x ?
C5 1x 470nF/0.47µF 275V anti-interference capacitor
R1 1x R680k
R2 1x R 1k
R3 1x R 4.7k
J1 1x screw terminal HS 2-pin. N
J2 1x screw terminal HS 2-pin. L
J3 1x screw terminal HS 2-pin. Change contact
J4 1x screw terminal HS 2-pin. L Input Tuya switch
PS1 1x HLK-PM01
K1 1x HF41F-5-ZS power relay

@jmk
Unfortunately this is not possible. Three wires (1Kabel) go from the junction box to the changeover switch. And three wires (1cable) to the lamp and three wires (1cable) to the Tuya Switsch. Where the Tuya was, there used to be a toggle switch.

I don’t understand. Why do you need the optocoupler? Seems to me you want the relay activated when there is mains coming in on J4. Why not connect J4 to the SMPS and drive the relay with the low voltage output? So only 2 components. Or use a mains powered relay, just one component.

@retiredfeline Great point, that simplifies things enormously. :heart_eyes: