Hello everyone.
I am doing a project where I want Arduino to detect audio (using an audio sensor), transform that audio to the corresponding waveform and then display that waveform on some external output (TFT LCD, PC). What would be your advice in achieving this?
The Arduino ADC converts the audio sensor voltage output into binary values suitable for display.
The waveform is simply a display of measured voltage versus time.
Depending on the ambition You might need to check the performance of various controllers. The controllers use some time for an analog reading. That might limit the beauty of the curve You can plot. The plotting device also takes some little time to access.
Specify Your needs.
The Arduino ADC converts the audio sensor voltage output into binary values suitable for display.
The waveform is simply a display of measured voltage versus time.
Thanks for answering. Yes I know how do A/D conversions go, my goal here is to represent that audio input with it’s waveform as a realtime continuous function.
The digitized waveform is not a continuous function of time, it is sampled at intervals you determine.
On a graphics display you can draw lines between the discrete points comprising the digitized waveform dataset.
What you are looking for is an oscilloscope made from an Arduino board...
"arduino" oscilloscope at DuckDuckGo
We (STM32duino forum) made one years ago and it can be very functional. After a while, one member put it into a rubber pig ... hence Pig-O-Scope
Thank you for answering.
Arduino in question is MEGA 2560 R3. I am aware that the analog reading will take some time, the goal is to minimize that period as much as the hardware can provide. The looks of the waveform are not a priority.
My goal is to show the waveform of the input signal realtime, will need some FFT library for the Arduino. Where do I go from there?
What for? There are two popular FFT libraries (the ArduinoFFT and OpenMusicLabs libraries), but all those do is transform the input data from a time series into a frequency series.
Keep the Sampling Theorem firmly in mind. No audio frequency higher than one half the sampling frequency can be present in the input, or you will be hopelessly confused by sampling artifacts.
Will check that out, thanks!
Clever!
Thanks, will do. I read that the Arduino has a built in A/D converter and with the audio sensor, I guess I should be fine with the analog to digital conversion. The thing that is confusing me about this project is how can I show the now digital data I got as a waveform?
Most people draw a graph of the data on a screen of some sort. For Arduino there is the Serial Plotter, which produces output similar to the graph below. The blue curve is the input signal, the red curve is a severe sampling artifact, caused by sampling the 440 Hz tone at 352 Hz.
x0 = analogRead(A0);
loop:
x1 = analogRead(A0);
drawLine (x0, x1);
x0=x1;
:loop
That might be just what I need. Is there a way I can present that output from Serial Plotter on to a external display, directly connected to the Arduino?
Probably not. But it is pretty simple to have the Arduino plot on a TFT display.
Adafruit has some nice displays, and a decent graphics library with good documentation and tutorials.
Thank you for your help. I will continue my research and update here when I have some significant results with my project.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.