Project tutorial

A Pocket-Sized Touch Keyboard © GPL3+

A small, Arduino-based physical device that can perform different keyboard operations through capacitive touch sensing.

  • 12 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

It is a small, Arduino-based physical device that can be used to simplify your various keyboard operations. You plug it into your computer's USB port and touch on the capacitive touch sensor. The touch sensor is completely made from scratch, and you can use any metallic objects such as foil, coins, etc. (This works based on the Arduino capacitive sensing library.)

The brain of this project is an Arduino Micro.

Arduino Micro is the smallest board of the family, easy to integrate it in everyday objects to make them interactive. The Micro is based on the ATmega32U4 microcontroller featuring a built-in USB which makes the Micro recognizable as a mouse or keyboard.

The Micro is a microcontroller board based on the ATmega32U4. It has 20 digital input/output pins (of which 7 can be used as PWM outputs and 12 as analog inputs), a 16 MHz crystal oscillator, a micro USB connection, an ICSP header, and a reset button. It contains everything needed to support the micro controller; simply connect it to a computer with a micro USB cable to get started. It has a form factor that enables it to be easily placed on a breadboard.

Follow the link below to learn more about the board.

Arduino Micro


you can use only the boards which use ATmega32U4 such as Arduino Leonardo, Leonardo ETH etc.

Circuit diagram:


Solder the components as per the circuit diagram.


The Micro is based on the ATmega32U4 microcontroller featuring a built-in USB which makes the Micro recognisable as a mouse or keyboard.

Instead of switches/buttons I decided to add some cool feature to my project, So I used arduino capacitive sensing library to use any metalic object as touch sensor.

The capacitiveSensor library turns two or more Arduino pins into a capacitive sensor, which can sense the electrical capacitance of the human body. All the sensor setup requires is a medium to high value resistor and a piece of wire and a small (to large) piece of aluminum foil on the end.

To know more about how capacitive touch works follow the below link: Capacitive sensing


You need to install capacitive sensing library if you have not installed yet.

You can download this library from here.

Uploading code:

  • Launch Arduino IDE
  • Select board
  • Select port
  • Upload your code

What else you can do with it:

The code which I have given in the description(to simplify your sign in) is an example that you can do with it.

You can do more keyboard functions with small modification in the code.

Refer below links to add more keyboard functions

     Keyboard.write(ASCII character);

For example to perform space bar operation use following code

Keyboard.write(32); //performs space bar operation

Thank youso much for reading if you need any more information feel free to ask in comments,and I'll do my best answer you.


capacitive touch login device -arduino codeArduino
it is an example that shows what you can do with it.This code can be used to simplify your login process.
Every keyboard function can be added to the board.
#include <CapacitiveSensor.h>
#include <Keyboard.h>

CapacitiveSensor   cs_2_4 = CapacitiveSensor(2,4); // 1M resistor between pins 2 & 4, pin 4 is sensor pin, add any metallic object such as foil ,coin etc..

void setup()                    
   cs_2_4.set_CS_AutocaL_Millis(0xFFFFFFFF);// turn off autocalibrate on channel 1 - just as an example

void loop()                    
 long sensor1 =  cs_2_4.capacitiveSensor(50);
   if(sensor1 >= 1000)
  Keyboard.print("p@ssW0rD");      //Enter your password here; //Enter key


Circuit diagram
A pocket sized logon device bb r2nq9oqttc


Similar projects you might like

Capacitive Touch Keyboard Extension with Leonardo

Project tutorial by Alex Wulff

  • 1 comment
  • 14 respects

How to Make a Customizable Punchable Keyboard Button

Project tutorial by Amal Mathew

  • 7 respects

Wireless Keyboard from TV Remote

Project tutorial by Amal Mathew

  • 12 respects

3D Printed Prosthetic Hand with Capacitive Touch Sensing

Project tutorial by Amal Mathew

  • 20 respects

Keyboard Melodies

Project tutorial by Ava Baker -21 and Natalie Clark -20

  • 1 comment
  • 8 respects
Add projectSign up / Login