Building the EMF bug detector
We are now going to dive into the core of this project and configure the project so that it can detect EMF activity around the antenna.
The following is the complete code for this project:
// Required libraries #include <Wire.h> #include <LiquidCrystal_I2C.h> // Number of readings #define NUMREADINGS 15 // Parameters for the EMF detector int senseLimit = 15; int probePin = 0; int ledPin = 7; int val = 0; int threshold = 200; // Averaging the measurements int readings[NUMREADINGS]; int index = 0; int total = 0 int average = 0; // Time between readings int updateTime = 40; // Create LCD instance LiquidCrystal_I2C lcd(0x27,20,4); void setup() { // Initialise LCD lcd.init(); // Set LED as output pinMode(ledPin, OUTPUT); // Print a welcome message to the LCD lcd.backlight(); lcd.setCursor(0,0); lcd.print("EMF Detector Started"); delay(1000); lcd.clear...