muhammed shameel k.v
Published © GPL3+

Making Capacitance Alarm with Arduino

This alarm will turn on a buzzer and the bulb when the capacitance sensor senses something. And show you how to make the sensor yourself!

IntermediateFull instructions provided30 minutes2,528
Making Capacitance Alarm with Arduino

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Relay (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

fritzing schematics

connect like this

Code

Arduino code

Arduino
upload it
#include <CapacitiveSensor.h>

// by M shameel kv


CapacitiveSensor   cs_4_2 = CapacitiveSensor(4,2);        // 1M resistor between pins 4 & 2
        

void setup()                    
{
   cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF);     
   Serial.begin(19200);
   pinMode(11,OUTPUT);
   pinMode(8,OUTPUT);
   digitalWrite(8,HIGH);
   delay(100);
   
}

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

 // for debugging
    Serial.print(millis() - start);       
    Serial.print("\t");                    

    Serial.println(total1);  
                    
    if ((total1)>=600) {
      tone(11,750);
      delay(1000);
      noTone(11);
      digitalWrite(8,LOW);
      
      
    }
   
    
    

    delay(10);                              
}

Credits

muhammed shameel k.v

muhammed shameel k.v

0 projects • 11 followers
I am a great at electronics. I have programming knowledge and some projects of my own

Comments