You are on page 1of 3

instructables

Arduino Ghost (EMF) Detector

by CelineW3

This is a project I made for the HKU (University of the Arts, Utrecht).

Arduino Ghost (EMF) Detector: Page 1


Step 1: Step 1: Things you'll need

1. Arduino

2. Antenna or Probe

3. 3.3M Ohm Resistor (I used a 4.7M Ohm one, which worked just fine)

4. 330 Ohm Resistors

5. a 100 Ohm Resistor

6. LEDs

7. Small Piezo Buzzer

8. Wire

9. Soldering iron and PCB ór a bread board.

Step 2: Step 2: The setup

This is the way I set up my bread board before I soldered it to a print plate. I attached the probe (which was a solid
core wire) to analog pin 5, together with the 4.7M Ohm resistor.

Arduino Ghost (EMF) Detector: Page 2


Step 3: Step 3: The code

I used this code by Collin Cunningham: 6; // anodes int LED6 = 7; // with int LED7 = 8; //
resistors
http://makezine.com/2009/05/15/making-the-arduino-
... int buzzer = 13; int buzzerTone = 0;

I modified it, so it would work with my LEDs and the unsigned long previousMillis = 0; const long interval =
Piezo Buzzer. 1000;

___________________________________ int readings[NUMREADINGS]; int index = 0; int total


= 0; int average = 0;
#define NUMREADINGS 15
void setup() {
int senseLimit = 15; int probePin = int val = 0;
pinMode(2, OUTPUT); pinMode(3, OUTPUT);
int LED1 = 2; // connections int LED2 = 3; // to int pinMode(4, OUTPUT); pinMode(5, OUTPUT);
LED3 = 4; // LED int LED4 = 5; // bargraph int LED5 = pinMode(6, OUTPUT); pinMode(7, OUTPUT);

pinMode(8, OUTPUT); pinMode(13, OUTPUT); {digitalWrite(LED1, LOW);}

Serial.begin(9600); if (average > 200) {digitalWrite(LED2, HIGH);} else


{digitalWrite(LED2, LOW);}
for (int i = 0; i < NUMREADINGS; i++) readings[i] = 0;
} if (average > 300) {digitalWrite(LED3, HIGH);} else
{digitalWrite(LED3, LOW);}
void loop() {
if (average > 400) {digitalWrite(LED4, HIGH);} else
val = analogRead(probePin); {digitalWrite(LED4, LOW);}

if(val >= 1){ if (average > 500) {digitalWrite(LED5, HIGH);} else


{digitalWrite(LED5, LOW);}
val = constrain(val, 1, senseLimit); val = map(val, 1,
senseLimit, 1, 1023); if (average > 600) {digitalWrite(LED6, HIGH);} else
{digitalWrite(LED6, LOW);}
total -= readings[index]; readings[index] = val; total +=
readings[index]; index = (index + 1); if (average > 700) {digitalWrite(LED7, HIGH);
tone(buzzer, 1000);} else {digitalWrite(LED7, LOW);
if (index >= NUMREADINGS) index = 0; noTone(buzzer);}

average = total / NUMREADINGS; Serial.println(val); // use output to aid in calibrating } }

if (average > 100) {digitalWrite(LED1, HIGH);} else

Arduino Ghost (EMF) Detector: Page 3

You might also like