logo elektroda
logo elektroda
X
logo elektroda

Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

ferbulous 7470 63
ADVERTISEMENT
  • #1 20521303
    ferbulous
    Level 18  
    Has anyone tried this no neutral hack that allows to install the tuya mini on the light fixture?
    I had the diodes polarity reversed to get it working with the tuya/aubess, but I still can't toggle the relay from the wall switch (S1 & S2)



    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Was wondering if anyone else got it working
  • ADVERTISEMENT
  • #2 20521660
    spin55
    Level 17  
    Have you tried flipping the 1N4007 diode and the 10uF/400V electrolytic capacitor?
  • #3 20521680
    p.kaczmarek2
    Moderator Smart Home
    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.
    Helpful post? Buy me a coffee.
  • #4 20521955
    spin55
    Level 17  
    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
  • #5 20522181
    ferbulous
    Level 18  
    spin55 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


    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Ah yes, I did flip those as well. If i’m doing it right on the bottom diagram
    Maybe there's more modification i need to add?

    Added after 2 [minutes]:

    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.


    Any more safety measures that could be added to the circuit?
    The uploader did emphasize on using fusible resistors for safety reason
  • #6 20522303
    spin55
    Level 17  
    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
  • #7 20522314
    ferbulous
    Level 18  
    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


    Just to clarify, i would just need to change diode & capacitor poles to the bulbs back to the orignal arrangement with the sonoff?

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • #9 20522319
    ferbulous
    Level 18  
    spin55 wrote:
    That is.


    Noted, will try that
    On my 1st attempt using the sonoff arrangement. The tuya mini switch didn’t boot up at all which is why i reversed the poles

    Added after 7 [hours] 33 [minutes]:

    @spin55
    hi, some update

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    With this arrangement, I can toggle from the wall switch but only if the relay is turned on. If relay is turned off, I can't trigger it from the switch
  • ADVERTISEMENT
  • #10 20523207
    spin55
    Level 17  
    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.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    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.
  • ADVERTISEMENT
  • #11 20524259
    ferbulous
    Level 18  
    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.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    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.


    1) yes, it stays online
    2) i will update later today once i get home and retry with higher resistors.

    Video demo, please ignore the fluorescent bulb




    3) yes, i have setup the pin as toggleonchannel
  • #12 20524329
    spin55
    Level 17  
    Just to confirm. Have you changed that or have you left it as the original?

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal? Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Added after 11 [minutes]:

    ferbulous wrote:
    2) i will update later today once i get home and retry with higher resistors.


    Don't make those changes for now.
  • #13 20524589
    ferbulous
    Level 18  
    @spin55
    I’ve reverted back to the original diagram (except for the diode on the wall switch that must be reversed for tuya mini to work)
  • ADVERTISEMENT
  • #14 20524600
    spin55
    Level 17  
    What pin configuration do you have? Are S2 and mini push button on the same channel?
    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • #15 20525635
    ferbulous
    Level 18  
    spin55 wrote:
    What pin configuration do you have? Are S2 and mini push button on the same channel?
    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?


    Yes, all on the same channel
    I’ve also changed the S2 (pin 14) to both toggleonchannel & btn_n with the same result
  • #16 20525679
    spin55
    Level 17  
    This is the configuration you have, right? Now I have to go out, I'll take the opportunity to buy a wall switch and I'll do some tests with my mini-switch. I'll inform you.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • #17 20525854
    ferbulous
    Level 18  
    spin55 wrote:
    This is the configuration you have, right? Now I have to go out, I'll take the opportunity to buy a wall switch and I'll do some tests with my mini-switch. I'll inform you.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?


    Correct, that's what I ended up with after not much difference between changing the polarity for the diode next to the octocoupler.

    Thanks for testing it out, i hope you find a solution for this

    If you have tuya wifi/zigbee wall switch you can follow the same wiring diagram for the sonoff switchman. Zigbee switch will still act as repeaters


  • #18 20526312
    spin55
    Level 17  
    Can you confirm if the led of the "Sonoff" button changes when you turn the wall switch on and off? It doesn't look good on the video.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • #19 20526372
    ferbulous
    Level 18  
    @spin55
    For the tuya wifi mini

    Relay on (via openbk ui or small button)

    Wall switch toggle on led onlight bulb on
    Wall switch toggle off led onlight bulb off


    Relay off (via openbk ui or small button)

    Wall switch toggle onled off light bulb off
    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

    So toggling switch only toggles the light bulb but not the relay, and the relay has to be on to work.
  • #20 20526471
    spin55
    Level 17  
    Do what it shows in the video. When you open the relay with a push button and the bulb no longer turns on when you press the wall switch, short-circuit S1 and S2 and tell me what happens.

    Added after 2 [minutes]:

    ferbulous wrote:
    So toggling switch only toggles the light bulb but not the relay, and the relay has to be on to work.


    By shorting S1 and S2 we will see if the relay is activated or not.

    Momentary short circuit, do not hold.

    Added after 25 [minutes]:

    If the relay is activated by short-circuiting momentarily, the RC value of the trigger must be decreased. Either by reducing the value of the 56K resistor or the 470uF capacitor, so that the optocoupler LED turns off during the negative half cycle of the wave.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Added after 1 [hours] 15 [minutes]:

    This is the setup I've tried.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    With the diode in that position, Sonoff stays online both when I turn the wall switch ON and OFF.
    In the OFF position, the bulb blinks, but that is logical because it only works with half wave. It is corrected with capacitor and diode.
    But there is a big problem: You can't control the bulb with the wall switch, it only supports remote control via web.
    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.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    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.

    Greetings
  • #21 20527321
    ferbulous
    Level 18  
    spin55 wrote:
    By shorting S1 and S2 we will see if the relay is activated or not.

    Ok, how do I short S1 & S2?

    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.

    With the added octocoupler, this is what I'm getting now

    ferbulous wrote:


    Wall switch toggle onled 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.

    I'm trying to avoid this because there would be no point of doing it if sonoff goes offline when wall switch is toggled off
  • #22 20527496
    spin55
    Level 17  
    To understand us better, we are going to take this diagram as a reference:

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Ok, how do I short S1 & S2?

    When you turn off the relay with P1 and can no longer turn on/off with SW1 or SW2, please take a piece of wire and touch both ends S1 and S2 at the same time and remove. Change the relay?

    With the added octocoupler, this is what I'm getting now

    We'll talk about that later. First you have to check if the relay changes with a short circuit of S1 and S2.
  • #23 20527785
    ferbulous
    Level 18  
    @spin55
    Would i need to remove the cables from the octocoupler to S1 & S2 before shorting it?
  • #24 20527813
    spin55
    Level 17  
    For this test do not remove them.

    Added after 8 [minutes]:

    If the relay does not switch, disconnect S1 and S2 from the optocoupler and repeat the operation.
  • #25 20529187
    spin55
    Level 17  
    With the current configuration this will not work because T1 is always ON and S1-S2 Close when SW1 is Open or Close.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    You have to turn D5, C1 and D6 to make T1 OFF and S1-S2 Open when SW1 is Open .

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • #26 20529201
    ferbulous
    Level 18  
    @spin55 I’m not home yet for now to test it
    For the 3rd pic, how do i reverse the D6 (diode) since it’s part of the octocoupler? T1 as well?
    ————————
    Nevermind, I’ll just need to swap the L & N connection to the octocoupler
  • #27 20530029
    spin55
    Level 17  
    ferbulous wrote:
    For the 3rd pic, how do i reverse the D6 (diode) since it’s part of the octocoupler? T1 as well?


    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Added after 10 [hours] 26 [minutes]:

    Beware of this if C1 has polarity!.

    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • Helpful post
    #28 20531832
    spin55
    Level 17  
    And configure like this:
    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Added after 6 [hours] 8 [minutes]:

    It works with this assembly:
    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?

    Added after 1 [hours] 9 [minutes]:





    Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal? Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal? Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal? Modifying Tuya Mini for No-Neutral Installation: Experiences with Diode Polarity Reversal?
  • #29 20534324
    ferbulous
    Level 18  
    @spin55 thanks for the successful test & the working diagram!
    I think I’ll move to using cables this time instead of pcb and redo this again
  • #30 20534335
    p.kaczmarek2
    Moderator Smart Home
    @spin55 very good job, you should post it separately to Smart Home Tutorials section with a better description (in a form of tutorial) and get a free gift:
    https://www.elektroda.com/rtvforum/topic3950844.html
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around modifying the Tuya Mini switch for no-neutral installations, specifically addressing issues related to diode polarity reversal and relay toggling from a wall switch. Users share experiences and suggestions for circuit modifications, including flipping diodes and capacitors to ensure proper operation with the positive half-cycle of AC voltage. Safety measures, such as using fusible resistors, are emphasized. Participants also explore the feasibility of using this setup with ceiling fans and other AC devices, noting the importance of understanding the power requirements and potential risks associated with half-wave DC operation. Successful configurations and troubleshooting steps are shared, along with links to relevant diagrams and videos.
Summary generated by the language model.
ADVERTISEMENT