Arduino capsense noise box

Geek, Lighting Tech, Maker

Arduino capsense noise box

This requires the Arduino capsense library!!!

#include <CapacitiveSensor.h>

* CapitiveSense Library Music Box
* Coded By: CPYarger 2013
* Library built by Paul Badger 2008
* Uses a high value resistor e.g. 10M between send pin and receive pin
* Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
* Receive pin is the sensor pin - try different amounts of foil/metal on this pin

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

void setup()


void loop()
long start = millis();

long total2 = cs_4_6.capacitiveSensor(30);

Serial.print(millis() - start); // check on performance in milliseconds
Serial.print("t"); // tab character for debug windown spacing

if (total2 > 50){

long total3 = (total2*2);

Serial.println(total2); // print sensor output 2


No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.