Hello builders! Here in this 'ible we will make a project which will use a capacitive sensor to turn on a LED. This project uses a micro controller to send and receive the signal to and from the capacitive sensor. This micro controller is called the LinkIt One Board.

How does a capacitive sensor work?

A capacitive sensor works on the human body's ability to store small amounts of charges and then give away. So when we get close to the the sensor the signal going through the foil back to the LinkIt One board changes.

Step 1: Parts

1. LinkIt One Board

2. USB Board

3. Aluminum Foil

4. 10 Mega Ohm Resistor

5. LED (any color)

6. Box

Step 2: Foil

1. Hot glue the foil on top of the box.

2. Cut of the excess foil.

3. Make a hole next to one of the edges.

4. Put a wire through the hole and strip a long part near the foil.

5. Hot glue the wire to the foil making sure that it doesn't move and has conductive contact with the foil.

Step 3: LED

1. Insert the LED in the same hole as the capacitive signal wire.

2. Hot glue it to the hole.

3. Solder wires to the positive and the negative pins on the LED.

Step 4: USB

1. Make a Hole for the Usb cable to seek through.

2. Now hot glue the board to the base. ( Make sure you use little)

Step 5: Code

Lets code the board such that the led turns on when the capacitive sensor comes in touch with the finger.

Before that download this library and put it in your libraries folder in the Arduino folder.



#include <Capacitive.Sensor.h>

CapacitiveSensor capsensor = CapacitiveSensor(8,12);

int LED = 13;

void setup()




void loop()

{ long start = millis();

long TouchVal = capsensor.capacitiveSensor(25);

if(TouchVal > 1000) // change this number here to change the distance from which the led will turn on.


digitalWrite(LED, HIGH);



Upload the code and move on to wiring it.

Step 6: Wiring

1. Connect the LED to pin 13.

2. Connect the negative of LED to GND.

3. Connect the 10m resistor between pins 8 and 12.

4. Insert the wire from the foil in pin 12.

And thats it:) You are done with the wiring. Now lets make it pretty and test it out.

Step 7: Tape(Optional)

Using some colorful tape to cover the sides and make the sensor look pretty.

2. Then write something on the foil. ( BUTTON, Zombie killer... etc)

Step 8: Test and Conclusion

Plug in the board and test it out by touching the foil.

You can even change the sensitivity of how much distance there should be before the LED turns on.

In conclusion this project turns on a LED but you can use it to control much more ( light, fan, tv... etc)

If you have any questions feel free to ask me in the comments below.

<p>Can't seem to get the sketch to compile, after fixing the #Include (for some reason it had a dot between the words, it should be #include &lt;CapacitiveSensor.h&gt;). </p><p>Now i'm getting the error: 'IO_REG_TYPE' does not name a type</p><p> volatile IO_REG_TYPE *rReg;</p>
Sorry for the late response,<br>Ok that shouldn't happen, I just checked my code and compiled it, it worked fine.<br>Try this code.<br>Let me know if you get the same error.<br><br>#include <br><br>CapacitiveSensor capsensor = CapacitiveSensor(8,12);<br><br>int LED = 13;<br>void setup()<br>{<br> capsensor.set_CS_AutocaL_Millis(0xFFFFFFFF); <br>}<br><br>void loop()<br>{<br> long start = millis();<br> long TouchVal = capsensor.capacitiveSensor(30);<br><br> if(TouchVal &gt; 1000)<br> {<br> digitalWrite(LED, HIGH);<br> <br> }<br> <br>}<br><br>

About This Instructable




Bio: I started this hobby when I was in 5th grade and since then I have gained a lot of knowledge I would love to help ... More »
More by robo10302:SLAMP( Smart Lamp ) LinkIt One Wifi Cam Turner Control LinkIt One Motion NightLight 
Add instructable to: