loading

Introduction

The TTP224 Capacitive Touch Module is a 4-channel capacitive touch sensor and as the name implies is based on the Tonek Design Technology's TTP224 IC.An introduction is posted here although the date or author are not shown. In addition there is the video treatment courtesy of Julian Ilett.

The module seemed attractive when compared to the more familiar 1-channel if for no other reason than the reduced connections need to make 4x1-channels. Of course it depends on the application, the proposition being that “if” the TTP224 form is acceptable. With that provision in mind it can be added that the module does not compare to the I2C/SPI capable breakout boards of SparkFun or Adafruit.

The design/layout of the module seems to parallel the off-the-rack application note. The greatest difference is the addition of the LED and supporting SMD resistor network but it doesn't take more than a cursory point by point comparison to concluded the module's options cannot be all those promised in the application note.

Intention

The intention of this Instructable is not to critique the presentation of Julian Ilett nor attempt any upmanship but simply to examine the workable options on the TTP224 Capacitive Touch Module. Hopefully in a manner that extends everyone's enjoyment in the realm of monks, myth and modules.

Step 1: Preparation/Plan

Preparation-Overview

Although preparation is likely the first step of an Instructable, any planning or preparation is not shared in the usual posted form. Here it is quite important and without some discussion the list of materials, soldering, wiring and so-on would seem more 'whimsy' that thoughtful.

The place to start is with the application note and the TTP224 module or a reasonable image of that module. With the module positioned with the 6-pin header is at the top, the IC is located below OUT3 and OUT4. Located on the right side of the module and outlined in the silk screen are holes for the male header/shorting blocks that can be related to the options table.

A quick inventory of pins should show the TTP224 Notes refer to pin numbers as high as 22 but the TTP224 Module probably holds a 16 pin IC. Interpreting the TTP224 note is a bit risky but these are the assumptions that will be taken through the Instructable.

If it is assumed the required pins are VDD, VSS, TP1, TP2, TP3, TP4, TPQ1, TPQ2, TPQ3 and TPQ4, the pin count is 10 with the 6 others to be defined. Next, with reference to the module, there are 6 quantities labelled at the header/shorting blocks, AHLB, TOG, LPMB, SM, OD and MOT0. Which means ignoring quantities VREG, REGEN, MOT1, DIS13, TPQ2D and TPQ0D will satisfy the pin count.

An inspection of the module supports the notion the pins are in the sequence shown in the TTP224 notes but this need not be verified for the purpose of the Instructable. Whether the options can be clearly invoked and their ‘functionality’ is important, not the PCB design. From this point, all references to quantities VREG, REGEN, TPQ2D and TPQ0D are safely(?) ignored..

Next is to review the options table of the TTP224 notes. Although the assumption is that DIS13 does not (cannot) be a user option, there is an assumption that internally DIS13 is open, that is all pads TP1-TP4 are enabled. Similarly, MOT1 is not brought out in the 16-pins but could be assumed to be (internally) open when interpreting that option in the tables.

Finally, without the VREG pin of course there is no option and whether the voltage regulator is enabled or disabled or even exits can be left out of this Instructable. On the same basis, not much can be added about the outputs TPQ2D and TPQ0D. Now only one little mystery remains, REGEN which is not really specified in the TTP224 notes but where the features of these notes also states “After power-on have about 0.5 sec stable time, during the time do not touch the keypad, and the function is disabled”. Are the feature and REGEN correlated? What was the function? Maybe this can just be left as the ‘worm hole’ that can be blamed for unexpected results?

Preparation – Scope

Again looking at the options table but in light of the above factors related to the 16 vs 22 pins, there are sixty-four possible combinations that could be investigated. This could be taken to another level (256) if each combination were investigated with each keypad. As much as this could be the best ‘science’, the stated purpose however purpose was not to test the module and didn’t represent the practical sense of this Instructable.

