Hi guys,
I am trying to measure some voltages with Arduino Due using analogRead.
I want to apply an antialiasing filter in order to avoid aliasing problems, and if I understood well, arduino don't have any kind of filtering on analog pins. Hence I want to put a filter before the analog-to-digital conversion (quantization).
- Are there any kind of commercial circuit for anti-aliasing filtering purposes to put between my Arduino and the voltage source?
- Are there any kind of circuit able to convert analog-to-digital with an integrated anti-aliasing filter that can send to my Arduino directly the digital signals?
Regards,
A
See this thread for anti-aliasing filtering ( can be done with a low pass filter):
Aliasing problems reduce with higher sample rate, and you can sample up to 1 Msps (i.e. a sampling interval of 1 us). For ADC conversions with registers programming, search in the DUE sub forum for example sketches.
I know that an antialiasing filter can be done using a low-pass filter. The problem is that a filter made of capacitor and resistance (as described in your link) is a first order low-pass filter, hence the decay after the cutting frequency is quite soft.
How can I sample at 1 MHz? If I put an analogRead in the void loop, and I display using serial port, the sampling frequency is about 2-3 kHz.
I am not an expert of antialiasing filters but an RC filter plus oversampling and averaging will give you decent results.
To power your board, use a 9V battery much more stable than powering the board thru the USB cable, make alternatively 2 ADC conversions on 2 different channels, one is the one you want to measure, the other one is connected to Gnd via a resistor. Note that for 2 channels conversions, each one will be sampled at 500 KHz.
This is an example sketch of ADC sampling at 1 Msps (reply #3):
https://forum.arduino.cc/index.php?topic=547194.0
If you search on the internet, you can find threads which suggest an analog antialiasing filter plus a digital antialiasing filter for best results:
With a DUE, you can have a digital filtering in between 2 DMA ADC conversions, triggered by the ADC Handler.