Can em frequencies be filtered with arduino?

Thanks for the suggestions. However, analog low-pass filter attempts fail. This does not happen with L/C filters because of the volume size. In other active and passive filters, signal passing is stopped. I don't know why either.

Welcome to my ignore list.

Hi,

Not clear enough I would say.

  1. What is the source of the EM?
  2. Why do you want to detect a specific frequency band?
  3. If you detect anything in this band, what do you want the Arduino to do?

Finally, what is the overall scope of your project, what is it trying to attain?
Is it a spirit detector or a safety device in a EM rich environment?

Tom... :grinning: :+1: :coffee: :australia:

1 Like

I understand, what u are trying to do, because I used to work a lot with such frequencies. To see the frequencies properly and how much noise is coming into arduino download Serial oscilloscope, it is similar to serial monitor of arduino but much better and u can actually visually see how much noise u are getting in your signal.

and to filter out the noise. you have two option one to use physical analog filter or use software based.

if u want to use software based then use IIR filter they work best in software rather than FIR filter. First design 1st order IIR filter and see if the filtering is done properly and then increase the order of the filter, well for most cases 2nd order works best it worked for me best.

1 Like

And please explain better after filtering what are u trying to achieve with this signal. what u need to do actually with it, what are u trying to run with it? With specific frequency what u need to do, only then we can help u with it.

if u have any screenshot of the signal please attach those also, it helps a lot to understand the problem.

1 Like

Hello, I got a message from the arduino forum system that I have to wait one day before I can write a new answer, as I am a novice user and have used my sufficient right of reply, and I blocked it. This is the reason why I haven't been able to comment on my post for so many hours. I don't know if it happened to you. Maybe they're right. But I found it funny. :))

My friend, my research is aimed at understanding natural phenomena such as thunder, lightning, lightning, earthquakes, volcanoes from long distances.
Bands containing frequencies such as 50hz and 60hz that I do not want to be detected in the project belong to high voltages used in homes and are the frequencies I will encounter most during measurement. Since the lower limits of this band are very close to the limits that I am trying to determine, I wanted to keep the lower limit more limited. ie 50-60hz down is limited to 49; If it's up, it doesn't matter if I keep it wide. So I wanted to block it between 49hz-85hz. The remaining band that I want to re-enter the system is not very important, but it is an expandable option. So, 600hz could actually be up to 200hz, or it could be up to 10khz. However, I don't think it would mean anything since frequencies greater than 1hz are likely to be affected by radio frequencies.
This was the answer to your first and second questions. As for your third question;
Since such signals will be constantly produced by nature, the arduino must be constantly active.
With the input of the signals in the range that I want to be detected to the system, these signals will be amplified by the necessary components. Then an effective and sharp edged filter or filters are required to pass the desired frequencies and block the unwanted signals. At this point, the use of analog filters becomes impossible due to their large volumetric dimensions. Passive filters, on the other hand, have difficulty passing low signals. Of course, I tested all these processes.
As a result, what I want the arduino to do is of course make an effective filtering that will pass the frequencies within the limits I want, block the ones I don't want, count the signals in the range I want.
Now I think I explained my project as much as you can satisfy your curiosity. I hope you don't generously withhold your coding knowledge.

My Friend, your suggestions are good, but I don't have the knowledge to do professional work in digital filter and more software. iir filter seems to be better. However, the codes are professional work. Now I'm waiting for you to help me get rid of this job.

my friend dont worry I will try my best to help u. I have attached the code for bandstop filtering try that, I have added comments in it to help u find correct values to block freq between 49-85hz u can also find many websites online which can generate you correct values.

bandstop_filter_arduino.ino (1.5 KB)

1 Like

I think, you are trying to "clean the floor with a toothbrush". You are fixated on a very local aspect of what is a much larger and demanding task - just the filtering. I think you need to examine the "bigger picture" of the data acquisition and constraints and demands that belong to the problem. For example, I suspect that the kind of signals you are talking about, would require much more digital resolution, for example 16 or 24 bit conversion, in order to achieve an adequate S/N ratio for the filtering algorithms to be effective. I think the bare Arduino platform is not sufficient for your needs.

Can you supply some links to some relevant academic articles that would help to illustrate the kind of signal processes that need to be supported? A few paragraphs here is really not enough to explain such a complex subject.

That is one of the reasons why the forum guidelines suggest that you provide as much information as possible in your first post, so you won't be stuck in reams and reams of questions and answers.

Thanks for the code my friend.

// Sampling frequency
const double f_s = 250; // Hz

Can you explain this line a little?
Also,

// Normalized notch frequency
const double f_n = 2 * f_c / f_s;

is this row always fixed?

Thanks for answere.
My friend, actually my project is not completely finished in this regard, let's say the first entries. My research continues. I have to skip the first step before I can decide if my project will be something that can be continued. The information I have written here is only the first step.

Also, you are justified in your concern. I think the arduino can pass the test I'm going to do now. However, I think that it may not be enough as a result of different sensors that can be added later and coding accordingly.
I think there might be a problem even at this step.

E.g; A friend in the comments above stated that using schmitt trigger integrated is not correct. However, as far as I know, the card in question increases the readability of the signals so that the analog signals can be counted on the arduino. I don't know what you think about it.

use 1000hz sampling frequency

keep it that way

you are right, just helping him start from somewhere.

1 Like

Haseeb, that was one of the filters I actually wanted. So, band block filter. However, there must be a low-pass band filter, which will weaken the band after 600hz.
You suggested an "IIR" filter.
I think it makes more sense to get your opinion because you have experience. You said you work at frequencies in this range.

Have you done any basic internet research on digital filters? Of course there are digital low pass filters. Really, I'm not trying to be patronizing, just trying to get you on track. A few minutes with Google and including "arduino" in the search terms along with terms related to your need, is guaranteed to answer all of the questions that you've asked here so far, and a lot that you haven't asked yet.

It's entirely plausible that @ haseebzaib is an expert in the field, however the subject itself is not novel, it's a widely studied and researched domain, dating back at least 80 years. That's just the computer implementation, the math is much older than that.

dear aarg, believe me I'm good with google. However, you will appreciate that people do research on the subject they focus on and start learning. For this reason, when I realized that there could not be analog filters related to my project, I realized that there were digital filters. As I am not a professional, you can appreciate that there are issues that must be consulted.
Look, for example, it's been half an hour, <AH/Timing/MillisMicrosTimer.hpp>
and
<Filters/Notch.hpp>
I've been searching for filters on google. However, since everything is prepared professionally, it is sometimes impossible for an amateur like me to reach.
Let me ask you how I can reach these two filters. It's not in the library. I couldn't find a downloadable zip file either!

What library? There are probably many. Also you can probably adapt general C coded filters for Arduino pretty easily.

...and... who says you can't use analog filters? There are some very high performance analog filters that you can build using operational amplifier IC's.

Being a professional in some thing is definitely a good omen for becoming proficient in another thing. But it won't often relieve you from the burden of the same learning curve that a non-professional would have.

In truth, digital filters are not simple and that is a good reason not to try learning about it here.

If you want, "fast food" filters, you are in for a disappointment because they are sufficiently complex that even a well written encapsulation still requires that you follow strict usage rules and procedures to make it work properly.

For example, have you evaluated the S/N requirements of your application, and compared them to the S/N figures that can be achieved with a typical Arduino A/D and processor? If it fails that test, you shouldn't waste so much time on it.

A non-professional can certainly achieve some things that a professional can, but not without a cost in time and effort. Generally, second party assistance is not tremendously helpful in such cases because it falls into a pattern of education, which is wonderful, but time consuming and lengthy.

Also, beginning a project without clear, openly stated or documented requirements and definitions, is a disaster for a professional or non-professional. So you really need to clarify that here if you want help.

Hi,
Have you Googled;

arduino lightning detector

There is even a module..
https://learn.sparkfun.com/tutorials/sparkfun-as3935-lightning-detector-hookup-guide-v20/all

Tom... :grinning: :+1: :coffee: :australia: