Vibrating Wire Readout – 4V p-p Square Wave Excitation

Hello,

For my research project, I am conducting an Arduino project to monitor on my computer the pressure applied by a borehole stress cell onto my sample. This device uses the vibrating wire technology to measure the applied pressure onto the cell. You may find more information regarding vibrating wire technology here:

Vibrating-Wire Measurement Principle: Vibrating-wire sensors and... (campbellsci.com)

For this purpose, I am trying to replicate a vibrating wire readout device by using an Arduino Uno board that would perform both the excitation and the signal sensing on the vibrating wire. By swapping the excitation frequencies in a given range, it would be possible to find the resonance frequency of the vibrating wire, thus being able to determine the pressure applied within the borehole pressure cell. The pressure shall be monitored in real time through a MATLAB GUI.

Here is the Borehole Stress Cell I am using:

Hydraulic Borehole Stress Cell - HMA Group (hmagrp.com)

Here is the Vibrating Wire Readout I am trying to replicate with my Arduino project:

Vibrating Wire Readout - HMA Group (hmagrp.com)

To successfully perform the project, the Arduino Uno board will have to:

  • Excite the vibrating wire with a frequency sweep
  • Sense the resonant response of the vibrating wire
  • Send back the data to the MATLAB GUI

I believe I can manage to perform point 2 and point 3. After rectifying the resonant response signal by using a two OP Amp rectifier, the signal may be sample using the Arduino analogRead() function. Higher sampling rates may be reached by modifying the prescaler.

My issue, is that I cannot figure out how to excite the vibrating wire with the same specifications as described in the Vibrating Wire Readout mentioned above:

  • Waveform type: Square wave
  • Frequencies: from 250Hz to 5000Hz (frequency sweep with the Arduino).
  • Amplitude: 4V p-p
  • Current: approximatively 250mA

My question is: How can I generate such a square wave signal to suitably excite the vibrating wire?

I have investigated the possibility of generating a square wave signal using a 741 OP Amp. The issue with this approach is that I cannot program the excitation frequency value with the Arduino.

Any insights on how I could manage to properly excite the vibrating wire would be very welcome !

Many thanks !

try a web search for arduino generate square wave you will get plenty of links
the question I have is I am not sure Uno would be able to generate 5KHz and also carry out other tasks - you may need a faster micro such as an Arduino Due

You could try using an Arduino to turn a MOSFET or a transistor on and off at the desired frequencies.

UNO:
Digital Pin Write Takes About 5 uS
Analogue Pin Read Takes About 0.1 mS <--- at default prescaler

With a prescaler of 16, which gives decent results per Gammon, I got an analog read time of about 0.016 mS.

Any of the hardware timers on an Arduino can be used to generate a very wide range of frequencies, including frequency sweeps, without unduly burdening the processor. On an Uno and the like, a 16 bit timer is the most versatile.

Tutorial for AVR-based Arduinos: https://gammon.com.au/timers

How, exactly, is the vibrating wire excited? We need to know whether the waveform is AC or DC, and the impedance of the wire driver.

Dear jremington,

Thank you very much for your reply and for the relevant questions you asked.

I do not know the impedance of the wire driver.

When first reading the Vibrating Wire Readout datasheet, I originally thought the waveform must be AC but your question made me wonder.

Unfortunately, I am not certain whether the excitation must be an AC or a DC waveform. So I did a little research on this topic. The electromagnet is used to “pluck” a metallic vibrating wire (and not a permanent magnet). The force exerted by an electromagnet on a section of core material is given by:

F=(B^2 A)/(2µ_0 )

With B being the magnetic field strength.

Source: Electromagnet - Wikipedia

As B is to the power 2, the force at which the electromagnet “plucks” the metallic wire does not depend on which direction the excitation current flows through the coil.

Therefore, we could assume the DC waveform would be suitable as when the square waveform shifts from +4V to 0V, the electromagnet would switch ON/OFF and thus “pluck” the wire. On the contrary, an AC waveform would keep the electromagnet in the ON state and would not pluck the cord.

Do you have any thoughts on this reasoning ?

Anyways, I will inquire for additional information to make sure.

Thank you for your suggestion !
The Arduino Due may seem an interesting option I was not aware of. It could be useful in case i need a bit more computing power for my project.

On the contrary, an AC waveform would keep the electromagnet in the ON state and would not pluck the cord.

Probably not correct. The speakers in your stereo system are electromagnets, and are driven by AC waveforms to create sound (air pressure variations).

It is very likely that the electromagnet is driven by AC. For that, you can use an H-bridge motor driver. But you can ALSO use the H-bridge for 0-5V DC square wave excitation.

Even the ancient L293D or L298N motor drivers would work fine for an application that requires less than 1 Ampere at 4V peak to peak. Do not use the 5V output of the Arduino as the power supply.

But you really need to know exactly what it is you are driving before going shopping. At the very least, measure the resistance and if possible, the inductance of the driver electromagnet.

I would be interested to know what your plan is for this goal:

Sense the resonant response of the vibrating wire

Caveat: I know nothing more about vibrating-wire technology other than the links you posted here and a short burst of reading a few years ago when I developed a borehole measurement device.

Within the constraints mentioned by @jremington (re: electromagnet parameters), I think you have a good shot at doing this with an arduino.

