Anda di halaman 1dari 4

TTP229 16 Key Capacitive Keypad

http://forum.hobbycomponents.com/viewtopic.php?f=73&t=1781&hilit=hcmodu0079

Descripcin
Este trabajo est basado en la pgina mostrada arriba.
Realmente no entiendo la filosofa del diseo, pero funciona muy bien. Solo le aument el
retardo porque repeta las lecturas y le agreg el sonido con un buzzer, a travs de un PIN
PWM para variarle la tensin de alimentacin o sea variarle el volumen. El sonido indica
que la tecla envi el dato.
Este teclado tctil capacitivo de 16 teclas se basa en el sensor capacitivo TTP229 con
deteccin de hasta 16 teclas. El uso de este teclado ofrece una alternativa para los
teclados de tipo mecnicos con la ventaja de una mayor durabilidad especialmente en
ambientes polvorientos . El teclado se puede configurar en diferentes modos que
proporcionan el uso de hasta 16 teclas independientes.
Las salidas 1 a 8 en el conector de cabecera permite el uso de 8 teclas .
Para usar las 16 16 teclas se hace a travs de su interfaz en serie de 2 hilos .
Nota: Por defecto, el teclado est en modo de 8 teclas. Para configurarlo para el modo 16
se deben puentear las pistas TP2 (ver diagrama) .

Especificaciones del teclado


Operating voltage2.4V~5.5V
Built-in regulator
Stand-by current At 3V, and sleep mode slow sampling rate 8Hz
=> Typical 2.5uA for 16 input keys
=> Typical 2.0uA for 8 input keys
8 Key or 16 key modes
Separate outputs to 8 keys in 8 key mode
2 wires serial output interface for both 16 key and 8 key mode
Outputs can be set to CMOS/OD/OC with active high/low
2 Wires serial interface can select active high or low by option
Optional Multi-key or single-key
Provides two kinds of sampling rate: slow sampling rate 8Hz and fast sampling rate 64Hz at sleep mode
Optional maximum key-on time about 80sec

Auto calibration at power up (keypad must not be touched for 0.5 seconds after power up)
Auto calibration for changes in environment

Conexionado de la Plaqueta
1.....VCC (2.4 - 5.5V)
2.....GND
3.....SCL (serial clock in)
4.....SDO (serial data out)
5.....OUT 1 (key 1 state)
6.....OUT 2 (key 2 state)
7.....OUT 3 (key 3 state)
8.....OUT 4 (key 4 state)
9.....OUT 5 (key 5 state)
10...OUT 6 (key 6 state)
11...OUT 7 (key 7 state)
12...OUT 8 (key 8 state)

Puenteado de TP2

Distintos usos de los puentes

Cableado

Programa Teclado Hobby.ino


Este programa est adems en el archivo.ZIP.
Conexionado para el programa:
Keypad......Arduino
VCC.........+5V
GND.........GND
SCL.........Digital pin 8
SDO.........Digital pin 9
Sonido

PWM pin 10 y GND

#define SCL_PIN 8 // Define los Pines digitales para Clock y Data


#define SDO_PIN 9
byte Key; // Usado para almacenar el estado del teclado (key state)
int SonidoPin = 10; // pin PWM para el Sonido
void setup()
{
Serial.begin(9600); // Initializar el Serial
pinMode(SCL_PIN, OUTPUT); // Configurar pines del Clock y Data
pinMode(SDO_PIN, INPUT);
}
void loop()

{
Key = Read_Keypad(); // Leer el estado del teclado
if (Key)

// Si se presiona una tecla, se enva al Serial

{
Serial.println(Key);
analogWrite(SonidoPin, 100); // se escribe el valor de PWM, para generar sonido.
Control de volumen
delay(50);
analogWrite(SonidoPin, 0); // se escribe el valor de PWM
}
delay(450); // Espera
} // FIN del void loop()
byte Read_Keypad(void) // Lee el estado del teclado
{
byte Count;
byte Key_State = 0;
/* Pulse the clock pin 16 times (one for each key of the keypad)
and read the state of the data pin on each pulse */
for(Count = 1; Count <= 16; Count++)
{
digitalWrite(SCL_PIN, LOW);
/* If the data pin is low (active low mode) then store the
current key number */
if (!digitalRead(SDO_PIN))
Key_State = Count;
digitalWrite(SCL_PIN, HIGH);
}
return Key_State;
}

Anda mungkin juga menyukai