Here I’m sharing my experiments with wemos D1Mini/ Node MCU with tasmota firmware installed in it and LED Touch Switch.
I have seen a video in Youtube by Dr.Zzzs showing how to install a touch switch LED to a sonoff basic flashed with Tasmota firmware. I tried the same on my wemos D1 Mini.
But I found that the built-in led responds only when we use the touch switch, it won’t respond if we use openhab/alexa/siri/google assistant.
So I did some modification(hack) to the touch switch as follows:
I used transistor BC547 to ground the switch (This is how the switch works in tasmota, connecting
the switch assigned pin to the ground). We should use this circuit as the output of Touch switch is High
while ON. If there is any other method like using a resistor instead of transistor please let me know. Please follow the diagrams
for more information.
I found that the LEDs negative pin is connected directly to the ground pin of Touch Switch and the other pin
connected to the output pin of Touch Switch Via a 300Ω resistor.
So I made a deep scratch to break the copper connecting to the output and LED(as shown in the attached
picture)
I want the inbuilt LED to be ON while the relay output is OFF and LED to be OFF while relay Output is ON
(so that I can see the touch switch in the night).
To do this I have to invert the logic from the Wemos D1/Node MCU. To invert the logic I used a BC547
transistor in combination with a resistor. The circuit is shown in the picture.
Now everything working perfectly as I need. Now the LED responds to My voice commands. I hope this may help some of you looking for touch switches in their projects.
@jacobkuriakose thanks! I planned on trying the same thing but hadn’t got around. Glad to know it’s possible!! Thx! I have a switch hooked to my sonoff but wanted it lit when off vs on.
You gave me very good direction in this small challenge.
I have some alterations though, that makes everything a bit simpler.
Just scratch the copper directly under the 300Ω resistor (see picture). The copper runs from the right side of te resistor to a VIA in the PCB, half under the black plastic of the 3-pin connector.
Connect the right side of the 300Ω resistor to D1.
D1 outputs 3.3V when ON/HIGH and the 300Ω resistor protects the LED.
Pull-down D1 to ground and assign D1 as a Relay or Relay_n (software based inverted logic for the led)
Also you can pull-down D2 to ground and assign D2 as Switch_n, to accept the 3.3V that the OUTPUT pin gives when the switch is on.
Everything else (the transistors) is not necessary (anymore).
Do the following in Tasmota web GUI Console:
SetOption114 1 (all switches are detached from their respective relays)