Falling back on assumptions (again), it seemed fair to look at the options from two points. First there are the ‘electrical/electronic’ choices for the output of the module that would allow some differing interfaces and circuits, namely HIGH/LOW CMOS/OPEN DRAIN.

Other optional can be taken to be ‘preferences’. While shaping the wider application and user interface, these do not alter the basic electrical choice. These are TOG (toggle), SM (single/multi-key) and MOT (maximum on time).

The last item is LPMB, fast and low power mode. While by the definitions employed this is a ‘preference’, it also smacks of ‘performance’, definitely not in the scope of this Instructable. The only reasonable measure is “What happened, good or bad?”.

Preparation – Plan

Given the module has four on-module LEDs, It seemed pretty obvious that the options SM, TOG and MOT could be observed without any more circuitry than a power (VDD) and a ground (VSS). The first inclination is to accept that approach and rather than struggle with wording simply refer to Julian Ilett's video. Perhaps, as a minor sceptic, the plan was changed to include a simple one-LED circuit that would at least confirm the options TOG and MOT did provide off-module results.

From more of the above came the proposition that four circuits could be used to observe the module and meet the objectives. First would be a mirror of the item posted at Arduino Learning, essentially ‘out-of-the-bag’ defaults that accompanies no shorting blocks. With this circuit and some code, the pad-signal pattern can be observed and the SM mode visualized and observed with code. On first consideration, this seemed to also be suitable for the CMOS active low option but the first attempts with that configuration caused a power spasm at the UNO. The precise reason is not clear, LEDs being a prime suspect or possibly the power-on demand of the module.

A circuit for testing HIGH/LOW CMOS/OPEN DRAIN is based the single pad approach. Although it would be 'nice' to claim there was some test-based purpose, there is not. Two circuits would seem to meet the challenge a pull-up and a pull-down for the open drain. The power spasm prompted however a third, current limiting circuit to be added to test the CMOS Active Low.

The final assumption was that the shorting block options were used to ‘configure’ the TTP224 at power-on. The answer seems to be YES (or a lot of more went wrong). Maybe this should have just been listed as the first step but it may influence someone’s breadboard arrangements of +5V for the module.

Based on the ‘best guess’ the fun part develop end shown in this Instructable follows.

Step 2: Material/Soldering

Material Things

  • 1x – Arduino UNO
  • 8x - Dupont M-F connector (nominal 20cm length)
  • 5x - Dupont M-F connector (nominal 20cm length)
  • 1x – 5mm LED
  • 1x – TTP224 Capacitive Touch Module
  • 2x - 200Ω Resistor 5% .25W
  • 1x - 4.7kΩ Resistor 5% .25W
  • 1x - 10kΩ Resistor 5% .25W
  • 1x - 3cm electrician tape (optional).
  • 1x - 25mmx35mmx4mm corkboard(optional).
  • 4x - 3-pin male header (or 2x - 3-pin double row male header)
  • 6x - Shorting Blocks (2 Contact-2.54mm pitch)
  • Piece of sandpaper
  • Solder
  • Soldering iron.

Soldering

With the module positioned with the 6-pin header at the top, located on the right side of the module and outlined in the silk screen are holes for the male header/shorting blocks. One is connected to Vdd (5V) and the other to Vss (GND). Solder the male pins to form 2x three headers to hold up to 6 shorting blocks.

With the optional electrician tape and corkboard, an under-pad for the module can be created. Isolating the PCB from any workbench debris is the paramount advantage of an under-pad. For some other advantage include how the blobs and smears of unskilled soldering are somewhat camouflaged, how the uneven length of original versus added pins is accommodated and how added gravity and skid-resistance can reduce frustration.

The module is ready for wiring.

Step 3: Wiring

The circuit for the basic 'out-of-the-bag' is achieved with direct Arduino to module wiring of:

  • Module VCC to Arduino 5V
  • Module GND to Arduino GND
  • Module OUT4 to Arduino pin 9
  • Module OUT3 to Arduino pin 8
  • Module OUT2 to Arduino pin 7
  • Module OUT1 to Arduino pin 6

