CAPACITIVE TOUCH MODULE

Description

  • 4 key capacitive touch board
  • Auto calibration in 0.5 sec. makes it easy to use
  • Output status indicator LEDs
  • Outputs can be configured to be Active, High or Low
  • Outputs can be configured to simulate Toggle or Momentary buttons
  • VCC input voltage from 2 to 5.5V
  • Mechanical buttons can be replaced easily

The capacitive touch board features an IC specifically designed for touch pad controls, with a built-in regulator and auto calibration. The stable sensing method can cover a diversity of conditions. You can design human user interfaces through non-conductive dielectric materials. The main application is focused on replacing mechanical switches or buttons, which have mechanical wear. The board can handle 4 touch pads independently and has 4 direct output pins. You can select fast mode or low power mode, direct mode or toggle mode, CMOS output or open drain output. Each pad can be selected for active high or active low, and can have a maximum on-time of 16 seconds or infinite.

Supply voltage 2.4V – 5.5V VDC 9uA
Response time 60 mS at fast mode,160 mS at low power mode
Calibration time at power on 0.5 sec
I/O 4 touch inputs, 4 direct outputs
LPMB pin Provides fast mode or low power mode selection for each pad
TOG / AHLB / OD pin Provides direct mode or toggle mode, CMOS output or open drain output, active high or active low for each pad
MOT0 pin Each pad can have a maximum on-time of 16 sec or infinite
Size 35 mm * 29 mm

Easy to connect. Use the male to female jumper cables to connect the module directly to the Arduino-compatible board.

To supply voltage to the board, connect the +5v pin to the VCC power pin and the GND pin to the GND pin. Each key has its own output which by default goes high when you touch it. You can connect it to any pin you like. In our example we are connecting pads 1, 2, 3 and 4 to digital ins 2, 3, 4 and 5.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*Rewieved by Dr. Mangus for MangoLabs
 /* TTP224 4-Channel Capacitive Touch Module */
 /*
 *  Display data from the TTP224. Setup based on the Module's
 *  'out-of-the-bag' options, all shorts open.
 *  Can be used for further observation of CMOS and Open Drain
 *  but each case requires a differing circuit.
 *  CMOS Active High          - default case
 *  CMOS Active Low           - Use curent limitimg circuit
 *  Open Drain, Active High   - Use Pull Down (example 10K)
 *  Open Drain, Active Low    - Use Pull Up (example 4.6K)
 
 *  Created:  April 2016
 *  By     :  TrewRoad
 */
 /*  ** In case it is unfamiliar **
 *  Conditional Compilation
 *  This sketch has conditional compilation to handle the respective
 *  active HIGH/LOW condition at the digital data pins.
 *  Accessing an Array
 *  This sketch has an array. The first element of the array is at index 0.
 */
  
#define AHLB_VDD                    // Conditional Compilation.
 
const byte the_pins[]={2,3,4,5};
//const byte the_pins[]={9,8,7,6};  // use this combo if easier to wire
            // use any sequence where Module Pad #1
            // is the first array element e.g. {6}
            // should display adequately with this sketch.
int i;
boolean re_start=true;
void setup()
{
  Serial.begin(9600);
  // Set the pin modes on digital pins
  for(i=0; i<sizeof(the_pins); i++)
  {
    #ifdef AHLB_VDD
    pinMode(the_pins[i], INPUT_PULLUP);  //Internal pull up not useful in open drain
                                         //but does no harm.
    #else
    pinMode(the_pins[i], INPUT);
    #endif
  }
  //Serial.println("Enter Loop Processing");  //Only of utility when loop() is empty (or suspect)
  re_start=true;
}
  
void loop()
{
  if(re_start) {Serial.println("Ready to go");re_start=false;}
  String a_msg="";
  for(i=0; i<sizeof(the_pins); i++)
  {
    #ifdef AHLB_VDD
    if(digitalRead(the_pins[i]) == LOW)
    #else
    if(digitalRead(the_pins[i]) == HIGH)
    #endif
    {
      //Correlate to module Key Pads
      a_msg += String(i+1);
    }
    else {
      a_msg += " ";
    }
    a_msg += " ";
  }
  String b_msg=a_msg;
  a_msg.trim();
  if (a_msg.length()>0)   Serial.println(b_msg);
  delay(250);         // 4 times per second
}
  1. In this example we are connecting:
    Arduino    Touch board
    D2     —  OUT1
    D3     —  OUT2
    D4     —  OUT3
    D5     —  OUT4
    GND —  GND
    5V     —  VCC
  2. Download and install the Arduino environment from here or use the web editor
  3. Download the sketch here and open, or open the Arduino environment and copy the code into a blank sketch.
  4. Connect your board to your computer with the included USB cable.
  5. Select your board in Tools / Board / Arduino Uno.
  6. Select your port in Tools / Port / COM# (Arduino Uno). This may be slightly different depending on your operating system.
  7. Upload by pressing the arrow in the circle to the upper left.
  8. To open the serial monitor, press the magnifying glass icon on the upper right.
  9. Set the baud rate to 9600 on the lower right.
  10. Touch the pads; the serial monitor will show which pad is touched.That’s it!