Arduino Digital Low-Pass Filter 2.0
Improving Current Sensor Readings with Digital Filtering
Introduction to the Project
- The speaker introduces a new project involving an ACS 712 current sensor, noting that the output is noisy and unreliable due to noise levels around 100 milliamps.
- The speaker considers using a digital filter to improve the sensor's readings, referencing a previous video on low-pass filtering techniques implemented in Python and Arduino.
Implementing Low-Pass Filtering
- The speaker presents the difference equations for a first-order low-pass filter and shares code for reading from the ACS 712 sensor, which involves rescaling voltage to current based on specifications.
- Variables are introduced to store historical data of raw and filtered signals (XNUS1 and YNUS1), essential for applying the difference equation in filtering.
Enhancements in Filtering Technique
- After initial filtering, the speaker contemplates further improvements by simplifying coefficient derivation; previously done in Python, now integrated directly into Arduino code.
- A new version of the digital low-pass filter (Arduino digital low-pass filter 2.0) is introduced, allowing users to adjust cutoff frequency without needing external software like Python.
Using the New Filter Class
- Instructions are provided on how to implement this new filter class within Arduino code: copy it at the top of your script and create instances for each signal requiring filtering.
- Four parameters are necessary: filter order (first or second), cutoff frequency in Hertz, sampling frequency (estimated as 1 kHz), and a boolean flag for automatic sampling frequency computation based on loop function duration.
Results of Filter Application