EMF Detector by Ian Kelley and Dylan Cooper

This semester we worked on a board we made for our LEDs so we incorporated that into our final with an electromagnetic field detector. The whole detector was not very hard to get to work the hardest thing was getting the LED's to go the way we wanted with the right values being read from the probe. We went through many problems, like 3 weeks without Dylan but i feel like we tried and we got it to work alright. It will read values but we did not successfully get our LED's to light the way we wanted them to. We switched the constrain command, to that of map, which did ecactly what we wanted it to. Also, in the if command we start at 1 instead of 0, because 0 was for the else which turn off all the LEDs, and the repeatitive idea confused our arduino and made the reading inconsistant. this caused our LED graph to randomly light up and off. After making these simply fixes, out LED graph is much smoother and marketable.

If we had more time and money, we would refine the quality of an antenna made just for detecting magnetic fields. Also, we would probably limit the number of LEDs to maybe ten, so that the range looked clearer, and it could be more easily marketed at hardware stores. It would also be nice if we could put all of the hardware into one single hand held device, so that it looked profesional. It would look something like a stud finder or the volt meter.

aveval=0; // takes 10 readings and avg. them out to get a smoother reading for (int x=0;x<10;x++){ val = analogRead(inPin); aveval=val+aveval;} val=aveval/10; //assigns them to val if(val >= 1){ // if its greater than 1 follow the if command

val = map(val,0,1023, 1, 30); // take the average readings between 1 and 1023 and map it so its between 1 and 30

for(int x=0; x<val; x++) // run this command the # of times that the value says which is the number of LED's being lit up{ pinMode(Plus[x], OUTPUT); // makes the positive output pinMode(Minus[x],OUTPUT); // make negative output digitalWrite(Plus[x],HIGH); // turns on digitalWrite(Minus[x], LOW);// turns off delayMicroseconds(100); // delay lights 100 microsecnds pinMode(Plus[x], INPUT); // turns leds off pinMode(Minus[x],INPUT); // turns leds off }

}else{ // if there is no reading turns LEd's off

for(int pin = 8; pin < 13; pin++){pinMode(pin,INPUT); }

}

Serial.println(val); // allows us to see the readings on the arduino program

}

Here is the sketch of our LEDs.

This is the where our light board gets plugged in these are pins; 8,9,10,11,12,13

This is the LED bargraph we used for the amount of electromagnetic energy being read from our probe attatched to analog pin1.