Thursday, 20 February 2014

Capacitive Sensor

The Arduino can be used for a multitude of projects. Designed to make it easier for those who are not experts in electronics, the chance to get creative with some electronic prototyping. This is one of the main reasons I felt it would be an ideal tool to use for my major project.

To begin detecting the human body's capacitance, Arduino has a clever library than can be downloaded which turns any pin declared in the sketch into a sensor. For this to work the Arduino must be able to find the libraries one they are installed. As far as I can tell, as long as the file is somewhere on the computer it can find it. But to be sure I have created a libraries folder in myDocuments that the Arduino will use to find all its files. Once done I will compress these files into one folder which also contains my sketch.

Basic example of capacitive sensing sketch. Imports the .h file which calls the function of the .cpp file.
This sketch is set up to read the values passing between pins 2 and 4.

Contained within the libraries folder is a .h and .cpp files, or header and source respectively. These files tell the arduino what to do with the information I give it, in this case, which pins are being used and what serial port to send the values over.

http://playground.arduino.cc/Main/CapacitiveSensor?from=Main.CapSense

No comments:

Post a Comment