1.6K
In this example we look at the CJMCU-1010 module – this is based on the AT42QT101x
The AT42QT101x Single Key capacitive touch controller family provides an easy way to add a touch key to any application. It implements advanced filtering algorithm to offer robust operation in noisy environment. Sensitivity and low power modes can be configured as well.
The AT42QT1011 output will remain high as long as a touch is detected. No “Max On” time out.
Additional Features
-
- Number of Keys: One – configurable as either a single key or a proximity sensor
- Key outline sizes: 6 mm × 6 mm or larger (panel thickness dependent); widely different sizes and shapes possible
- Electrode design: Solid or ring electrode shapes
- PCB Layers required: One
- Electrode materials: Etched copper, silver, carbon, Indium Tin Oxide (ITO)
- Panel thickness: Up to 12 mm glass, 6 mm plastic (electrode size and Cs dependent)
- Key sensitivity: Settable via capacitor (Cs)
- Power consumption: 17 µA at 1.8 V typical
- Applications: Control panels, consumer appliances, IoT, proximity sensor applications, toys, lighting controls, mechanical switch or button replacement
Connection
Arduino Uno | CJMCU-1010 module |
5v | Vcc |
Gnd | Gnd |
D2 | OUT |
Parts List
Here are the parts I used
Part name | Link |
Arduino Uno | UNO R3 CH340G/ATmega328P, compatible for Arduino UNO |
CJMCU-1010 module | |
Dupont cable | Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire Dupont cablefor Arduino |
Code
[codesyntax lang="cpp"]
const int TOUCH_BUTTON_PIN = 2; // Input pin for touch state const int LED_PIN = 13; // Pin number for LED // Global Variables int buttonState = 0; // Variable for reading button void setup() { // Configure button pin as input pinMode(TOUCH_BUTTON_PIN, INPUT); // Configure LED pin as output pinMode(LED_PIN, OUTPUT); } void loop() { // Read the state of the capacitive touch board buttonState = digitalRead(TOUCH_BUTTON_PIN); // If a touch is detected, turn on the LED if (buttonState == HIGH) { digitalWrite(LED_PIN, HIGH); } else { digitalWrite(LED_PIN, LOW); } }
[/codesyntax]
Links
http://ww1.microchip.com/downloads/en/devicedoc/40001948a.pdf