Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
EDUcentrum
Published © CC BY-NC-SA

Electro Magnetic Interference (EMI) Detector

In this tutorial you will learn how to assemble an EMI (electromagnetic interference) probe. Spot “phantom” or “vampire” energy loads!

BeginnerFull instructions provided2,238
Electro Magnetic Interference (EMI) Detector

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
or Arduino UNO
×1
Through Hole Resistor, 1 Mohm
Through Hole Resistor, 1 Mohm
×1
4x6cm PCB
×1
Arduino male headers
×1
Speaker, Piezo
Speaker, Piezo
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

EMI detector

C/C++
// Arduino Electromagnetic interference detector
// Code modified by Patrick Di Justo, based on
// Aaron ALAI EMF Detector April 22nd 2009 VERSION 1.0
// aaronalai1@gmail.com
//
// This outputs sound and numeric data to the 4char
#include <SoftwareSerial.h>
#define SerialIn 2
#define SerialOut 7
#define wDelay 900
int inPin = 5;
int val = 0;
SoftwareSerial mySerialPort(SerialIn, SerialOut);
void setup()

{
 pinMode(SerialOut, OUTPUT);
 pinMode(SerialIn, INPUT);
 mySerialPort.begin(19200);
 mySerialPort.print("vv");
 mySerialPort.print("xxxx");
 delay(wDelay);
 mySerialPort.print("----");
 delay(wDelay);
 mySerialPort.print("8888");
 delay(wDelay);
 mySerialPort.print("xxxx");
 delay(wDelay);
 Serial.begin(9600);
}
void loop()
{
 val = analogRead(inPin);
 Serial.println(val);
 dispData(val);
 val = map(val, 1, 100, 1, 2048);
 tone(3,val,10);
}
void dispData(int i)
{
 if ((i<-999) || (i>9999))
 {
 mySerialPort.print("ERRx");
 return;
 }
 char fourChars[5];
 sprintf(fourChars, "%04d", i);
 mySerialPort.print("v");
 mySerialPort.print(fourChars);
}

Credits

EDUcentrum
0 projects • 15 followers
Contact

Comments

Please log in or sign up to comment.