Arduino EMF wave Detector


Lessi da qualche parte che siamo circondati da onde elettromagnetiche. Che queste ci fanno molto male e che sono la causa di molte malattie. Supposto che credo ci sia molto di falso in tutte queste affermazioni, mi venne la curiosità di scoprire da dove provenissero queste onde elettromagnetiche.

Googlando ho trovato questo interessante progettino che spiegava come convertire la board di Arduino in un semplice rilevatore di onde elettromagnetiche. Eccolo: http://www.aaronalai.com/emf-detector.

Avevo da parte un componente molto carino che è la barretta led che vedete nel video. Decisi allora di cominciare a saldare qualcosina. Dopo poco mi ritrovai con un semplice ma efficiente rilevatore di onde elettromagnetiche, scoprendo che la maggior parte di queste malefiche onde risiede nel motori elettrici. Ma la cosa sconcertante è che tali motori producono più onde elettromagnetiche quando sono fermi.

 EMF Arduino_bb

Questo è il codice:

// Aaron ALAI EMF Detector May 28th 2009 VERSION 1.1
// aaronalai1@gmail.com
// contains code for averaging sensor data

#define sample 300                    //this is how many samples the device takes per reading
//more information for #define http://arduino.cc/en/Reference/Define
int inPin = 5;                                  //analog 5
float val;                                         //where to store info from analog 5
int pin11 = 11;                              //output of red led

int array1[sample];                      //creates an array with number of elements equal to "sample"
//more information about arrays http://arduino.cc/en/Reference/Array

unsigned long averaging;         //the program uses this variable to store the sum of each array it makes

void setup() {

Serial.begin(9600);

}

void loop() {

for(int i = 0; i < sample; i++){              //this code tells the program to fill each element in the array we made with
array1[i] = analogRead(inPin);       //information from the antenna wire coming out of the Arduino
averaging += array1[i];                      //more information about for loops http://arduino.cc/en/Reference/For
}                                                               //the averaging line is simply saying: add averaging to whatever is in array position i
//averaging += array[i] is the same as averaging = averaging + array[i]
//for more information about += http://arduino.cc/en/Reference/IncrementCompound

val = averaging / sample;                   //here the program takes the sum of all numbers in array1, and divides by the number of elements "sample"

val = constrain(val, 0, 100);               //this constrains the variable value to between two numbers 0 and 100
val = map(val, 0, 100, 0, 255);      //for more information about constrain http://arduino.cc/en/Reference/Constrain
analogWrite(pin11, val);                //the map statement tells the program to map out 0-100 to 0-255, 255 is
//the threashold of analogWrite for more information about map http://arduino.cc/en/Reference/Map
averaging = 0;                                 //this line of code sets averaging back to zero so it can be used again

}

Giovanni
Tag:, ,
Ott 11, 2013 | Posted by in Arduino, Blog, Elettro, Tutorial | 0 comments

Add Your Comment

Your email address will not be published.

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

Premium Wordpress Themes by UFO Themes