Finding Amplitude of Analog Signal (Constant Vibration)

Hello,
I'm trying to analyze vibrations in a string. I would like to find the amplitude of an analog signal from an accelerometer attached to the vibrating string.

  1. Do I need to export the data to another program, or can I do the work with the arduino program? It currently does not matter whether analysis is real time or after the fact.

  2. Do I need to do an fft? (at the moment all I care about is the amplitude)

What would be the simplest way to do this? I have little programming experience, but I can look stuff up if you point me in the right direction!

Thanks!

Arduino model: Uno

Accelerometer: ADXL193

What is the frequency of the oscillation.
And the material.

Why an accelerometer, and why attached to the vibrating object.
It could dampen it, and wiring it up could be a chalenge.

I would expect a static sensor. IR, hall, magnetic (guitar pickup), etc.
Leo..

I'm trying to analyze vibrations in a string.

What sort of analysis and why an accelerometer?

String vibrations can be quite complex, composed of many harmonics, and as pointed out above, attaching an accelerometer will change the harmonic content.

Take a look at the astonishing results of this simple video approach https://www.facebook.com/paulie.franky.branc/videos/958061790880783/?fref=nf

Haha, trickery.

Seems to me that the poster has overlayed six oscilloscope pictures on top of the sky-hole.
None of the strings vibrate on the base frequency. And the top part of each signal seems to clip.
Leo..

Strings on a guitar almost never vibrate at (only) the base frequency. In fact is very difficult to make them do so. Plucking usually excites mostly higher harmonics and certainly doesn't work, but exposing a string to an audio signal at exactly the base frequency will.

Hello Wawa & jreminton,

  1. Frequency should be between 30-100Hz

  2. Material is paracord

  3. I'm using an accelerometer because the sensor must be connected to the vibrating string. A hall effect sensor depends on the string vibrating relative to the magnetic field, and in this case the whole sensor will vibrate with the string unless I get into some impracticably complicated setups. Whatever data a hall effect sensor did yield would be confused by the sensor's own vibration.

  4. It doesn't really matter if the harmonic content is changed: I just care about the amplitude of the vibration at the moment.

BIG picture: Eventually there will be several accelerometers at different points in a paracord 'web'. We want to locate sources of vibration by comparing the amplitudes at the different accelerometers. People who are more experienced than me at programming will be helping by that point. Suggestions would be cool to hear still, but mostly I need help with the problem below.

Problem I need help with: I'm trying to test how consistent our physical connections are. I have one accelerometer to experiment with, and I need to write a simple program to find the amplitude of the analog signal from the vibrating accelerometer, so I can compare the amplitude at different connections when subjected to a certain vibration source.

What would be the simplest way to find the amplitude of an analog signal?

Thanks again!

We want to locate sources of vibration by comparing the amplitudes at the different accelerometers

What do you mean by "locate sources of vibration"? Are you looking for the nodes of standing waves on the string?

What would be the simplest way to find the amplitude of an analog signal?

For an arbitrary time varying analog signal, the amplitude is just its value at any particular point in time. What do you mean by "amplitude"?

You still haven't told us what you mean by "analyze vibrations in a string". If this is for a course, what did the instructor ask you to do?

jremington:

By locate source of vibration, I mean we'll apply a constant vibration source (a little vibration motor, like the kind that vibrates a cell phone, for example) to a point on the web, and our final set-up will be able to report the coordinates of that point of application by comparing readings picked up by the set of accelerometers. Accelerometers nearer to the source will experience larger vibrations, etc. (Not this simple: see jremington's next post)This is still out in the future, however, not what I'm trying to do at this moment.

By amplitude, I mean the amount of vibration the accelerometer experiences. An accelerometer which is experiencing a larger vibration should report higher acceleration. Since the vibration source will be applying a constant vibration at a constant frequency, I expect the accelerometer to experience mainly that driving frequency. Hence the analog signal will not be arbitrary - it should show some periodicity and finding the amplitude will be reasonable. However, I can't just take the (max - min) of the readings to find amplitude, because that might not be representative of the whole data sample - the max or min could just be a spike in the signal, so I need a more consistent approach.

I found a way of getting a visual on the amplitude of a periodic signal, at least (with another analog sensor (a range sensor) since the accelerometer hasn't arrived in the mail yet). I get the arduino to print a set number of analog readings to the serial monitor, then I copy paste them into excel and graph the data. I can then visually estimate the 'height' of the signal. (it looks basically like a sine wave). It's a pretty tacky way to do it though, and it would be better to get a numerical result.

For the sake of any other newbies who want a simple way to graph their data, here's the code I used to print 1000 consecutive readings to the serial monitor. (Serial monitor can be found under 'Tools', open it once you've started the code, then you can just highlight the data and paste it into another program to graph it):

void setup()
{
Serial.begin(4800);
for (int i=0; i<1000; i=i+1) 
Serial.println(analogRead(A0));
  delay (2);
}
void loop()
{
 
}

Lateral vibrations on a string have four quantities that can be derived from the accelerometer measurements: acceleration of the string at the point where you attach the accelerometer, velocity of the string at that point, position of the string at that point and in certain cases, frequency of vibration.

You integrate the acceleration with respect to time to get the velocity and integrate the velocity with respect to time to get the position. Analyzing for frequency requires you to make assumptions about the motion, for example that it is sinusoidal, or the sum of sinusoidal motions.

Accelerometers nearer to the source will experience larger vibrations, etc.

For a vibrating string, this is simply not the case. In general you will either have standing waves (where there will be points of maximum lateral excursion and nodes, points where there is no lateral excursion), or chaotic motion with no well defined amplitude.

You mention a "web" -- what is that?

jremington:

The web will be a model spider web, a network made of paracord.

You're right about the way vibrations travel in a string - thanks for helping me think that through. I think that only reflects my own misunderstanding - I'm not the one who will be doing the analysis with the whole web. When I get a chance I'll talk with the guy who is so I can better understand. Not sure how he's planning to interpret the data, now that I've considered what you said.

I'll wait till I get the accelerometer, so I can get an idea what the data will look like by plotting it. This will probably be a case of chaotic motion, but I think I will still be able to see which connections (between to sensor and web) are transmitting a lot of vibration and which only a little, when subjected to the same conditions, distance from the vibration source, etc. At the moment that will be all I need, since I'm just trying to test whether the connection clips we're planning on using are secure and consistent enough.

Thanks for the clarity - at least now I'm aware that I'm confused!

You can expect standing waves in a web, too, unless it is too loosely knotted.

Is this project to investigate how a spider finds its prey in a web?

Do your sensors produce enough voltage to be read by an analog input pin, or will you need an op amp to beef it up?

Do you need to sample ever 1/10 of a second, or ever 1/1,000 of a second, or what?

Once the signal is received by the arduino, it should be well capable to analyze the results.

jremington:
Yep, it's sort of a demo/investigation of that.

jack wp:
I think it will be fine w/o an op amp. It's the ADXL 193. The second question is more in the realm of the guy who will be doing the 'real' programming, and he for some unfathomable reason decided to go on vacation with his girlfriend.

Thanks for the discussion, everyone, I may be back once I actually get the accelerometer hooked up.