Experiment 6 - Capacitive II: Acceleration sensor

1.      Context of the Experiment

Usually, one does not design and build a sensor for their applications. Exceptions are application specific sensors that have to provide very specific specifications with regard to e.g. energy management, accuracy, measurement range. Those sensor typically require complex ASIC design and sophisticated and expensive design processes. Normally, off-the-shelf sensors  that provide an either digital or analog way of reading out sensor data are chosen. The challenges then are finding a suitable sensor, that is suited for the desired application by matching requirements for e.g. output voltage, data rate, precision, size, price or measurement principle. Therefore, this experiment focuses not on the design of a sensor but on choosing suitable sensors, working with measurement data from said sensors and observing the consequences of choosing a wrong sensor for an application.

In the previous experiment, the concept of capacitance measurement was introduced. The principle is based on measuring changes in capacitance or the influence of a changed capacitance on an electrical circuit. One field of application is acceleration measurement, which are covered in this experiment.

This experiment is dived into three parts, with the first part focusing on choosing a suitable sensor for different applications. In the second part, a digital sensor is provided and to be evaluated with an Arduino mirco-controller. The data shall give insight and understanding of the sensor's advantages and drawbacks. In the third part, a measurement of the often only theoretically discussed pendulum is to be conducted and the data to be analyzed.

Similar to already conducted experiments, questions concerning knowledge, understanding and your results have to be answered correctly, to pass this experiment. The questions are VIPS only and can be answered during and after the experiment.

2.      Learning Goals of this Experiment

  • Knowledge:
    • Understanding sensor principle
    • Learning about limits of capacitive sensors due to their principle of operation
    • Selecting a suitable sensor according to predefined requirements
  • Skills
    • Skimming through datasheets for desired information
    • Working with an Arduino micro-controller for data acquisition of digital data
    • Processing of measurement data in Matlab

3.      Literature 

      [1] Kern, A. Abbasimoshaei, C. Hatzfeld, Engineering Haptic devices, 3rd edition, Springer, 2022.

      [2] Craig Aszkler, CHAPTER 5 - Acceleration, Shock and Vibration Sensors, Editor(s): Jon S. Wilson, Sensor Technology Handbook, Newnes, 2005, Pages 137-159, ISBN 9780750677295,https://doi.org/10.1016/B978-075067729-5/50045-8.

      [3] Lectures: Electrical Measurement Technology, Capacitive Sensors

4.     Basics/Fundamentals

4.1 Acceleration measurement

A fundamental part of mechanical dynamics is acceleration. It is used to measure vibrations, impulses and can be further used to get velocities and positions. Acceleration is sensed by accelerometers, where several different types of accelerometers are commercially available. These types can be distinguished by their principle of operation. There are for example, piezo-electric, piezo-resistive, and capacitive sensors.

4.2 Capacitive accelerometers

The capacitive accelerometer provides an output voltage according to the change of an internal capacitance, where Fig. 1 shows the basic structure of one type of capacitive accelerometer. Inside, there are two fixed and one movable electrodes that make two capacitors in total. The capacitance of each capacitor depends on the distance between the movable and the outer electrode, where the movable electrode is influenced by its mass and moves according to forces affecting the mass.

From this point it is clear, that the mass is affected by a multitude of forces such as friction, material elasticities, friction and gravitation to just name a few. The most important ones are dynamic forces, such as acceleration ( ).


Fig. 1 Structure of one type of capacitive accelerometer


By knowing the mass, the relationship between displacement and force and the relationship between displacement and capacitance, the acceleration can be calculated. An electronic circuit is used to convert the change of capacitance into a useful voltage signal as sensor output. The output signal can then be used directly (analog sensor) or be transformed into a digital signal (digital sensor). In analog-sensors, an analog-to-digital converter is required to digitalize the sensor values. This process typically includes filtering noise and amplifying the signal. On the other hand side, a digital sensor consists of a small micro-controller, that filters and digitalizes the sensor signals and communicates with the main processing unit (Computer, Main controller) transmitting the sensor output as already digital signals.

4.3 Parameters of Capacitive accelerometers

There are several specifications for capacitive accelerometers. The specifications are usually listed in the datasheet of the sensor. Some of them are:

4.3.1  Measurement range

The output acceleration is usually scaled to multiples of and typical capacitive accelerometers range from  to .

4.3.2  Sensitivity

Sensor sensitivity defines, how sensitive the sensor output (in )  is to changes in acceleration. The sensitivity depends on the excitation frequency and is typically higher for smaller sensor ranges. Usually, the sensitivity is given in .

4.4 How to choose a suitable sensor

Depending on the application's requirements, a suitable accelerometer has to be chosen. Typical parameters to respect are:

  • The range of acceleration to be measured
  • The required sensitivity
  • The number of required axes of measurement
  • Maximum allowed error
  • The operational ranges (pressure, temperature)
  • Linearity-factor (how reliable can values be reproduced

5.      Technical Basics & preparations

  • In the following are some aspects to be considered before starting a measurement

    • What is supposed to be measured → What values are to be expected (sine-wave-like shape, spikes etc.)?
    • What measuring device can be used for measuring → Does it need to measure analog values or digital protocols? Does it provide the necessary accuracy?
    • What are the possible (systemic) errors and external limitations that exist in the setup?

    Preparations:

    For the first part:

    • Check the following datasheets:

    For the second part you need:

    • Arduino UNO (Version R3)
    • ADXL 345 (digital accelerometer)
    • Jumper wires
    • Make sure that the Adafruit ADXL345 and Adafruit Unified Sensor libraries are installed on Arduino IDE:

For the third part, use one of the provided measurement pendulums and computers to generate data. A user-guide can be found below to explain the procedure. The goal is to adjust and use the data to analyze the pendulum.


6.  Experiment 6A : Choosing a suitable sensor

6.1 Choosing the correct accelerometer:

In this section, different applications are introduced and a suitable accelerometer are to be chosen for each application. The decision on the sensor for this shall be based on the conditions and circumstances of each application.

For each application, one sensor is considered the optimal solution. The task is therefore, to find the optimal sensor.

All the required properties and features of each sensor are given in the datasheets.

The sensors in question are:

  • ASC 4221 MF 
  • ADXL 377
  • ADXL 335


6.1 For each of the following applications, choose the most appropriate accelerometer from the given three sensors. Note down the correct sensor and use it later in VIPS!

6.1.1 The environment of an application requires sensing of acceleration over 1 axis at 90°C.  {VIPS}

6.1.2 An application requires acceleration sensing over 3 axes with a range of  (Hint: The non-linearity error of the sensors would be a decisive factor!) {VIPS}

6.1.3 An application requires 3-axes acceleration sensing with a range of  and a maximum resolution of  {VIPS}

6.2 Experiment 6B: Working with a capacitive accelerometer:

In this section, you will use an off-the-shelf capacitive accelerometer (ADXL345) and derive a relationship between accelerations and angles. The following file is the datasheet of the sensor.

As a digital sensor, the ADXL345 uses a communication protocol to exchange data with the main processing unit (for us, this is the Arduino). For this sensor, the communication protocol is called I²C. The sensor is located on a so called breakout-board, that provides some electronics and connection pins. The sensor itself is the small, black block in the middle of the breakout board. In total, the breakout board has 10 pins, of which four are of our interest for this experiment:

  • 3.3 V → supply voltage (not 5V!)
  • GND → Ground connection
  • SCL → Clock pin (for I²C communication)
  • SDA → Data pin (for I²C communication)

Connect the sensor to your Arduino board as follows:


Use the following Arduino code to get the acceleration data from your sensor:

When you upload the code on your Arduino board, open the serial monitor:

You should see something like this:


In the next step, use your desk and the provided triangles to put the z-Axis of the sensor into different angles with respect to your desk. Use the Arduino Serial monitor for reading the sensor.

(Note the direction of the axes!)


  1. (flat on the table with z-Axis pointing up) {VIPS}
  2. {VIPS}
  3. {VIPS}
  4.   {VIPS}
  5. (flat on the table with z-axis pointing down) {VIPS}


6.3 Experiment 6C - Analyzing a pendulum

As a famous example for oscillations and kinematics in general, the pendulum is an often discussed topic. As part of this experiment, you will be using a prepared setup to generate your own measurement data and analyze it in Matlab.

For generating measurement data, you will be working with a fully functional measurement set up.

Your first task therefore should be to understand the system:

  • What is the pendulum doing?
    • What influences the swing?
  • What measurement set up is installed?
    • What sensor is installed?
      • What is it measuring?
      • What is its orientation?
    • What are the limits of your system?
      • Which part of the sensor is observing what part of the pendulum swing?
      • Is the swing influencing the sensor?

Pendulum

Acceleration sensorArduino connection

  • The experiment included typical questions regarding
    • Frequency
    • Mass
    • Forces
    • Amplitudes
  • This experiment does not include us giving you all the equations, so you need to look up a few of them in your scripts or on the internet
    •  As an example: the relationship between mass, pendulum radius and frequency is given by , but what that means is yours to find out
  • The experiment consists of 2 measurements
    • Measurement A: simulate a slow, constant angular velocity while measuring accelerations in tangential and normal direction
    • Measurement B: simulate a free oscillation by initially displacing the pendulum while measuring normal acceleration, tangential acceleration, angular velocity
    • The measurements will be conducted by using our Matlab app at one of our computers
    • The app is only for taking measurements, not for analyzing the data!
      • There currently are only 2 pendulums, so please respect the time
      • But please feel invited to observe different behaviors
  • Afterwards, you will receive the measurement data via Email and post-process it to find the answers to our questions.
    • We will also receive the same measurement data and calculate your solutions depending on your measurements
  • DISCLAIMER:
    •  Treat the pendulums with respect and care! → No unnecessary swing-ups and/or games!
    • Warn people around you, that they won't get hit by the pendulum's mass!

Matlab App:

App after logging in with credentialsApp after connecting to ArduinoApp after performing Experiment AApp after performing Experiment B

  • Interactivity:
    • Connect: Connects/Disconnects to/from Arduino
    • Testbench ID: Updates current experiment setup
    • Status: displays app status (e.g. offline/online)
    • Start Measurement A: Record measurements for Experiment A. Lower sampling rate, but longer than Experiment B
    • Start Experiment B: Record measurements for Experiment B
    • Show Measurement A: After performing your Measurement A, you can review it before handing them in
    • Show Measurement B: After performing Measurement B, you can review them before handing them in
    • Save Data: Saves data and sends the recorded data to you and us
  • Connect is currently the only available button. Arduino has to be connected to the the computer and sensor has to be connected to the Arduino (see image above)
  • After connecting successfully, the measurements can be performed, for the procedure, see below
  • One possible outcome of Experiment A can be seen here
  • One possible outcome of Experiment B can be seen here


Experiment 6A

This experiment is about understanding the dynamic behavior of the capacitive sensor and ignore the angle/angular velocity. The VIPS questions are related to the accelerations, their amplitudes, their mean and their relation to each other. The output accelerations should look similar to sine/cosine waves. Everything else is most likely a false measurement and has to be repeated.

Procedure:

Check the VIPS questions beforehand to understand, what you have to analyze and get out of the measurement data. You may get an understanding for how to generate good data to help you out on the long run.

Open the App, connect to the Arduino and use the "Start Measurement" button to initiate the recording of data.

→ Best practice: Take the mass in your hand, start the measurement and move it with a slow and constant angular velocity as seen in the animation below.

FAQ:

  • Why do we have to move slowly?
    • Feel free to compare a slow movement with a fast movement. You will most likely see the influence of angular acceleration on the sensor's capacitor, hence changing the oscillation amplitudes. The goal of this experiment is to reduce the influence of angular velocities as much as we can
  • How many periods do I need?
    • Check the example plot, which is enough to successfully work on the tasks. Try to get at least 1 period.
  • How long does this take?
    • Each measurement only takes a couple of seconds
  • What range for angles do we need to move?
    • There is no benchmark for this. If you move too far, you will not manage enough periods or will have to move too fast. If you move not far enough, your acceleration amplitudes may not be far enough.


Experiment 6B

This experiment is about actually taking measurements to recover the pendulum physics. The focus is about recording data and analyzing it in Matlab. The output accelerations should look similar to sine/cosine waves. Everything else is most likely a false measurement and has to be repeated.

You will receive a *.mat file containing a Matlab struct. Inside of that struct, you will find different arrays with the measurement data. To get the data, a "." index is required (e.g. "all_evaluation_data_6.experiment" will output 6, as this is Experiment Nr.6 and the variable is inside the struct).

You will find the following:

  • From Measurement A
    • accelTime : time vector of the measurements
    • accelX : acceleration in X direction of the sensor
    • accelY : acceleration in Y direction of the sensor
    • angle : angle of the mass about the pendulum (rotation about the sensor Z-axis)
    • angleVel : angular velocity of the mass about the pendulum (rotation about sensor Z-axis)
  • From Measurement B
    • accelTimeTriggered : time vector of the measurement
    • accelXTriggered : acceleration in X direction of the sensor
    • accelYTriggered : acceleration in Y direction of the sensor
    • angleTriggered : angle of the mass about the pendulum (rotation about the sensor Z-axis)
      • This angle may not be correct, but please use it for your VIPS questions
    • angleVelTriggered : angular velocity of the mass about the pendulum (rotation about sensor Z-axis)

Procedure:

Open the App, connect to the Arduino and use "Start Measurement B" button to initiate the recording of data.

→ Best practice: Take the mass in your hand, displace it to somewhere between  and (PLEASE AVOID MORE THAN THAT), start the measurement and let go of the pendulum


  • Repeat the experiments as often as you must, to generate a reasonable sensor output (sine/cosine wave shape).
  • When you are done, send the data and start with the post-processing
  • You may need the length of the pendulum though!

7.      Evaluation of Experiment Results

After conducting the pendulum experiment 6C, you should have received a mail with your measurement results in the form of a *.mat file. The handling and explanation about elements in said *.mat file can be found  above. Now it is time to analyze and interpret the acquired data. For this, you should be using Matlab to plot the data, perform calculations and transform your results to answer VIPS questions. If you find yourself new to Matlab, we recommend using the tutorial, as it provides a great starting point.

!!! ATTENTION !!!

Each VIPS exam is only for entering the results and therefore limited to 30min! You should prepare your answers beforehand, as the calculations may require more time than is available during the VIPS. Below you will find the collection of all VIPS questions regarding experiment 6:

7.1 Choosing a Suitable Sensor 1/3 - Single Choice

The environment of an application requires sensing of acceleration over one axis at 90 °C.

Which sensor should be used?

  1. ASC 4221 MF
  2. ADXL 377
  3. ADXL 335

7.2 Choosing a Suitable Sensor 2/3 - Single Choice

An application requires acceleration sensing in 3 axes with a range of ±2 g. (Hint: The non-linearity error of the sensors would be a decisive factor!)

Which sensor should be used?

  1. ASC 4221 MF
  2. ADXL 377
  3. ADXL 335

7.3 Choosing a Suitable Sensor 3/3 - Single Choice

An application requires 3-axes acceleration sensing with a range of ±16 g and a maximum resolution of 7 mV/g.

Which sensor should be used?

  1. ASC 4221 MF
  2. ADXL 377
  3. ADXL 335

7.4 Experiment 6B - Tilting the ADXL345 - Numerical Input

In part 6.2 you titled the sensor in different angles and read the values of the acceleration on the z-axis.
Find the acceleration values on the z-axis for six different angles and create a table.

Please enter your table values as follows:

sensor angle in Degree °acceleration value on z-axis  in m/(s^2)
1
30°2
45°3
90°4
180°5


enter your table like this:
[0 1; 30 2; 45 3; 90 4; 180 5]

Please use the decimal point and give only numerical values in degree, respectively m/(s^2) as in this example: [0 1; 30 2; 45 3; 90 4; 180 5]

7.5 Experiment 6C 1/4 - Manual Displacement: Angle Correlation - Numerical Input

In experiment 6C, you've conducted the measurement A, where you manually displaced the pendulum. The data shows, that the measured angle does not match the pendulum displacement, that you have have observed while displacing the pendulum manually. You now want to recover the angle over time from the acceleration over time by using the relationship between deflection and gravity which you already analyzed in task 7.4. Use the acceleration in the x axis to derive the maximum angle you have manually displaced.

What is the maximum angle, that you have displaced the pendulum to manually in degree?

Please use the decimal point and give only numerical values

7.6 Experiment 6C 2/4 - Free Oscillation: Pendulum Frequency - Numerical Input

In experiment 6C, you've conducted the measurement B, where you initially displaced the pendulum and observed its free oscillation. From the acceleration in the x axis, you want to derive the pendulum frequency. The acceleration in the y axis and a sketch can help to understand the behavior tracked in the x axis.

What is the pendulum frequency in Hz?

Hint: By now you should have realized, that a capacitive acceleration sensor is not suitable for this experiment, hence the measurement data is not representing the pendulum correctly. But like in the real world, sometimes bad measurement data is all you have to work with. For all your answers, only use your measurement data. Analytical calculations based on pendulum geometries will not be accepted.

Please use the decimal point and give only numerical values.

7.7 Experiment 6C 3/4 - Free Oscillation: Centri Petal / Centri Fugal Acceleration - Numerical Input

In experiment 6C, you've conducted the measurement B, where you initially displaced the pendulum and observed its free oscillation. During the circular movement on the circular track, the mass inside the acceleration sensor experiences the centri fugal/ centri petal force. The force causes an acceleration of the masses along the pendulum axis and points in a 90° angle to the tangential line at the circular track. You want to use the information about the pendulum angle to calculate the centri fugal/ centri petal acceleration in the point, where the acceleration in x equals 9.81 m/(s^2).

Hint: The centri fugal/ centri petal forces also influences the sensor causing the data not to be physically correct. The point of x_accel being 9.81 m/s² is not the point, where x is fully aligned with the gravitation, but  some more or less arbitrary point influences by the sum of all acting forces. If your data set does not contain a measurement point at desired locations, interpolation is an option.

What is the centri fugal / centri petal acceleration experienced by the mass inside the accelerometer, where the acceleration in the x axis is equal to 9.81 m/(s^2)? Give the answer in m/(s^2)

Please use the decimal point and give only numerical values.

7.8 Experiment 6C 4/4 - Free Oscillation : Maximum Velocity - Numerical Input

In experiment 6C, you've conducted the measurement B, where you initially displaced the pendulum and observed its free oscillation. The acceleration in the y axis describes the acceleration that is tangential to the circle track of the pendulum. You are interested in the highest tangential velocity. 

Hints:

  • By now you should have realized, that a capacitive acceleration sensor is not suitable for this experiment, hence the measurement data is not representing the pendulum correctly. But like in the real world, sometimes bad measurement data is all you have to work with. For all your answers, only use your measurement data. Analytical calculations based on pendulum geometries will not be accepted. Use of the measurement data you acquired in the y-axis
  • Numerical integration can be performed using built-in Matlab functions like cumtrapz (always make sure to understand a function before using it - read its manual and test it with known data!)

What is the highest tangential velocity along the circle track of the pendulum in m/s?

Please use the decimal point and give only numerical values.













Institut für Mechatronik im Maschinenbau (iMEK), Eißendorfer Straße 38, 21073 Hamburg