The tone() command can be used to send square waves of varying frequency to an output pin that could drive the electromagnet. The main issue is going to be reading the response. I'm guessing that you can determine resonant frequency by the maximum RMS value measured across the sweep range?

The ADC tops out at about 10ksamples/second on a 16 MHz atmega328-based arduino. Dr. Nyquist says that your 5kHz signal will require sampling at a minimum of 10kHz. In reality you may need to sample at 5-10x that to get useful readings (maybe? DSP isn't my strong suit).

You would have to use an external ADC to get a higher sampling rate or perhaps move to another arduino platform such as a black pill.

Interesting project, in any case!

[edit]
After reading some more of your links, it looks like tone() may not have the frequency resolution you need. May have to do some register twiddling to get higher resolution.

That's correct, the speaker example is not applicable.

As the data sheet mentions a transistor is required to switch the 250mA @ 4V current through the coil. The frequency can be generated by a timer. A resistor may be used to both drop 1V from the 5V supply and serve as the shunt for the coil current measurement (untested).

Reading back the response is a challenge, as @cedarlakeinstruments mentions. You may have to use an differential amplifier that subtracts the excitation rectangle from the coil current. With a compensation of the phase shift between the voltage and current signals. Then the remaining signal can be analyzed by frequency (FFT...) or amplitude.

More thoughts:
It may be easier to stop the generator for some time to measure only the wire response without the excitation. Then only the amplitude of that signal is of importance.
A single pulse or jump may be a sufficient excitation like in playing a guitar.

IMO all that cries for a DSP for the signal handling, the Arduino may be left for the sweep generation(?) and communication.

This is the complete quote. Note the words "we could assume".

So far, the OP has posted no evidence that the waveform is DC offset, +4V to 0V.

Yes they use electromagnets, but speakers uses the voice coil actuating mechanism which uses both an electromagnet and a permanent magnet.

The formula for the force actuating a voice coil is given by:

F = i(N_total*L)*B_ext

With i being the current flowing through the coil and B_ext the permanent magnet magnetic field which is constant. Depending on wether the current is positive or negative, the coil will either attract or repulse the permanent magnet.

Source: Supplement – Lorentz-force actuation | Design and Technology Portal (wordpress.com)

In shorter terms:

  • An electromagnet will always attract a ferrous material no matter in which direction the current flows through the coil.
  • An electromagnet will attract or repulse a permanent magnet depending on which direction the current flows through the coil (like in the a speaker).

And from my understanding, there are no permanent magnets attached onto the vibrating wire.

That being said, I sent an inquiry email to the manufacturer asking about the proper waveform to use and expect to get some feedback in the following days and update accordingly the waveform specifications. I have also asked for resistance and impedance values.

Thank you for your recommendation. Yes, this seems like an interesting option as it should be able to provide both AC or DC square waveforms.

Please,see my response to cedarlakeinstruments.

Dear cedarlakeinstruments,

Thank you for your help!

For sensing the resonant signal, I was thinking about using the AnalogRead() function from Arduino. As you mentioned, it is by default limited to a 10kHz sampling which would not be sufficient. It is possible to modify the ADCSRA register to modify the ADC prescaler. The following link shows how to proceed.

Source: Gammon Forum : Electronics : Microprocessors : ADC conversion on the Arduino (analogRead)

Therefore, with a 16 prescaler (instead of the default 128) the analogRead() function could sample the signal at frequencies up to 76kHz which is 15x more than the maximum vibrating wire (VW) excitation frequency which is plenty enough.

After sampling the resonant signal at a given frequency, the sampled data shall be sent to MATLAB on the computer in which all sorts of signal processing tools are available.

To reconstruct the signal, I was thinking about using the sinc() function, it is used to “Perform ideal bandlimited interpolation of a random signal sampled at integer spacings.” The square waveform signal could then be removed to only keep the resonant response signal.

Source: Sinc function - MATLAB sinc - MathWorks Suisse

Once the signal has been reconstructed, it would be possible to retrieve the Vpeak value and the Vrms value of the signal.

This sampling and reconstructing procedure shall be conducted with several frequencies in a given frequency range, let’s assume from 250Hz to 5000Hz. By plotting the Vrms or V_peak as function of the VW excitation frequency, I expect to plot the following resonance graph:
Graph-showing-Mechanical-Resonant-Frequency.png (850×424) (researchgate.net)

With MATLAB, it is then possible to reconstruct the signal and find the resonant frequency when a given pressure is applied by the Borehole Stress Cell.

Altough, I do not know which would be more relevant:

  • Plot the resonant signal Vrms as function of excitation frequency
  • Plot the resonant signal V_peak as function of excitation frequency

Do you have any thoughts on this ?

Dear DrDiettrich,

Thank you for your help and your insights !

I was thinking of doing some DSP through MATLAB instead of having to substract the excitation voltage with a differential amplifier.

It is a good idea to measure the response without the excitation signal. Altough, if the excitation does not remain constant, I am affraid the resonant signal will decrease quickly and shall not provide reliable values. To be tested.

How do you want to get that signal? I.e. the resonant signal of the wire, not of the excitation coil.

Can you give a circuit diagram of your project?

Correct, but note that with ADC clocks above 200kHz (roughly corresponding to about 10ksamples/second), the resolution will be reduced.

Patents can be interesting to read, for example