Subscribe to Make Magazine Today!

Aaron ALAI’s EMF detector project looked so simple and fun I had to give it a try. After putting it together, I liked it so much that I went and built a more ‘meter-like’ version using an LED bargraph –

EMF_detector_LED_bargraph2.jpg

Arduino code is available here.

As I mention in the vid, I was a bit concerned the wire probe might be affected by the LEDs I mounted nearby — but from what I can tell, it still seems (relatively) accurate. A short walk around my workspace even revealed a few items I’d forgotten were plugged in – helpful! I’m sure there are many ways in which this project could be used/repurposed/modded – I plan on converting the readings to sound when I get the chance. If you make one be sure to submit a pic to the Flickr pool and/or send us a link.

Collin Cunningham

Collin Cunningham

Born, drew a lot, made video, made music on 4-track, then computer, more songwriting, met future wife, went to art school for video major, made websites, toured in a band, worked as web media tech, discovered electronics, taught myself electronics, blogged about DIY electronics, made web videos about electronics and made music for them … and I still do!


  • dude

    In the code that comes with this project I see:

    total -= readings[index]; // subtract the last reading
    readings[index] = val; //read from the sensor
    total += readings[index]; //add the reading to the total
    index = (index + 1); // advance to the next index

    It should be noted that the smoothing doesn’t happen without removing the first line of those shown here. And then you get a problem when you start over from index = 0; so this should be changed to:

    readings[index] = val;
    total = 0;
    for(int i = 0; i < NUMREADINGS; i++){
    total += readings[i];
    }
    index += 1;

  • CS

    This could be useful for activating something else; like an inductive relay, but in a non-contact fashion. (Like triggering a low-voltage circuit when a motor starts)

    • Boffincentral

      Excellent suggestion. I have a need for something like that to trigger the big dust collector when I use the saw or planer. I could even trigger it at higher levels as the power board is on all the time. I just sniff for the higher amperage and even have a delay cut off. Awesome project!

      • Boffincentral

        Excellent suggestion. I have a need for something like that to trigger the big dust collector when I use the saw or planer. I could even trigger it at higher levels as the power board is on all the time. I just sniff for the higher amperage and even have a delay cut off. Awesome project!

  • Nitin Kushwaha

    Hello, It is really gr8!

    can you please tell me, how to get this done without using a microcontroller.
    I am working on a similar model as well.
    nknitinkushwaha[at]gmail[dot]com

    Thanks.

  • Nitin Kushwaha

    Hello,

    I am a bit confused, how do i power this up,

    I bought ATMega328 Microcontroller,
    uploaded the sketch, now on the wiring part, i see in the ckt diagram,

    I am not able to see where the Orange wire goes to,
    Pins 2 thro 11 are on the Digital signal side.
    Common cathode gets to analog5–3.3M–gets to GND.

    still i am getting it to work,

    Am i missing something?

    I have a doubt on where the Orange wire and Probe wire goes to?

    where do i connect the VCC +5v?

    Please reply ASAP.

    Thanks

    • http://gravatar.com/dragonmaster198577 dragonmaster198577

      It loks like the orange wire is going to 5v.. I think it is for something else because the resistor goes between ground and A5, and then the probe comes off of A5 also.. All of the other outputs are + anodes and then you run one ground for all of them.. I left off the other resistors because my LEDs require more power to light, plus they are brighter that way.. I don’t really care if they burn out either I have thousands of them.. Good show!!

  • joshua perriman

    could i have the code

    • http://gravatar.com/dragonmaster198577 dragonmaster198577

      There is a link right under the Wiring chart for the circuit.. Click the word “HERE” and it will take you to a website where you can download a file with the code in it!! This is a really cool project and it works really well..

  • joshua perriman

    could i have the code

  • dragon tirex

    thanks for simple schematic, and the code can be found on the video description or click on the Flickr pool , i will definitely try it :D

  • http://www.facebook.com/people/Caesar-R-H-Yount/100000530733691 Caesar R. H. Yount

    i watched the vid on the arduino emf detector, and i thought i would build one of my own. im a bit confused right now, so i figured i would ask the experts. how would i go about making one out of a hand-held am fm sports radio?

  • http://twitter.com/qbott2000 quentin bell

    what arduino board do you use?

    • Nathan Towell

      Arduino uno

  • Dietrick Kooyman

    is the code for the arduino the same as the old one

  • Fr0sty

    Can you put on a piezo buzzer?

    • dragonmaster198577

      I am actually in the process of Trying to build an Oscillator for this Project, But I wonder if there is a way to use one of the Unused Pins as an output for a buzzer.. You have to be careful though with that because any time you have power going into a coil you are generating EMF.. And this is a very sensitive circuit.. we don’t want to read our own EMF now do we? :-)

  • David

    ¿Donde puedo encontrar la placa con las perforaciones?Soy spañol

  • David

    La e encontrado,pero la resistencia dorada,verde,naranja,naranja no la encuentro

  • sayous

    Are mobile phones detected?

    • dragonmaster198577

      I built it and tried to detect my cellphone.. It barely had any EMF.. Maybe the phone is not powerful enough, or maybe the project just is not sensitive enough.. I tried making it as sensitive as possible for Paranormal investigation.. And it now detects when I get close to it.. But not on the cellphone at all..

  • http://.www.honestweb.info HANKENSTIEN

    Just an idea, but if you think that the wire connector is effecting the readings, im sure you could build an RF cage around it with some thin metal…

    Then again that may make it worse and pick up more interference, well food for thought.
    PEACE

    • dragonmaster198577

      Actually some metal Shielding that was hooked into the ground might eliminate board interference all together, then the only EMF reading would be at the Antenna, Where it belongs.. Good thinking!! :-)

  • http://gravatar.com/dragonmaster198577 dragonmaster198577

    For those of you needing the code, I will put it here just copy and paste it into your program editor and I hope this will help.. I changed a few sensitivity settings on mine, but it works.. Follow instructions in the Comments of the code to change them.

    // EMF Detector for LED Bargraph v1.0
    // 5.12.2009
    // original code/project by Aaron ALAI – aaronalai1@gmail.com
    // modified for use w/ LED bargraph by Collin Cunningham – collin@makezine.com

    #define NUMREADINGS 1 // raise this number to increase data smoothing

    int senseLimit = 550; // raise this number to decrease sensitivity (up to 1023 max)
    int probePin = 5; // analog 5
    int val = 0; // reading from probePin

    int LED1 = 11; // connections
    int LED2 = 10; // to
    int LED3 = 9; // LED
    int LED4 = 8; // bargraph
    int LED5 = 7; // anodes
    int LED6 = 6; // with
    int LED7 = 5; // resistors
    int LED8 = 4; // in
    int LED9 = 3; // series
    int LED10 = 2; //

    // variables for smoothing

    int readings[NUMREADINGS]; // the readings from the analog input
    int index = 0; // the index of the current reading
    int total = 0; // the running total
    int average = 0; // final average of the probe reading

    void setup() {

    pinMode(2, OUTPUT); // specify LED bargraph outputs
    pinMode(3, OUTPUT);
    pinMode(4, OUTPUT);
    pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
    pinMode(7, OUTPUT);
    pinMode(8, OUTPUT);
    pinMode(9, OUTPUT);
    pinMode(10, OUTPUT);
    pinMode(11, OUTPUT);

    Serial.begin(9600); // initiate serial connection for debugging/etc

    for (int i = 0; i = 1){ // if the reading isn’t zero, proceed

    val = constrain(val, 1, senseLimit); // turn any reading higher than the senseLimit value into the senseLimit value
    val = map(val, 1, senseLimit, 1, 1023); // remap the constrained value within a 1 to 1023 range

    total -= readings[index]; // subtract the last reading
    readings[index] = val; // read from the sensor
    total += readings[index]; // add the reading to the total
    index = (index + 1); // advance to the next index

    if (index >= NUMREADINGS) // if we’re at the end of the array…
    index = 0; // …wrap around to the beginning

    average = total / NUMREADINGS; // calculate the average

    if (average > 50){ // if the average is over 50 …
    digitalWrite(LED1, HIGH); // light the first LED
    }
    else{ // and if it’s not …
    digitalWrite(LED1, LOW); // turn that LED off
    }

    if (average > 150){ // and so on …
    digitalWrite(LED2, HIGH);
    }
    else{
    digitalWrite(LED2, LOW);
    }

    if (average > 250){
    digitalWrite(LED3, HIGH);
    }
    else{
    digitalWrite(LED3, LOW);
    }

    if (average > 350){
    digitalWrite(LED4, HIGH);
    }
    else{
    digitalWrite(LED4, LOW);
    }

    if (average > 450){
    digitalWrite(LED5, HIGH);
    }
    else{
    digitalWrite(LED5, LOW);
    }

    if (average > 550){
    digitalWrite(LED6, HIGH);
    }
    else{
    digitalWrite(LED6, LOW);
    }

    if (average > 650){
    digitalWrite(LED7, HIGH);
    }
    else{
    digitalWrite(LED7, LOW);
    }

    if (average > 750){
    digitalWrite(LED8, HIGH);
    }
    else{
    digitalWrite(LED8, LOW);
    }

    if (average > 850){
    digitalWrite(LED9, HIGH);
    }
    else{
    digitalWrite(LED9, LOW);
    }

    if (average > 950){
    digitalWrite(LED10, HIGH);
    }
    else{
    digitalWrite(LED10, LOW);
    }

    Serial.println(val); // use output to aid in calibrating
    }
    }

    • jake

      Please someone program it like the richter scale where every bar is 10x the previous one, that would be GREAT, it would let us detect small and large fields with accuracy relative to the size, also please add a SLOWER averaged serial right function if its not already included!!!

      • http://gravatar.com/dragonmaster198577 dragonmaster198577

        I will help you since no one seems to want to hep so far.. :-P

        Look at the Code and Where you see this:

        if (average > 150){ // and so on …
        digitalWrite(LED2, HIGH);
        }
        else{
        digitalWrite(LED2, LOW);
        }

        if (average > 250){
        digitalWrite(LED3, HIGH);
        }
        else{
        digitalWrite(LED3, LOW);
        }

        if (average > 350){
        digitalWrite(LED4, HIGH);
        }

        Etc.. change the number to where you want it, That is the number, Basically telling the Uno that “If the Average of the reading is Greater than that presented number, Send that Output High, Otherwise Make it low.. High=on low=off.. I hope this helps you some..

        • https://www.facebook.com/zarif.hassan.7 Zarif Hassan

          sorry to interrupt..what is the unit of the reading? is it Hz?

    • MananWeb

      I am very confused. How do you add voltage to it to power it up and what would the piece be called? I have all of my resistors, LED bar graph, and wire (in A5) on the board and I’m not sure where to go from there. It would be super helpful if there were a list of materials required for this project..

  • naveen raja

    Any idea to display the digital value of output as shown in LCD bar graph???? ……..Will be very useful………..

  • Andrew

    Hmmm, interesting….maybe attach one of these to the main power cable on the washer, program some limits, and detect when the washer cycle is complete, as there should be a significant drop in current. Use button to put the A in ‘monitor’ mode when it cycle starts…maybe have a dial to set the limit instead of coding it. And then it sends a response to my home network server when finished. Although I don’t have any CAT5 in the basement and a real pain to run it down there, so I might have to look into a wireless version.

  • jake

    Please someone program it like the richter scale where every bar is 10x the previous one, that would be GREAT, it would let us detect small and large fields with accuracy relative to the size, also please add a SLOWER averaged serial right function if its not already included!!!!

  • dragonmaster198577

    I want to figure out a way that I can either use one of the unused outputs as an Oscillator for a buzzer, or analog wire it with resistors to control an RC oscillator.. Maybe hook it up ths way.. One resistor of a different value onto each Anode, And the Diodes to prevent current Backup, and then put it in the RC Oscillators Capacitor instead of being one resistor that will keep the oscillator at a fixed pitch use multiple Resistors hooked up instead, That way with each LED that lights the Oscillator Pitch will become higher and higher.. I don’t think a Blocking Oscillator would Suffice for this though as it Emits EMF, Which would cause interference in the readings.. It might feed right back into the circuit.. That would be bad.. :-(

    But an Astable Multivibrator type Circuit might not put off so much EMF.. or even a NAND Oscillator.. or a 555 Timer.. Idk.. :-)

  • Sam

    Hi

    • Sam

      When I try to upload the program to my arduino i get this error

      EMF_detector_LED_bargraph_smooth.cpp:30:5: error: ‘int index’ redeclared as different kind of symbol
      c:userssamdownloadsmpide-0023-windows-20120903mpide-0023-windows-20120903hardwarepic32compilerpic32-toolsbin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/string.h:56:8: error: previous declaration of ‘char* index(const char*, int)’
      EMF_detector_LED_bargraph_smooth.cpp: In function ‘void loop()':
      EMF_detector_LED_bargraph_smooth.cpp:63:28: error: invalid types ‘int [15][char*(const char*, int)]’ for array subscript
      EMF_detector_LED_bargraph_smooth.cpp:64:19: error: invalid types ‘int [15][char*(const char*, int)]’ for array subscript
      EMF_detector_LED_bargraph_smooth.cpp:65:28: error: invalid types ‘int [15][char*(const char*, int)]’ for array subscript
      EMF_detector_LED_bargraph_smooth.cpp:66:23: error: assignment of function ‘char* index(const char*, int)’
      EMF_detector_LED_bargraph_smooth.cpp:66:23: error: cannot convert ‘char* (*)(const char*, int)’ to ‘char*(const char*, int)’ in assignment
      EMF_detector_LED_bargraph_smooth.cpp:68:18: error: ISO C++ forbids comparison between pointer and integer
      EMF_detector_LED_bargraph_smooth.cpp:69:15: error: assignment of function ‘char* index(const char*, int)’
      EMF_detector_LED_bargraph_smooth.cpp:69:15: error: cannot convert ‘int’ to ‘char*(const char*, int)’ in assignment

      Any Ideas??

  • Georgia

    Hi,

    Is there a Fritzing file available for this project?

    Thanks!

  • http://leinsterparanormal.com/v1/?p=996 » Blog Archive » Make Your Own EMF Reader

    […] Here at LP, we’ve been looking at a few projects where we can learn to make our own equipment, specialised to our own needs. Here’s one that has certainly captured the imagination and is a great starting point. http://blog.makezine.com/2009/05/15/making-the-arduino-emf-detector/ […]

  • https://github.com/strykeroz/ATTiny85-EMF-detector Geoff

    Hi,

    Inspired by how great this looked with the LED bargraph I created one of these based on ATTiny85, using charlieplexing to drive the 10 segment LED. Code here if you’re interested https://github.com/strykeroz/ATTiny85-EMF-detector

    Also have included a photo there too.

    Thanks Geoff

  • radPaul

    Hi Im trying to build this project but seem to be getting it wrong if anyone would mentor me for this one project I would be grateful really @dragonmaster198577 if you could help me I would love it

blog comments powered by Disqus

Related Supplies at Maker Shed