Things used in this project

Hardware components:
09590 01
LED (generic)
×1
12002 04
Breadboard (generic)
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
A000057 featured
Arduino Leonardo
×1
Software apps and online services:
Ide web
Arduino IDE
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)

Schematics

captureemf_XgN1bVNQQW.JPG
Captureemf xgn1bvnqqw

Code

Untitled fileC/C++
int inPin = 5;             // analog 5 
int val = 0;                 // where to store info from analog 5
int pin11 = 11;         // output of red led

void setup() {
 
  Serial.begin(9600);
  
}

void loop() {
  
  val = analogRead(inPin);                    // reads in the values from analog 5 and
                                                                   //assigns them to val
  if(val >= 1){
    
    val = constrain(val, 1, 100);               // mess with these values                                       
    val = map(val, 1, 100, 1, 255);        // to change the response distance of the device
    analogWrite(pin11, val);                    // *note also messing with the resistor should change  
                                                                   // the sensitivity
   }else{                                                     // analogWrite(pin11, val); just tuns on the led with 
                                                                  // the intensity of the variable val
    analogWrite(pin11, 0);                     // the else statement is just telling the microcontroller
                                                                 // to turn off the light if there is no EMF detected
  }
  
 Serial.println(val);                                // use output to aid in calibrating
 
}

Credits

12540590 741555235974555 3535889509737692135 n u3tbvajh6h
Patel Darshil
2 projects • 38 followers
I am an Electronics Hobbyist pursuing my BE in Electronics and communication
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog