Sensor pushbutton with Darlington pair


If in your projects mechanical buttons are inappropriate: the shape does not fit, the installation space is missing or the color is not good, perhaps a separate sensor button is the right choice.

A sensor button does not respond by the mechanical contact between two conductors or by a magnetic element as in a reed contact. It responds with a switching signal to the touch of its sensor surfaces. That makes eg many applications – such as use in clothing – possible in which a normal pushbutton is not suitable.

Function of sensor button

The sensor surfaces consist only of a broken line. In the simplest case, these can be two bare wires. In the case of your washing machine or TV, it’s more conductive, nicely shaped surfaces. This makes an extremely flat design possible.

Upon contact with your hand or finger, the electronics will respond and output a tactile signal. A small current flows through your body and closes the circuit for the signal.

Schematics: Darlington-pair or Darlington transistor
Schematics: Darlington-pair or Darlington transistor

The circuit is based on a Darlington pair. By connecting the two transistors (eg a BC547C) a high current gain is achieved. As a result, the very small current through your finger is enough for the base of transitor T1 to go through.

To prevent the circuit from becoming too sensitive, resistor R3 is installed. You can experiment with it a little and use other values or no resistor.

As long as you now put a finger on the contact, the transistors go through. Take your finger away again and it turns off. This signal can be used as an input signal for a microcontroller as a touch signal.

Test setup

For a test, it is best to take a breadboard and build the circuit. Any type of microcontroller with GPIO contacts can be considered for the evaluation.

I use in this example a Raspberry Pi. As a supply voltage suitable for the switching signal of the Pi 3.3 V are used. The circuit works just as well for an Arduino or ESP8266 with 5 V.

For the visualization, we also install a LED with a suitable resistor. Here you must consider the supply voltage. That’s about 100 ohms at 3.3V and at 5V about 220 ohms.

Breadboard setup for sensor button with Darlington-pair
Test setup with a Raspberry Pi

A test program for the RasPi could look like this with Python:

import time
import RPi.GPIO as GPIO

#Bounce time in seconds

#GPIO-Pin of the sensor button


while True:
    if GPIO.input(PinButton)==0:
        #Button is pressed; it' 0 because of the pull-up resistor
        print("Sensor button ist pressed")

        #Wait bounce time


Contact types

There are many ways to create the contacts types.  And it probably depends on the demands of your project. Here your ingenuity is in demand. As an inspiration, here are a few suggestions for you.

a) Parallel bare wires

2 blanke Drähte
2 bare wires are routed through 2 holes each
Gehäuse mit 2 Drähten
Interior view: wires are inserted through the housing

b) Washer and nail head

Sensor button: Housing with contact surfaces: washer and nail head
Housing with contact surfaces: washer and nail head
Interior view: fixation of the nail head with hot glue
Interior view: fixation of the nail head with hot glue

c) 2 nail heads next to each other

d) Package clips or sample bag clips

Beispiel Paketklammern
Contact through 2 package clips
Sensor button: Soldered package clips
Soldered package clips

e) Metal rivets in fabric

Fabric with sensor button
Metal rivets in fabric
Soldered metal rivets in the fabric

With the sensor button you now have a solution at hand, if a classic button is not the right choice. As you have seen, all you need is a few electronic components, a little source code, and imagination to make the contact surfaces.


Interesting facts about the Darlington circuit can be found on

I used the sensor button with my mediaplayer to turn on and off the Raspberry Pi touch display: On/Off switch for the Raspberry Pi touch display




Klicken Sie hier, um diesen Artikel in Deutsch zu lesen.

Dieser Beitrag hat 2 Kommentare

Kommentar verfassen