The circuit for TOG and MOT is:

  • Module VCC to Arduino 5V
  • Module GND to Arduino GND
  • Module OUT1 to Breadboard Pin13a
  • Pin12d to 220R to Pin 13f
  • Pin 13j to anode LED
  • LED cathode to GND

The circuit for current limiting CMOS Active Low is:

  • Module VCC to Arduino 5V
  • Module GND to Arduino GND
  • Module OUT4 to Breadboard Pin16b
  • BB_Pin 16d to 220R (or 200R) Resistor to BB_Pin 20b
  • BB_Pin 20b to Arduino Pin D9

The circuit for Open Drain, Active High is:

  • Module VCC to Arduino 5V
  • Module GND to Arduino GND
  • Module OUT3 to BB_pin 42d
  • BB_Pin 42e to 10K Resistor to BB_Pin 46e
  • BB_Pin 46c to GND
  • BB_in 42a to Arduino Pin D8

The circuit for Open Drain, Active Low is:

  • Module VCC to Arduino 5V
  • Module GND to Arduino GND
  • Module OUT3 to BB_pin 49h
  • BB_Pin 49g to 4.7K Resistor to BB_Pin 53g
  • BB_Pin 53f to +5V
  • BB_in 49f to Arduino Pin D7

Please note, any combination of Arduino Pin D7, D8, D9 should not me connected simultaneously. Practically, Arduino Pin D6 can be used one by one with the Sketch.

Step 4: Code/Observations

Sketch

The sketch drawn up for this Instructable can be downloaded and there is not much excuse for elaboration or comment. It is perhaps fair to repeat the previous caveat to remind that the objective is not to test the module but to observe the options. The solder and stuff are just to this end.

The sketch probably looks like the thousands of snippets of code that would be useful in sampling four Arduino digital pins with display to Serial Monitor. The sketch requires no library to be included.

Observations

For the most part the options selected with the shorting blocks performed as expected and the joy of discovery will be left to anyone that wishes to modify their module or otherwise do the work of the shorting blocks. One observation, while logical, does answer the 'hidden' question. The toggle option and the MOT option are mutually exclusive. The toggle option however takes precedent, therefore shorting MOT0 has no function while TOG is shorted but happily shorting MOT0 does not prevent the toggle feature.

On the topic of MOT0, the option tables of the application note and the assumed case of MOT1 as open. Continually touching a pad will produce an output at the corresponding pin for about 16 seconds (MOT0 shorted).

The LPMB option passed the 'nothing happened' observation. The millisecond difference that could possibly possibly occur and the current level were not observed. The module did not change function.

Step 5: Summary

In general, the options for TTP224 4-Channel Capacitive Touch Module seem to be without any major surprises or unintended consequence. The options that are here described as 'preferences' are likely helpful in any application as the module is maybe over sensitive given the size/separation of the pads. The SM option is a help in overcoming the conflicting outputs but the pad selection is still problematic.

The TOG feature would get the authors vote for the most usable option, worked very well but again the pad selection 'sensitivity' does interfere and could pose issues in a potential application. The MOT0 option could be of interest as well, possibly to avoid 'blocking code' from becoming 'bogging code'.

Comment on the options for output will be reserved. Though the TTP224 IC does respond correctly to the shorting options, the module or at least the module used in this Instructable did not provide the confidence to use anything other than the default output circuit.

Simply stated, any module that can or does cause an Arduino UNO to 'power spasm' is an unwelcome addition to any project. Whether the solution is as simple as a capacitor or is fatal by design maybe requires the evaluation of another unit or the application of superior talent.

Hopefully this rather lengthy Instructable contain information useful to someone and wishfully prompt someone to contribute their knowledge and skills to the question of design.

About This Instructable

1,669views

5favorites

License:

More by TrewRoad:N7000 MOSFET - Empirically Breadboard Caddy for LEDs Rotary Encoder Display Panel 
Add instructable to: