Announcement
Collapse
No announcement yet.
Emf Detector
Collapse
X
-
hi paku, would you share the code too?
seems like a smal emf detector with bargraph Display, i would be interested to chekc my home with this tool
can help you with sprint layout 6 design
pls tell also the correct compent you want to assemble
for example i would take this
https://www.reichelt.de/?ARTICLE=229...SABEgI2p_D_BwE
instead of 10 single led and 10 single resistor
- Likes 1
Comment
-
atenna is a simple Piece of 5cm wire, it is just the same scheme as arduino emf detector
but it seems that paku wants a Version without arduino Environment
hope the code is a improoved Version, the Basic Setup is only for nearfield detecion
an aerlier idea of me was to get a higher Resolution by using a 1601 or 1602 Display as bargraph and using all columns and not only 10 leds
Comment
-
Aref, Vcc, Avcc from Atmega needs little Capacitors to Ground.
At Jp2 the Gnd Input is marked with + ???
The 7805 needs also Capacitors at In and Output.
The LEDs goes to Ground and over Resistor to Gnd.So there is no current control for the LED.
You have to connect the Resistornetwork like this:
PBx---LED---Resistor----Gnd or VCC. It depends what your Output Pegel is.
It is better to sink the current, it means the Resistors should go to Vcc and a logical 0 on the Outputport turns the LED on.
It schould be usefull to ad a ISP Connector to flash the ATmega.
regards horbei
Comment
-
Originally posted by bernte_one View Posthi paku, would you share the code too?
seems like a smal emf detector with bargraph Display, i would be interested to chekc my home with this tool
can help you with sprint layout 6 design
pls tell also the correct compent you want to assemble
for example i would take this
https://www.reichelt.de/?ARTICLE=229...SABEgI2p_D_BwE
instead of 10 single led and 10 single resistor
Comment
-
THE CODE IF SOMEONE CAN ALSO MODIFY IS GOOD
#define NUMREADINGS 15 // raise this number to increase data smoothing
int senseLimit = 15; // raise this number to decrease sensitivity (up to 1023 max)
int probePin = 5; // analog 5
int val = 0; // reading from probePin
int LED1 = 11; // connections
int LED2 = 10; // to
int LED3 = 9; // LED
int LED4 = 8; // bargraph
int LED5 = 7; // anodes
int LED6 = 6; // with
int LED7 = 5; // resistors
int LED8 = 4; // in
int LED9 = 3; // series
int LED10 = 2; //
// variables for smoothing
int readings[NUMREADINGS]; // the readings from the analog input
int index = 0; // the index of the current reading
int total = 0; // the running total
int average = 0; // final average of the probe reading
void setup() {
pinMode(2, OUTPUT); // specify LED bargraph outputs
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
Serial.begin(9600); // initiate serial connection for debugging/etc
for (int i = 0; i < NUMREADINGS; i++)
readings[i] = 0; // initialize all the readings to 0
}
void loop() {
val = analogRead(probePin); // take a reading from the probe
if (val >= 1) { // if the reading isn't zero, proceed
val = constrain(val, 1, senseLimit); // turn any reading higher than the senseLimit value into the senseLimit value
val = map(val, 1, senseLimit, 1, 1023); // remap the constrained value within a 1 to 1023 range
total -= readings[index]; // subtract the last reading
readings[index] = val; // read from the sensor
total += readings[index]; // add the reading to the total
index = (index + 1); // advance to the next index
if (index >= NUMREADINGS) // if we're at the end of the array...
index = 0; // ...wrap around to the beginning
average = total / NUMREADINGS; // calculate the average
if (average > 50) { // if the average is over 50 ...
digitalWrite(LED1, HIGH); // light the first LED
}
else { // and if it's not ...
digitalWrite(LED1, LOW); // turn that LED off
}
if (average > 150) { // and so on ...
digitalWrite(LED2, HIGH);
}
else {
digitalWrite(LED2, LOW);
}
if (average > 250) {
digitalWrite(LED3, HIGH);
}
else {
digitalWrite(LED3, LOW);
}
if (average > 350) {
digitalWrite(LED4, HIGH);
}
else {
digitalWrite(LED4, LOW);
}
if (average > 450) {
digitalWrite(LED5, HIGH);
}
else {
digitalWrite(LED5, LOW);
}
if (average > 550) {
digitalWrite(LED6, HIGH);
}
else {
digitalWrite(LED6, LOW);
}
if (average > 650) {
digitalWrite(LED7, HIGH);
}
else {
digitalWrite(LED7, LOW);
}
if (average > 750) {
digitalWrite(LED8, HIGH);
}
else {
digitalWrite(LED8, LOW);
}
if (average > 850) {
digitalWrite(LED9, HIGH);
}
else {
digitalWrite(LED9, LOW);
}
if (average > 950) {
digitalWrite(LED10, HIGH);
}
else {
digitalWrite(LED10, LOW);
}
Serial.println(val); // use output to aid in calibrating
}
}
Comment
Comment