Introduction
A touch sensor operate with the conductivity of human body. When you touch the metal on the base electrode of the transistor, the level of pin SIG will turn over.
Required Components
– 1 * Raspberry Pi
– 1 * Breadboard
– 1 * Touch sensor module
– 1 * Dual-Color LED module
– 2 * 3-Pin anti-reverse cable
Experimental Principle
In this experiment, touch the base electrode of the transistor by fingers to make it conduct as human body itself is a kind of conductor and an antenna that can receive electromagnetic waves in the air. These electromagnetic wave signals collected from the human body are amplified by the transistor and processed by the comparator on the module to output steady signals. The schematic diagram:
Experimental Procedures
Step 1: Build the circuit.
Raspberry Pi | GPIO Extension Board | Touch Sensor Module |
GPIO0 | GPIO17 | SIG |
3.3V | 3V3 | VCC |
GND | GND | GND |
Raspberry Pi | GPIO Extension Board | Dual-Color LED Module |
GPIO1 | GPIO18 | R |
GND | GND | GND |
GPIO2 | GPIO27 | G |
For C Users:
Step 2: Change directory.
cd /home/pi/SunFounder_SensorKit_for_RPi2/C/24_touch_switch/
Step 3: Compile.
gcc touch_switch.c -lwiringPi
Step 4: Run.
sudo ./a.out
For Python Users:
Step 2: Change directory.
cd /home/pi/SunFounder_SensorKit_for_RPi2/Python/
Step 3: Run.
sudo python3 24_touch_switch.py
Now, touch the metal disk, you can see the LED change its colors and “ON” and “OFF” printed on the screen.