EMF Detector

This DIY EMF detector works by utilizing the principle of electromagnetic induction. The exposed wire acts as an antenna, picking up electromagnetic signals present in the surrounding environment. These signals induce a small current in the wire, which is then measured by the Arduino through analog pin A5. The 1 ohm resistor helps to limit the current flow and protect the Arduino 

Materials Required:

Here are some suggested uses for the EMF detector 


In the provided image, the LEDs are arranged sequentially, starting with the red LED connected to Pin 2 and ending with the LED at Pin 11. This sequential arrangement allows for easy visualization of the EMF data, with each LED representing a specific range of values. 

To create the antenna for the EMF detector, begin with a 20 cm single-core wire. Strip off approximately 1 cm of insulation from one end, exposing the wire. 

On the other end of the wire, strip off about 7 cm of insulation to expose the central portion. This exposed section acts as the central pickup for detecting EMF signals in the surrounding environment. By placing this portion strategically, you can capture electromagnetic fluctuations and variations, providing valuable data for the EMF detector's operation.


Connect this exposed end to the analog pin five (A5) on the Arduino board, which serves as the input for sensing electromagnetic field (EMF) data.

Additionally, a 1 ohm resistor is connected from the antenna wire to ground (GND), completing the circuit. The resistor helps limit the current flow and protects the Arduino board while ensuring accurate EMF measurements. Together, the antenna and resistor form a crucial part of the EMF detector, enabling the visualization of electromagnetic phenomena. 

Arduino code below with detailed comments explaining each part to someone who's new to programming 


/*Author: Douglas FesslerDate: 3/17/2024Description: This code serves as the firmware for an electromagnetic field (EMF) detector using an Arduino board. It reads analog data from a sensor, smooths it using a rolling average, and visualizes it using a 10-segment LED bar graph. The LEDs represent the intensity of the EMF field detected by the antenna sensor. The code includes setup for data smoothing, LED configuration, and serial communication for debugging purposes.*/
#define NUMREADINGS 25 // raise this number to increase data smoothing
int senseLimit = 1023; // raise this number to decrease sensitivity (up to 1023 max)int probePin = 5; // analog 5int val = 0; // reading from probePin
int LED1 = 11;  // connectionsint LED2 = 10;  // toint LED3 = 9;   // LEDint LED4 = 8;   // bargraphint LED5 = 7;   // anodesint LED6 = 6;   // withint LED7 = 5;   // resistorsint LED8 = 4;   // inint LED9 = 3;   // seriesint LED10 = 2;  // 
// variables for smoothing
int readings[NUMREADINGS];                // the readings from the analog inputint index = 0;                            // the index of the current readingint total = 0;                            // the running totalint 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 < 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
    if (average > 30){                // 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 > 125){               // and so on ...      digitalWrite(LED2, HIGH);    }    else{      digitalWrite(LED2, LOW);    }
    if (average > 225){      digitalWrite(LED3, HIGH);    }    else{      digitalWrite(LED3, LOW);    }
    if (average > 325){      digitalWrite(LED4, HIGH);    }    else{      digitalWrite(LED4, LOW);    }    if (average > 425){      digitalWrite(LED5, HIGH);    }    else{      digitalWrite(LED5, LOW);    }
    if (average > 525){      digitalWrite(LED6, HIGH);    }    else{      digitalWrite(LED6, LOW);    }
    if (average > 625){      digitalWrite(LED7, HIGH);    }    else{      digitalWrite(LED7, LOW);    }    if (average > 725){      digitalWrite(LED8, HIGH);    }    else{      digitalWrite(LED8, LOW);    }
    if (average > 825){      digitalWrite(LED9, HIGH);    }    else{      digitalWrite(LED9, LOW);    }
    if (average > 925){      digitalWrite(LED10, HIGH);    }    else{      digitalWrite(LED10, LOW);    }    Serial.println(val); // use output to aid in calibrating  }}

Now, let's go through each part:

In summary, this code reads sensor data, smooths it using a rolling average, and visually represents it using a 10-segment LED bar graph. The LEDs illuminate based on the intensity of the EMF field detected by the antenna sensor, allowing users to observe fluctuations and patterns in electromagnetic activity in their environment.



Donate

If you've enjoyed exploring my Arduino projects and want to see more amazing creations, your support can make a big difference! By contributing, you're helping me continue to innovate and bring even more exciting projects to life. Together, we can explore the endless possibilities of DIY electronics! Don't forget to like, subscribe, and follow for updates on the latest developments. Thank you for being a part of this journey! 

Click here to make a difference with your donation today!