logo elektroda
logo elektroda
X
logo elektroda

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

ferbulous 14457 63
Best answers

How can I wire a Tuya/Aubess mini relay for no-neutral operation so the wall switch on S1/S2 still toggles the relay without the module going offline?

Yes, but the thread says your current polarity change is not enough: with that configuration T1 stays on and S1-S2 stay closed, so you need to reorient D5, C1 and D6 so T1 turns off and S1-S2 open when SW1 is open [#20529187] The practical consequence of the simpler diode reversal is that the mini works, but it loses connection when the wall switch is off; in that setup you only get remote control when the wall switch is closed [#20526471] The switch input also needs to be configured in Toggle mode for S2 [#20523207] After the final reconfiguration, spin55 reported that “it works with this assembly,” and the original poster confirmed the working diagram [#20531832]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • Moving fusible resistor reduced standby power

    #61 21041394
    franfj
    Level 6  
    Posts: 7

    >>20894879
    Unfortunately the mini relay was too big to fit between my wall and switch so I haven’t been able to use the new version.

    But I have moved the fusible resistor near the capacitor as on the new version and that reduced a lot the amount of power that it consumes so it will not burn by normal use.

    Ps: some aliexpress modules like the aubess mini 16a have a little free space inside and some gpio ports unused, therefore it’s possible to fit the optocoupler part of the original design inside the module case (with the capacitor, diodes and resistors, but they must be soldered one to each other without a pcb so they fit in the least space possible). That allows very compact designs, just the diode on the switch, and just the module on the lamp (and the 400v capacitor with its diode and resistor if required by the lamp).
  • ADVERTISEMENT
  • #62 21280829
    ferbulous
    Level 18  
    Posts: 419
    Help: 8
    Rate: 56
    >>20824558
    Getting back to this because sonoff basic r4 magic switch mode doesn’t work with all switch (specifically himmel)

    So with the new modification I just need to replace the fusible resistors and the bigger diodes?
  • ADVERTISEMENT
  • #63 21403807
    nkz
    Level 9  
    Posts: 25
    Hi


    Section of an electrical schematic with a PC817 optocoupler, 1N4007 diode, 470uF/10V capacitor, and 56K resistors.

    What current will flow through the diode in the optocoupler?
    Won't it be too small?

    Can anyone provide calculations?
  • Measured 1.14 mA optocoupler drive current works

    #64 21406579
    spin55
    Level 17  
    Posts: 209
    Help: 17
    Rate: 42
    >>21403807

    This is the circuit that was tested and worked: Circuit diagram with electrical components.

    https://www.elektroda.com/rtvforum/topic3971605.html

    In testing I used the components I had on hand at the time. The actual measured values ​​are:

    - R1 and R2 are 45.9K and 46.9K
    - The voltage measured on the pins of capacitor C1 is 1.1 Vdc
    - The current consumed is 1.14 mA
    - The alternating voltage of the mains supply: 236 Vac
    - Peak network voltage: 332 Vac

    The formula to apply is Ohm's law: V = I * R (V being the average DC voltage)
    Vdc = Vp/3.14 (pi)
    Therefore: I = (332/3.14) / (45.9 + 46.9) = 105.73 / 92.8 = 1.14 mA

    https://www.youtube.com/watch?v=sekdEc5wU6k&a...b_ph_WdlLDny2cGloFSxyRgO8B733jeo&index=81

    If we take a look at the optocoupler datasheet, that current of 1.14 mA seems very low compared to the 5 mA or 20 mA that it recommends, but the truth is that it works. To ensure those 5 mA, the resistances would have to be reduced to (18.5K / 2 = 9.3K).

    Greetings

Topic summary

✨ The discussion centers on modifying Tuya Mini and similar smart switches (e.g., Aubess mini, Sonoff Mini-R2) for no-neutral wire installations by reversing diode polarity and adjusting associated components. Key modifications include flipping the 1N4007 diodes and electrolytic capacitors, especially those connected to the optocoupler, to ensure conduction during the positive half-wave of the AC mains. The relay toggle functionality from wall switches (S1 & S2) is problematic when the relay is off, requiring further circuit tuning such as adjusting RC network resistor values (e.g., increasing from 56K to 100K) to maintain relay activation. Safety improvements involve using fusible resistors placed near capacitors to handle inrush currents during capacitor charging. The no-neutral hack is effective for lighting loads but may not suit AC motors or fans due to half-wave DC supply potentially damaging motor windings; DC fans may work if diode ratings and capacitor values are adjusted accordingly. Testing with loads like hand dryers confirmed AC devices fail to operate properly on half-wave DC. The community shared detailed wiring diagrams, component value calculations, and practical test results, including current through optocoupler LEDs (~1.14 mA) and resistor power dissipation estimates. The discussion also covers alternative wiring setups with neutral at the ceiling, remote control integration, and the impact of switch configurations on relay behavior. The original no-neutral circuit author offered to provide updated designs and tutorials. Overall, the thread provides a comprehensive technical exploration of no-neutral smart switch modifications, component selection, safety considerations, and load compatibility.
AI summary based on the discussion. May contain errors.

FAQ

TL;DR: For 230 V, 50 Hz Tuya/Aubess no-neutral installs, the tested fix is “It works with this assembly”: align diode/capacitor polarity with the mini switch, add an optocoupler trigger, and keep the load circuit protected by a fusible resistor. This FAQ is for smart-switch modders solving S1/S2 relay-toggle failure at the light fixture. [#20531832] Why it matters: A wrong half-wave polarity can keep the module online while leaving the wall switch unable to toggle the relay.

Alternative Result in the thread Practical limit
Sonoff-style original polarity Tuya Mini did not boot on the first attempt Needs polarity adaptation
Reversed diode for Tuya/Aubess Mini switch powered on S1/S2 trigger still needed
Tested optocoupler assembly Wall switch and remote control worked Requires careful mains wiring
Simple series wiring Manual works; remote works only with switch ON Module goes offline when switch OFF

Key insight: The Tuya/Aubess version is not just a diode swap. The optocoupler trigger must open and close S1/S2 at the correct half-cycle, while the mini switch stays powered.

Quick Facts

  • The tested optocoupler input used measured resistors of 45.9 kΩ and 46.9 kΩ, with 1.1 Vdc on C1 and 1.14 mA current. [#21406579]
  • At 236 Vac mains, the peak voltage was calculated as 332 Vac, and Vdc was estimated as Vp/π, or 105.73 Vdc. [#21406579]
  • A 10 Ω fusible resistor at 50 W and 230 V with cos φ = 1 dissipates about 0.515 W, so a 1 W part was suggested. [#20772829]
  • The bulb-side capacitor was discussed as 400 V, and one tested fan/load circuit used C2 = 470 µF / 450 V. [#20540862]
  • For 50 Hz mains, the capacitor near the bulb bridges the 10 ms negative half-cycle to reduce visible flicker. [#20746946]

How can I modify a Tuya or Aubess mini switch for a no-neutral installation at the light fixture?

Use the tested Tuya/Aubess adaptation with a series diode, bulb-side smoothing parts, and an optocoupler trigger for S1/S2.
  1. Find the diode polarity that powers the mini switch.
  2. Build the rest of the half-wave circuit to that polarity.
  3. Add the optocoupler circuit so the wall switch pulses S1/S2. One user later confirmed the idea worked on Aubess mini switches. [#20745181]

Why does reversing the diode polarity make a Tuya Mini boot in a no-neutral circuit but stop S1 and S2 from toggling the relay?

Reversing only the power diode can feed the Tuya Mini but leave the optocoupler biased wrong. In that state, the wall switch changes the bulb path, not the relay input. The reported failure was precise: relay ON allowed bulb control, but relay OFF blocked wall-switch triggering. The trigger transistor stayed in the wrong state until D5, C1, and D6 were turned. [#20529187]

Which diodes and capacitors need to be flipped when adapting the Sonoff Mini R2 no-neutral hack for a Tuya or Aubess mini switch?

Flip the diode and capacitor around the bulb path, plus the optocoupler-side polarity parts. The thread specifically named D5, C1, and D6 for correction, so T1 turns OFF and S1/S2 opens when SW1 opens. If C1 is polarized, its polarity matters because reversing it incorrectly can damage the capacitor. [#20530029]

How do I test whether shorting S1 and S2 manually will trigger the relay in a modified Tuya Mini no-neutral setup?

Momentarily bridge S1 and S2 with a wire after the relay is turned off by the module button. Do not hold the short. First test with the optocoupler still connected. If the relay does not switch, disconnect S1 and S2 from the optocoupler, then repeat the momentary bridge. This separates firmware/input failure from trigger-circuit failure. [#20527813]

What OpenBeken pin configuration should I use for S2 on a Tuya Mini when the wall switch should toggle the same relay channel?

Configure S2 on the same relay channel, using Toggle mode or the tested OpenBeken options for that channel. The user had S2 on pin 14 and tested both toggleonchannel and btn_n. The mini push button and S2 were also assigned to the same channel. That setup removed channel mismatch as the main fault. [#20525635]

Why does the wall switch only control the bulb when the Tuya Mini relay is already on in this no-neutral circuit?

The wall switch only controls the bulb because S1/S2 is not receiving a valid trigger pulse. With the relay ON, the bulb path exists, so toggling the wall switch changes the lamp. With the relay OFF, the bulb remains off and the relay never changes state. The thread traced this to an optocoupler trigger state problem, not OpenBeken alone. [#20526372]

What is an optocoupler and why is it used between the wall switch circuit and S1/S2 on a Tuya Mini?

An optocoupler lets the wall-switch half-wave circuit trigger S1/S2 without directly joining the mains-side circuit to the module input. “Optocoupler is an isolation component that transfers a signal using light, keeping input and output electrically separated while allowing a low-current LED side to control a transistor side.” The tested circuit used about 1.14 mA through that input. [#21406579]

What is a fusible resistor and why is it recommended for safety in no-neutral smart switch hacks?

A fusible resistor limits current and opens under fault conditions instead of acting like ordinary wire. “Fusible resistor is a safety resistor that carries normal circuit current, limits surge current, and is designed to fail open during overload, reducing fire risk compared with a standard resistor.” The video author emphasized fusible resistors, and the thread later stated all assemblies need fuse protection. [#20538272]

How do I choose the wattage for a 10 ohm fusible resistor in a no-neutral LED lighting circuit?

Calculate resistor power from lamp current, then add margin for mains tolerance. For a 50 W LED at 230 V and cos φ = 1, current is 0.227 A. A 10 Ω resistor then dissipates 0.515 W. Because mains can vary by ±10%, the suggested practical choice was 1 W or the nearest standard value. [#20772829]

When can I omit the 400V capacitor near the bulb in a no-neutral Tuya Mini or Aubess Mini installation?

You can omit the 400 V capacitor when the bulb does not visibly blink without it. The capacitor exists to keep the lamp on during the negative half-cycle. At 50 Hz, that gap lasts about 10 ms. If the lamp driver hides that flicker, the capacitor is not required and space improves. [#20746946]

Tuya Mini vs Sonoff Mini R2: what changes are needed when using the Sonoff no-neutral circuit on Tuya or Aubess hardware?

Tuya/Aubess hardware needs polarity matched to the module, not copied blindly from Sonoff Mini R2. The first Tuya attempt using the Sonoff arrangement did not boot. Reversing polarity powered the Tuya Mini, then the optocoupler trigger still needed correction. A later practical tip was to start with one series diode in Line In and build the circuit from the working polarity. [#20745181]

Can a no-neutral half-wave circuit safely power a ceiling fan, and how does the answer change for AC motor vs DC motor fans?

Do not run an AC fan motor from the half-wave DC load circuit. The thread warned that motor winding impedance is too small in DC, so damage can occur. A DC fan may work if its internal supply suits the circuit, but the diodes and C2 must match load current and ripple. One discussed fan range was 14.1 W to 82.5 W. [#20536819]

What diode ratings should I use instead of 1N4007 or UF5408 for higher-power loads in a no-neutral smart switch circuit?

Choose diodes by load current and voltage, not by the mini-switch name. The thread used 1N4007 in small tests and UF5408 because those parts were available. For larger loads, select D1 and D7 from the fan or lamp current in amps. One proposed test used UF5408 with C2 = 470 µF / 450 V. [#20540862]

How can I check whether a ceiling fan uses an AC motor or DC motor before connecting it to a half-wave no-neutral circuit?

Use the relay test described in the thread before committing the ceiling fan. With SW1 closed and relay ON by web control, the fan should run normally. Then open SW1 and turn the relay ON by web control. If there is movement in the half-wave state, the fan behaves as a DC fan in that test. [#20542515]

What are the safety risks of building a no-neutral Tuya Mini modification inside a wall box or ceiling fixture?

The risks include mains shock, overheated resistors, damaged capacitors, and damaged AC motor loads. The circuit works directly around 230 Vac mains and peak voltages near 332 Vac were measured. One expert warned that major wiring interference may not be safe. Another warned: “don’t try it” if you do not understand what the circuit does. [#20538272]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT