2.18 Touch Switch Module

Overview

In this lesson, you will learn about touch switch module. It can replace the traditional kinds of switch with these advantages: convenient operation, fine touch sense, precise control and least mechanical wear.

Components Required

../_images/Part_two_18.png

Fritzing Circuit

In this example, pin 2 is used to read the signal of Touch Switch Module.

../_images/image170.png

Schematic Diagram

../_images/image171.png

Code

Note

  • You can open the file 2.18_touchSwitch.ino under the path of sunfounder_vincent_kit_for_arduino\code\2.18_touchSwitch directly.

  • Or copy this code into Arduino IDE.

Uploaded the codes to the Mega2560 board, you can see the readings of pins displaying on the serial monitor.

When your finger tip touches the Touch switch module, 「1」will be displayed on the serial monitor; and when you remove your finger, 「0」 will be be displayed. As for the detailed code explanation, you need to turn to 1.4 Digital Read.

Phenomenon Picture

../_images/image172.jpeg