Electronics 101 - HTTM Capacitive LED Button

July 16, 2018
electronics led button

Parts

  • 1x Raspberry PI
  • 1x HTTM capacitive touch led button
  • 3x jumper cables

Schematics

Fritzing schematics

IC in the schematics represents the following sensor.

Sensor

Starting from left to right, connect the pins to:

  • GPIO23
  • GND
  • 3V3

Python Code

from gpiozero import Button
from signal import pause

def press():
    print("Pressed")
    
def release():
    print("Released")

led_button = Button(21)
led_button.when_pressed = press
led_button.when_released = release

pause()