Skip to content

DIY Tasmota touchpad wall switch

jsiddall edited this page Jan 7, 2021 · 4 revisions

For anyone looking for an inexpensive touchpad wall switch running Tasmota, here is an option.

Sonoff Minis are designed to mount inside an electrical box, but that leaves the issue of how to locally control the switch. An obvious solution is to use a standard toggle wall switch, which works but has the same issue that a multi-way setup does: the local switch position might not reflect the actual output state when controlled remotely.

A more desirable solution is to use a pushbutton that toggles the state of the relay, but these type of devices, designed for mounting in North American household electrical boxes, are not readily available.

This solution uses a capacitive touch switch mounted to a blank plate to toggle the Tasmota state. The touch sensor itself is powered from the Sonoff Mini switch input, so no hardware modification is required to provide power.

The example below is for a 1 gang switch, but it is also possible to wire a second touch sensor to the "OTA" pins inside the case.

Parts list

  • Sonoff Mini (4 for $43 CAD on Amazon.ca)
  • TTP223 touch sensor (20 for $12 CAD on Amazon.ca)
  • Blank wall plate inserts (10 for $26 CAD for Decora on Amazon.ca, standard plates also work and are cheaper at about 10 for $13 CAD)
  • Small signal diodes (ex: 1N914, almost any will work, pennies each)
  • 47 uF+ 6.3V+ capacitors (any type, smaller will probably work, I just had these on hand, pennies each)
  • 5" 1-pair wire (any kind)

Total price per switch: about $16 CAD

Assembly

  • Solder the "A" pads on the TTP223 board (may require a small piece of fine wire to bridge the gap)
  • Solder the capacitor negative lead (if polarized, either lead otherwise) to GND terminal on the TTP223 board
  • Solder the other capacitor lead to the VCC terminal on the TTP223 board
  • Solder the diode anode (the end without a band) to the I/O terminal on the TTP223 board
  • Solder the diode cathode (the end with the band) to the VCC terminal on the TTP223 board
  • Solder one connection wire to the GND terminal on the TTP223 board (connects to "S1" on the Sonoff Mini)
  • Solder the other connection wire to the I/O terminal on the TTP223 board (connects to "S2" on the Sonoff Mini)
  • Trim off any leads extending through to the "TOUCH" side of the board
  • Use hot melt glue to adhere the "TOUCH" side of the board to the wall plate blank

Tasmota Setup

  • To setup the template for the Sonoff Mini (see: https://templates.blakadder.com/sonoff_mini.html) run:
    Template {"NAME":"Sonoff Mini","GPIO":[32,0,0,0,160,0,0,0,224,320,0,0,1,0],"FLAG":0,"BASE":1}
    • Note: device will reset after this command
  • To turn on typical normally open push button type operation with the touch sensor run:
    SwitchMode 3
  • To send the relay state to MH every time it changes run:
    Rule1 ON Power1#State DO WebSend [192.168.x.y] /SET;none?select_item=<item_name>&select_state=%value% ENDON
    • Where: <item_name> is the name of this device in MH (ex: Kitchen_SM) and 192.168.x.y is the IP address of MH
  • To enable Rule1 run:
    Rule1 1

Installation

Wire the Sonoff Mini as usual, ensuring the GND connections to the TTP223 board goes to S1 connector on the Mini.

Note that the touch sensor LED will glow when idle and will go off when pressed after the "A" pads are bridged. This is required to ensure the touch sensor gets power when idle.

View of a finished touch sensor: Finished sensor

Clone this wiki locally