ARDUINO EMF DETECTOR GOES MAD !

i made an arduino emf detector , simple circuit ,
connected 1 Mohms Resistor from ground , to A0, then took a wire as probe from A0 ,out ..
when i bring magnet near it , it works properly ,but after a bit of caliberation , i found out it went on ,itself ..
help me plz:'

const int led=13;
void setup() {
  Serial.begin(9600);
  pinMode(led,OUTPUT);
}


void loop() {

  int sensorValue = analogRead(A0);
 
  if(sensorValue>=18){// 28 for no probe ,40 for wire probe ,68 for coilgun coil type 1, 84 for metal //detector
  Serial.print("EMF Reading :");
  Serial.println(sensorValue);
  digitalWrite(led,HIGH);
  delay(1);
  }
  else{digitalWrite(led,LOW);}
  delay(1);       
}

If the pin is floating then attaching a wire to it will make it act like a aerial that picks up ALL EMF like radio, TV, microwave, static, PC & your body.

The magnet will have no effect. It is your hand moving near the aerial that is effecting the reading.

Weedpharma

weedpharma is correct. That is an electric field probe, not an EM probe.

harslu8:
i made an arduino emf detector , simple circuit ,
connected 1 Mohms Resistor from ground , to A0, then took a wire as probe from A0 ,out …
when i bring magnet near it , it works properly ,but after a bit of caliberation , i found out it went on ,itself …
help me plz:’

const int led=13;

void setup() {
  Serial.begin(9600);
  pinMode(led,OUTPUT);
}

void loop() {

int sensorValue = analogRead(A0);

if(sensorValue>=18){// 28 for no probe ,40 for wire probe ,68 for coilgun coil type 1, 84 for metal //detector
  Serial.print(“EMF Reading :”);
  Serial.println(sensorValue);
  digitalWrite(led,HIGH);
  delay(1);
  }
  else{digitalWrite(led,LOW);}
  delay(1);     
}

where did you find the code, can you put a link?