Sometimes the projects of an electronics hobbyist actually find very practical and even by their own family well recognized applications :
My dear wife asked me to provide the many LED spots at the workplace under the kitchen wall cabinets with a “better” switch. You (and me? 🙂 should also be able to switch the light “good and easy” even during baking and cooking with floury or sticky fingers.
Alexa and Siri have a kitchen ban with us. This quickly gave rise to the idea of building a relay-based switch that should have “only” a touch sensor running along the entire edge of the cabinet in the form of a thin wire.
In the large box with sensors and actuators for the microcontroller world, I found a suitable 5V relay with 250V/10A contacts and also a TTP223 based touch sensor board.
In contrast to all current trends: It doesn’t always have to be the Arduino or ESP32 microcontroller that meaningfully connects such peripheral components, as my schematic circuit shows.
It was easy to connect the two boards as the pins of my relay and the blue touch board correspond 1:1. Be careful with other relays or different touch boards.
However, I still had to invest a few thoughts and a bit of time in the design of the sensor. The touch sensor chip TTP223 works with a fingertip sensor plate whose capacitance against ground affects an internal 1MHz-oscillator. But the sensor area respectively its capacitance value must not become too large.
Take a look at the TTP223 datasheet as there are some useful descriptions and hints.
I divided the old sensor plate into three parts and used them to connect a three-pin terminal for the power supply and the new external sensor wire. The top part of the circular sensor area remains connected to the TTP223 input pin 3 via the previous printed copper line. The middle part now carries the positive pole for +5V, which is connected via the additional short white wire. The lower part is used for the GND connection via the angled blue wire.
Instead of the old sensor plate, I then experimented very successfully with sensor wires of different lengths and thicknesses, including a variable telescopic antenna.
The summarized results of my experiments: A thin insulated wire gave the best sensitivity in my kitchen cabinet environment. However, one should keep this sensor wire at least 5mm away from any metallic components, as they negatively affect the capacitance and thus the sensitivity.
Finally, a two-meter-long thin insulated wire (0.5mm) well optically hidden along the entire edge of the kitchen cabinet’s down side did perfectly fulfill my wife’s wish, which then earned me a very nice compliment 🙂
I changed the original application circuit of the TTP223 at Pin 6. As this pin is connected to Vdd now, output Pin 1 goes into toggle mode. Every touch of the wire now turns the relay state and holds it then. Pin 4 remains on Vss, which ensures that the relay remains switched off initially when the operating voltage is applied.
For experimenting with your own sensor plates or wires, you should know that the TTP223 dynamically adapts very well to slowly changed capacitance values of the sensor at startup and also during operation. With an additional capacitor of a maximum of 50pF between Pin 3 and Vss/ground , the sensitivity of the circuit can also be reduced in a targeted manner.
Don’t be too surprised if your sensor reacts to opening a pot of boiling hot pasta water nearby. In fact, the hot water vapor can affect the capacitance between sensor wire and ground too quickly for the normally well-adapting mechanism of the TTP223 to compensate.
After laboriously rebuilt my old blue touch sensor board, the long-awaited ordered 10 pieces of the red TTP223 mini sensor boards arrived for 6€. These are even smaller and are much easier to customize. The additional sensor wire can be soldered directly on the “touch” plate or a solder area next to pin 3. The board is so small that it could also be mounted separately from the relay board directly next to the sensor wire. A uncritical dimensioned even up to some meters long and thin three-pole cable then connects the two boards.
The red TTP223 touch boards
Meanwhile I had time to test my circuit with the smaller red touch boards as well.
Attention! The pinning is different from the blue touch boards as the output pin (I/O) of the red boards is now located in the middle. The input pin (S) of my relay-board is the left-most.
To set the “self-lock” toggle-mode you have to solder the bridge marked with “B”. Bridge “A” stays open, if the position of the relay following a power-up cycle is intended to stay “off”.