Close

Automating Data Collection

A project log for Mini Audio Equalizer

A graphic equalizer that fits in your pocket!

grant-giesbrechtGrant Giesbrecht 05/09/2019 at 20:090 Comments

I decided to try to automate data collection partially because this project was going to demand measuring dozens of frequency responses, each of which takes upwards of 20 minutes to collect by hand. Even if I only take a dozen or so data points, each point requires setting the function generator and oscilloscope to get a good reading, writing the data into a table, and entering it into my computer. Only then can I see the plot. It's too much writing and too slow to see results.

To fix the issue I made a Python script to run on my laptop and send commands to my Rigol oscilloscope over USB. I'd still have to manually set my function generator and adjust my scope's trigger and horizontal + vertical scales to get clear measurements, but after that my script pulls the measurements I need straight from my oscilloscope. This eliminated the time consuming paper tables and copying them into a digital format. Plus I designed my script save the data to my hard drive in a file format I designed a few years ago that makes it easy to load the data into MATLAB or C++ programs for further analysis.

My program helped, but had some important issues. It didn't automatically set the scope's horizontal + vertical scales and thus still required pretty significant amounts of attention to work. Plus, occasionally the scope would send corrupt data and the python script would record this as if it were valid. I continued to use a mix of fully-manual measurements alongside those collected by this program and continued to update and improve the program as I used it. Even with just a few tweaks to eliminate the largest problems (eg. 1. detect corrupt data and ask the user to re-collect 2. allow the user to view the data and erase the corrupt data) my script accelerated data collection quite significantly. I could now collect a data set in half the time or less.

Note: You won't find the script uploaded here because (as you'll read later) I rewrote the script so it automates the entire measurement process and you can go grab a coffee as your test equipment does your work for you. Because this second program is universally better, I omitted the earlier one. I've got a project page for the completed script here (https://hackaday.io/project/165389-automating-data-collecting-w-python) if you're just too excited to wait.

Discussions