about programming emf (Electromagnetic Field) detector
Excuse me, I would like to inquire about emf detector. I saw one of the projects in makezine.com make emf with arduino, with LED bargraph. but here I replaced it with a small audio (8 Ohm), but why not come up with the perfect voice?
This is my remake program
if(val >= 1){
val = constrain(val, 1, senseLimit);
val = map(val, 1, senseLimit, 1, 1023);
total -= readings[index];
readings[index] = val;
total += readings[index];
index = (index + 1);
if (index >= NUMREADINGS)
index = 0;
average = total / NUMREADINGS;
if (average > 50){
tone(10, 50, 100);
delay(1000);
}
if (average > 150){
tone(10, 50, 200);
delay(1000);
}
if (average > 250){
tone(10,50,300);
delay(1000);
}
if (average > 350){
tone(10,50,400);
delay(1000);
}
if (average > 450){
tone(10,50,500);
delay(1000);
}
if (average > 550){
tone(10,50,600);
delay(1000);
}
if (average > 650){
tone(10,50,700);
delay(1000);
}
if (average > 750){
tone(100,50,800);
delay(1000);
}
Serial.println(average);
delay(updateTime);
}
}
void tone(long duration, int freq) {
duration *= 1000;
int period = (1.0 / freq) * 1000000;
long elapsed_time = 0;
while (elapsed_time < duration) {
digitalWrite(pinSpeaker,HIGH);
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);
}
}
please answer. Thank's.
Discussions
5 years ago
This is not Makezine but Inscrutables so details, pointers, pictures and nothing is perfcet. What is your emf flux sensor ?
A hall probe or that speaker ??
Are you making this Makezene project for a blind person ?
How far above the sea water do you program ?
Answer 5 years ago
I make this emf to detect mobile phone, I was given the task by the school to make a project of arduino. so I made this. sorry in advance what the purpose of this question "How far above the sea water do you program?" i do not exactly understand?
Answer 5 years ago
1] What kind of component is your emf flux sensor, hall probe or wire coil ?
2] Are you using a mobile phone to detect magnetic flux ?
Your software is some sort of averaging BUT what are you averaging
3] How do you use a speaker to indicate 5 bars, 1 bar, all bars ?
Here is where you can impress us HOW do you use sound to represent LED-BARs
4] Is the speaker for a blind person ?
If sound is the information for magnetic strength it would work for a blind engineer !
5] Do you live near the ocean ?
Can you locate your home on a map
6] How many meters above the sea water do you live ?
You did not answer any questions to help you. I want to know if you can !
How high are you above drowning, can you provide a link to the projects in makezine.com
Answer 5 years ago
Wow, relaxed. I am here still learning. I just do not understand here. and I just wanted to try to make a little innovation. so i replace LEDBar with sound. for each LedBar 1, 2, or more I use my voice if 1 then use microseconds or may knock tone. This is not only for the blind.
Answer 5 years ago
Understand Now ..... different sound for each bar.
Do all sounds continue as log as bar or only beep once ?
DO you KNOW what kind of component is your emf flux sensor ?
Can you provide a link to this project in makezine.com
Can a tsunami affect your safety ?
You only answer 1 question each time.
Answer 5 years ago
I will try all sounds continue as log as a bar.
Yes, i know.
http://makezine.com/2009/05/15/making-the-arduino...
I think yes.
all your questions were answered by me
5 years ago
Have to agree with Iceng here.
Not real details make it next to impossible to help and I fail to see the point in having an audio signal for the magnetic field strenght as it goes against the purpose of "accurate" measurements.
I could just use my phone to get an estimated field strenght reading....
Am I correct to assume that english is not your first language as it is a bit hard to understand your question?
Answer 5 years ago
how to make it so that accurate? I am sorry for my english, not so good.
the core of my question, whether the program that I remake is correct?