Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamspin55 wrote:I think that in addition to the parts that I mentioned before, I would also invert the capacitor and diode that go to the optocoupler so that the internal diode conducts in the positive half cycle of the wave and closes contacts S1 and S2.
Very good video, although I had not seen it when I answered before.
Greetings
p.kaczmarek2 wrote:The trick from video really could work but I am not sure if such a big interference into your electrical wiring is a good and safe idea.
spin55 wrote:In the image above it has a good diode, capacitor and optocoupler, but you would also need to invert the diode and capacitor of the bulb part so that everything works in the positive half-wave of the mains voltage. Actually it would be enough to exchange the inputs to the diode of the optocoupler and I think it would work with the original circuit and negative half wave. But I guess it's better to flip capacitors and diodes than cut leads if you already have the board done.
The bottom image does not work because you would have to flip the diode and capacitor to work with a positive half wave and correctly bias the internal diode of the optocoupler.
Greetings
spin55 wrote:That is.
spin55 wrote:First clarify that I have not experimented with this assembly. All I tell you is based on what I see on the electrical diagram.
Checks to perform:
1.- Sonoff stays online when you turn off a key?
2.- If positive, if the relay does not hold until the next half wave, you will have to play with the values of the RC network of the optocoupler. But first try to change the 56K resistor that goes to the cathode of the optocoupler diode for another 100K, or higher depending on the result.
If that causes the LED not to activate, I would try inserting a resistor between the capacitor and the anode of the optocoupler.
![]()
Added after 11 [minutes]:
How do you have S2 configured in Sonoff? It would have to be in Toggle mode for it to maintain the connection.
First check that Sonoff is still online when you turn off a key before you start changing resistors.
spin55 wrote:
Wall switch toggle on | led on | light bulb on | Wall switch toggle off | led on | light bulb off |
Wall switch toggle on | led off | light bulb off | Wall switch toggle off | led off | light bulb off |
ferbulous wrote:So toggling switch only toggles the light bulb but not the relay, and the relay has to be on to work.
spin55 wrote:By shorting S1 and S2 we will see if the relay is activated or not.
spin55 wrote:So you have to add the trigger circuit to be able to control the bulb via S1-S2. I haven't been able to do this test because I don't have an optocoupler.
ferbulous wrote:
Wall switch toggle on led off light bulb on Wall switch toggle off led off light bulb off
Another scenario, if the light bulb was already off before the relay is toggled off.
When the relay is turned on, light bulb stays off and i’ll need to toggle the wall switch again to turn light bulb on
spin55 wrote:If I reverse the position of the diode, everything works like the classic series assembly where the power to Sonoff is provided through the wall switch in the ON position. So it can be controlled remotely, but when the switch turns OFF, Sonoff loses connection. In this way you have manual control of turning the bulb on and off, but remotely only if the wall switch is ON. That's how I've had it so far and it's fine for me.