Capacitive Sensing
Oct 13, 2022
Albert Hodo. Tangible UI, Fall 2022
Prompt:Make a capacitive sensor using a different material, not aluminum foil. Hint: try things that are conductive, like metal or things containing water like fruits and vegetables. Take pictures!
Components Used
- Bread Board
- Esp 32
- Jump Wires
- 1 10K Resister
- 1 LED
Process
I took input from the capacitive touch input from the lead from the pencil marking and used the input to turn an LED on and off.
Code
bool lightOn=false;
void setup()
{
Serial.begin(115200);
delay(1000); // give me time to bring up serial monitor
// Serial.println("ESP32 Touch Test");
// pinMode(34, OUTPUT);//buzzer
pinMode(13, OUTPUT);//led indicator when singing a note}
void loop()
{
Serial.println(touchRead(4));
if(touchRead(4)<45){
lightOn=!lightOn;
Serial.print(lightOn);
}
Serial.print("light: ");
if (lightOn){
digitalWrite(13,HIGH);
}else{
digitalWrite(13,LOW);}
// }delay(1000);
}
Demo