Mirko Pavleski
Published © GPL3+

DIY ULTRA-SENSITIVE EMF (Electromagnetic field) Detector

This device can also be called an EMF meter, as it can measure the relative strength of a field using a scale of 10 LEDs.

BeginnerFull instructions provided10,430
DIY ULTRA-SENSITIVE EMF (Electromagnetic field) Detector

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
LED (generic)
LED (generic)
×10
Buzzer
Buzzer
×1
Slide Switch
Slide Switch
×1
resistor 10M ohm
×1
resistor 4.7M ohm
×1
Resistor 221 ohm
Resistor 221 ohm
×1
9V battery (generic)
9V battery (generic)
×1
potentiometr 1M ohm
×2

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Schematic diagram

Code

Arduino code

Arduino
// 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
// modified by Mirko Pavleski: Dot Led mode + Sound

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

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

int LED1 = 12;  
int LED2 = 10; 
int LED3 = 9;   
int LED4 = 8;   
int LED5 = 7;  
int LED6 = 6;   
int LED7 = 5;   
int LED8 = 4;   
int LED9 = 3;   
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(12, OUTPUT); 

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

  for (int i = 0; i < NUMREADINGS; i++)
    readings[i] = 0;                      // initialize all the readings to 0
}

void loop() {

  val = analogRead(probePin);  // take a reading from the probe

  if(val >= 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

        int thisPitch = map (average, 50, 950, 100, 1500);
       tone(11, thisPitch,120);
       
    if (average > 50 && average < 150){                // 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 && average < 250){               // and so on ...
      digitalWrite(LED2, HIGH);      
    }
    else{
      digitalWrite(LED2, LOW);    
    }

    if (average >= 250 && average < 350){
      digitalWrite(LED3, HIGH);
    }
      
    else{
      digitalWrite(LED3, LOW);
     
    }

    if (average >= 350 && average < 450){
      digitalWrite(LED4, HIGH);
    
    }
    else{
      digitalWrite(LED4, LOW);
    
    }

    if (average >= 450 && average < 550){
      digitalWrite(LED5, HIGH);
      
    }
    else{
      digitalWrite(LED5, LOW);
    
    }

    if (average >= 550 && average < 650 ){
      digitalWrite(LED6, HIGH);
      
    }
    else{
      digitalWrite(LED6, LOW);
   
    }

    if (average >= 650 &&average < 750){
      digitalWrite(LED7, HIGH);
     
    }
    else{
      digitalWrite(LED7, LOW);
    
    }

    if (average >= 750 && average <850){
      digitalWrite(LED8, HIGH);
     
    }
    else{
      digitalWrite(LED8, LOW);
   
    }

    if (average >= 825 && average <900){
      digitalWrite(LED9, HIGH);
    }
     
    else{
      digitalWrite(LED9, LOW);
   
    }

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

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

Credits

Mirko Pavleski

Mirko Pavleski

151 projects • 1289 followers

Comments