DIY Capacitive Proximity Sensors for Interactive Prototyping With Everyday Objects




Introduction: DIY Capacitive Proximity Sensors for Interactive Prototyping With Everyday Objects

About: Artist, Sculpture and combined media, phototography, Video and Audio editing, UX design, Web Design, Interactive Design, electronic prototyping Shane Cunningham's Art https://shanecunninghamblog.wordpress.c...

This Instructable explores interactive potential of electrical field sensing by the means of Capacitive technology. It is because of the technologies low-cost and versatility that it is relatively easy to apply the technology into everyday objects, an area that can be explored by using off-the-shelf materials.

It is the simplification of the technology that makes it inclusive to all and paves the way for exploring easy to apply prototyping tools. The goal of this project was to create an interactive audio visual installation that explores low tech solutions for prototyping with interactive technologies. This project used used serial communication between an Arduino Uno board and a PC, sending sensor data from the Arduino board, and receiving it on the Processing IDE on a computer.

This project used the Arduino CapSense Library by Paul Badger, and the SerialCallResponse sketches by Tom Igoe and Scott Fitzgearld.

This Instructable will show how

  • to make proximity sensors from tin foil and cardboard
  • to read sensor data and manipulate the data on your computer for controlling graphics or audio

To make this Instructable you will need:

  • Crocodile Clips (3 per sensor)
  • Tin Foil
  • Cardboard
  • Stick Glue (Pritt Stick), Spray Glue or double sided tape
  • Shielded Cable (3 per sensor)
  • 1M Resistor (1 Resistor per sensor)
  • Break away header pins
  • Solder
  • Soldering Iron
  • Arduino Uno
  • Computer (windows, Mac, Linux)
  • Software : Arduino IDE, Processing IDE, Pure Data (all free software)

Step 1: Step 1: Make Proximity Sensors

1. Cut 1 piece of cardboard roughly at 300 x 300 mm and paste a sheet of foil to one side.

2. Cut a second piece of cardboard at roughly 100 x 100 mm, and paste foil on one side. let dry and engrave a stator pattern into the foil, and then cut with a craft knife. adding this pattern will increase the sensitivity of the sensor

3. Place the larger piece of cardboard, connected to GND, beneath the smaller piece of cardboard. keep foil separate.

Step 2: Step 2: Connect to Arduino and Run Code

Connect Arduino to computer and run the Arduino code.

This code uses CapSense Library by Paul Badger, and the SerialCallResponse sketches by Tom Igoe and Scott Fitzgearld.

In order to calibrate a sensor, use Serial.print and map the values of the corresponding pin:


void loop() {
long total1 = cs_4_2.capacitiveSensor(30);



Code for Communicating with Processing over Serial


int val1 = 0;

int val2 = 0;

int val3 = 0;

int inByte = 0;

CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // 1M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired

CapacitiveSensor cs_4_6 = CapacitiveSensor(4,6); // 1M resistor between pins 4 & 6, pin 6 is sensor pin, add a wire and or foil

void setup() {

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



pinMode(2, INPUT);

pinMode(6, INPUT);

// pinMode(8, INPUT);

establishContact(); // send a byte to establish contact until receiver responds

void loop() {

// if we get a valid byte, read inputs:

if (Serial.available() > 0){

// get incoming byte:

inByte =;

//long start = millis();

long total1 = cs_4_2.capacitiveSensor(30);

long total2 = cs_4_6.capacitiveSensor(30);

//long total3 = cs_4_8.capacitiveSensor(30);


val1 = map(total1, 700, 2300, 0, 255); // sensor values from calibration are mapped to here - begins to detect human proximity at 700 (4" away) , hand nearly touching sensor at 2300

val2 = map(total2, 30, 175, 0, 255);

//val3 = map(total3, 0, 13000, 0, 255);







void establishContact() {

while (Serial.available() <= 0) {


delay(300); }

Step 3: Step 3: Manipulate Sensor Data in Processing

Audio Contest 2017

Participated in the
Audio Contest 2017

Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020
    • Maps Challenge

      Maps Challenge

    8 Discussions


    1 year ago

    hi. .nice project. .
    i have a question. .how to increase the sensitivity of the sensor?


    Reply 1 year ago

    Thanks dauss.
    This project uses a high value 1M resistor between send pin and receive pin. The Resistor effects the sensitivity, try experimenting with resistors with values from 50K - 50M.
    Larger resistor values yield larger sensor values, but they can pick up a lot of unwanted noise from any metal or device that may come within proximity of your sensor. You could also try experimenting with different amounts of foil/metal on
    the sensor pin.


    2 years ago

    Nice share


    2 years ago

    can I use this tech to sense approximately how much food is left in a dog's bowl


    Reply 2 years ago

    not too sure about food, but capacitive sensing technoloy is used to measure liquid levels though. there's plenty of videos on youtube, this guy is doing it with pellets, check this out,


    2 years ago

    That's a neat setup :)