justin1445
Published © GPL3+

Electromagnetic Field Detector - Arduino Uno

A simple Electromagnetic Field Detector.

BeginnerShowcase (no instructions)12 minutes25,415
Electromagnetic Field Detector - Arduino Uno

Things used in this project

Hardware components

Resistor 330 ohm
Resistor 330 ohm
×1
Resistor 100k ohm
Resistor 100k ohm
×1
LED (generic)
LED (generic)
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
USB-A to B Cable
USB-A to B Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Fritszing Breadboard

Fritszing schematic

Code

Arduino Code

Arduino
int inPin = 3; 
int var = 0;
int pin11 = 5;

void setup() {
  Serial.begin(9600);
}
void loop() {
  var = analogRead(inPin);
  if(var >= 1){
    var = constrain(var, 1, 100;                        
    var = map(var, 1, 100, 1, 255);
    analogWrite(pin11, var);
   }else{
       analogWrite(pin11, 0);                     
  }
 Serial.println(var);
}

Credits

justin1445

justin1445

1 project • 5 followers
Former: ICT student "Davinci college" Former: Human Technology Student "Zadkine" Current: Anime & manga shop employee "Special Edition"

Comments