Close
0%
0%

Detecting Motion With AC/Static Electricity

Using only a single wire to increase sensitivity, an Arduino's ADC can be used to detect motion!

Similar projects worth following
I've developed a library called Buzz to add simple motion detection to projects using just a 6-12" wire connected to an Arduino's ADC pin! See the video below for a demonstration.

By monitoring the amplitude of AC electricity waveforms in the air for changes caused by the passing of statically charged objects, (people, animal, blankets, etc.) Buzz provides motion detection using only a wire! It's extremely easy to implement, and a perfect library for all experience levels.

Disclaimer

The Buzz library is just for experimental use only, and is not intended for providing a home/business security solution.

Explanation

Due to the ATMega328p's ADC being very high impedance, it can easily detect the AC electricity waves that leak into the air via open outlets, bad shielding, and more.

When something statically charged (human, pet, blanket, etc.) passes near the antenna, it increases or decreases the voltage perceived at the input. Even without rubbing a balloon on your head, you'll always have enough static charge to affect this value a measurable amount.

The Buzz library allows you to easily monitor these changes, and attach your own functions that will execute when motion exceeds a specified threshold.

Usage

Using the Buzz library is very simple, you only need the following to get started:

#include "Buzz.h" // Include the Buzz library
Buzz buzz;

void setup() {
  Serial.begin(115200);
  buzz.begin(A0,60,3000);
}
void loop() {
  Serial.println(buzz.level());
  delay(1);
}

Next, connect a wire/jumper (6-12") to pin A0, and open the Arduino IDE's Serial Plotter to see the current motion value! Try waving your hand near the antenna, or walking past it.

  • 1 × 6-12" Copper Wire

  • Finally, a library!

    Lixie Labs08/23/2016 at 07:16 1 comment

    Hello everyone! Back in May 2016, I released this video demonstrating using the Arduino's ADC to detect motion of nearby living things. Since then I've been very busy with other projects like the Emotiscope and Volume Library, but I've returned to this code to library-ize it!

    Before I continue, let me clear up some things I've learned since then:

    • Originally I coined the phenomenon as "Capacitive Turbulence", the changes in capacitive coupling between objects and the antenna over time. Since then, it's been shown to be caused by statically charged objects causing a shift in the voltage seen at the ADC input when they pass.
    • Because of this being caused by static electricity, it LOVES cats. While the human body always has enough static charge to cause a measurable shift, cats are covered in electron-loving fur - causing it to be much more sensitive to them. A solution is to make your cat wear an anti-static soldering strap at all times, but so far I've been very unsuccessful in implementing this

    Once you've installed the Buzz library from GitHub or the Arduino Library Manager, usage is as simple as this:

    #include "Buzz.h" // Include the Volume library
    Buzz buzz;
    
    void setup() {
      Serial.begin(115200);
      buzz.begin(A0,60,3000);
    }
    void loop() {
      Serial.println(buzz.level());
      delay(1);
    }

    Also included with the library is an example ("basic.ino") that allows you call your own functions when motion exceeds a custom threshold! This allows for alarm-type actions! For example:

    #include "Buzz.h"
    
    Buzz buzz;
    
    void setup() {
      Serial.begin(115200);
      pinMode(13, OUTPUT);
    
      buzz.begin(A0,60,3000);
      buzz.setAlarm(soundTheAlarm, 20, 500);
    }
    void loop() {
      buzz.checkAlarm();
      buzz.printData();
      delay(1);
    }
    void soundTheAlarm(){
      // Generates an alarm sound
      for(byte i = 0; i < 128; i++){
        tone(speaker,880);
        delay(1);
        tone(speaker,440);
        delay(1);
      }
      noTone(speaker);
    }

    Feel free to try the Buzz Library for yourself, and let me know how things go!
    https://github.com/connornishijima/arduino-buzz

    - Connor Nishijima

View project log

  • 1
    Step 1
    1. Connect a 6-12" wire to an ADC pin of the Arduino, and upload the "basic" demo sketch included in the Buzz library.
    2. That's it! Your Arduino now detects nearby motion, and outputs data to the Serial Plotter.

View all instructions

Enjoy this project?

Share

Discussions

Mike Atencio wrote 05/14/2018 at 01:28 point

I'm doing home-based scientific research on static electricity and why people believe they see ghosts. I think it is possible to measure if static can affect a humans sensory systems. I'm trying to develop the instrumentation to do this using an Raspberry Pi 3B+ board, but, I also have an Arduino Uno I have never used. Do you think it could be adapted to this project. (I have no experience with these. I'm 59 and just want to learn how to use them so I can do the stuff like my research.) Any help would be great.

  Are you sure? yes | no

Vijayenthiran Subramaniam wrote 05/02/2017 at 12:50 point

Nice project. Does the library support other microcontrollers as well? such as ESP8266 etc.

  Are you sure? yes | no

krkl wrote 11/23/2016 at 12:50 point

Thank you so much for this library, it just saved an art project of mine that was originally based on capacitive sensing. I can also report that the libray now has been proven to work with as much as 80 ft. of wire as antenna.

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates